Jump to content
Sign in to follow this  
kumpel100

How to set a Timer Func correctly?

Recommended Posts

kumpel100

im fully lost i start with AutoIt yesterday i want do some changes in a skript i found yesterday.

i want insert a buff timer for 2 buffs with 2 diffrent timers.

CODE
Func start()

; PREPARING

$deathtime = GUICtrlRead($input1) ; time to kill a mob in ms (1000ms = 1 second)

$cycles = GUICtrlRead($input2) ; Counter to determine when to make a 180° Rotation.

$count = 0

winactivate($XXXXXX)

Sleep(2000)

; KILLING LOOP

While $killing = 1

; SELECTING ENEMY

Send("+{TAB}")

Sleep(500+Random(20,60))

; If Selected Mob Is al1ready dead - Ransak

If GUICtrlRead($checkboxcraft) = 1 Then

Send(GUICtrlRead($input15))

EndIf

; TURN ON AUTOATTACK

Send("3")

Sleep(1500+Random(1,25))

; SPAM ATTACKS TILL TIMER RUNS OUT

$begin = TimerInit()

Do

; ATTACK 1

If GUICtrlRead($checkboxattack1) = 1 And GUICtrlRead($checkboxattack1a) = 1 Then

Send("{SHIFTDOWN}")

Send(GUICtrlRead($input9))

Send("{SHIFTUP}")

Sleep(2100+Random(1,25))

ElseIf GUICtrlRead($checkboxattack1) = 1 Then

Send(GUICtrlRead($input9))

Sleep(2200+Random(1,25))

EndIf

; ATTACK 2

If GUICtrlRead($checkboxattack2) = 1 And GUICtrlRead($checkboxattack2a) = 1 Then

Send("{SHIFTDOWN}")

Send(GUICtrlRead($input10))

Send("{SHIFTUP}")

Sleep(2100+Random(1,25))

ElseIf GUICtrlRead($checkboxattack2) = 1 Then

Send(GUICtrlRead($input10))

Sleep(2500+Random(1,25))

EndIf

Until(TimerDiff($begin) > $deathtime)

$count = $count+1

If $count=$cycles Then

;Use Lens Stones----START

If GUICtrlRead($checkboxlens) = 1 Then

Send(GUICtrlRead($input16))

Sleep(600+Random(1,25))

EndIf

;**************************************************

; Buff Part

;**************************************************

$begin1 = TimerInit()

; BUFF 1

$Bufftime1 = GUICtrlRead($input9a)

If GUICtrlRead($checkboxbuff1) = 1 And GUICtrlRead($checkboxbuff1a) = 1 and (TimerDiff($begin1) > $Bufftime1) Then

Send("{SHIFTDOWN}")

Send(GUICtrlRead($input3))

Send("{SHIFTUP}")

Sleep(2200+Random(1,25))

ElseIf GUICtrlRead($checkboxbuff1) = 1 Then

Send(GUICtrlRead($input3))

Sleep(2200+Random(1,25))

$begin1 = TimerInit()

EndIf

$begin2 = TimerInit()

; BUFF 2

$Bufftime2 = GUICtrlRead($input10a)

If GUICtrlRead($checkboxbuff2) = 1 And GUICtrlRead($checkboxbuff2a) = 1 and (TimerDiff($begin2) > $Bufftime2) Then

Send("{SHIFTDOWN}")

Send(GUICtrlRead($input4))

Send("{SHIFTUP}")

Sleep(2200+Random(1,25))

ElseIf GUICtrlRead($checkboxbuff2) = 1 Then

Send(GUICtrlRead($input4))

Sleep(2200+Random(1,25))

$begin2 = TimerInit()

EndIf

;************************************************

; End BuffPart

;************************************************

; TURNING 180°

MouseClick("middle")

$count = 0 ;resetting counter

endif

WEnd

EndFunc

pls help me out to create a functional timer routine.

the buffs timer can be insert in my GUI in ms:

$Bufftime1 = GUICtrlRead($input9a) < the time in Ms is to insert n my GUI

$Bufftime2 = GUICtrlRead($input10a) < the time in Ms is to insert n my GUI

$input9a = GUICtrlCreateInput("",220,70,50,20)

$input10a = GUICtrlCreateInput("",220,90,50,20)

$checkboxattack1a = GUICtrlCreateCheckbox("B_Timer1",140,70,70,20)

$checkboxattack2a = GUICtrlCreateCheckbox("B_Timer2",140,90,70,20)

1) does the BuffPart (red code) part in Code works?

2)if not pls help me out with a new code

Thx alot

P.s German language welcome :) my english sux a little hehe

Edited by kumpel100

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.