Sign in to follow this  
Followers 0
rmp459

Basic Noob Question... Can't find answers (Vars)

15 posts in this topic

#1 ·  Posted (edited)

$while = 2

$winwake=WinExists ( "WINDOWTITLE" )

if $winwake=0 then

Exit

endif

if $winwake=1 then

WinActivate ( "WINDOWTITLE" )

While $while > 1

$while = $while

While $while > 1

$while=$while

what 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 by rmp459

Share this post


Link to post
Share on other sites



It looks like a monkey wrote that. It shouldn't even compile without a Wend. Where did you get this from?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

$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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

$while = 2

$winwake=WinExists ( "Darkfall Online" )

if $winwake=0 then

Exit

endif

if $winwake=1 then

WinActivate ( "Darkfall Online" )

While $while > 1

$while = $while

MouseClick("left")

sleep(10000)

WEnd

endif

from http://darkfall-mmorpg.blogspot.com/2009/0...oit-script.html

Is it just there so that the while function can work ?

Edited by rmp459

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Gondus could you explain the $paused = NOT $paused ??

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/forum/index.php?showtopic=21048

Autoit 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

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by Gondus

-----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran

Share this post


Link to post
Share on other sites

Edit: AHHH you made me double post :E

my apologies.. lol

thanks again

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0