mIRC Home    About    Download    Register    News    Help

Print Thread
How to only allow Ops to activate a script. #206161 08/11/08 08:25 PM
Joined: Oct 2008
Posts: 167
S
seanturner70 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
I currently have this:
Code:
on @*:text:+i:#:{
  if ($me == no-nick) {
    mode $chan +i
    msg $chan $nick set "Invite Only" on $chan 
  }
} 
}

but it seams to be allowing everyone to activate it.

Re: How to only allow Ops to activate a script. [Re: seanturner70] #206162 08/11/08 09:06 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
on @*:text:+i:#:{
   if ($nick isop $chan) {
   mode $chan +i
   msg $chan $nick set "Invite Only" on $chan 
 } 
}

or if only a specified nick can/should trigger it
Code:
on @*:text:+i:#:{
  if ($nick isop $chan) && ($nick == no-nick) {
    mode $chan +i
    msg $chan $nick set "Invite Only" on $chan 
  }
} 

;------------

Edited :P $me replaced with $nick =)

Last edited by sparta; 08/11/08 10:23 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: How to only allow Ops to activate a script. [Re: seanturner70] #206163 08/11/08 09:09 PM
Joined: Oct 2007
Posts: 214
B
Buggs2008 Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
Use this then,

Im not sure why its not picking up the @ part on the on text event

Code:
On *:text:+i:#: {
If ($nick isop #) && ($nick == $me) {
Mode # +i
Msg # $nick set "invite only" on #
}

}



Re: How to only allow Ops to activate a script. [Re: Buggs2008] #206164 08/11/08 09:10 PM
Joined: Oct 2008
Posts: 167
S
seanturner70 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
cool!

Thanks!

Re: How to only allow Ops to activate a script. [Re: Buggs2008] #206165 08/11/08 09:13 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
@ prefix = you're opped.
($nick == $me) in on text events? ... smile

Re: How to only allow Ops to activate a script. [Re: seanturner70] #206166 08/11/08 09:40 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Quote:
on *:TEXT:&:#: {
if ($nick == no-nick) && ($regex($1,^((?:\+)|(?:\-))([imst])$)) {
mode $chan $+($regml(1),$regml(2)) | msg $chan $nick set "Invite Only" on $chan
}
}


You can use regex to add more channel modes and use +m, +s +i ..-m -s -i..etc.. to get the job done.

Re: How to only allow Ops to activate a script. [Re: Buggs2008] #206167 08/11/08 09:41 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This would never get activated as you can't activate your own on text events, therefore $nick can never be equal to $me in an ON TEXT event.

Re: How to only allow Ops to activate a script. [Re: Horstl] #206170 08/11/08 09:56 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
$nick == $me is valid for onTEXT events that respond to PMs. You can /msg yourself, and your scripts will respond.

Obviously, this doesn't apply to the scripts in this thread.

-genius_at_work

Re: How to only allow Ops to activate a script. [Re: Buggs2008] #206171 08/11/08 10:14 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Unless of course you want to do this:

Code:
on *:TEXT:*:#: {
  if ($me ison $chan) {
    echo -a $v1
  }
}


But that's besides the point.

Re: How to only allow Ops to activate a script. [Re: RusselB] #206172 08/11/08 10:37 PM
Joined: Oct 2008
Posts: 167
S
seanturner70 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
I have my chatting nick (seanturner70) and my bot (no-nick) and the scripts work fine smile