Loop Demonstration
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 7.0 (of 1 scores) |
| Date Added | Sep 02, 2009 |
| Last Updated | Sep 24, 2009 |
| Tags | do how i loop loops to tutorial while |
Description
A simple demonstration on how to write a loop script.
Done in status window by typing /loop
The script will end at: 1000
Done in status window by typing /loop
The script will end at: 1000
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 2:15 pm
Posted on Sep 2, 2009 2:15 pm
Nice demonstration, but mirc's help file has shown an example similar to this one you posted, except you've included the explanation. You can change var %i = 1 to var %i = 0 so that it counts from 0 to 999
P.S. Your code will stop at 999; you need to change it to
P.S. Your code will stop at 999; you need to change it to
| Quote: |
| while (%i <= 1000) { |
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 4:19 pm
Posted on Sep 2, 2009 4:19 pm
or
that'll shed a byte!
| Code: |
| while (%i < 1001){ |
that'll shed a byte!
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 4:52 pm
Posted on Sep 2, 2009 4:52 pm
lol. i think 1000's a bit excesive? 10 usually shows the gist of it..
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 5:02 pm
Posted on Sep 2, 2009 5:02 pm
It actually loops through lightning fast. It'll be over before you know it. lol
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 5:18 pm
Posted on Sep 2, 2009 5:18 pm
i know, i know.. but it's a bit ... pointless to show SO many times. :/
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 5:40 pm
Posted on Sep 2, 2009 5:40 pm
Jonesy is right. No point in showing 1000 when 10 will do it just as fine. If anything 1000 will spam whatever is your active window (<--Not a great idea).
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 5:51 pm
Posted on Sep 2, 2009 5:51 pm
As a suggestion -- and possible improvement on teaching loops, make the number editable -- this way you can show how to change the number of loops more dynamically.
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 7:25 pm
Posted on Sep 2, 2009 7:25 pm
Nice description of it, and example. But I know a few people would prefer "smaller" code, even though it could kill readability.. Anyways.
I decided to add to this, to possibly show more (or a different) way loops could work. It's a fun little mass shoot thing, but I'd suggest only doing it in your own channel.
| Code: |
alias Loop { var %i = 1 | while (%i < 1000) { echo -a Looped #= %i | inc %i } } |
I decided to add to this, to possibly show more (or a different) way loops could work. It's a fun little mass shoot thing, but I'd suggest only doing it in your own channel.
| Code: |
alias mshoot { var %x = 1 | while (%x <= 5) { describe $active shoots $nick(#,$r(1,$nick(#,0))) dealing $r(1,1000) damage! | inc %x } } |
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 10:43 pm
Posted on Sep 2, 2009 10:43 pm
@GlobalAnomaly: I think you posted your example in a hurry that you forgot to space the /while %x and <= 5, without it, you'll get an error. And you should add a timer delay to it, so that they won't come out at the same time in a flooding fashion:
| Code: |
| alias mshoot { var %x = 1, %y = $!nick(#,$r(1,$nick(#,0))) while (%x <= 5) { .timer 1 $calc(%x * 2) describe $!chan shoots %y dealing $r(1,1000) damage! inc %x } } |
mIRC Snippet:
Loop Demonstration
Posted on Sep 2, 2009 10:54 pm
Posted on Sep 2, 2009 10:54 pm
Aye, noticed that. Edited to add the space :P I was posting in a hurry.
mIRC Snippet:
Loop Demonstration
Posted on Sep 3, 2009 8:34 am
Posted on Sep 3, 2009 8:34 am
/me thumbs up | /me rates a 7 | timer 0 0 msg concept FLOOOOOOOOOOOOOOOOOOOODED | NOW I CAN DO IT WITH WHILE LOOPS! WOOHOOO :DDD. nice :P.
mIRC Snippet:
Loop Demonstration
Posted on Sep 3, 2009 4:30 pm
Posted on Sep 3, 2009 4:30 pm
And you never thought to /help while .. ?
mIRC Snippet:
Loop Demonstration
Posted on Sep 3, 2009 5:57 pm
Posted on Sep 3, 2009 5:57 pm
| Quote: |
| /me thumbs up | /me rates a 7 | timer 0 0 msg concept FLOOOOOOOOOOOOOOOOOOOODED | NOW I CAN DO IT WITH WHILE LOOPS! WOOHOOO :DDD. nice :P. |
mIRC Snippet:
Loop Demonstration
Posted on Sep 3, 2009 9:34 pm
Posted on Sep 3, 2009 9:34 pm
lol ^ dont worry, it was just a joke.
mIRC Snippet:
Loop Demonstration
Posted on Sep 3, 2009 10:56 pm
Posted on Sep 3, 2009 10:56 pm
I think this would do better in the forum, though. Won't score it :( sorreh
mIRC Snippet:
Loop Demonstration
Posted on Sep 4, 2009 3:50 pm
Posted on Sep 4, 2009 3:50 pm
if you want to properly flood, you'll need a better script than that. ;)
mIRC Snippet:
Loop Demonstration
Posted on Sep 24, 2009 8:34 am
Posted on Sep 24, 2009 8:34 am
its not for flooding, its just to teach the format of a basic loop, and yes, i forgot the = after if (%i < 1000) so it will go to 999.
it'll be fixed by time you read this.
it'll be fixed by time you read this.
mIRC Snippet:
Loop Demonstration
Posted on Sep 24, 2009 8:36 am
Posted on Sep 24, 2009 8:36 am
and to jonsey
mIRC Snippet: Loop Demonstration
Posted on Sep 2, 2009 4:52 pm Delete
lol. i think 1000's a bit excesive? 10 usually shows the gist of it..
I'm aware that 10 shows the gist, but i was demonstrating that a loop can be endless, or to any set amount. As a matter of fact, three of my scripts that are private and i will not be publishing use while loops to 12k, 17k, and 23k.
in realitive its about 20 seconds.
rather than the .5 seconds 1 - 10 would show.
mIRC Snippet: Loop Demonstration
Posted on Sep 2, 2009 4:52 pm Delete
lol. i think 1000's a bit excesive? 10 usually shows the gist of it..
I'm aware that 10 shows the gist, but i was demonstrating that a loop can be endless, or to any set amount. As a matter of fact, three of my scripts that are private and i will not be publishing use while loops to 12k, 17k, and 23k.
in realitive its about 20 seconds.
rather than the .5 seconds 1 - 10 would show.
mIRC Snippet:
Loop Demonstration
Posted on Sep 24, 2009 8:37 am
Posted on Sep 24, 2009 8:37 am
mIRC Snippet: Loop Demonstration
Posted on Sep 2, 2009 5:40 pm Delete
Jonesy is right. No point in showing 1000 when 10 will do it just as fine. If anything 1000 will spam whatever is your active window (<--Not a great idea).
/clear works fine.
and its meant to be done in the status window. Read the description.
Posted on Sep 2, 2009 5:40 pm Delete
Jonesy is right. No point in showing 1000 when 10 will do it just as fine. If anything 1000 will spam whatever is your active window (<--Not a great idea).
/clear works fine.
and its meant to be done in the status window. Read the description.








