Doug Porter Posted November 8, 2006 Share Posted November 8, 2006 I am so confused as to what is causing the error. Any help would be great. Thanks. expandcollapse popup<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> AutoItSetOption("PixelCoordMode",0) AutoItSetOption("MouseCoordMode",0) HotKeySet("{ESC}","Terminate") While 0=0 Func Terminate() Exit 0 EndFunc Dim $y=0 WinActivate("url") WinWaitActive("url") MouseClick("",400,440) Sleep(5000) MouseClick("",600,585) Sleep(5000) MouseClick("",1055,370) While $y < 531 Dim $y=Random(310,530,1) WinActivate ("url") If WinActive ("url")Then MouseClick("",58,$y,1,0) MouseClick("",500,299,1,0) EndIf If PixelGetColor(577,315)=9925823 Then Do $y=Random(310,530,1) MouseClick("",58,$y,1,0) Until PixelGetColor(577,315)=16777215 MouseClick("",500,299,1,0) EndIf sleep(2000) If PixelGetColor(35,495)=15066597 Then MouseWheel("down",10) MouseClick("",297,490) EndIf WEnd WEnd <!--c2--></div><!--ec2--> Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 8, 2006 Moderators Share Posted November 8, 2006 (edited) You have the whole function expandcollapse popupFunc Terminate() Exit 0 EndFuncoÝ÷ Û)íå¡W¥¢j}ý¶¯yéí·ºw-ðØb§(ØÚǶ)àjëh×6 AutoItSetOption("PixelCoordMode",0) AutoItSetOption("MouseCoordMode",0) HotKeySet("{ESC}","Terminate") While 0=0 Dim $y=0 WinActivate("url") WinWaitActive("url") MouseClick("",400,440) Sleep(5000) MouseClick("",600,585) Sleep(5000) MouseClick("",1055,370) While $y < 531 Dim $y=Random(310,530,1) WinActivate ("url") If WinActive ("url")Then MouseClick("",58,$y,1,0) MouseClick("",500,299,1,0) EndIf If PixelGetColor(577,315)=9925823 Then Do $y=Random(310,530,1) MouseClick("",58,$y,1,0) Until PixelGetColor(577,315)=16777215 MouseClick("",500,299,1,0) EndIf sleep(2000) If PixelGetColor(35,495)=15066597 Then MouseWheel("down",10) MouseClick("",297,490) EndIf WEnd WEnd Func Terminate() Exit 0 EndFuncI only glanced, didn't bother to look at the rest. Edited November 8, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PaulIA Posted November 8, 2006 Share Posted November 8, 2006 You've got some other problems too. This actually compiles, but I have no idea what you were trying to do: expandcollapse popupAutoItSetOption("PixelCoordMode",0) AutoItSetOption("MouseCoordMode",0) HotKeySet("{ESC}","Terminate") While 0=0 Dim $y=0 WinActivate("url") WinWaitActive("url") MouseClick("left",400,440) Sleep(5000) MouseClick("left",600,585) Sleep(5000) MouseClick("left",1055,370) While $y < 531 Dim $y=Random(310,530,1) WinActivate ("url") If WinActive ("url")Then MouseClick("left",58,$y,1,0) MouseClick("left",500,299,1,0) EndIf If PixelGetColor(577,315)=9925823 Then Do $y=Random(310,530,1) MouseClick("left",58,$y,1,0) Until PixelGetColor(577,315)=16777215 MouseClick("left",500,299,1,0) EndIf sleep(2000) If PixelGetColor(35,495)=15066597 Then MouseWheel("down",10) MouseClick("left",297,490) EndIf WEnd WEnd Func Terminate() Exit 0 EndFunc Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
GaryFrost Posted November 8, 2006 Share Posted November 8, 2006 now he has the same answer several times in 2 threads.... lol SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Doug Porter Posted November 8, 2006 Author Share Posted November 8, 2006 what does compile do, or why would i use it? thanks for the help. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 8, 2006 Moderators Share Posted November 8, 2006 what does compile do, or why would i use it?thanks for the help.http://en.wikipedia.org/wiki/Compiler Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Doug Porter Posted November 8, 2006 Author Share Posted November 8, 2006 the reason i put the {esc} function in the while is becouse i thought that if it was outside then i would get stuck looping and ot be able to stop the script. i guess that it doesn't matter? it did seem to fix the problem. Thanks to all. Link to comment Share on other sites More sharing options...
GEOSoft Posted November 8, 2006 Share Posted November 8, 2006 You've got some other problems too. This actually compiles, but I have no idea what you were trying to do: expandcollapse popupAutoItSetOption("PixelCoordMode",0) AutoItSetOption("MouseCoordMode",0) HotKeySet("{ESC}","Terminate") While 0=0 Dim $y=0 WinActivate("url") WinWaitActive("url") MouseClick("left",400,440) Sleep(5000) MouseClick("left",600,585) Sleep(5000) MouseClick("left",1055,370) While $y < 531 Dim $y=Random(310,530,1) WinActivate ("url") If WinActive ("url")Then MouseClick("left",58,$y,1,0) MouseClick("left",500,299,1,0) EndIf If PixelGetColor(577,315)=9925823 Then Do $y=Random(310,530,1) MouseClick("left",58,$y,1,0) Until PixelGetColor(577,315)=16777215 MouseClick("left",500,299,1,0) EndIf sleep(2000) If PixelGetColor(35,495)=15066597 Then MouseWheel("down",10) MouseClick("left",297,490) EndIf WEnd WEnd Func Terminate() Exit 0 EndFuncYou may be right. For openers I stopped looking after line 4. Something like While 0 = 0 will usually start my head spinning. Last time I looked it up in an advanced mathematics book 0 was always equal to 0. 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...
Doug Porter Posted November 8, 2006 Author Share Posted November 8, 2006 You may be right. For openers I stopped looking after line 4.Something like While 0 = 0 will usually start my head spinning. Last time I looked it up in an advanced mathematics book 0 was always equal to 0.thats the point, the body will loop indefinitely. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 8, 2006 Share Posted November 8, 2006 (edited) you can just put while 1 it stands for while 1 = 1 just short, hell if you want put while 0 or while 0 = 0 and 1 = 1 and 2 =2 all the same, im just getting at that you can just put while and a number Edited November 8, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
tresa Posted November 8, 2006 Share Posted November 8, 2006 There are 3 remarks : - your $y var is declared twice - the while $y<531 test is not useful as the $y is randomly between 310 and 530 ! Replace it by a while 1 loop for clarity - you have several sleep(...) instructions. After these there's now warranty that the active window has'nt changed. You have to check it in your code 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