Jump to content

i need a little help please


Recommended Posts

well heres my program im making for a game for a special buff user that uses them every 20-60 mins

i have everything right but i want to have this timer thing in my script so i can see how much time before it does it againe until i uncheck the checkbox it will 0:00 the timer out and if i tick the checkbox it restarts the timer like 60:00 :)

Heres my code

#AutoIt3Wrapper_icon=E:\my product\blue-apple.ico
#AutoIt3Wrapper_outfile=..\Silkroad Scroll Tool  V1.1.4.exe
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>

Global $DodgeTimer, $DrugTimer, $ExpTimer, $MoveTimer


HotKeySet("{f5}","_Exit")



$iniFile = @ScriptDir & "\Scroll User.ini"

Opt("TrayMenuMode", 1)
$ProgName = GUICreate("Silkroad Event Scroll User V1.2.4", 633, 400, 191, 142); Program Name
GUICtrlCreatePic(@ScriptDir & "\brand1.gif", 0, 40, 633, 400 ,$WS_EX_TRANSPARENT)
$Main = GUICtrlCreateTab(0, 0, 633, 41); Main Tab
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Settings = GUICtrlCreateTabItem("Scroll Setting's"); Settings Tab
$SaveBnt = GUICtrlCreateButton("Save", 530, 300, 100); Save Button
$LoadBnt = GUICtrlCreateButton("Load", 530, 330, 100); Load Button
$rights = GUICtrlCreateLabel("Copyright © 2008-2009 Scroll User All rights reserved.", 225, 385, 317, 20); Rights Label
$Versionlabel = GUICtrlCreateLabel("Silkroad Event Scroll User V1.2.4", 0, 385, 200, 17); Version Label
$EventLabel = GUICtrlCreateLabel("Event Scroll's Available To Use", 20, 200, 190, 17); Event Label
$MadeLabel = GUICtrlCreateLabel("Made By Dragon10660", 515, 385, 152, 17); Made By Label
$Checkbox1 = GUICtrlCreateCheckbox("DodgeCheckBox", 80, 226, 17, 17); Dodge CheckBox
GUICtrlSetTip(-1, "Tick To Start Dodging"); Dodge Help
$Checkbox2 = GUICtrlCreateCheckbox("DrugCheckBox", 80, 266, 17, 17); Drug CheckBox
GUICtrlSetTip(-1, "Tick To Start Drug"); Drug Help
$Checkbox3 = GUICtrlCreateCheckbox("Sp/ExpCheckBox", 80, 306, 17, 17); Sp CheckBox
GUICtrlSetTip(-1, "Tick To Start Sp/Exp"); Sp Help
$Checkbox4 = GUICtrlCreateCheckbox("MoveCheckBox", 80, 346, 17, 17); Move CheckBox
GUICtrlSetTip(-1, "Tick To Start Moving"); Moving Help
$Label1 = GUICtrlCreateLabel("Dodging Scroll", 0, 226, 95, 17); Dodge Label
$Label2 = GUICtrlCreateLabel("DrugTyphoon", 0, 266, 95, 17); Drug Label
$Label3 = GUICtrlCreateLabel("Sp/Exp Scroll", 0, 306, 95, 17); Sp/Exp Label
$Label4 = GUICtrlCreateLabel("Moving Scroll", 0, 346, 95, 17); Move Label
$Label5 = GUICtrlCreateLabel("Slot   =", 100, 226, 45, 17); Slot Label
$Label6 = GUICtrlCreateLabel("Slot   =", 100, 266, 45, 17); Slot Label
$Label7 = GUICtrlCreateLabel("Slot   =", 100, 306, 45, 17); Slot Label
$Label8 = GUICtrlCreateLabel("Slot   =", 100, 346, 45, 17); Slot Label
$Dodge1 = GUICtrlCreateList("", 142, 226, 49, 19); Dodge List
GUICtrlSetData(-1, "F4"); Dodge F4
GUICtrlSetState(-1, $GUI_DISABLE); Dodge F4 Disabled
$Dodge2 = GUICtrlCreateInput("", 202, 226, 49, 19); Dodge Input
GUICtrlSetData(-1, "6"); Dodge input
GUICtrlSetTip(-1, "Set It To Your Needs"); Dodge Help
$Drug1 = GUICtrlCreateList("", 142, 266, 49, 19); Drug List
GUICtrlSetData(-1, "F4"); Drug F4
GUICtrlSetState(-1, $GUI_DISABLE); Drug F4 Disabled
$Drug2 = GUICtrlCreateInput("", 202, 266, 49, 19); Drug Input
GUICtrlSetData(-1, "7"); Drug input
GUICtrlSetTip(-1, "Set It To Your Needs"); Drug Help
$Sp1 = GUICtrlCreateList("", 142, 306, 49, 19); Sp List
GUICtrlSetData(-1, "F4"); Sp F4
GUICtrlSetState(-1, $GUI_DISABLE); Sp F4 Disabled
$Sp2 = GUICtrlCreateinput("", 202, 306, 49, 19); Sp Input
GUICtrlSetData(-1, "8"); Sp input
GUICtrlSetTip(-1, "Set It To Your Needs"); Drug Help
$Move1 = GUICtrlCreateList("", 142, 346, 49, 19); Move List
GUICtrlSetData(-1, "F4"); Move F4
GUICtrlSetState(-1, $GUI_DISABLE); Move F4 Disabled
$Move2 = GUICtrlCreateInput("", 202, 346, 49, 19); Move Input
GUICtrlSetData(-1, "9"); Move Input
GUICtrlSetTip(-1, "Set It To Your Needs"); Move Help
$Setting = GUICtrlCreateTabItem("Times Of Scrolls"); Time Label)
$Versionlabel = GUICtrlCreateLabel("Silkroad Event Scroll User V1.2.4", 0, 385, 200, 17); Version Label
$EventLabel = GUICtrlCreateLabel("How Long The Times Last :D", 20, 200, 200, 17); Event Label
$Label1 = GUICtrlCreateLabel("Dodging Scroll", 0, 224, 73, 17); Dodge Label
$Label2 = GUICtrlCreateLabel("DrugTyphoon", 0, 264, 65, 17); Drug Label
$Label3 = GUICtrlCreateLabel("Sp/Exp Scroll", 0, 304, 69, 17); Sp/Exp Label
$Label4 = GUICtrlCreateLabel("Moving Scroll", 0, 344, 68, 17); Move Label
$Dodgeinput = GUICtrlCreateInput("", 160, 224, 100, 19); Dodge Start/Stop
GUICtrlSetState(-1, $GUI_DISABLE); Dodge Input
$Druginput = GUICtrlCreateInput("", 160, 264, 100, 19); Drug Start/Stop
GUICtrlSetState(-1, $GUI_DISABLE); Drug Input
$Spinput = GUICtrlCreateInput("", 160, 304, 100, 19); Sp/Exp Start/Stop
GUICtrlSetState(-1, $GUI_DISABLE); Sp/Exp Input
$Moveinput = GUICtrlCreateInput("", 160, 344, 100, 19); Move Start/Stop
GUICtrlSetState(-1, $GUI_DISABLE); Move Input
GUICtrlCreateLabel("Whats Started???", 175, 200, 170, 17); Whats Started Label
$Label5 = GUICtrlCreateLabel("=  60Mins", 75, 224, 73, 17); Dodge Time
$Label6 = GUICtrlCreateLabel("=  30Mins", 75, 264, 73, 17); Drug Time
$Label7 = GUICtrlCreateLabel("=  20Mins", 75, 304, 73, 17); Sp Time
$Label7 = GUICtrlCreateLabel("=  60Mins", 75, 344, 73, 17); Move Time
$About = GUICtrlCreateTabItem("About"); About Tab
$Versionlabel = GUICtrlCreateLabel("Silkroad Event Scroll User V1.2.4", 0, 385, 170, 17); Version Label
GUICtrlCreateEdit("", 40, 94, 337, 233); About The Program Txt
GUICtrlSetData(-1, StringFormat("Thank You For Choosing My Tool I Hope You Enjoy It\r\n\r\nButtons For this Tool\r\nEmergency ShutDown Program Button Is F5 Key\r\nAll Keys Are Set To KeySlot F4\r\nDodging Scroll Is Slot 6\r\nDrug Scroll Is Slot 7\r\nSp Scroll Is Slot 8\r\nMoving Scroll Is Slot 9\r\n\r\n\r\nBest Regards Dragon10660 ElitePvpers Member"))
GUICtrlSetState(-1, $GUI_DISABLE); About Disabled
$HelpInfo = GUICtrlCreateTabItem("Info/Help"); Info Tab
$Versionlabel = GUICtrlCreateLabel("Silkroad Event Scroll User V1.2.4", 0, 385, 170, 17); Version Label
GUICtrlCreateEdit("", 40, 94, 337, 233); Info And Help On Program
GUICtrlSetData(-1, StringFormat("Here I Will Tell You How To Use My Tool\r\n\r\nStep *1*\r\nFirst Of Go Ahead And Check One Of The CheckBox\r\nOr What u Need Too Use\r\n\r\nStep *2*\r\nPlease Thank Hussert At Elitepvpers For His Patience\r\nAnd Great Tutorials\r\n\r\nStep *3*\r\nEnjoy My Tool\r\n\r\nBtw You Can Check All Of The Checkbox's To Your Need's\r\nBut If You Dont Wait It Will Get Confused...\r\n"))
GUICtrlSetState(-1, $GUI_DISABLE); Info Disabled
$Change = GUICtrlCreateTabItem("Change Log"); Change Log Tab
$Versionlabel = GUICtrlCreateLabel("Silkroad Event Scroll User V1.2.4", 0, 385, 170, 17); Version Label
GUICtrlCreateEdit("", 40, 94, 337, 233); Change Log Up To date Stuff
GUICtrlSetData(-1, StringFormat("Change Log\r\n\r\nV1.1 Added Timer Correctly\r\nV1.2 Added Moving Scroll\r\nV1.3 Added Correction On Somethings\r\nV1.4 Added Graphic User Interface  \r\nV1.1.4 Added BackGround And Fixed Some little Stuff\r\nV1.2.4 Added Input Boxes At Choosing Where To Put Your Scrolls\r\n\r\n\r\nSpecial Thanks  Too \r\nNigel\r\nHussert\r\nAndyBioChem\r\nAnd Elitepvper For Ur Great Forum  :D"))
GUICtrlSetState(-1, $GUI_DISABLE); Change Log Disabled
$Credits = GUICtrlCreateTabItem("Credits"); Credits Tab
$Versionlabel = GUICtrlCreateLabel("Silkroad Event Scroll User V1.2.4", 0, 385, 170, 17); Version Label
GUICtrlCreateEdit("", 40, 94, 337, 233); Credits To The People That Care
GUICtrlSetData(-1, StringFormat("Credits \r\nGo To \r\nHussert Thnx For Your Support And Believing In Me\r\nThe Member's/Admin's From  http://www.autoitscript.com/forum/\r\nAnd My Best Friend in the World Nigel Manning\r\n\r\n\r\nThnx Guy's I Couldnt Have Done It With Out Ya \r\n\r\n\r\nBest Regards Dragon10660\r\n\r\n\r\n"))
GUICtrlSetState(-1, $GUI_DISABLE); Credits Disabled

GUISetState(@SW_SHOW)


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE; X Close
            ExitLoop
    Case $SaveBnt; If Save Button Pressed Save File
            Save(); Save File
    Case $loadBnt; If Load Button Pressed Load File
            Load(); Load File
    EndSwitch
    $msg = GUIGetMsg()
    Sleep(10); Sleep 10 MilliSec
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then; If CheckBox Checked Then 
If TimerDiff($DodgeTimer) > 3600000 Then; Timer Set To 1hr
        $DodgeTimer = TimerInit()
        WinWaitActive("SRO_Client"); Window Wait For SRO
        Send("{F4}"); Send Key F4 
        Sleep("2500"); Sleep 2.5Sec
        GUICtrlSetData($Dodgeinput, "Dodging Started..."); Dodge Start/Stop
        Send(GUICtrlRead($Dodge2)); Read Dodge2 Too Send What Key
    EndIf       
EndIf
If GUICtrlRead($Checkbox1) = $GUI_UNCHECKED Then; If CheckBox UnChecked Then
    GUICtrlSetData($Dodgeinput, "Dodging Stopped..."); Dodge Start/Stop
    $DodgeTimer = False; Dodge Timer = False If CheckBox UnChecked
EndIf
If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then; If CheckBox Checked Then
If TimerDiff($DrugTimer) > 1800000 Then; Timer Set To 30min
        $DrugTimer = TimerInit()
        WinWaitActive("SRO_Client"); Window Wait For SRO
        Send("{F4}"); Send Key F4
        Sleep("2500"); Sleep 2.5Sec
        GUICtrlSetData($Druginput, "Drug Started..."); Drug Start/Stop
        Send(GUICtrlRead($Drug2)); Read Druge2 Too Send What Key
    EndIf       
EndIf
If GUICtrlRead($Checkbox2) = $GUI_UNCHECKED Then; If CheckBox UnChecked Then
    GUICtrlSetData($Druginput, "Drug Stopped...");  Drug Start/Stop
    $DrugTimer = False; Drug Timer = False If CheckBox UnChecked
EndIf
If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then; If CheckBox Checked Then
If TimerDiff($ExpTimer) > 1200000 Then; Timer Set To 20min     
        $ExpTimer = TimerInit()
        WinWaitActive("SRO_Client"); Window Wait For SRO
        Send("{F4}"); Send Key F4
        Sleep("2500"); Sleep 2.5Sec
        GUICtrlSetData($Spinput, "Sp/Exp Started..."); Sp/Exp Start/Stop
        Send(GUICtrlRead($Sp2)); Read Sp2 Too Send What Key
    EndIf   
EndIf
If GUICtrlRead($Checkbox3) = $GUI_UNCHECKED Then; If CheckBox UnChecked Then
    GUICtrlSetData($Spinput, "Sp/Exp  Stopped...");  Sp/Exp Start/Stop
    $ExpTimer = False; Sp/Exp Timer = False If CheckBox UnChecked
    EndIf
If GUICtrlRead($Checkbox4) = $GUI_CHECKED Then; If CheckBox Checked Then
If TimerDiff($MoveTimer) > 3600000 Then; Timer Set To 1hr
        $MoveTimer = TimerInit()
        WinWaitActive("SRO_Client"); Window Wait For SRO
        Send("{F4}")
        Sleep("2500")
        GUICtrlSetData($Moveinput, "Moving Started..."); Move Start/Stop
        Send(GUICtrlRead($Move2)); Read Move2 Too Send What Key
    EndIf       
EndIf
If GUICtrlRead($Checkbox4) = $GUI_UNCHECKED Then; If CheckBox UnChecked Then
    GUICtrlSetData($Moveinput, "Moving Stopped...");  Move Start/Stop
    $MoveTimer = False; Move Timer = False If CheckBox UnChecked
EndIf
WEnd

;functoin Exit
Func _Exit()
    Exit
EndFunc

Func Save()
IniWrite($iniFile, "DodgeInput", "Message", GUICtrlRead($Dodge2))
IniWrite($iniFile, "DrugInput" , "Message", GUICtrlRead($Drug2))
IniWrite($iniFile, "Sp/ExpInput" , "Message", GUICtrlRead($Sp2))
IniWrite($iniFile, "MoveInput" , "Message", GUICtrlRead($Move2))
MsgBox(4096,"Saving","Saving Successfull TY For Waiting" )
EndFunc

Func Load()

GUICtrlSetData($Dodge2, IniRead($iniFile, "DodgeInput", "Message", "Error"))
GUICtrlSetData($Drug2, IniRead($iniFile, "DrugInput", "Message", "Error"))
GUICtrlSetData($Sp2, IniRead($iniFile, "Sp/ExpInput", "Message", "Error"))
GUICtrlSetData($Move2, IniRead($iniFile, "MoveInput", "Message", "Error"))
MsgBox(4096,"Loading","Loading Successfull TY For Waiting" )
EndFunc

and i want to to add this to it or something like it

#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Timers.au3>
#include <Date.au3>
#include <ProgressConstants.au3>

Global $iCountdown = 20; Sets the time-out in seconds

$iTotal_Time = 20
$Prompt = 0

$Form1 = GUICreate("Reminaing Time To Continue", 415, 145, -1, -1, BitOR($WS_CAPTION, $WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS), $WS_EX_WINDOWEDGE); Creates GUI Window
$Progress = GUICtrlCreateProgress(10, 65, 395, 15, $PBS_SMOOTH); Creates Progress Bar
GUICtrlSetColor($Progress, 0xff0000); Sets Progress Bar Color
$Label1 = GUICtrlCreateLabel("", 10, 10, 405, 25)
GUISetState(@SW_SHOW)

_Timer_SetTimer($Form1, 1000, '_Countdown')
While 1
    $nMsg = GUIGetMsg()
WEnd

;-------------Functions Below this Line---------------------------

Func _Countdown($hWnd, $iMsg, $iIDTimer, $dwTime)
    $iCountdown -= 1
    $percent_value = (($iCountdown / $iTotal_Time) * 100)
    If $iCountdown > 0 Then
        GUICtrlSetData($Label1, $Prompt & _SecsToTime($iCountdown) & " Time Remaining to Continue")
        GUICtrlSetData($Progress, $percent_value)
    ElseIf $percent_value <= 0 Then
        GUICtrlSetData($Label1, $Prompt & _SecsToTime($iCountdown) & " Time Remaining to Continue")
        GUICtrlSetData($Progress, $percent_value)
    EndIf
EndFunc;==>_Countdown

but what i want to how to make it do the timer over and over like say i tick $checkbox1 it start dodging when i tick that it starts the timer 60:00 or something until i uncheck $checkbox1 Then it 0:00 it out ?

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...