Guest trexton Posted March 5, 2005 Posted March 5, 2005 I want to add F12 as a quit key to my script, but cant figure out how.. Im still a bit of a noob. can anyone help me?#include <Color.au3> AutoItSetOption ( "ColorMode", 0 ) WinActivate ( "ROSE online" ) Sleep ( 6000) $i = 0 $s = 0 While $i <= 100000000 ;Checks your healthbar, hits the F6 hotkey (Apple,Kiwi, etc) if your health is low $s = PixelGetColor ( 130 , 43 ) if $s=9724820 Then Send("{F1}") sleep(500) endif ;My genius way of changing the screen every time the macro runs MouseClickDrag ( "right", 394, 316, 520, 316 ,0) ;Checks for the BASIC color of a monster VVVdayVV MONSTER COLOR VALUE HERE $coord = PixelSearch( 50, 0, 1024, 700, 3235211,20,8) If Not @error Then MouseMove ( $coord[0], $coord[1],0) ; VVVVVVVV Strength Indicator 1 here $coordb = PixelSearch( 0, 0, 1024, 768, 13300735,0,4) if Not @error then MouseClick("left") $s=1 sleep (7000) Send("{F2}") Send("{F3}") Send("{F4}") Send("{F5}") Send("{F6}") Send("{F7}") Send("{F8}") endif ; VVVVVVVV Strength Indicator 2 HERE $coordc = PixelSearch( 0, 0, 1024, 768, 14277081,0,4) If Not @error Then MouseClick("left") $s=1 ;if you kill monsters fast, lower this down (14000=14 seconds of delay). This just stops the program and waits until your character has killed the monster. Not the perfect way for a bot to work, but what can you do? sleep (7000) Send("{F2}") Send("{F3}") Send("{F4}") Send("{F5}") Send("{F6}") Send("{F7}") Send("{F8}") EndIf endif $i = $i + 1 WEndAny help would be great
Guest trexton Posted March 5, 2005 Posted March 5, 2005 Try using the function SetHotKey<{POST_SNAPBACK}>I cant find that in the AutoIt Help file..
Guest trexton Posted March 5, 2005 Posted March 5, 2005 It's called HotKeySet<{POST_SNAPBACK}>Thanks So i just add this to the end of my script and push Esc to Quit and Push Pause to Pause it?; Press Esc to terminate script, Pause/Break to "pause"Global $PausedHotKeySet("{PAUSE}", "TogglePause")HotKeySet("{ESC}", "Terminate")HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d;;;; Body of program would go here ;;;;While 1 Sleep(100)WEnd;;;;;;;;Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("")EndFuncFunc Terminate() Exit 0EndFuncFunc ShowMessage() MsgBox(4096,"","This is a message.")EndFunc
SlimShady Posted March 5, 2005 Posted March 5, 2005 (edited) No. Put all the UDFs (user defined functions) at the bottom. And the necessary code above it. Example: Important code. ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage");Shift-Alt-d ;;;; Body of program would go here;;;; While 1 Sleep(100) WEnd ;;;;;;;; UDFs (user defined functions) Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","This is a message.") EndFunc Edited March 5, 2005 by SlimShady
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now