Sign in to follow this  
Followers 0
iHAILEY

I suk at this.

7 posts in this topic

Would someone mind if they make a script for me please because i fail :<, that press and holds the right key for 15 sec then same then for the left key press and hold for 15 sec then like maybe loop that 50 times Dx?

Share this post


Link to post
Share on other sites



Sounds like you wanna make bot for game.


edited

Share this post


Link to post
Share on other sites

Sounds like you wanna make bot for game.

Let's not jump to conclusions, shall we?

Post your Fail.

Yes, I am all for teaching a man to fish. But I hope they take the time to learn from the code.

Would someone mind if they make a script for me please because i fail :<, that press and holds the right key for 15 sec then same then for the left key press and hold for 15 sec then like maybe loop that 50 times Dx?

Here is what you asked for with notes;

;Count is the number of loops
For $count = 1 to 50
    $begin = TimerInit() ;This commands sends the value of the clock timer to $begin
    $end = 0             ;This is our prime feed of the $end value
    ;Sending a right keypress until our timer runs out.
    While $end < 15000
        Send ("{right}")
        $end = TimerDiff($begin)
    WEnd
    $begin = TimerInit() ;Read the clock timer again
    $end = 0             ;Feed $end value
    ;Sending a left keypress until our timer runs out.
    While $end < 15000
        Send ("{left}")
        $end = TimerDiff($begin)
    WEnd
Next

#comments-start
Place your cursor in this area and run with F5 to see how it functions.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
#comments-end

I know there are other methods available using SendKeyDownDelay and you can and should research those on your own. I feel this one should get you started discovering how the scripts works. Post your code, don't go making game bots (they don't allow that here) and have fun learning the scripting language.

Share this post


Link to post
Share on other sites

Or...

MouseDown("left")
Sleep(15000)
MouseUp("left")
MouseDown("right")
Sleep(15000)
MouseUp("right")

Share this post


Link to post
Share on other sites

Or...

MouseDown("left")
Sleep(15000)
MouseUp("left")
MouseDown("right")
Sleep(15000)
MouseUp("right")

That works for the left and right mouse buttons but they asked for left and right keys.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

#Include <Timers.au3>
global $start = _Timer_Init()


winactivate("Untitled - Notepad")

for $x = 1 to 2
    Send("{LEFT}")
    if _Timer_Diff($start) > 15000 then ExitLoop
    if $x=2 then $x=1
Next

Edit2: the $x wasnt needed in the SEND.

Anyway:

You can also use this:

for $x = 1 to 262001
Send("{LEFT}")
next

I'm not sure wheter tis nessacery that the button is "HOLD DOWN". In these cases its pushed a single time every moment.

I calculated that 262001 (in a for/next) is 15 seconds. I'm not sure if this value is exactly the same on every computer.

Edited by notsure

Share this post


Link to post
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
Sign in to follow this  
Followers 0