eKolin Posted May 24, 2016 Share Posted May 24, 2016 So basicly, i wantto create a function that it would search for certain colour pixel, if false it would try to search for it again after 1 second. AUTOIT FORUM.au3 Link to comment Share on other sites More sharing options...
eKolin Posted May 24, 2016 Author Share Posted May 24, 2016 func Teleport_Air_Altar();Requires Teleport_Skilling_Area While 1;Trying to loop till it finds a pixel (NPC) $pixels = PixelSearch(290,32,498,212,0x999709,50) if @error Then sleep(1000) ContinueLoop WEnd if NOT(@error) Then MouseMove($pixels[0],$pixels[1],);Hoovers teleport NPC sleep(300) LC($pixels[0],$pixels[1]) sleep(2750) MouseMove(266,413);Selects Air Altar Teleport LC(266,413) sleep(4000) EndIf EndIf EndFunc Link to comment Share on other sites More sharing options...
rudi Posted May 24, 2016 Share Posted May 24, 2016 Hello. Welcome to the forum. Please read up the forum rules (game automation, topic #1) Func Teleport_Air_Altar();Requires Teleport_Skilling_Area While 1;Trying to loop till it finds a pixel (NPC) $pixels = PixelSearch(290, 32, 498, 212, 0x999709, 50) If @error Then Sleep(1000) ContinueLoop Else MouseMove($pixels[0], $pixels[1],);Hoovers teleport NPC Sleep(300) LC($pixels[0], $pixels[1]) Sleep(2750) MouseMove(266, 413);Selects Air Altar Teleport LC(266, 413) Sleep(4000) EndIf WEnd EndFunc ;==>Teleport_Air_Altar Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
eKolin Posted May 24, 2016 Author Share Posted May 24, 2016 Ok, thanks Link to comment Share on other sites More sharing options...
rudi Posted May 24, 2016 Share Posted May 24, 2016 Hint: Func Coffee_watcher(); check the web cam, if coffee is available While 1;Trying to loop till it finds a pixel (NPC) $pixels = PixelSearch(290, 32, 498, 212, 0x999709, 50) If @error Then Sleep(1000) ContinueLoop Else ; trigger info, that coffee is not available MouseMove($pixels[0], $pixels[1],) Sleep(300) LC($pixels[0], $pixels[1]) Sleep(2750) MouseMove(266, 413) LC(266, 413) Sleep(4000) EndIf WEnd EndFunc ;==>Coffee_watcher That's basically the same question, isn't it? Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
eKolin Posted May 24, 2016 Author Share Posted May 24, 2016 func Teleport_Air_Altar();Requires Teleport_Skilling_Area Do;Trying to loop till it finds a pixel (NPC) $pixels = PixelSearch(290,32,498,212,0x8E8C08,10) sleep(500) Until @error = 0 MouseMove($pixels[0],$pixels[1]);Hoovers teleport NPC sleep(300) LC($pixels[0],$pixels[1]) sleep(2750) MouseMove(266,413);Selects Air Altar Teleport LC(266,413) sleep(4000) EndFunc WOW that code that u've posted there is so similar, anyway i've found this code to work aswell ^. If u're already here, maybe you u know a way to use only window coordinates? Like that desktop coords wouldnt matter and only window coords would be used. Link to comment Share on other sites More sharing options...
rudi Posted May 24, 2016 Share Posted May 24, 2016 Hi. Have a look at "wingetpos()" and opt("PixelCoordMode",0) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Developers Jos Posted May 24, 2016 Developers Share Posted May 24, 2016 3 hours ago, rudi said: Please read up the forum rules (game automation, topic #1) *click* 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...
Recommended Posts