mIRC Homepage
Posted By: GamingTom Variable help. - 13/07/13 10:15 AM
I currently have this code which doesn't seem to work. When I type in '!capsban on' it correctly sets the variable to 'on' but on the next code it doesn't say 'This seems to be working.' when I type in '!capstest'. I get the error '/if: insufficient parameters (line 7, script1)' but from what I can see it's correct. I'm probably just looking over something really stupid, but any help would be greatly appreciated.
Many thanks, Tom.

Code:
on *:text:!capsban *:#:{
  set %capsban. [ $+ [ $chan ] ] $2
  msg $chan Capsban is now  $2 $+ .
}

on *:text:!capstest:#:{
  if (%capsban. [ $+ [ $chan ] ] isin %on){
  msg $chan This seems to be working.}
  else {
    msg $chan this isn't working}
  }
}


%on just equals 'on'.
Posted By: sparta Re: Variable help. - 13/07/13 11:06 AM
Dont know what you trying to do here, but i changed your code a bit, is this what you want?
Code:
on *:text:!capsban *:#:{
  set %capsban. [ $+ [ $chan ] ] $2
  msg $chan Capsban is now  $2 $+ .
}

on *:text:!capstest:#:{
  if (%capsban. [ $+ [ $chan ] ] == on) {
    msg $chan This seems to be working.
  }
  else {
    msg $chan this isn't working
  }
}
Posted By: GamingTom Re: Variable help. - 13/07/13 11:49 AM
It's just what I'm using at the moment to learn variables and things, it will be used in a bigger script soon. But thanks for the changes you made, it works now. I find it funny though, because I think that is what I had been using at the start and it wasn't working. But again, thanks for the help.
Posted By: sparta Re: Variable help. - 13/07/13 02:44 PM
No, look closer. You using:

isin should be ==
%on should be on

and you also have some } in wrong places, you cant use it the way you do.

msg $chan This seems to be working.}
msg $chan this isn't working}

This make you end up with a bad result.
© mIRC Discussion Forums