Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 08:57

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



help with bot/ timer code

Discussion on help with bot/ timer code within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2011
Posts: 11
Received Thanks: 0
help with bot/ timer code

hello, I'm very new to autoit, I only had experience with java language. But I'm trying to make a timer. So I'll explain what I'm trying to do:

1) the first 7 seconds (after I pressed the button) should show up normally
2) the following 80 seconds should show up with an orange background but when 1) is finished the timer should be resetted and start counting to 80 with the orange background
3) then if 2) is finished the timer should be resseted to and start counting to 6 with a red background
4) finally if 3) is finished the timer should reset again and start counting ip to 8minutes and I want it so it displays minutes : seconds
5) after all this is finished it should start from the beginning again
AutoIt expand popup
Code:
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

;==> Set our $font variable
Global $font
$font = "Arial Black"

;Constants
Const $sleepLen = 100
; New variables
Dim $check1 = False
Dim $check2 = False
Dim $check3 = False
Dim $check4 = False
Dim $botcounter = 0

;==> Create our Graphic User Interface
;Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
$varWindow = GUICreate("Jungle Timers Deluxe", 150, 400, 1675, 30)
$startbutton = GUICtrlCreateButton("start bot", 10, 10, 100, 50, $BS_MULTILINE)
$varButtonTopmost = GUICtrlCreateButton("window topmost", 10, 60, 100, 50)
$varButtonNormal = GUICtrlCreateButton("window normal", 10, 110, 100, 50)
$varLoop = True

;==> Display our Graphic User Interface.
GUISetState(@SW_SHOW)

While $varLoop
$varMessage = GUIGetMsg()
Select
Case $varMessage = $GUI_EVENT_CLOSE
$varLoop = False
Exit
Case $varMessage == $varButtonTopmost
_Button_Topmost_Clicked()
Case $varMessage == $varButtonNormal
_Button_Normal_Clicked()
EndSelect

$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
CLOSEClicked()
Case $startbutton
; Start the timer
$check1 = True
; Reset the counter
$botcounter = 0
; Delete the controls and make the new ones
$bot = GUICtrlCreateLabel("Bot active:", 10, 165)
GUICtrlDelete($startbutton)
Global $botlabel = GUICtrlCreateLabel("0", 15, 180, 50, 40)
GUICtrlSetFont(-1, 22, 500, $font)
EndSwitch
sleep($sleepLen)
check1()
WEnd

Func check1()
If $check1 Then
$botcounter += 1
If $botcounter = (1000/$sleepLen)*7 Then
                    $botcounter = 0
                    $check2 = True
                EndIf
; Update the label & font
                If Mod($botcounter, (1000/$sleepLen)) = 0 Then
                                GUICtrlSetData($botlabel, Round($botcounter/(1000/$sleepLen)))
EndIf
                check2()
                if $check2 = True then
                $check1 = False
                endif
EndIf
EndFunc

Func check2()
        if $check2 then
            $botcounter += 1
            GUICtrlSetBkColor($botlabel, 0xff9900)
            If $botcounter = (1000/$sleepLen)*80 Then
; Set the back color
                GUICtrlSetBkColor($botlabel, 0x66ccff)
                $botcounter = 0
                $check3 = True
            EndIf
            If Mod($botcounter, (1000/$sleepLen)) = 0 Then
                                GUICtrlSetData($botlabel, Round($botcounter/(1000/$sleepLen)))
EndIf
EndIf
        check3()
EndFunc

Func check3()
        if $check3 then
            If $botcounter = (1000/$sleepLen)*6 Then
; Set the back color
                GUICtrlSetBkColor($botlabel, 0xff0000)
                $botcounter = 0
                $check4 = True
            EndIf
            If Mod($ybluebuffcounter, (1000/$sleepLen)) = 0 Then
                                GUICtrlSetData($botlabel, Round($botcounter/(1000/$sleepLen)))
EndIf
EndIf
        check4()
EndFunc

Func check4()
        if $check4 then
            If $botcounter = (1000/$sleepLen)*6 Then
; Set the back color
                GUICtrlSetBkColor($botlabel, 0xff0000)
                $botcounter = 0
            EndIf
            If Mod($botcounter, (1000/$sleepLen)) = 0 Then
                                GUICtrlSetData($botlabel, Round($botcounter/(1000/$sleepLen)))
EndIf
EndIf
EndFunc

Func _Button_Topmost_Clicked()
WinSetOnTop($varWindow,"",1)
EndFunc

Func _Button_Normal_Clicked()
WinSetOnTop($varWindow,"",0)
EndFunc



; Finished!
I know it's not finished the code but I can't even get numer 2)
please help me :ermm:

(oh and btw the second code has 2 extra buttons to choose if it should be topmost or not)
bryanstael is offline  
Old 07/12/2013, 11:51   #2
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
PHP Code:
$hTimer TimerInit()
$iDiff TimerDiff($hTimer
YatoDev is offline  
Old 07/12/2013, 13:58   #3
 
elite*gold: 0
Join Date: May 2011
Posts: 11
Received Thanks: 0
what do I have to do with that ?
bryanstael is offline  
Old 07/12/2013, 14:04   #4
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
That are the Timers in autoit .

$hTimer is the Handle of the initialed Timer and $diff is the difference between the start of a Timer ->$hTimer<-
YatoDev is offline  
Reply


Similar Threads Similar Threads
Job Timer (Taxi Timer, etc)
09/01/2011 - SRO Hacks, Bots, Cheats & Exploits - 2 Replies
A small utility to keep track of jobs that need timing. http://img834.imageshack.us/img834/6076/jt01.png Always read the changelog! To get access to Job Timer, register at "www.error- soft.net" ( without the spaces between the - ) Press thanks if this helps at all.
Request Backyard Monsters Timer Code
06/20/2011 - Facebook - 2 Replies
Hey there, it would be cool if anyone would find the code in cheatengine for the timers in backyard monsters like the ones for unlocking and upgrading monsters, that would be cool ;) Also, after the latest update, it would be very intresting if anyone would find the code for the champion-cage-timer, that you dont have to wait for hours to feed your champion (: is it possible to find that?
Suche Timer Code
05/08/2011 - Last Chaos - 9 Replies
Hallo Leute suche für einen hack für 777 den timer code für schurkin...also was bei timer reingeschrieben wird. Danke schonmal im vorraus MFG
Suche Timer Code für Schurkin
05/07/2011 - Last Chaos - 3 Replies
Suche den oben genannten Timer code für Schurkin. In dem lastchaos 777 hack Danke schonmal. MFG
Timer code for everything
12/11/2008 - Ace Online / AirRivals - 16 Replies
0084a0e4 it is the timer code for everything just set it to 0 the only problem is that it drains your Sp really fast on certant skills but it gives you Uber everything oh yea if you engin over heats it wont regin but if you put the infinite booster hack on it work perfectly this is the RA root pointer Code that that DisiredDeath was talking about P.s. It compleatly stop the mission timer Happy hacking guys:mofo:



All times are GMT +1. The time now is 09:02.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.