Jump to content
mib666007

Why is it exiting this endless loop? - (Locked)

Recommended Posts

I'm kinda new to AutoIt but not programming so I apologize in advance for any dumbness but why is this script exiting?

Specifically, it will run a while and stop suddenly with a message in the console that reads "Exit code: 0    Time: 43.45". The amount of time it runs seems variable. I have tried running from the SciTE and also run the script outside of it and the same thing happens. 
 

#include <File.au3>
Opt("SendKeyDelay", 500)
Opt("SendKeyDownDelay", 300)
$hwnd = WinGetHandle("RetroArch Nestopia1.50-WIP 7f48c21")
While True
; first check to see if we are on make new game screen
  WinActivate($hwnd)
  sleep(2000)
$screengraboverall = PixelChecksum(-1327, 52, -260, 860, 1, $hwnd)
$preseasonselecttrue = PixelChecksum(-1285, 64, -344, 116, 1, $hwnd)
$tecmosportsnewstrue = PixelChecksum(-1139, 60, -551, 112, 1, $hwnd)
;_FileWriteLog(@ScriptDir & "\Example.log", $tecmosportsnewstrue)
If $screengraboverall = 514921478 Then
send("x")
sleep(1000)
EndIf
If $screengraboverall = 732458330 Then
send("{down}")
sleep(1000)
EndIf
If $screengraboverall = 3348524438 Then
send("{down}")
sleep(1000)
EndIf
If $screengraboverall = 2961993129 Then
send("{down}")
sleep(1000)
EndIf
If $screengraboverall = 2832821635 Then
send("{down}")
sleep(1000)
EndIf
If $screengraboverall = 893414804 Then
send("{down}")
sleep(1000)
EndIf
If $screengraboverall = 4291259785 Then
send("x")
sleep(1000)
EndIf
If $preseasonselecttrue = 478876543 Then ;inside team selection
$x = Random(0, 3, 1)
$y = Random(0, 7, 1)
While $x > 0
send("{right}")
sleep(1000)
$x = $x - 1
WEnd
While $y > 0
send("{down}")
sleep(1000)
$y = $y - 1
WEnd
send("x")
sleep(1000)
$x = Random(0, 3, 1)
$y = Random(0, 7, 1)
While $x > 0
send("{right}")
sleep(1000)
$x = $x - 1
WEnd
While $y > 0
send("{down}")
sleep(1000)
$y = $y - 1
WEnd
; delay and set text for final betting
send("x")
sleep(1000)
EndIf
If $tecmosportsnewstrue = 320358972 Then ;halftime , delay and set text
send("x")
sleep(1000)
EndIf
WEnd

 

Share this post


Link to post
Share on other sites

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...