Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Runescape
You last visited: Today at 20:43

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

 

I need help with AutoIT timerint and timerdef.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2017
Posts: 5
Received Thanks: 1
I need help with AutoIT timerint and timerdef.

Hello,
I am currently trying to write a script in autoIT that has a while 1 loop that contains a couple of IF, ElseIf statements. Some of those ElseIf Statements are Pixelsearches that contain Func(s) that contain PixelCheckSum. I Need help with making the script do two things. It only does one of those things right now the way I have it written. I need it to first Pixelsearch, click found pixel, and then wait for the PixelCheckSum to find a Change in some defined Coords. Once it detects that change it can continue with the rest of the code. That's what it does right now. The minor addendum I need is to change the PCS so that it does both:
Wait for a change and once there is a change execute the next step OR
Wait for a change and if there is no change for a desired amount of time then execute the next step that it would've executed had there been a change.

This is the script so far:
Func Start()
While 1
$x = PixelSearch($x1, $y1, $x2, $y2, $color, 1)
$y = PixelSearch($x1, $y1, $x2, $y2, $color1, 1)
$z = PixelSearch($x1, $y1, $x2, $y2, $color2, 1)

If IsArray($y) = True Then
ElseIf IsArray($z) Then
ElseIf IsArray($x) Then
Wait()
EndIf
WEnd
EndFunc

Func Wait()
$Waiting = True
Local $Pix = PixelCheckSum($x3, $y3, $x4, $y4, $Color4, 1)

While ($Pix) = PixelCheckSum($x3, $y3, $x4, $y4, $Color4, 1)
Local $Start = TimerInit()
If Not (@error) Then
$Waiting = False
$End = TimerDiff($Start)
If ($End) > 5000 Then
$Waiting = False
Start()
EndIf
EndIf
WEnd

EndFunc ;==>Wait



EnemyUnknown is offline  
Thanks
1 User
Reply

Tags
autoit code loop, autoit func



« Previous Thread | Next Thread »



All times are GMT +2. The time now is 20:43.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.