Atonement Posted June 26, 2011 Share Posted June 26, 2011 (edited) Alright i'm working on a function for my script and I just need to know how to get it to repeat till it comes back positive It's an image search and I just need it to keep searching for the image till it finds it. After it's found I need it to end function. I'm pretty new to scripting so :s I already have Func HungerCheck() _ImageSearch("Ego.bmp",1,$ex,$ey,30) I just need it to keep repeating image search till found then EndFunc Edited June 26, 2011 by Atonement Link to comment Share on other sites More sharing options...
Maffe811 Posted June 26, 2011 Share Posted June 26, 2011 Func HungerCheck() While 1 $ImageSerchResult = _ImageSearch("Ego.bmp",1,$ex,$ey,30) If $ImageSerchResult = Whatever _ImageSearch outputts when it has found the image Then ExitLoop Wend Where do you get the _ImageSearch function from? Because i cant find it in the helpfile. All it needs is the output it gives when it finds the image. [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted June 26, 2011 Share Posted June 26, 2011 @AtonementFunc HungerCheck()_ImageSearch("Ego.bmp",1,$ex,$ey,30)That looks like it could be game-related. You did read the forum-rules before posting, right?@Maffe811Where do you get the _ImageSearch function from?Because i cant find it in the helpfile.All it needs is the output it gives when it finds the image.Do a search for _ImageSearch in the examples forum and you'll only get one result. That's most likely where it came from. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Maffe811 Posted June 26, 2011 Share Posted June 26, 2011 In that case my code should either be *Removed* or Func HungerCheck() While 1 $ImageSearchResult = _ImageSearch("Ego.bmp",1,$ex,$ey,30) If $ImageSearchResult = 1 Then ExitLoop Wend [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Atonement Posted June 26, 2011 Author Share Posted June 26, 2011 Thanks Maffe, i'll try it and see if it works. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now