Jump to content

help with repeating an action


Recommended Posts

please, i've been searching the web for like an hour trying to find out how to repeat an action with the autoit scripty thingy, yes i am quite a bit of a noobie at this thing i recently started making my own bots, the script is below, please tell me how to repeat it and where i should plug in the repeat codes. :idea:

(i need to repeat the ENTIRE THING 20 times)

send("{right down}")
sleep(6000)
send("{right up}")
send("{space}")
sleep(1000)
send("{down down}")
sleep(400)
send("{down down}")
sleep(400)
send("{down down}")
sleep(400)
send("{space}")
sleep(1000)
send("{down down}")
sleep(400)
send("{down down}")
sleep(400)
send("{down down}")
sleep(400)
send("{down up}")
send("{space}")
sleep(2000)
Send("{a down}")
send("{a up}")
sleep(800)
Send("{a down}")
send("{a up}")
sleep(800)
Send("{a down}")
send("{a up}")
sleep(800)
Send("{a down}")
send("{a up}")
sleep(800)
send("{z 55}")
sleep(200)
send("{left down}")
sleep(2500)
send("{left up}")
sleep(300)
send("{up down}")
sleep(3800)
send("{up up}")
sleep(300)
send("{right down}")
sleep(100)
send("{right up}")
Send("{a down}")
send("{a up}")
sleep(800)
Send("{a down}")
send("{a up}")
sleep(800)
Send("{a down}")
send("{a up}")
sleep(800)
Send("{a down}")
send("{a up}")
sleep(800)
send("{z 55}")
sleep(200)
send("{right down}")
sleep(4600)
send("{right up}")
sleep(300)
send("{up down}")
sleep(3800)
send("{up up}")
sleep(300)
send("{right down}")
sleep(300)
send("{right up}")
Send("{a down}")
send("{a up}")
sleep(800)
Send("{a down}")
send("{a up}")
sleep(800)
send("{z 55}")
sleep(200)
send("{right down}")
sleep(500)
send("{Right up}")
sleep(300)
send("{down down}")
send("{alt down}")
sleep(2000)
send("{down up}")
send("{alt up}")
sleep(1000)
send("{up down}")
sleep(2000)
send("{up up}")
sleep(1000)
Link to comment
Share on other sites

In the helpfile lookup Autoit > Language referance > Loop Statements it shows 4 differanr available loop methods to choose from. You can make the code you have already a bit easier to manage by putting the repeated parts in there own loops as well.

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
Link to comment
Share on other sites

In the helpfile lookup Autoit > Language referance > Loop Statements it shows 4 differanr available loop methods to choose from. You can make the code you have already a bit easier to manage by putting the repeated parts in there own loops as well.

yeah i did look at that but the problem is, i dont know how to use it and i cant put the repeated parts in their own loops and the reason being is because that script IS 1 WHOLE PIECE, its all together and i need ALL of it to repeat

Link to comment
Share on other sites

please, i've been searching the web for like an hour trying to find out how to repeat an action with the autoit scripty thingy, yes i am quite a bit of a noobie at this thing i recently started making my own bots, the script is below, please tell me how to repeat it and where i should plug in the repeat codes. :idea:

There's a sticky you should read.

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

Depending on what you need most check the help file under _StringRepeat or Keyword Do...UntilLoop Statements such as Do...Until

I believe this should help you:

$i = 0
Do
    send("{right down}")
    sleep(6000)
    send("{right up}")
    send("{space}")
    sleep(1000)
    send("{down down}")
    sleep(400)
    send("{down down}")
    sleep(400)
    send("{down down}")
    sleep(400)
    send("{space}")
    sleep(1000)
    send("{down down}")
    sleep(400)
    send("{down down}")
    sleep(400)
    send("{down down}")
    sleep(400)
    send("{down up}")
    send("{space}")
    sleep(2000)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    send("{z 55}")
    sleep(200)
    send("{left down}")
    sleep(2500)
    send("{left up}")
    sleep(300)
    send("{up down}")
    sleep(3800)
    send("{up up}")
    sleep(300)
    send("{right down}")
    sleep(100)
    send("{right up}")
    Send("{a down}")
    send("{a up}")
    sleep(800)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    send("{z 55}")
    sleep(200)
    send("{right down}")
    sleep(4600)
    send("{right up}")
    sleep(300)
    send("{up down}")
    sleep(3800)
    send("{up up}")
    sleep(300)
    send("{right down}")
    sleep(300)
    send("{right up}")
    Send("{a down}")
    send("{a up}")
    sleep(800)
    Send("{a down}")
    send("{a up}")
    sleep(800)
    send("{z 55}")
    sleep(200)
    send("{right down}")
    sleep(500)
    send("{Right up}")
    sleep(300)
    send("{down down}")
    send("{alt down}")
    sleep(2000)
    send("{down up}")
    send("{alt up}")
    sleep(1000)
    send("{up down}")
    sleep(2000)
    send("{up up}")
    sleep(1000)
    $i +=1
Until $i = 20

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

Link to comment
Share on other sites

; a loop will 'loop' any code that is between the loop starter and loop finisher
; if using 'For' anything after for will be repeated up until it reaches the 'next'
; bit of repeated code that are not needed are commented out


For $a = 1 To 20 ; Main loop all the contained code 20 times
    Send("{right down}")
    Sleep(6000)
    Send("{right up}")
    Send("{space}")
    Sleep(1000)

    For $i = 1 To 3 ; Inner loop1 from here 3 times
        Send("{down down}") ; this
        Sleep(400) ; and this repeats here 3 times
;~ send("{down down}")
;~ sleep(400)
;~ send("{down down}")
;~ sleep(400)
    Next ; Inner loop1 to here

    Send("{space}")
    Sleep(1000)

    For $i = 1 To 3 ; Inner loop2 from here 3 times
        Send("{down down}") ; this
        Sleep(400) ; and this repeats 3 times
;~ send("{down down}")
;~ sleep(400)
;~ send("{down down}")
;~ sleep(400)
    Next ; Inner loop2 to here

    Send("{down up}")
    Send("{space}")
    Sleep(2000)

    For $i = 1 To 4 ; Inner loop3 from here 4 times
        Send("{a down}") ; this
        Send("{a up}") ; this
        Sleep(800) ; and this repeats 4 times
;~ Send("{a down}")
;~ send("{a up}")
;~ sleep(800)
;~ Send("{a down}")
;~ send("{a up}")
;~ sleep(800)
;~ Send("{a down}")
;~ send("{a up}")
;~ sleep(800)
    Next ; Inner loop3 to here

    Send("{z 55}")
    Sleep(200)
    Send("{left down}")
    Sleep(2500)
    Send("{left up}")
    Sleep(300)
    Send("{up down}")
    Sleep(3800)
    Send("{up up}")
    Sleep(300)
    Send("{right down}")
    Sleep(100)
    Send("{right up}")

    For $i = 1 To 4 ; Inner loop4 from here 4 times
        Send("{a down}") ; this
        Send("{a up}") ; this
        Sleep(800) ; and this repeats 4 times
;~ Send("{a down}")
;~ send("{a up}")
;~ sleep(800)
;~ Send("{a down}")
;~ send("{a up}")
;~ sleep(800)
;~ Send("{a down}")
;~ send("{a up}")
;~ sleep(800)
    Next ; Inner loop4 to here

    Send("{z 55}")
    Sleep(200)
    Send("{right down}")
    Sleep(4600)
    Send("{right up}")
    Sleep(300)
    Send("{up down}")
    Sleep(3800)
    Send("{up up}")
    Sleep(300)
    Send("{right down}")
    Sleep(300)
    Send("{right up}")

    For $i = 1 To 2 ; Inner loop5 from here 2 times
        Send("{a down}") ; this
        Send("{a up}") ; this
        Sleep(800) ; and this is repeated twice
;~ Send("{a down}")
;~ send("{a up}")
;~ sleep(800)
    Next ; Inner loop5 to here

    Send("{z 55}")
    Sleep(200)
    Send("{right down}")
    Sleep(500)
    Send("{Right up}")
    Sleep(300)
    Send("{down down}")
    Send("{alt down}")
    Sleep(2000)
    Send("{down up}")
    Send("{alt up}")
    Sleep(1000)
    Send("{up down}")
    Sleep(2000)
    Send("{up up}")
    Sleep(1000)
Next ; Main loop ends here

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
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...