s3xt0y Posted November 16, 2006 Share Posted November 16, 2006 Alright basicaly , it wont work , can anyone spot the broken code? MsgBox ( 64 , "Bot", "waiting.." ) WinWaitActive ( "EverQuest II (Nov 14 2006 16:36:00) USER OPTIMIZED: SOEBuild=3662T" ) If PixelSearch ( 0,0,@1024, @768, 0x02E800 ) then send ("{F8}" ) send ( "1" ) send ( "2" ) send ( "3" ) EndIf If PixelSearch ( 0,0,@1024, @768, 0xB90000 ) then send ( "x" ) EndIf Link to comment Share on other sites More sharing options...
jacob_1998_1999 Posted November 16, 2006 Share Posted November 16, 2006 MsgBox ( 64 , "Bot", "waiting.." )You don't have anything linked to this MsgBox?WinWaitActive ( "EverQuest II (Nov 14 2006 16:36:00) USER OPTIMIZED: SOEBuild=3662T" )I am assuming that the Date/Time will change every time this is ran. Perhaps look into the built in time macros.IfPixelSearch ( 0,0,@1024, @768, 0x02E800 ) thensend ("{F8}" )send ( "1" )send ( "2" )send ( "3" )EndIfAre you certain you wish to spam the keys as fast as your computer will process them?Perhaps add a small sleep in between.send ("{F8}" ) sleep(1000) ;<-- send ( "1" ) sleep(1000) ;<-- send ( "2" ) sleep(1000) ;<-- send ( "3" )IfPixelSearch ( 0,0,@1024, @768, 0xB90000 ) thensend ( "x" )EndIfAre you meaning to run this only once, or is it supposed to be a continuous PixelSearch? Link to comment Share on other sites More sharing options...
s3xt0y Posted November 16, 2006 Author Share Posted November 16, 2006 (edited) Thanks for the reply , i am aware that the title will change , thats fine thought also, thanks for the sleep inbetween commands. also , why is the pixelsearch still broke , what did i do rong? -edit- yes , continuous PixelSearch and it needs to be a looped script all around , besides the msgbox. Edited November 16, 2006 by s3xt0y Link to comment Share on other sites More sharing options...
jacob_1998_1999 Posted November 16, 2006 Share Posted November 16, 2006 From the Help File: PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] ) Your Modified Code: If PixelSearch ( 0, 0, 1024, 768, 0xB90000 ) then send ( "x" ) EndIf Remember: Top then Left then Right then Bottom X: 0 then Y: 0 then W: 1024 then H: 768 Link to comment Share on other sites More sharing options...
newb_powa' Posted November 16, 2006 Share Posted November 16, 2006 (edited) I'm pretty noob too but this is how I would do it MsgBox ( 64 , "Bot", "waiting.." ) WinWaitActive ( "EverQuest II (Nov 14 2006 " & @HOUR & ":" & @MIN & ":" & @SEC & ") USER OPTIMIZED: SOEBuild=3662T" ) While 1 ;; It's the loop Sleep(250) PixelSearch ( 0, 0, 1024, 768, 0x02E800 ) ;Do the pixelsearch If Not @error = 1 then ;If the color is found anywhere it will do that send ("{F8}" ) Sleep(250) send ( "1" ) Sleep(250) send ( "2" ) Sleep(250) send ( "3" ) Sleep(250) EndIf Sleep(250) PixelSearch ( 0, 0, 1024, 768, 0xB90000 ) ;Do the pixelsearch If Not @error = 1 then ;If the color is found anywhere it will do that send ( "x" ) Sleep(250) EndIf WEnd I'm not sure of the "IF" statement, what do you want to do about the pixelsearch ?? What i understand for the moment is that your search on all the screen for any pixel of this color and then it'll do the sendkey ... But i'm pretty sure this is'nt what you want to do. Could you explain more ? Edited November 16, 2006 by newb_powa' Link to comment Share on other sites More sharing options...
jacob_1998_1999 Posted November 16, 2006 Share Posted November 16, 2006 As per your Edit: To my knowledge, You cannot preform two separate PixelSearchs simultaneously, as AutoIt does not support multi threading. If you merely wish for the script to run forever, you might try looking into whiles. i.e. while 1 ;Insert Code Wend oÝ÷ ØZèØ^éi)^jëh×6 Example $i = 0 While $i <= 10 MsgBox(0, "Value of $i is:", $i) $i = $i + 1 WEnd Link to comment Share on other sites More sharing options...
s3xt0y Posted November 16, 2006 Author Share Posted November 16, 2006 ah , is there any alt way to get more then one pixel search , well , look for the color anyway? Link to comment Share on other sites More sharing options...
jacob_1998_1999 Posted November 16, 2006 Share Posted November 16, 2006 To my knowledge, no. However, you can run them at separate times, merely very close to each other. As newb_powa' has done. Link to comment Share on other sites More sharing options...
newb_powa' Posted November 16, 2006 Share Posted November 16, 2006 (edited) ah , is there any alt way to get more then one pixel search , well , look for the color anyway?I think you can do multiple pixelsearch at the time, but I would recommanded (is it the good word ??) to use small search area because it use a lot of CPU.Look at my example, it is doing the twice pixelserch in like a second, or it should, not tested yet.Sorry for bad english :S / Edit : some mistakes Edited November 16, 2006 by newb_powa' Link to comment Share on other sites More sharing options...
s3xt0y Posted November 16, 2006 Author Share Posted November 16, 2006 thanks guys , worked like a charm! , now for me to finish it up. Link to comment Share on other sites More sharing options...
newb_powa' Posted November 16, 2006 Share Posted November 16, 2006 thanks guys , worked like a charm! , now for me to finish it up.No problem If we can help you in any way, ask here. Link to comment Share on other sites More sharing options...
jacob_1998_1999 Posted November 16, 2006 Share Posted November 16, 2006 (edited) Very welcome, if I was actually any help. Just study the help file, it works miracles. http://www.autoitscript.com/autoit3/docs/Edit:I happened to think about something with your title.add this to the top of the script :Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advancedTo get past your EverQuest Title problems. Edited November 16, 2006 by jacob_1998_1999 Link to comment Share on other sites More sharing options...
s3xt0y Posted November 17, 2006 Author Share Posted November 17, 2006 sorry too bump this , but i cant seem to get my hotkey too work, check this out Hotkeyset ( "{F12}" , "Exit" ) i have tryed Func_quit and just Quit , im a nub , and i looked but i didnt find anything on it. Link to comment Share on other sites More sharing options...
newb_powa' Posted November 17, 2006 Share Posted November 17, 2006 (edited) sorry too bump this , but i cant seem to get my hotkey too work, check this outHotkeyset ( "{F12}" , "Exit" )i have tryed Func_quit and just Quit , im a nub , and i looked but i didnt find anything on it.Did you only read the helpfile ??It's really easyIn ==> "" Hotkeyset ( "{F12}" , "Exit" ) "" Exit is the name of the function you want to callTry that:Hotkeyset ( "{F12}" , "_Exit" )Func _Exit()exitEndfunc Edited November 17, 2006 by newb_powa' Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 17, 2006 Share Posted November 17, 2006 Exit is already a function in autoit, exampleHotKeySet("{F12}","_Exit") While 1 Sleep(100) WEnd Func _Exit() Exit EndFuncand as for multiple pixel search http://www.autoitscript.com/forum/index.php?showtopic=20051 Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 17, 2006 Share Posted November 17, 2006 (edited) Did you only read the helpfile ??It's really easyIn ==> "" Hotkeyset ( "{F12}" , "Exit" ) "" Exit is the name of the function you want to callTry that:Hotkeyset ( "{F12}" , "_Exit" )Func _Exit()exitEndfunc1.) Use Code/Autoit Tags for easy reading2.) Your missing a loop Edited November 17, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
newb_powa' Posted November 17, 2006 Share Posted November 17, 2006 1.) Use Code/Autoit Tags for easy reading2.) Your missing a loop I know for AutoIt tag, only forget, thanks For the loop, it's only an exemple, it's not the main script, i think Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 17, 2006 Share Posted November 17, 2006 well for an example yes but if you were to execute your code it would end instantly Link to comment Share on other sites More sharing options...
newb_powa' Posted November 17, 2006 Share Posted November 17, 2006 well for an example yes but if you were to execute your code it would end instantlyLol I know, I'm not such a noob Anyway, nextime I'll make a loop (just for you ) 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