Jump to content

i got one question


Recommended Posts

i need a lil help with understanding buttons and everything

#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 by Dragon10660
Link to comment
Share on other sites

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 by will88
Link to comment
Share on other sites

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

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 ?

?

#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 by Dragon10660
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...