Need help with autopotter

06/23/2012 15:56 sklyman#1
Hello everyone,

I was attempting to create an autopotter, Which basically spam the F-key's...

Now i was having a problem that it wouldnt spam in co... however, when i tried it in some other application, it did work...

This is the source i'm using:
Code:
        [DllImport("user32.dll", EntryPoint = "keybd_event", CharSet = CharSet.Auto, ExactSpelling = true)]
        private static extern void keybd_event(byte vk, byte bscan, uint flags, int extrainfo);

        const int KEYEVENTF_KEYUP = 0x2;
        const int KEYEVENTF_KEYDOWN = 0x0;


        public void SpamHotkeys()
        {
            //2 seconden wachten voordat hij spammed.
            Thread.Sleep(2000);

            for (int i = 0; i < 1; i++)
            {
                keybd_event((byte)Keys.F1, 0, (int)KEYEVENTF_KEYDOWN, 0); // F1 Press
                keybd_event((byte)Keys.F1, 0, (int)KEYEVENTF_KEYUP, 0); // F1 Release

                keybd_event((byte)Keys.F2, 0, (int)KEYEVENTF_KEYDOWN, 0); // F2 Press
                keybd_event((byte)Keys.F2, 0, (int)KEYEVENTF_KEYUP, 0); // F2 Release

                keybd_event((byte)Keys.F3, 0, (int)KEYEVENTF_KEYDOWN, 0); // F3 Press
                keybd_event((byte)Keys.F3, 0, (int)KEYEVENTF_KEYUP, 0); // F3 Release
            }
        }
If anyone has any idea why it wont work in co or knows a solution, this would help me alot...

Thanks in advance!
06/23/2012 23:38 PKDemon#2
well if you are spaming all them keys at once every 2 seconds i am sure that will get you botjailed really fast

but the way i do it is get into the memory and use my hp and then have it set so when my hp gets to a certain point i will press the key so it will not be spamming it
06/24/2012 03:19 sklyman#3
Okay nevermind, it seems when you debug, it runs without admin rights.

So when i open the .exe itself, everything works fine...

Been looking for this for 12 hours yesterday.. lmao *frustrating*
06/24/2012 09:20 { Angelius }#4
PHP Code:
using System.Windows.Forms;

[
DllImport("user32.dll")]
public static 
extern int SetForegroundWindow(IntPtr hWnd);

public 
void Test()
{
SetForegroundWindow(/*Conquer.exe MainWindowHandle*/);
SendKeys.SendWait("{F1}");//{F2} or {F3} or {F4} etc

I tested it today and it works just fine.

Good luck.
06/26/2012 17:15 Zeroxelli#5
I'd recommend writing it in C++, or grabbing and making use of the C# hooking library in this section. Why? You want to read the address of your HP and MP, and then when they get to a certain point (or lower), then you send your F1, F2, etc. That way you're much less likely to be botjailed.

Just remember not to actually name your executable "autopotter", as TQ's system will send you to an autoclicker jail (if I remember right.)