longxx Posted May 22, 2008 Share Posted May 22, 2008 hi guys. I am trying to make this SearchPixel works in game this is what I have so far: $coord = PixelSearch( 20, 300, 700, 850, 0x02F000, 10 ) If Not @error Then Send("found color at",$coord[0] & "," & $coord[1] ) Else Send("Could not find color") EndIf my question is how to active it? how to let it search it in game? does it only do it once when I active it? because I prefer it constantly scan the area and when it observes the desired color can trigger the command. thanks. Link to comment Share on other sites More sharing options...
TnTProductions Posted May 22, 2008 Share Posted May 22, 2008 i found 1 error in your script after color dont have anything else its fine before you have something after it "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology" Link to comment Share on other sites More sharing options...
Generator Posted May 22, 2008 Share Posted May 22, 2008 Put it in a loop such as While 1...WEnd or Do....Until or For..Step...Next or For..In..Next Link to comment Share on other sites More sharing options...
TnTProductions Posted May 22, 2008 Share Posted May 22, 2008 (edited) also stop using the send function that doesnt display messages for you thats a key function try this: $coord = PixelSearch( 20, 300, 700, 850, 0x02F000) If Not @error Then MsgBox("Color Found!","Color found at: & $coord[0] & $coord[1]" ) Else MsgBox("Color not Found..","Color wasn't found") EndIf Edited May 22, 2008 by TnTProductions "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology" Link to comment Share on other sites More sharing options...
Orgins Posted May 22, 2008 Share Posted May 22, 2008 (edited) You can try something like this: (Like Generator suggested but with a hotkeyset) Hit the pause key and it'll do the search. (keep hitting pause it'll keep doing a new search) HotKeySet("{PAUSE}", "search") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) WEnd Func search() $coord = PixelSearch( 20, 300, 700, 850, 0x02F000, 10 ) If Not @error Then Tooltip("found color at",$coord[0] & "," & $coord[1] ) Else Tooltip("Could not find color") EndIf EndFunc Func Terminate() Exit 0 EndFunc Edited May 23, 2008 by Orgins I'm a newbie.Sorry if I don't reposed to your replays very fast. Link to comment Share on other sites More sharing options...
Rydextillxixdiex Posted May 23, 2008 Share Posted May 23, 2008 I recommend the following over tool tips: HotKeySet("{PAUSE}", "search") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) WEnd Func search() Global $show = 0 $coord = PixelSearch( 20, 300, 700, 850, 0x02F000, 10 ) If Not @error Then MsgBox(0, "PixelSearch", "found color at",$coord[0] & "," & $coord[1] ) Else MsgBox(0, "PixelSearch", "Could not find color") EndIf EndFunc Func Terminate() MsgBox(0,"PixelSearch", "Press ok to exit" & @CRLF & "or" & @CRLF & "Press pause to search again") Exit EndFunc ...will never learn all there is to know about autoit, no worries...i came to the forums :) Link to comment Share on other sites More sharing options...
longxx Posted May 23, 2008 Author Share Posted May 23, 2008 hey thanks for your help, it works!!! tooltip is great idea compare to message window. now I have more advanced question to make this works towards the goal closer -----I want to do two different things depends on two different color collected, is it better to to two sets of PixelSearch, or two PixelSearch two colors? then to add IF color=A ... If color=B ... some sample codes will be greatly appreciated! since i am really new at this.. thanks. Link to comment Share on other sites More sharing options...
TnTProductions Posted May 23, 2008 Share Posted May 23, 2008 (edited) Just have two pixel searches in will make things simpler let me get this strait you want it to do this: If the 1 pixel search returns true then do a certian function but if another pixel search is true then do another function? Edited May 23, 2008 by TnTProductions "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology" Link to comment Share on other sites More sharing options...
TnTProductions Posted May 23, 2008 Share Posted May 23, 2008 (edited) ex:$coord = PixelSearch( 20, 300, 700, 850, 0x02F000, 10 ) $coord2 = PixelSearch(your second pixel search cordinates) $color = PixelSearch() Select Case $color = PixelSearch(20, 300, 700, 850, 0x02F000, 10 ) ;;add function you want here;; Case $color = PixelSearch(second pixel search coordinates) ;;add function you want here;; EndSelect use case for events like urs Edited May 23, 2008 by TnTProductions "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology" Link to comment Share on other sites More sharing options...
longxx Posted May 23, 2008 Author Share Posted May 23, 2008 (edited) hey TnT thanks for your advice, I tried to run the script but there is error message with the $color variable, however I got it working with this code with two IFs, will it be ok? Func search() Global $show = 0 $c1 = PixelSearch( 20, 300, 700, 850, 0x009933, 10 ) If Not @error Then tooltip("yes1" ) EndIf $c2 = PixelSearch( 20, 300, 700, 850, 0xFFFFFF, 10 ) If Not @error Then tooltip("yes2" ) EndIf EndFunc so now this is working each time I press hotkey, how to make it KEEP scanning? ----I havent done anything like this before, is it ok to make computer keep scanning one area??? will that make CPU temperature too hot? and can anyone explain what the codes of " While 1 Sleep(100) WEnd" mean? thanks. Edited May 23, 2008 by longxx Link to comment Share on other sites More sharing options...
TnTProductions Posted May 23, 2008 Share Posted May 23, 2008 (edited) yea thats fine i was using casing so it chooses from the options but i frgot to make the pixel searches a variable Edited May 23, 2008 by TnTProductions "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology" 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