Jump to content

controlsend key hold + sleep not working right...


Recommended Posts

Ok, im trying to write me a little bot for a game, what it is supposed to do, is hold my "2" key down for 30 seconds, release it, then wait 2 seconds, then send the "4" key 4x times

I can get it to send the "2" key 2x times, then it hits the "4" key 4x times, it doenst hold the "2" down for 30 seconds then send the "4" key

Here is my code so far.

AutoItSetOption("WinTitleMatchMode", 4)
$hwnd = WinGetHandle("classname=D3D Window")
If @Error Then
    MsgBox(0, "LAWL", "It would help to open the program....")
Else
EndIf

While 1 = 1
      ControlSend($hwnd, "", "", "{2 down}")
      Sleep(30000)
      ControlSend($hwnd, "", "", "{2 down}")
      Sleep(2000)
      ControlSend($hwnd, "", "", "{4 down}")
      ControlSend($hwnd, "", "", "{4 down}")
      ControlSend($hwnd, "", "", "{4 down}")
      ControlSend($hwnd, "", "", "{4 down}")


Wend

any help is appreciated and thanks in advance(from most of the tutorials i have read, in the past 3 hours this is what i have gotten)

The TOS Says no afk Splash, i wont be afk, i will be duel screening, and playing another game... so technically im not "AFK"

Edited by DeadAdm1n
Link to comment
Share on other sites

i think i may have found what im looking for but, can someone explain this code to me a little bit?

$TimeStamp = TimerInit() ;Create timestamp
While TimerDiff($TimeStamp) < 2000 ;While the timestamp is less than 2 seconds old, do this
    Send("x")
WEnd
Link to comment
Share on other sites

Have you read the forum FAQ and sticky notes? This one regarding game bots may apply to this thread: Game Bot Sticky Note

Much luck!

yes i actually did read that sticky, you must have not have read the rest of my post, it says no AFK... i will be at my computer, i will be watching it. my time off = computer, when im away from the computer its off...

Plus at least i was being honest...

Edited by DeadAdm1n
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...