tommyoo Posted March 5, 2018 Share Posted March 5, 2018 Hello,im pretty new to coding and i need your help.i tried to create a script which should do the following steps:1. search for image2. if it appears right click on it3. if it doesnt appear do some mouse clicks4. search for image again5. if it appears right click on it6 if it doesnt appear do some mouse clicksand so on and so onmy result is:without the else part the script is fine and it would right click on the image if it appears, however when i added the else part it wouldnt click on the image anymore if it appeared. (i think i use the else function wrong but let me know what you guys think) #include <ImageSearch.au3> HotKeySet("s", "Start") HotKeySet("e", "_Exit") Global $y = 0, $x = 0 Func Start() While 1 sleep (100) $file = @DesktopDir & '\Coronet.bmp' local $search = _ImageSearch($file, 1, $x, $y, 0) if $search = 1 Then MouseClick("right", $X, $Y) Sleep (50) Else MouseClick ("left", 929, 691) ;mble window schliessen Sleep (200) MouseClick ("left", 960, 459) ;Gheed Sleep (200) MouseClick ("left", 960, 359) ;auf glücksspiel drücken Sleep (500) EndIf Wend EndFunc I appreciate your help! Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2018 Developers Share Posted March 5, 2018 Sounds like a game script for Diablo, so guess you missed the forum rules on your way in? Jos Xandy 1 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. Link to comment Share on other sites More sharing options...
tommyoo Posted March 5, 2018 Author Share Posted March 5, 2018 yes it is. well i didnt know that. excuse me then Link to comment Share on other sites More sharing options...
Recommended Posts