R4WR Posted March 25, 2008 Share Posted March 25, 2008 Hello, I am kinda new to all the scripting (still a newbie) and I needed some help with following script: What I need to to do is: - check pixel color --> (color = 0x214252 ; pixel = 470, 667) --> if so keep right clicking it (repeat) - untill it changes --> then Alt tab, click (pixel = 494, 475), Alt tab (back to 1st window), moove mouse to go and check pixel again (pixel = 470, 667) Im not sure about: PixelGetColor, PixelGetPos, Alt+Tab and the overall scripting interpretation (since im new ot this) CODEHotKeySet("{DELETE}", "Stop") ;script can be stopped by pressing DELETE $Color = PixelGetColor ("0x214252"); check if pixel has got certain color While 1 ;repeat endlessly If $Color = 1 ;pixel has color 0x214252 Then MouseClick ( "right", 470, 667, 1 , 2 ) Sleep ("600") If $Color = 0 ;pixel has other color Then Send ("Alt+Tab") ;is Alt+Tab put in right? Sleep("600") Mouseclick ( "left", 494, 475, 1, 2) Send("Alt+Tab") Sleep("600") MouseGetPos (470, 667) ;mouse goes back to position for colorcheck WEnd ;repeat Func Stop() ;to allow the script to stop Exit ;same EndFunc ;same Link to comment Share on other sites More sharing options...
spudw2k Posted March 25, 2008 Share Posted March 25, 2008 (edited) Keystrokes that are function keys (tab,ctrl,enter,etc..) should be surrounded by brackets. Send("{ALT}+{TAB}") Edited March 25, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Paulie Posted March 25, 2008 Share Posted March 25, 2008 (edited) You are all screwed up try this HotKeySet("{DELETE}", "Stop") ;script can be stopped by pressing DELETE While 1 ;repeat indefinitly $Color = PixelGetColor (470,667); get decimal color value of pixel (470,667) If $Color = 0x214252 then ; compare color to 0x214252 and if it is the same then MouseClick ( "right", 470, 667, 1 ,0 );rightclick on the pixel Sleep(600) ; wait for 6/10 of a second Else ; if its not the same Send("!{TAB}");send Alt+Tab Sleep(600);wait Mouseclick ( "left", 494, 475, 1, 2) ; leftclick on (494,475) Sleep(600); wait again EndIf WEnd ; repeat Func Stop() ;to allow the script to stop Exit ;same EndFunc ;same Edited March 25, 2008 by Paulie Link to comment Share on other sites More sharing options...
Developers Jos Posted March 25, 2008 Developers Share Posted March 25, 2008 For the record: your Sleep("600") are wrong too, should be Sleep(600) if you want your script to pause for 600ms. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
R4WR Posted March 25, 2008 Author Share Posted March 25, 2008 Thank you all so much :-D Damn, I wanna study this too so I can learn how to do this without having to ask help. But, I guess I didn't do too bad for the first try. :-) I'll let u know if it worked how I expected it to work Grtz, anna Link to comment Share on other sites More sharing options...
R4WR Posted March 25, 2008 Author Share Posted March 25, 2008 after some minor changes (sleep times and stuff) it worked a next accomplishment wud be to do this minimised... feel free to hook me up, but its not necesaraly. HotKeySet("{DELETE}", "Stop") ;script can be stopped by pressing DELETE While 1 ;repeat indefinitly $Color = PixelGetColor (470,667); get decimal color value of pixel (470,667) If $Color = 0x214252 then ; compare color to 0x214252 and if it is the same then MouseClick ( "right", 470, 667, 1 ,0 ) ; rightclick on the pixel Sleep(600) ; wait for 6/10 of a second Else ; if its not the same Send("!{TAB}");send Alt+Tab Sleep(600);wait Mouseclick ( "left", 494, 475, 1, 2) ; leftclick on (494,475) Sleep(1600);wait Mouseclick ( "right", 250, 20, 1, 2) ; rightclick on (250, 20) Sleep(1600);wait Send("!{TAB}");send Alt+Tab Sleep(6000); wait again EndIf WEnd ; repeat Func Stop() ;to allow the script to stop Exit ;same EndFunc ;same Grtz, and thx again 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