mIRC Home    About    Download    Register    News    Help

Print Thread
#242433 13/07/13 10:15 AM
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
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'.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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
  }
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #242435 13/07/13 11:49 AM
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
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.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard