Sign in to follow this  
Followers 0
Melkor2

Kill Time Average

8 posts in this topic

#1 ·  Posted (edited)

How exactly would I record and automatically average the time it takes my script to to go from the finish of function Find() to the finish of function CheckHealth() then also save to a INI file?

I've read some intresting things in the documentation, but Im unsure where to start with this bit. I want to add this bit of into to my tooltip :)

Also, is it possible to have two rows of info in one tooltip, other than having one real long annoying tooltip?

Edited by Melkor2

Share this post


Link to post
Share on other sites



How exactly would I record and automatically average the time it takes my script to to go from the finish of function Find() to the finish of function CheckHealth() then also save to a INI file?

In the helpfile look for examples using TimerInit() and TimerDiff()

I've read some intresting things in the documentation, but Im unsure where to start with this bit. I want to add this bit of into to my tooltip :)

Also, is it possible to have two rows of info in one tooltip, other than having one real long annoying tooltip?

ToolTip("This is"&@CR&"on two lines")
Sleep(2000)

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Will do, thanks mate.

Share this post


Link to post
Share on other sites

So.... In my operation.

While $i <= 1000
    $i = $i + 1
    ToolTip("Monsters Killed: " & $i & "Kill Time: " & $killtime &, 0, 0)
$time1 = TimerInit()
    _Find()
    Send("3")
    _checkhealth()
    Send("2")
    Send("T")
    Send("T")
$killtime = TimerDiff($time1)   
wend

Now, How do I make this save that variable over many loops, and make $killtime an average not a per-run. Im also looking to convert it into minuets, but I assume I can do that with the division function.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Syntax error in my tooltip =S

While $i <= 1000
    $i = $i + 1
    ToolTip("Monsters Killed: " & $i & @CR "Kill Time: " & $killtime2 &, 0, 0)
$time1 = TimerInit()
    _Find()
    Send("3")
    _checkhealth()
    Send("2")
    Send("T")
    Send("T")
$killtime = TimerDiff($time1)   
$killtime2 = ($killtime / 1000)
Wend

Bugger this bit of code is.

Ahh, after some debugging it seems it either has a problem with how I'm dividing $killtime2, or the comma? Either way I'd appreciate a revision :)

Wend

Edited by Melkor2

Share this post


Link to post
Share on other sites

#include <Date.au3>

Global $iKillTimerDiff, $iHours, $iMins, $iSecs

For $i = 1 To 1000
    _TicksToTime($iKillTimerDiff, $iHours, $iMins, $iSecs)
    ToolTip("Monsters Killed: " & $i & @CR & "Kill Time: " & $iMins & "Min "&$iSecs&"Sec", 0, 0)
    $oKillTimer = TimerInit()
    _Find()
    Send("3")
    _checkhealth()
    Send("2")
    Send("T")
    Send("T")
    $iKillTimerDiff = TimerDiff($oKillTimer)
Next

Func _Find()
    ; Find code goes here
EndFunc

Func _CheckHealth()
    ; CheckHealth goes here
EndFunc

This is an example of something you could do.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Awesome man, thanks!

Most of that was out of my ability level, thanks for the help!

I see you understand about pixel search etc, may I PM you my script get your opinion on how to optimize it? It works as it is, just needs a bit of tweaking. It's quite hard to edit the coords and it's slow.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

#include <Date.au3>

Global $iKillTimerDiff, $iHours, $iMins, $iSecs

For $i = 1 To 1000
    _TicksToTime($iKillTimerDiff, $iHours, $iMins, $iSecs)
    ToolTip("Monsters Killed: " & $i & @CR & "Kill Time: " & $iMins & "Min "&$iSecs&"Sec", 0, 0)
    $oKillTimer = TimerInit()
    _Find()
    Send("3")
    _checkhealth()
    Send("2")
    Send("T")
    Send("T")
    $iKillTimerDiff = TimerDiff($oKillTimer)
Next

Func _Find()
    ; Find code goes here
EndFunc

Func _CheckHealth()
    ; CheckHealth goes here
EndFunc

This is an example of something you could do.

The average seems to have been forgotten. Added with the average displayed instead of the last time.

#include <Date.au3>

Global $iKillTimerDiff, $iHours, $iMins, $iSecs, $iTotal = 0,$iAverage = 0

For $i = 1 To 1000
    _TicksToTime($iAverage, $iHours, $iMins, $iSecs)
    ToolTip("Monsters Killed: " & $i & @CR & "Kill Time: " & $iMins & "Min "&$iSecs&"Sec", 0, 0)
    $oKillTimer = TimerInit()
    _Find()
    Send("3")
    _checkhealth()
    Send("2")
    Send("T")
    Send("T")
    $iKillTimerDiff = TimerDiff($oKillTimer)
        $iTotal += $iKillTimerDiff
        $iAverage = $iTotal/$i
Next

Func _Find()
; Find code goes here
EndFunc

Func _CheckHealth()
; CheckHealth goes here
EndFunc
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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  
Followers 0