mIRC Homepage
Posted By: Bullseye grr - 08/01/06 12:02 AM
Howcome this aint working?
It works fine on cola and beer.
but somehow on grr ... ??...?? I have no idea
Code:
On 1:text:*:#:{
if (grr isin $strip($1-)) { 
var %nicknum = $nick($chan,0) 
var %nick1 = 1 
} 
while (%nicknum >= %nick1) { 
if ($nick($chan,%nick1) isin $1-) { 
var %nicklijst = $+(%nicklijst,$chr(32),$nick($chan,%nick1)) 
} 
inc %nick1 
} 
if ((mij isin $1-) || (ik isin $1-)) { $read(bar\grrik.txt,t) 
}
else { $read(bar\grrlijst.txt,t) 
}
else { $read(bar\grr.txt,t) 
}
}
  

somehow it only returns the grrik.txt and grrlijst.txt
it doesn't read the grr.txt
and it responds on every word i say.
And i mean every word.
Posted By: Sid Re: grr - 08/01/06 12:10 AM
You have 2 elses there, the script never even gets to read the "grr.txt".
You need to specify more ELSEIF statements.

if (mij isin $1-) || (ik isin $1-) { command }
elseif (something for the other one isin $1-) { command }
else { something from grr.txt }
Posted By: NeUtRoN_StaR Re: grr - 08/01/06 04:04 AM
whats the second else in response to
Posted By: Bullseye Re: grr - 08/01/06 12:19 PM
simple said just grr
Posted By: NeUtRoN_StaR Re: grr - 08/01/06 11:59 PM
well the point is you cant have two elses ina row because it wont work
its a oxymoron

if ($me isop $chan) {
stuff
}
else { ;this equate to if ($me !isop $chan)
stuff
}
else { ;this equate to if ($me isop $chan) "i think ive never messed with it so im not sure what statement it will draw its comparison from, and it really doesnt matter it will yeild a comparison you have already had.
Posted By: Bullseye Re: grr - 09/01/06 03:52 AM
got it all working.
here is the code:
Code:
 On 1:text:*:#:{
  if (grr isin $strip($1-)) { 
    var %nicknum = $nick($chan,0) 
    var %nick1 = 1 
    while (%nicknum >= %nick1) { 
      if ($nick($chan,%nick1) isin $1-) { 
        var %nicklijst = $+(%nicklijst,$chr(32),$nick($chan,%nick1)) 
      } 
      inc %nick1 
    } 
    if (%nicklijst) {
      if (Ik isin $1-) || (mij isin $1-) { 
        msg $chan grr ik 
      }
      else {
        msg $chan grr naam 
      }
    }
    else { 
      msg $chan grr 
    }
  }
}
 
© mIRC Discussion Forums