Dragon10660 Posted May 1, 2009 Share Posted May 1, 2009 (edited) i need a lil help with understanding buttons and everything expandcollapse popup#include <GUIConstants.au3> Global $DodgeButton = False Global $DrugButton = False Global $ExpButton = False Global $MoveButton = False Global $DodgeTimer, $DrugTimer, $ExpTimer, $MoveTimer GUISetState() $Form1_1 = GUICreate("Silkroad Event Scroll User V 1.4", 633, 494, 191, 142) $Settings = GUICtrlCreateTabItem("Settings") $DodgeLabel = GUICtrlCreateLabel("Dodging Scroll", 0, 48, 73, 17) $DrugLabel = GUICtrlCreateLabel("Drug Scroll", 0, 88, 56, 17) $SpLabel = GUICtrlCreateLabel("Sp/Exp Scroll", 0, 128, 69, 17) $MovingLabel = GUICtrlCreateLabel("Moving Scroll", 0, 168, 68, 17) $DodgeButton = GUICtrlCreateButton("Dodge Start", 85, 48, 73, 17) $DrugButton = GUICtrlCreateButton("Drug Start", 85, 88, 73, 17) $SpButton = GUICtrlCreateButton("Sp/Exp Start", 85, 128 , 73, 17) $MovingButton = GUICtrlCreateButton("Moving Scroll", 85, 168 , 73, 17) $getstartitem = TrayCreateItem("Getting Started") $buttonitem = TrayCreateItem("EveryThing To Know") $versionitem = TrayCreateItem("Version Info") $credititem = TrayCreateItem("Credits") $aboutitem = TrayCreateItem("About") $changelogitem = TrayCreateItem("Change Log") $exititem = TrayCreateItem("Exit") GUISetState() While 1 _PerformActions() Sleep(10);Always put a Sleep in your main loop, otherwise the CPU is stressed WEnd Func _Switch() ;----- Toggle actions ----- Switch @HotKeyPressed;which hotkey was pressed?... Case "{F1}";toggle Dodge $DodgeButton = Not $DodgeButton Case "{F2}";toggle Drug $DrugButton = Not $DrugButton Case "{F3}";toggle Exp $ExpButton = Not $ExpButton Case "{F6}";toggle Move $MoveButton = Not $MoveButton EndSwitch EndFunc;==>_Switch Func _PerformActions() ;----- Check Dodge ----- If $DodgeButton = True And TimerDiff($DodgeTimer) > 3600000 Then; Timer Set To 1hr $DodgeTimer = TimerInit() ToolTip('Dodge Started"', 0, 0) Send("{F4}") Sleep("1500") Send("6") EndIf ;----- Check Drug ----- If $DrugButton = True And TimerDiff($DrugTimer) > 1800000 Then; Timer Set To 30mins $DrugTimer = TimerInit() ToolTip('Drug Started"', 0, 0) Send("{F4}") Sleep("1500") Send("7") EndIf ;----- Check Exp ----- If $SpButton = True And TimerDiff($ExpTimer) > 1200000 Then; Timer Set To 20mins $ExpTimer = TimerInit() ToolTip('Sp Started"', 0, 0) Send("{F4}") Sleep("1500") Send("8") EndIf ;----- Check Move ----- If $MoveButton = True And TimerDiff($MoveTimer) > 1200000 Then; Time Set To 20mins $MoveTimer = TimerInit() ToolTip('Sp Started"', 0, 0) Send("{F4}") Sleep("1500") Send("9") EndIf EndFunc;==>_PerformActions GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd how to make it so when this is pressed $DodgeButton = GUICtrlCreateButton("Dodge Start", 85, 48, 73, 17) it will do this ;----- Check Dodge ----- If $DodgeButton = True And TimerDiff($DodgeTimer) > 3600000 Then; Timer Set To 1hr $DodgeTimer = TimerInit() ToolTip('Dodge Started"', 0, 0) Send("{F4}") Sleep("1500") Send("6") EndIf how to make it so in the GUI when i press the button Dodge Start or etc button how do i make start the timer instead of time always starting when program started? if anyone can help i would be much appreciated Edited May 1, 2009 by Dragon10660 Link to comment Share on other sites More sharing options...
will88 Posted May 1, 2009 Share Posted May 1, 2009 (edited) In your while loop, add something like this: $msg = GUIGetMsg() If $msg = $DodgeButton Then If TimerDiff($DodgeTimer) > 3600000 Then; Timer Set To 1hr $DodgeTimer = TimerInit() ToolTip('Dodge Started"', 0, 0) Send("{F4}") Sleep("1500") Send("6") EndIf EndIf Edited May 1, 2009 by will88 Password-Keeper Link to comment Share on other sites More sharing options...
Dragon10660 Posted May 1, 2009 Author Share Posted May 1, 2009 In your while loop, add something like this: $msg = GUIGetMsg() If $msg = $DodgeButton Then If TimerDiff($DodgeTimer) > 3600000 Then; Timer Set To 1hr $DodgeTimer = TimerInit() ToolTip('Dodge Started"', 0, 0) Send("{F4}") Sleep("1500") Send("6") EndIf EndIf ok i think wat u mean let me try this btw ty Link to comment Share on other sites More sharing options...
Dragon10660 Posted May 1, 2009 Author Share Posted May 1, 2009 (edited) hmm here is wat i got but how can i make it so i can start 2 or more than 2 buttons and they activate both and keep both or 3 times to all ? ? expandcollapse popup#include <GUIConstants.au3> Global $DodgeButton = False Global $DrugButton = False Global $SpButton = False Global $MoveButton = False Global $DodgeTimer, $DrugTimer, $ExpTimer, $MoveTimer GUISetState() $Form1_1 = GUICreate("Silkroad Event Scroll User V 1.4", 633, 494, 191, 142) $Settings = GUICtrlCreateTabItem("Settings") $DodgeLabel = GUICtrlCreateLabel("Dodging Scroll", 0, 48, 73, 17) $DrugLabel = GUICtrlCreateLabel("Drug Scroll", 0, 88, 56, 17) $SpLabel = GUICtrlCreateLabel("Sp/Exp Scroll", 0, 128, 69, 17) $MovingLabel = GUICtrlCreateLabel("Moving Scroll", 0, 168, 68, 17) $DodgeButton = GUICtrlCreateButton("Dodge Start", 85, 48, 73, 17) $DrugButton = GUICtrlCreateButton("Drug Start", 85, 88, 73, 17) $SpButton = GUICtrlCreateButton("Sp/Exp Start", 85, 128 , 73, 17) $MoveButton = GUICtrlCreateButton("Moving Scroll", 85, 168 , 73, 17) $getstartitem = TrayCreateItem("Getting Started") $buttonitem = TrayCreateItem("EveryThing To Know") $versionitem = TrayCreateItem("Version Info") $credititem = TrayCreateItem("Credits") $aboutitem = TrayCreateItem("About") $changelogitem = TrayCreateItem("Change Log") $exititem = TrayCreateItem("Exit") GUISetState() While 1 _PerformActions() Sleep(10);Always put a Sleep in your main loop, otherwise the CPU is stressed WEnd Func _PerformActions() ;----- Check Dodge ----- $msg = GUIGetMsg() If $msg = $DodgeButton Then If TimerDiff($DodgeTimer) > 3600000 Then; Timer Set To 1hr $DodgeTimer = TimerInit() WinActivate("SRO_Client") ToolTip('Dodge Started"', 0, 0) Send("{F4}") Sleep("1500") Send("6") EndIf EndIf ;----- Check Drug ----- $msg = GUIGetMsg() If $msg = $DrugButton Then If TimerDiff($DrugTimer) > 1800000 Then; Timer Set To 30hr $DrugTimer = TimerInit() WinActivate("SRO_Client") ToolTip('Drug Started"', 0, 0) Send("{F4}") Sleep("1500") Send("7") EndIf EndIf ;----- Check Exp ----- $msg = GUIGetMsg() If $msg = $SpButton Then If TimerDiff($ExpTimer) > 1200000 Then; Timer Set To 20mins $ExpTimer = TimerInit() WinActivate("SRO_Client") ToolTip('Sp Started"', 0, 0) Send("{F4}") Sleep("1500") Send("8") EndIf EndIf ;----- Check Move ----- $msg = GUIGetMsg() If $msg = $MoveButton Then If TimerDiff($MoveTimer) > 3600000 Then; Timer Set To 30mins $MoveTimer = TimerInit() WinActivate("SRO_Client") ToolTip('Move Started"', 0, 0) Send("{F4}") Sleep("1500") Send("9") EndIf EndIf EndFunc;==>_PerformActions GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Edited May 1, 2009 by Dragon10660 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