mIRC Homepage
Posted By: Cred can some one please fix this script - 14/08/08 12:15 PM
on *:text:.add $nick 5:#: if ($nick == Hayden131) .add $nick $chan 5


Why doesnt this work, ive just started to learn about mirc scripting and im confused. please help.
Posted By: Typos Re: can some one please fix this script - 14/08/08 02:38 PM
I would just do it like this.
Code:
on *:text:.add*:#:if ($1- == .add Hayden131 5) $v2

The reason I checked for $1 and on instead of starting at $2 in the IF line is because that would allow me to pass $v2 to issue the whole command and it saves typing that way.
Good luck.
Posted By: Cred Re: can some one please fix this script - 14/08/08 02:44 PM
no i want it so i can use .add (a nick) (access level), i want this to work for who ever i put in and for what ever level.
Posted By: RoCk Re: can some one please fix this script - 14/08/08 03:25 PM

The & character is to match any one word, so you could try that in the matchtext section...

Code:

on *:TEXT:.add & &:#: {
  if ($nick == Hayden131) .add $nick $chan 5
}



You would probably want to make sure the nick is on the channel and the level is a valid level...

Code:

on *:TEXT:.add & &:#: {
  if ($nick != Hayden131) .notice $nick Do I know you?
  elseif ($2 !ison #) .notice $nick $2 is not on # $+ .
  elseif ($3 !isnum) .notice $nick Invalid level.
  else .add $2 # $3
}


Posted By: Typos Re: can some one please fix this script - 14/08/08 03:29 PM
Ok then you could use this. This line checks that $3 is a number and then uses a iswm to look for .add * in $1- and even checks if theres anything in $4- to make sure there wasnt too many paramters typed.
Code:
on *:text:.add*:#:if ($nick == hayden131) && (!$4-) && ($3 isnum) && (.add* iswm $1-) $1-

Anyhow I really really should be asleep, hours ago so I apologize for making this short but I need to get to kicking my butt into bed.

*Edit* This doesnt check if the nick is in the channel and I forgot to add the if $nick == hayden131 so I threw that in and yanked an echo -as I accidently left. I really shouldnt try and do hurry before bed postings but atleast I caught it all within a few seconds. Anyhoo, good luck. *Edit*
Posted By: RusselB Re: can some one please fix this script - 14/08/08 11:56 PM
Alternative suggestion
Code:
on *:text:.add & &:#:  $iif(($nick == hayden131) && ($$2 ison $chan) && ($$3 isnum),$1-)

© mIRC Discussion Forums