mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 60
C
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.
Joined: Dec 2002
Posts: 332
C
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    
}  
}


Joined: Dec 2002
Posts: 60
C
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

Joined: Dec 2002
Posts: 332
C
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 ?

Joined: Dec 2002
Posts: 191
N
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) {

Joined: Feb 2003
Posts: 47
G
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


Joined: Dec 2002
Posts: 60
C
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


Link Copied to Clipboard