While Loop demonstration

By Hawkee on Sep 19, 2003

Add this to your remote scripts screen, close the window and type /harr to get a pleasant surprise!

alias harr {
  var %i = 1
  while (%i <= 10) {
    echo -a HARR!
    inc %i
  }
}

Comments

Sign in to comment.
RussellReal   -  Jan 12, 2007

sorry about the double post.. :x
but it will return:

will do like
1st!
2nd!
3rd!
4th!

 Respond  
RussellReal   -  Jan 12, 2007

if you make %i = 0 you can loop it and increase the variable before the commands which gives you more flexibility.

alias harr {
var %i = 0
while (%i <= 10) {
inc %i
echo -a $+($ord(%i),!)
}
}
will do like
1!
2!
3!
4!
etc which is good for looping through a hash table or even a text file, I use it in my stat script (runescape) to loop through the items which can be used to get to the next level which turns out like this:

Green Dragons: 888 Red Dragons: 666
etc etc

anyway its rly a matter of preferrence :) to each his own ;)

 Respond  
Yoinx   -  Sep 12, 2005

what did you do to it tokenmaster? The alias works fine.

 Respond  
TokenMaster   -  Sep 12, 2005

AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA

  • Break: command halted
 Respond  
Ville   -  Apr 19, 2005

A nice snippet.

 Respond  
StanZ   -  Nov 25, 2003

AAAAAAAAAAAAAARRRRRRRRRRRRGGGGGGGGGGGGGGG!!!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.