zfoxhunterz Posted December 23, 2006 Share Posted December 23, 2006 this script is called myscript.au3 . and my code is not working please help me here. expandcollapse popup$pixelcolor1=pixelgetcolor(50,36) $pixelcolor2=pixelgetcolor(52,36) $pixelcolor3=pixelgetcolor(54,36) $pixelcolor4=pixelgetcolor(56,36) $pixelcolor5=pixelgetcolor(58,36) $pixelcolor6=pixelgetcolor(60,36) $pixelcolor7=pixelgetcolor(62,36) $pixelcolor8=pixelgetcolor(64,36) $pixelcolor9=pixelgetcolor(66,36) $pixelcolor10=pixelgetcolor(68,36) $pixelcolor11=pixelgetcolor(70,36) If $pixelcolor1 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor2 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor3 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor4 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor5 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor6 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor7 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor8 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor9 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor10 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor11 = 6510897 Then Send("{PAUSE}") Else Run("C:\Documents and Settings\my comp\Desktop\folder\myscript.au3") EndIf Please tell me what im doing wrong and how i can make this work thanks Link to comment Share on other sites More sharing options...
Valuater Posted December 23, 2006 Share Posted December 23, 2006 (edited) Not Tested ********** expandcollapse popup; Press Esc to terminate script, Pause/Break to "pause" Global $Paused, $Runner HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "Run_myScript") ;;;; Body of program would go here ;;;; While 1 If $Runner Then ToolTip('Script is "Running"', 0, 0) For $x = 50 To 70 Step 2 If PixelGetColor($x, 36) = 6510897 Then Send("{PAUSE}") ; $runner = 0 ; ????????? ExitLoop EndIf Next EndIf ToolTip("") Sleep(500) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func Run_myScript() ; to stop AND Start your script $Runner = Not $Runner EndFunc ;==>Run_myScript 8) Edited December 23, 2006 by Valuater Link to comment Share on other sites More sharing options...
GEOSoft Posted December 23, 2006 Share Posted December 23, 2006 this script is called myscript.au3 . and my code is not working please help me here. expandcollapse popup$pixelcolor1=pixelgetcolor(50,36) $pixelcolor2=pixelgetcolor(52,36) $pixelcolor3=pixelgetcolor(54,36) $pixelcolor4=pixelgetcolor(56,36) $pixelcolor5=pixelgetcolor(58,36) $pixelcolor6=pixelgetcolor(60,36) $pixelcolor7=pixelgetcolor(62,36) $pixelcolor8=pixelgetcolor(64,36) $pixelcolor9=pixelgetcolor(66,36) $pixelcolor10=pixelgetcolor(68,36) $pixelcolor11=pixelgetcolor(70,36) If $pixelcolor1 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor2 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor3 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor4 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor5 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor6 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor7 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor8 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor9 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor10 = 6510897 Then Send("{PAUSE}") ElseIf $pixelcolor11 = 6510897 Then Send("{PAUSE}") Else Run("C:\Documents and Settings\my comp\Desktop\folder\myscript.au3") EndIf Please tell me what im doing wrong and how i can make this work thanksFor openers you can't run() a scrpt that way Use Shell execute("C:\Documents and Settings\my comp\Desktop\folder\myscript.au3","","","Run") instead Secondly what par of the script do you want loop? If Its only The If/ElseIf portion then Use While i If ElseIf Etc Etc Else Shell execute("C:\Documents and Settings\my comp\Desktop\folder\myscript.au3","","","Run") ExitLoop WEnd George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
zfoxhunterz Posted December 23, 2006 Author Share Posted December 23, 2006 (edited) I want it to run the script over and over and over again untill one of thoes 10 pixels become the color i want them to be. and if that happens i want it to stop running the script and then press the pause button. Edited December 23, 2006 by zfoxhunterz Link to comment Share on other sites More sharing options...
zfoxhunterz Posted December 23, 2006 Author Share Posted December 23, 2006 btw are you wanting to send the word "Pause" or click a button thats Named "Pause"i want to click the button thats named pauesthanks man i cant wait to try this out. and i cant wait to start learning more autoit. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 24, 2006 Share Posted December 24, 2006 wow dude you need to learn to edit.... Global $answer While 1 For $i = 50 To 70 Step 2 If PixelGetColor($i,36) = 6510897 Then Send("{Pause}") $answer = 1 ExitLoop EndIf Next If $answer = 1 Then Exit WEnd 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