Introduction to Programming... AutoIT

Go down

Introduction to Programming... AutoIT

Post  czdragon on Thu Oct 15, 2009 1:43 pm

Check this out cyclops ... didn't even had this when I started bounce

Auto IT Tutorial 1-2-3 -CLICK-ME

Sample Scripts:

; Key Spammer: (Presses "1" Key Repeatedly)

$i = 1 ; We set a variable $i equals to "1"

While $i=1 ; While-WEnd (Repeat the script while $1 = 1)

Send ("{1 down}") ; Holds down "1" Key
Sleep (100) ; Waits for 100 milliseconds
Send ("{1 up}") ;Releases "1" Key
Sleep(500) ; Waits for 500 milliseconds

WEnd

That's boring.. let's add a button toggle that "pauses" the script when needed...
I know.. let's make a button that does just that Smile

HotKeySet("{PAUSE}", "TogglePause") ; were declaring a button that responds to the "PAUSE" key and named it TogglePause

Func TogglePause() ; using the Function command we made our own key
$Paused = Not $Paused ; checks to see if it is "Pause" or not
While $Paused ; If it is "PAUSE" then it will wait for 100 milliseconds and repeats it until it is un"PAUSED"
Sleep(100)
WEnd
EndFunc ; We ended our function

How about the exit button... we shouldn't forget that Smile

HotKeySet("{ESC}", "Terminate")

Func Terminate() ; we declared our own function same as the one above
Exit 0 ; we used another command which is "EXIT" that ends the script
EndFunc

Hmm... but how do we know if the bot is paused or not?
How about... a tooltip rabbit

[b]ToolTip('The Key Spammer is "Paused"', 0, 0) ; the command "Tooltip"

Putting it all together bounce ...

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

Sleep(5000)

While 1

Send ("{1 down}")
Sleep (100)
Send ("{1 up}")
Sleep(500)

WEnd

Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Key Spammer is "Paused"', 0, 0)
WEnd
ToolTip("")
EndFunc; TogglePause

Func Terminate()
Exit 0
EndFunc; Terminate

We can also make one that presses two keys... How about "5" and "3"..

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

Sleep(5000)
$count = 0

While 1

If $count < 40 Then

Send ("{5 down}")
Sleep (100)
Send ("{5 up}")
Sleep(500)

$count = $count + 1

Else

Send ("{3 down}")
Sleep (100)
Send ("{3 up}")
Sleep(1500)

$count = 0

EndIf

WEnd

Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Key Spammer is Paused"', 0, 0)
WEnd
ToolTip("")
EndFunc; TogglePause

Func Terminate()
Exit 0
EndFunc; Terminate

I even added a countdown timer such that they wont get pressed at the same time Surprised ...

Just between you and me ... I used the 2nd script to level my curative and support skills at the same time with "3" for chakra gum and "5" for spell buff.... Maybe it was 15 on the count timer "$count < 40" not sure though...

So that's about it... there's always the help file in AutoIT program if u need help tongue
avatar
czdragon

Posts : 128
Rep : 149
Join date : 2009-10-07
Age : 30
Location : ~Unkown~

Back to top Go down

Re: Introduction to Programming... AutoIT

Post  Decique on Fri Oct 01, 2010 3:23 am

Download Link Location:

http://www.autoitscript.com/autoit3/downloads.shtml


-Decique

IGN: Decique, acp315, DaisukeTsuichi
Nickname: Frosty
avatar
Decique

Posts : 135
Rep : 145
Join date : 2009-10-23
Age : 26
Location : US

http://www.myspace.com/acp315

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum