Ultratech Posted February 25, 2007 Posted February 25, 2007 Ok I'm searching a single coordinate of the screen (366, 240). I'm trying to write a script that does a command when that pixel changes a certain color. The color I'm using is 0x042313 or dark green. Only thing I know how to do is do a command if the color changes. Func checkcolor() ; Check 366, 240 until it turns green then command $color = PixelGetColor(366, 240) Sleep(100) Do Sleep(100) PixelGetColor(366, 240) Until $color = 0x042313 Send("{ENTER}") EndFunc This is all I could think of... any easy way to do this?
NicoTn Posted February 25, 2007 Posted February 25, 2007 is this the whole script ? while 1 If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe") wend [size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Ultratech Posted February 25, 2007 Author Posted February 25, 2007 No just the troubling part. The other is just assigning a hotkey. It's a short script.
NicoTn Posted February 25, 2007 Posted February 25, 2007 i rly dont know sorry man while 1 If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe") wend [size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Ultratech Posted February 25, 2007 Author Posted February 25, 2007 I just took a look at sandman's post, that looks like it might work. Any tips still welcome.
newb_powa' Posted February 25, 2007 Posted February 25, 2007 (edited) Ok I'm searching a single coordinate of the screen (366, 240). I'm trying to write a script that does a command when that pixel changes a certain color. The color I'm using is 0x042313 or dark green. Only thing I know how to do is do a command if the color changes. Func checkcolor() ; Check 366, 240 until it turns green then command $color = PixelGetColor(366, 240) Sleep(100) Do Sleep(100) PixelGetColor(366, 240) Until $color = 0x042313 Send("{ENTER}") EndFuncoÝ÷ Ù8b²+R¢é]¶§Ú'³,ÊÚ¢Øb³ú®¢×¢çhmºZµì¨º»Ú®&í7éÊ%¢·n®)à¶¥¢l¢+b²w¯z¸(x-¡ÈZ¯+ajÖ®¶sdgVæ2õVÄ6V6²¤Fò¥6ÆVW¢b33c¶6öÆ÷"ÒVÄvWD6öÆ÷"3cbÂ#C¥VçFÂb33c¶6öÆ÷"ÒC#30£²WBFRFærFòWV7WFRgFW"FR6öÆ÷"2f÷VæBW&P¤VæDgVæ Edit : the return of pixelcolor is in decimal, is'nt it ?? Try to put the decimal number for "0x042313" Edited February 25, 2007 by newb_powa'
phantom Posted February 25, 2007 Posted February 25, 2007 (edited) Try this. Func checkcolor() ; Check 366, 240 until it turns green then command Do Sleep(100) $color = PixelGetColor(366, 240) Until $color = 0x042313 Send("{ENTER}") EndFunc EDIT: dam to slow xD Edited February 25, 2007 by phantom
xcal Posted February 25, 2007 Posted February 25, 2007 (edited) You guys do realize that pixelgetcolor returns a dec, and you're checking for hex? Func checkcolor() Do Sleep(100) Until StringTrimLeft(Hex(PixelGetColor(366, 240)), 2) = '042313' Send("{ENTER}") EndFunc Edited February 25, 2007 by xcal How To Ask Questions The Smart Way
newb_powa' Posted February 25, 2007 Posted February 25, 2007 You guys do realize that pixelgetcolor returns a dec, and you're checking for hex?Did you look at my edit :S
xcal Posted February 25, 2007 Posted February 25, 2007 Did you look at my edit :SNot so much - didn't see the value in it. I saw script that wouldn't work, so I only skimmed your post. How To Ask Questions The Smart Way
Ultratech Posted February 25, 2007 Author Posted February 25, 2007 Nothing's working I tried it all and it doens't work.
xcal Posted February 25, 2007 Posted February 25, 2007 You're probably using it on a game that has some kind of protection. How To Ask Questions The Smart Way
Ultratech Posted February 25, 2007 Author Posted February 25, 2007 Just trying to scan a square or a pixel and add a command when it changes to a color. Seems harder than I thought.
xcal Posted February 25, 2007 Posted February 25, 2007 Don't have 'FFFFFF' (white) in your bottom right corner. Run this: checkcolor() Func checkcolor() Do Sleep(100) Until StringTrimLeft(Hex(PixelGetColor(@DesktopWidth - 50, @DesktopHeight - 50)), 2) = 'FFFFFF' MsgBox(0, '', 'color found') EndFunc Open notepad (white background) and move it to the bottom right corner. How To Ask Questions The Smart Way
newb_powa' Posted February 25, 2007 Posted February 25, 2007 (edited) Just trying to scan a square or a pixel and add a command when it changes to a color. Seems harder than I thought. If it's alway the same color, try pixelsearch, with this you can search in a define area and look for differents shade Edit: Try that, i'm not sure if it's going to work but if it do that would be great Func checkcolor() $x = 0 Do $color = PixelSearch(300, 200, 400, 300, 0x042313, 10) If IsArray($color) then $x = 1 EndIf Until $x = 1 ;Thing to Do Here EndFunc This is probably not the best solution but you should try it Edited February 25, 2007 by newb_powa'
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