mIRC Home    About    Download    Register    News    Help

Print Thread
if statment variable help please #17005 26/03/03 09:26 PM
Joined: Dec 2002
Posts: 60
C
Cyber_Axe Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
Code:
 
on @*:text:*:#: {
  if (@* iswm $1) || $& 
    (!* iswm $1) {
    if ($+(%cs.textwarntest,$nick,$chan,$network) != $null) {
      kick $chan $nick
    }
    else {
      set $+(%cs.textwarntest,$nick,$chan,$network) warn
      msg $chan blah
    }
  }
}
  


for some reason at the if ($+(%cs.textwarntest,$nick,$chan,$network) != $null) its acting as if the variable is there when it isn't set anyone know whats wrong? ive tried switching if statments around to see if that worked with no success

Last edited by Cyber_Axe; 26/03/03 09:51 PM.
Re: if statment variable help please #17006 27/03/03 01:24 AM
Joined: Dec 2002
Posts: 332
C
Cheech Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
not sure but maybe you need to close the brackets above the else
Code:
  
on @*:text:*:#: { 
 if (@* iswm $1) || $&    
 (!* iswm $1) {    
if ($+(%cs.textwarntest,$nick,$chan,$network) != $null) { kick $chan $nick }    
else { set $+(%cs.textwarntest,$nick,$chan,$network)warn     
msg $chan blah    
}  
}
}


Code:
  
on @*:text:*:#: { 
 if (@* iswm $1) || $&    
 (!* iswm $1) {    
if ($+(%cs.textwarntest,$nick,$chan,$network) != $null) { kick $chan $nick }        
}
else {  set $+(%cs.textwarntest,$nick,$chan,$network warn     
msg $chan blah    
}  
}


Re: if statment variable help please #17007 27/03/03 01:36 AM
Joined: Dec 2002
Posts: 60
C
Cyber_Axe Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
that would just move that else statment to activate if the if the first if failed it needs to go with the second if

Re: if statment variable help please #17008 27/03/03 02:07 AM
Joined: Dec 2002
Posts: 332
C
Cheech Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
but even if the first two if statements need to go together wouldnt you still need to match up the brackets before yo go into the else statement ?

Re: if statment variable help please #17009 27/03/03 06:12 AM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
It needs to be evaluated.

if ($eval($+(%,cs.textwarntest,$nick,$chan,$network),2) != $null) {

Re: if statment variable help please #17010 27/03/03 11:28 AM
Joined: Feb 2003
Posts: 47
G
guesseyder Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 47
i might be wrong but aren't u concatenating the variables with that $+ (...) ? Seems to me that in the event the $chan $nick and $network are always set, and thus the result of the $+ () is always at least the content of those 3 vars. Thus the result is never $null . I'm not sure what eval( ) will do to that concatenated string (no spaces in the string?).

This syntax is not my personal style so i might be missing something which has put me off track. I'm also not sure what you're trying to do tbh smile


Re: if statment variable help please #17011 29/03/03 07:06 PM
Joined: Dec 2002
Posts: 60
C
Cyber_Axe Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
thanks, that eval seemed to work tho i also changed != to == ands now it works