Jump to content

Recommended Posts

Posted
the function below crashes when $pixels has no value (and crashes the program)
I would like my loop to continue when $pixels returns an error.
 
 
Func mineIron()
 
   For $count = 1 To 100
 
   $pixels = PixelSearch(631,332,732,428,0x391E14,1)
   $pixelColor = PixelGetColor(1334,658)
 
   If ($pixelColor = "1") Then ExitLoop
 
   If NOT(@error) Then
   LC($pixels[0],$pixels[1])
   Sleep(5000)
   EndIf
 
   Next
 
EndFunc
 
 
  • Developers
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Jos locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...