mIRC Homepage

need help with op script

Posted By: spirit_cro

need help with op script - 06/12/05 02:50 AM

Hi i made a script so that you must be in the channel #plounge and also your name must have [p] in it to get ops. you must have both not one or the other to get ops.

example: name [p]spirit is on #plounge = get ops
name: random on #plounge = no ops

but i also want to make it so they can have [p] anywhere in their nickname like s[p]irit for example.

and 1 more thing some of them just use [p] to get ops so i want to make it if they do that then change their nickname to something else it deops them.

here is my script.

on *:JOIN:#:{
if ((*[p]* iswm $nick) && ($nick ison #plounge) && ($me isop $chan)) { mode $chan +o $nick }

any help appreciated. thanks
Posted By: SladeKraven

Re: need help with op script - 06/12/05 02:55 AM

Code:
on @*:JOIN:#:{
   if (*[p]* iswm $nick) && ($nick ison #plounge) { mode $chan +o $nick }
}


-Andy
Posted By: RusselB

Re: need help with op script - 06/12/05 03:20 AM

Code:
 on @*:JOIN:#:{
   if (*[p]* iswm $nick) && ($nick ison #plounge) { mode $chan +o $nick }
}
on @*:nick:{
if (*[p]* !iswm $newnick) {
var %a = $comchan($nick,0)
while %a {
if ($newnick isop $comchan($nick,%a)) { .mode $comchan($nick,%a) -o $newnick }
dec %a
}
}
}

 
Posted By: benjy355

Re: need help with op script - 06/12/05 05:24 PM

on *:join:#: {
if ($chan == #plounge) {
if ($mid($nick,1,3) == [p]) {
mode $chan +o $nick
}
}
}[/code]
I used if $mid instead of iswm so that if somebody is omg[p]rocks, they won't be oped.
Posted By: schaefer31

Re: need help with op script - 06/12/05 06:34 PM

Quote:
on *:join:#: {
if ($chan == #plounge) {
if ($mid($nick,1,3) == [p]) {
mode $chan +o $nick
}
}
}[/code]
I used if $mid instead of iswm so that if somebody is omg[p]rocks, they won't be oped.


The original poster mentioned it was acceptable for [p] to be anywhere in the nickname.
Posted By: benjy355

Re: need help with op script - 06/12/05 06:50 PM

doh! shocked

Anyways I wouldn't suggest making it for anyone with [p] in their name, because if someone were to just add it in... Chaos!
I would suggest using a small hash table, or an INI file of sorts.
For keeping a list of people smile

[EDIT]
Code:
alias get.op { return $iif($readini(operlist.ini,users,$1), is on, isn't on) the oper list }
alias addop { 
writeini operlist.ini users $1 true 
if ($1 ison #plounge) { mode #plounge o $1 }
}
alias remop { 
remini operlist.ini users $1 
if (41 ison #plounge) { mode #plounge -o $1 }
}
menu nicklist {
Oper List
.$nick is $get.op($1)
.Add to list : addop $$1
.Remove from list : remop $$1
}
}
on *:join:#: {
if ($chan == #plounge) && ($get.op($1) == is on the oper list) {
mode $chan +o $nick
}
}


I don't have time or the program to check this to see if it works or not right now, I'm at school... mad
-Enjoy
© 2019 mIRC Discussion Forums