Terrified Posted November 23, 2007 Share Posted November 23, 2007 (edited) Hi im writing a script and i hope you can help me. i want that the sleep command in Func buff() will cahnge by the combo. expandcollapse popup#include <GUIConstants.au3> HotKeySet( "{F11}" , "Buff") HotKeySet( "{F10}" , "stop") GUICreate("My GUI combo") $AP=GUICtrlCreateCheckbox( "AutoPicker",25 , 205 , 80) GUICtrlCreateCombo ("sleep 600", 10,10) GUICtrlSetData(-1,"sleep1|sleep 1000","sleep 1000") Func Buff() $buffing = 1 While $buffing = 1 if $buffing = 0 then ExitLoop MouseMove( 1225 , 46, 1 ) send("1") Mouseclick("Right") Sleep( "600") if GUICtrlRead($AP) = $GUI_CHECKED Then Send("{SPACE}") if $buffing = 0 then ExitLoop send("2") Mouseclick("Right") Sleep( "600") if GUICtrlRead($AP) = $GUI_CHECKED Then Send("{SPACE}") if $buffing = 0 then ExitLoop send("3") Mouseclick("Right") Sleep( "600") if GUICtrlRead($AP) = $GUI_CHECKED Then Send("{SPACE}") if $buffing = 0 then ExitLoop MouseMove( 1225 , 208, 1 ) send("1") Mouseclick("Right") Sleep( "600") if GUICtrlRead($AP) = $GUI_CHECKED Then Send("{SPACE}") if $buffing = 0 then ExitLoop send("2") Mouseclick("Right") Sleep( "600") if GUICtrlRead($AP) = $GUI_CHECKED Then Send("{SPACE}") if $buffing = 0 then ExitLoop send("3") Mouseclick("Right") Sleep( "600") if GUICtrlRead($AP) = $GUI_CHECKED Then Send("{SPACE}") if $buffing = 0 then ExitLoop Sleep ( "10000") WEnd Return EndFunc Func Stop() $Buffing = 0 Return EndFunc GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend thx for the help. Edited November 23, 2007 by Terrified Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 24, 2007 Share Posted November 24, 2007 Hi im writing a script and i hope you can help me. i want that the sleep command in Func buff() will cahnge by the combo. thx for the help. OK, this changes a few things: 1. Uses a global flag variable so the script is not trapped in a HotKeySet() function (Buff()) for an extended period. 2. Uses only the one HotKey to start/stop. 3. Saves the control ID of the combo ($Combo_1) so it can be read. 4. Replaced your Buff() function with a simple display of the value read, just to simplify the demo. #include <GUIConstants.au3> Global $buffing = False HotKeySet("{F11}", "_StartStop") GUICreate("My GUI combo") $AP = GUICtrlCreateCheckbox("AutoPicker", 25, 205, 80) $Combo_1 = GUICtrlCreateCombo("sleep 600", 10, 10) GUICtrlSetData(-1, "sleep 1|sleep 1000", "sleep 1000") GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $buffing Then Buff() WEnd Func Buff() $iSleep = Number(StringTrimLeft(GUICtrlRead($Combo_1), 6)) TrayTip("Sleep Combo:", "Sleep = " & $iSleep, 5) EndFunc ;==>Buff Func _StartStop() $buffing = Not $buffing EndFunc ;==>Stop Hope that helps. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Terrified Posted November 24, 2007 Author Share Posted November 24, 2007 thx for the help, im not understanding all the commands because im new - ill search it in the help file. thx again . Link to comment Share on other sites More sharing options...
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