mIRC Home    About    Download    Register    News    Help

Print Thread
#138856 08/01/06 12:02 AM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
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.

#138857 08/01/06 12:10 AM
Joined: Jan 2006
Posts: 5
Sid Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
Joined: Jan 2006
Posts: 5
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 }


Mad at god, and mad at you, you're believing in something which cannot be true
#138858 08/01/06 04:04 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
whats the second else in response to

#138859 08/01/06 12:19 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
simple said just grr

#138860 08/01/06 11:59 PM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
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.

Last edited by NeUtRoN_StaR; 09/01/06 12:04 AM.
#138861 09/01/06 03:52 AM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
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 
    }
  }
}
 


Link Copied to Clipboard