Jump to content
Sign in to follow this  

Timer macro

Recommended Posts


I have not been able to figure out what is going wrong with this function for keeping track of the time in my macro. All of it works except for the average time. Here is the scripts, if anyone can see an issue I would greatly appriciate the help.

Func _TimeToString($timestamp)

Local $_time, $_h, $_m, $_s, $_message

$_time = Round($timestamp / 1000, 0)

$_h = Int($_time / 3600)

$_m = Int(($_time - $_h * 3600) / 60)

$_s = $_time - $_h * 3600 - $_m * 60

If ($_h > 0) Then

$_message = StringFormat("%02d:%02d:%02d", $_h, $_m, $_s)

ElseIf ($_m > 0) Then

$_message = StringFormat("%02d:%02d", $_m, $_s)

ElseIf ($_s > 0) Then

$_message = StringFormat("%02d", $_s)


$_message = ""


Return $_message


Func DoTimer()

Local $iTotalTime = 0, $iAvrageTime = 0

Local $sTotalTime = 0, $sAvrageTime = 0

Local $_Message = "", $_Pattern = ""

If ($BotTimer > 0) Then

$iTotalTime = TimerDiff($BotTimer)

$sTotalTime = _TimeToString($iTotalTime)


If (GetStatus() = 1) Then

$iAvrageTime = ($iTotalTime / $BotCycles)

$sAvrageTime = _TimeToString($iAvrageTime)


$_Pattern = "Total Time: %s" & @CRLF & "Cycle: %d" & @CRLF & "Avrage Cycle Time: %s"

$_Message = StringFormat($_Pattern, $sTotalTime, $BotCycles, $sAvrageTime)

GUICtrlSetData($EveGUI_TimerLine, $_Message)


Edited by glarson

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.