mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2008
Posts: 14
C
Cred Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2008
Posts: 14
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.

Joined: Jun 2008
Posts: 48
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Jun 2008
Posts: 48
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.

Last edited by Typos; 14/08/08 02:39 PM.

I've gone to look for myself. If I should return before I get back, please keep me here.
Joined: Aug 2008
Posts: 14
C
Cred Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2008
Posts: 14
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.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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
}



Joined: Jun 2008
Posts: 48
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Jun 2008
Posts: 48
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*

Last edited by Typos; 14/08/08 03:42 PM.

I've gone to look for myself. If I should return before I get back, please keep me here.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Alternative suggestion
Code:
on *:text:.add & &:#:  $iif(($nick == hayden131) && ($$2 ison $chan) && ($$3 isnum),$1-)



Link Copied to Clipboard