cerix Posted September 8, 2010 Share Posted September 8, 2010 HotKeySet("(Home)","_Start") HotKeySet("(insert)","_Stop") While 1 $Variable = PixelSearch(240,202,580,550,0xCE2E16) If IsArray($Variable) = True Then MouseMove($Variable [0], $Variable [1],1) MouseClick("right") EndIf WEnd While 2 $Variable = PixelSearch(190,190,750,600,0xE5EAEB) If IsArray($Variable) = True Then MouseMove($Variable [0], $Variable [1],1) MouseClick("left") EndIf WEnd While 3 $Variable = PixelSearch(190,190,750,600,0xDCF070) If IsArray($Variable) = True Then MouseMove($Variable [0], $Variable [1],1) MouseClick("left") EndIf WEnd Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
enaiman Posted September 8, 2010 Share Posted September 8, 2010 alot of things are wrong - there is no _Start function - there is no _Stop function - there is absolutely no way out of your all 3 While loops Guess that would be "alot". SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Dreu Posted September 8, 2010 Share Posted September 8, 2010 (edited) A: Theres 3 While loops. Use 1. B: Try tossing some error processing in there somewhere to locate WHERE the error is... C: I assume the program closes while appearing to do nothing? It can't find the specified pixels. --- Nvm... didn't notice the forever loops. D: I second-assume your pressing "Home" to start the script... And your hotkeys aren't bound to anything. Try This... HotKeySet("{Home}","_Start") HotKeySet("{insert}","_Stop") While 1 Sleep(500) WEnd Func _Start() $Variable1 = PixelSearch(240,202,580,550,0xCE2E16) If @Error Then MsgBox(0, "Error", "$Variable1 couldn't find the color.") Else If IsArray($Variable1) = True Then MouseMove($Variable1[0], $Variable1[1],1) MouseClick("right") Else MsgBox(0, "Error", "$Variable1 isn't an array.") EndIf EndIf $Variable2 = PixelSearch(190,190,750,600,0xE5EAEB) If @Error Then MsgBox(0, "Error", "$Variable2 couldn't find the color.") Else If IsArray($Variable2) = True Then MouseMove($Variable2[0], $Variable2[1],1) MouseClick("left") Else MsgBox(0, "Error", "$Variable2 isn't an array.") EndIf EndIf $Variable3 = PixelSearch(190,190,750,600,0xDCF070) If @Error Then MsgBox(0, "Error", "$Variable1 couldn't find the color.") Else If IsArray($Variable3) = True Then MouseMove($Variable3[0], $Variable3[1],1) MouseClick("left") Else MsgBox(0, "Error", "$Variable3 isn't an array.") EndIf EndIf EndFunc Func _Stop() Exit EndFunc Edited September 8, 2010 by Dreu Link to comment Share on other sites More sharing options...
cerix Posted September 8, 2010 Author Share Posted September 8, 2010 alot of things are wrong- there is no _Start function- there is no _Stop function- there is absolutely no way out of your all 3 While loopsGuess that would be "alot".Please help me write to true code Link to comment Share on other sites More sharing options...
Dreu Posted September 8, 2010 Share Posted September 8, 2010 It is pasting it as one big line -.-... I wrote it, you get to space it out =). Link to comment Share on other sites More sharing options...
chorao157 Posted September 8, 2010 Share Posted September 8, 2010 (edited) HotKeySet("(Home)","_Start") HotKeySet("(insert)","_Stop") While 1 $Variable = PixelSearch(240,202,580,550,0xCE2E16) If IsArray($Variable) = True Then MouseMove($Variable [0], $Variable [1],1) MouseClick("right") EndIf WEnd only use this Edited September 8, 2010 by chorao157 Link to comment Share on other sites More sharing options...
enaiman Posted September 8, 2010 Share Posted September 8, 2010 @chorao157 Please don't give wrong suggestions to OP SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Dreu Posted September 8, 2010 Share Posted September 8, 2010 You replicated his code, just deleted some of it -.- Link to comment Share on other sites More sharing options...
cerix Posted September 9, 2010 Author Share Posted September 9, 2010 HotKeySet("(Home)","_Start") HotKeySet("(insert)","_Stop") While 1 $Variable = PixelSearch(240,202,580,550,0xCE2E16) If IsArray($Variable) = True Then MouseMove($Variable [0], $Variable [1],1) MouseClick("right") EndIf WEnd only use this i know but i want so right click to 0xCE2E16 then open another symbol another symbol colors 0xE5EAEB left clixkt to 0xE5EAEB then open the an another symbol lastly symbol color code 0xDCF070 i want to follow each other Link to comment Share on other sites More sharing options...
Tvern Posted September 9, 2010 Share Posted September 9, 2010 (edited) @OP If this is the same program as the one in your other topic I strongly suggest you follow the non-pixelsearch approach. Make the best of the help you're getting in that topic as it will lead to a much more reliable script. edit: but if you insist on the pixelsearch approach: Do $aPos = PixelSearch(240,202,580,550,0xCE2E16) ;repeat pixelsearch Until IsArray($aPos) ;until it returns an array (no infinite loop this way) MouseClick("right",$aPos[0],$aPos[1]) ;then click that pixel. Do $aPos = PixelSearch(190,190,750,600,0xE5EAEB) Until IsArray($aPos) MouseClick("left",$aPos[0],$aPos[1]) Do $aPos = PixelSearch(190,190,750,600,0xDCF070) Until IsArray($aPos) MouseClick("left",$aPos[0],$aPos[1]) Edited September 9, 2010 by Tvern 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