mIRC Homepage
Posted By: Cyber_Axe if statment variable help please - 26/03/03 09:26 PM
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
Posted By: Cheech Re: if statment variable help please - 27/03/03 01:24 AM
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    
}  
}

Posted By: Cyber_Axe Re: if statment variable help please - 27/03/03 01:36 AM
that would just move that else statment to activate if the if the first if failed it needs to go with the second if
Posted By: Cheech Re: if statment variable help please - 27/03/03 02:07 AM
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 ?
Posted By: Nobodi Re: if statment variable help please - 27/03/03 06:12 AM
It needs to be evaluated.

if ($eval($+(%,cs.textwarntest,$nick,$chan,$network),2) != $null) {
Posted By: guesseyder Re: if statment variable help please - 27/03/03 11:28 AM
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

Posted By: Cyber_Axe Re: if statment variable help please - 29/03/03 07:06 PM
thanks, that eval seemed to work tho i also changed != to == ands now it works
© mIRC Discussion Forums