Top

$wloop()


mIRC Code
+ 0 likes
Please Register to submit score.
Average Score  0.0
Scores Submitted  0
Date Added  Aug 05, 2007
Last Updated  Aug 06, 2007
Tags  function  loop  while 
  Bookmark and Share

Introduction

We all have to use a while loop sometimes. But its annoying to type it all over and over again.
So I thought lets make a function which does all that in 1 line.
here it goes:

How to:

use: $wloop(-sanmcqno, -mo, -te, <file>)

1st parameter:
-s = will echo to the status window (echo -s)
-a = will echo to the active window (echo -a)
-n = will send the nick a notice (notice $nick)
-m = will notice yourself (notice $me)
-c = will messages the channel its typed on (msg #)
-q = will query msg the nick (msg $nick)
-no = this will NOT give a return, this will just read the lines ($read(foo.txt))
basicly this option can be used for people who got some txt/ini with a line like: /whois $nick
if the $wloop would read such a file with the -no parameter it will execute this line instead of putting it on your window

2nd parameter:
-m = will return a dir starting from the main dir ($mircdir). e/g mirc<4th parameter>
-o = will let you greate a dir yourself (this one doesnt automaticly start with $mircdir). This requires a full manually typed 4th parameter

3rd parameter:
-t = this will read the file from the first line to the last
-e = this will read the file from the last line to the first

4th parameter:
this is simply your file. e/g <dir>foo.txt

error notes:
if you didn't gave a valid parameter it will return an error.
the errors are echoed to the active window.
1st: Error: invalid return value
2nd: Error: invalid root dir
3rd: Error: invalid position

im simply to lazy to make a dir check but you will notice this aswell.
if you don't get any result you might consider you gave a wrong dir, perhaps try another 2nd paramter or just have a good look at the dir

Grab the Code

Comments

  (1)  RSS
FeaR^
Comments: 1
 
mIRC Snippet:  $wloop()
Posted on Aug 6, 2007 1:16 pm
There's a little update already. actually I dont think anyone has seen this snippet already but w/e :).
It didnt realy listen to the while loop so I have it fixed. also it reads empty lines however it'll print a $lf

Please Register or Login to start posting comments.
Bottom