russell Posted October 4, 2010 Posted October 4, 2010 Ok having a little trouble finding out how to get the pixel search to run in the loop then deliver the output (0, or 1) to the value $Search. I feel like im really really close. Can anyone straighten me out? Global $Search=PixelSearch (93,89,102,98,0xf9f8f7) Global Const $FF = ("Mozilla Firefox") HotKeySet("{F10}", "exitNow") Func exitNow() Exit EndFunc ;==>exitNow ToolTip("F10: Exit", 0, 0) WinActivate ($FF) Sleep (500) While 1 If $Search=0 Then MsgBox(0, "Notice", "Yup its there",1) WinActivate ($FF);fight program in front Elseif $Search=1 Then MsgBox(0, "Notice", "Nope Its NOT",1) WinActivate ($FF) ;fight program in front Else MsgBox (0,"Notice","Well Im broke, never ran the search",2) WinActivate ($FF);fight program in front Sleep (6000) EndIf WEnd muppet hands are so soft :)
russell Posted October 4, 2010 Author Posted October 4, 2010 Come on noone? Is this possible? It feel like its 1 line away from done. Just how to i get the Pixel Search to run Ok having a little trouble finding out how to get the pixel search to run in the loop then deliver the output (0, or 1) to the value $Search. I feel like im really really close. Can anyone straighten me out? Global $Search=PixelSearch (93,89,102,98,0xf9f8f7) Global Const $FF = ("Mozilla Firefox") HotKeySet("{F10}", "exitNow") Func exitNow() Exit EndFunc ;==>exitNow ToolTip("F10: Exit", 0, 0) WinActivate ($FF) Sleep (500) While 1 If $Search=0 Then MsgBox(0, "Notice", "Yup its there",1) WinActivate ($FF);fight program in front Elseif $Search=1 Then MsgBox(0, "Notice", "Nope Its NOT",1) WinActivate ($FF) ;fight program in front Else MsgBox (0,"Notice","Well Im broke, never ran the search",2) WinActivate ($FF);fight program in front Sleep (6000) EndIf WEnd muppet hands are so soft :)
enaiman Posted October 4, 2010 Posted October 4, 2010 5 hours to bump your post? Shouldn't have been something like 24 hours? Not a written rule but one everybody respects ... I have your answer ... but I'll post it tomorrow. Learn to be patient. 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 :)
enaiman Posted October 5, 2010 Posted October 5, 2010 You are not getting the result you need because you are evaluating $Search at the top of your script when the window you want to search might not even be open. The value of $search won't change during your script execution. To have it working, you need to change "If $Search=0 Then" with "If PixelSearch (93,89,102,98,0xf9f8f7) = 0 Then" so the pixel search will be done continuously in the While/Wend loop. 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 :)
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