rmp459 Posted March 9, 2009 Posted March 9, 2009 (edited) $while = 2$winwake=WinExists ( "WINDOWTITLE" )if $winwake=0 thenExitendifif $winwake=1 thenWinActivate ( "WINDOWTITLE" )While $while > 1$while = $whileWhile $while > 1$while=$whilewhat purpose does this server in the macro if nothing later on every uses $while ?if While...WEnd is for a loop... why did this person include the $while>1 and $while=$while ?? Edited March 9, 2009 by rmp459
Nevin Posted March 9, 2009 Posted March 9, 2009 It looks like a monkey wrote that. It shouldn't even compile without a Wend. Where did you get this from?
rmp459 Posted March 9, 2009 Author Posted March 9, 2009 there is a WEnd later on... after other mouse/key commands... but what is the purpose of the $while=$while and for that matter.. what is the purpose of the variable $while anyways... Im just trying to understand the language a bit more.. it makes no sense to me
Hawkwing Posted March 9, 2009 Posted March 9, 2009 $while = $while doesn't do anything at all. Who the heck wrote this? Could you post the whole script? Maybe it will make more sense The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.
Gondus Posted March 9, 2009 Posted March 9, 2009 There really isnt any point to it, shown in this code (dont see how that would change in any other code), might of been trying to do $while = not $while (which i use alot), but since thats not the case here i see no point in it. -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran
rmp459 Posted March 9, 2009 Author Posted March 9, 2009 (edited) $while = 2$winwake=WinExists ( "Darkfall Online" ) if $winwake=0 then Exit endif if $winwake=1 then WinActivate ( "Darkfall Online" ) While $while > 1$while = $whileMouseClick("left")sleep(10000)WEndendiffrom http://darkfall-mmorpg.blogspot.com/2009/0...oit-script.htmlIs it just there so that the while function can work ? Edited March 9, 2009 by rmp459
Gondus Posted March 9, 2009 Posted March 9, 2009 I play darkfall and that is for simply to left click for casting/resource grinding. You would run out of stamina/mana eventually so this is not a bot. I do have a script for left clicking my self since it is tedious to do it for 4 hours straight every 10 seconds (have mine set to 18 seconds so i dont run out of stam so fast). Also that $while = $while has no point what so ever. -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran
AdmiralAlkex Posted March 9, 2009 Posted March 9, 2009 Is it just there so that the while function can work ?No. The "proper" way to do an infinite loop is:While 1 ;Some code hereWEnd .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Gondus Posted March 9, 2009 Posted March 9, 2009 Share the wealth? Global $Paused HotKeySet( "{Pause} ", "TogglePause" ) while 1 sleep(18000) MouseClick ( "left" ) WEnd ;; Pauses Whole Program Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran
rmp459 Posted March 9, 2009 Author Posted March 9, 2009 Thanks admiral... appreciate it... so technically it could just be in there so the maker could see if his script was edited by another person by inserting some random variables/values in place of the "1" ...also are their any recommended tutorials/reading sources for learning this language properly?
rmp459 Posted March 9, 2009 Author Posted March 9, 2009 Share the wealth?Global $PausedHotKeySet( "{Pause} ", "TogglePause" )while 1 sleep(18000) MouseClick ( "left" )WEnd;; Pauses Whole ProgramFunc TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEndEndFuncGondus could you explain the $paused = NOT $paused ??
Gondus Posted March 9, 2009 Posted March 9, 2009 http://www.autoitscript.com/forum/index.php?showtopic=21048Autoit 1-2-3 tutorial, what i first used 2 and something years ago. (i think they keep it up to date). -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran
Gondus Posted March 9, 2009 Posted March 9, 2009 (edited) Gondus could you explain the $paused = NOT $paused ??Basically, if you hit the pause button once it will start going though the pause while until you hit pause again. Very helpful when you want to stop all actions in a script (i believe it starts from the beginning of the while you were in before you paused). Its very practical in a lot of situations.Edit: AHHH you made me double post :E Edited March 9, 2009 by Gondus -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran
rmp459 Posted March 9, 2009 Author Posted March 9, 2009 Edit: AHHH you made me double post :Emy apologies.. lolthanks again
AdmiralAlkex Posted March 9, 2009 Posted March 9, 2009 Thanks admiral... appreciate it... so technically it could just be in there so the maker could see if his script was edited by another person by inserting some random variables/values in place of the "1"Well no, that script is just badly written, whoever wrote it must be (near) worthless at AutoIt....also are their any recommended tutorials/reading sources for learning this language properly?That Would be AutoIt 1-2-3 and Learning To Script with AutoIt V3. Two other great resources is the helpfile and the examples scripts forum. Both are filled with great examples that show how to use everything except the most exotic udf's. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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