mIRC Homepage
Posted By: destiny84 trouble with while-loop - 06/02/05 04:13 PM
Hi folks,

after scriptis this litte nice one:

greeting_selected {
set %current 1
while (%current <= $snick(#,0) )
{
/msg $snick(#,%current) xdcc list
inc %current
}
}

i always get the error: insufficent paramter on line 12 (the while loop)

i can't find find an error there.

maybe you guys have any suggestions or tips smile

thx in advance
destiny84
Posted By: FiberOPtics Re: trouble with while-loop - 06/02/05 04:16 PM
Opening brackets cannot be the first token in a line in mIRC Script.

while (%current <= $snick(#,0) )
{

turns into

while (%current <= $snick(#,0)) {

Btw why are you messaging people with "xdcc list" that doesn't sound too kosher to me.

mIRC is not designed for mass file sharing, you should use the proper tools for that like an ftp client, Kazaa or the likes.

Also might want to take a look at this
Posted By: destiny84 Re: trouble with while-loop - 06/02/05 04:41 PM
thx for tip,
but the error still exists
"/while: insufficient parameters"
Posted By: FiberOPtics Re: trouble with while-loop - 06/02/05 04:44 PM
Where are you triggering this alias? From a channel window right?

Btw you ought to put $snick(#,0) in a var, and decrement that, rather than to look up this value in each while iteration. Or do an incremental loop checking for the nth $snick.

Paste the code you use exactly as you have it in mIRC and tell us exactly where and how you are triggering it.

Code:
greeting_selected { 
  var %current = 1 
  while $snick(#,%current) {
    .msg $ifmatch xdcc list
    inc %current
  }
}
Posted By: destiny84 Re: trouble with while-loop - 06/02/05 10:45 PM
firstly great thx for the fast help

this script is still not working.
now i replaced the identifiers with varibales:

greet_selected {
set %current 1
set %total_amount $snick($chan(#),0)
set %current_nick
while (%current <= %total_amount){
%current_nick = $snick($chan(#),%current)
msg %current_nick "hi"
inc %current
}
}


but i still get the same error with the while loop
(insufficent parameters)

i'm triggering the script in the active channel trough the nicklist

maybe any suggestions ?

thx
Posted By: DaveC Re: trouble with while-loop - 06/02/05 11:36 PM
while (%current <= %total_amount){

replace with

while (%current <= %total_amount) {
Posted By: destiny84 Re: trouble with while-loop - 07/02/05 12:36 AM
i added space character and now i works !

thanks for all suggestions:)

btw: why needs such a powerfull application and space sign to work ?
© mIRC Discussion Forums