Golden Posted October 7, 2009 Share Posted October 7, 2009 Alright, for one, im utterly new to using autoit, but hey i thought id give it a try using commen sense to peice together something i need done. Now in my bot i want it to search an area near my mouse of about 100x100pixels, and find an colour and right click on it when i click a hotkey, now this is what i got so far.. its quite mangled so any help would be appreciated. HotKeySet("z", "Start") HotKeySet("x", "Pause") HotKeySet("c", "Leave") $pos = MouseGetPos() $searchcolor = 0x94EB7B While 1 Sleep(1000) WEnd Func Start() While 1 $coord = PixelSearch(($pos[0] - 100) , ($pos[1] - 100) , ($pos[0] + 100) , ($pos[1] + 100), $searchcolor) ; If IsArray($coord) = 1 Then MouseClick( "right", $coord[0], $coord[1], 1, 0) Sleep(100) EndIf WEnd EndFunc Func Pause() While 1 Sleep(1) WEnd EndFunc Func Leave() Exit EndFunc Link to comment Share on other sites More sharing options...
Golden Posted October 9, 2009 Author Share Posted October 9, 2009 ~bump~ Link to comment Share on other sites More sharing options...
Developers Jos Posted October 9, 2009 Developers Share Posted October 9, 2009 Wondering why nobody is willing to help in this thread with the clear topic title. Jos 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...
jebus495 Posted October 9, 2009 Share Posted October 9, 2009 Alright, for one, im utterly new to using autoit, but hey i thought id give it a try using commen sense to peice together something i need done. Now in my bot i want it to search an area near my mouse of about 100x100pixels, and find an colour and right click on it when i click a hotkey, now this is what i got so far.. its quite mangled so any help would be appreciated. HotKeySet("z", "Start") HotKeySet("x", "Pause") HotKeySet("c", "Leave") $pos = MouseGetPos() $searchcolor = 0x94EB7B While 1 Sleep(1000) WEnd Func Start() While 1 $coord = PixelSearch(($pos[0] - 100) , ($pos[1] - 100) , ($pos[0] + 100) , ($pos[1] + 100), $searchcolor) ; If IsArray($coord) = 1 Then MouseClick( "right", $coord[0], $coord[1], 1, 0) Sleep(100) EndIf WEnd EndFunc Func Pause() While 1 Sleep(1) WEnd EndFunc Func Leave() Exit EndFunc HotKeySet("z", "Start") HotKeySet("x", "Pause") HotKeySet("c", "Leave") Global $paused, $pos Pause() Func Start() ToolTip("Searching", 0, 0) While 1 $coord = PixelSearch($pos[0] - 100 , $pos[1] - 100 , $pos[0] + 100 , $pos[1] + 100, 0x94EB7B) If Not @error Then MouseClick("right", $coord[0], $coord[1], 1, 0) Sleep(100) Else ExitLoop EndIf WEnd EndFunc Func Pause() $paused = Not $paused While $paused Sleep(50) ToolTip("Paused", 0, 0) WEnd EndFunc Func Leave() Exit EndFunc The first while loop isn't really needed... You an just have it sit in Pause() until it needs to do something else. Link to comment Share on other sites More sharing options...
Golden Posted October 9, 2009 Author Share Posted October 9, 2009 got any other advice to help me get where i need to be? Link to comment Share on other sites More sharing options...
jebus495 Posted October 10, 2009 Share Posted October 10, 2009 got any other advice to help me get where i need to be?Maybe if we knew where you needed to be? Link to comment Share on other sites More sharing options...
JRowe Posted October 10, 2009 Share Posted October 10, 2009 Google maps is good for directions. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] 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