Simple Ops using $istok

By Scakk on Sep 05, 2007

These are two simple ways for select people that you choose to op when they enter a channel. There is one way for servers that have ChanServ and a way if there is not a ChanServ.

on *:text:!ups:#: { 
  var %voices place,nicks,here,seperated,by,commas
  var %halfops place,nicks,here,seperated,by,commas 
  var %ops place,nicks,here,seperated,by,commas
  var %protects place,nicks,here,seperated,by,commas
  var %owners place,nicks,here,seperated,by,commas
  if ($istok(%voices,$nick,44)) { mode # +v $nick } 
  if ($istok(%halfops,$nick,44)) { mode # +h $nick } 
  if ($istok(%ops,$nick,44)) { mode # +o $nick }
  if ($istok(%protects,$nick,44)) { mode # +a $nick }  
  if ($istok(%owners,$nick,$44)) { mode # +q $nick }
}

on *:text:!up:#: { 
  var %voices place,nicks,here,seperated,by,commas
  var %halfops place,nicks,here,seperated,by,commas
  var %ops place,nicks,here,seperated,by,commas
  var %protects place,nicks,here,seperated,by,commas
  if ($istok(%voices,$nick,44)) { cs voice # $nick } 
  if ($istok(%halfops,$nick,44)) { cs halfop # $nick } 
  if ($istok(%ops,$nick,44)) { cs op # $nick }
  if ($istok(%protects,$nick,44)) { cs protect # $nick }
}

Comments

Sign in to comment.
Gummo   -  Oct 19, 2007

\"Keep your language professional at all times.\"
Ahem.

 Respond  
guest598594   -  Sep 05, 2007

no shit, im sayin with a server w/o chanserv, it is impossible to set +a +q +h -a -q or -h on a nick, whether you do /cs or /mode

 Respond  
Scakk   -  Sep 05, 2007

On the Network I use

/cs op #testers WaiterJohn = ChanServ sets mode: +o WaiterJohn
/mode #testers +o WaiterJohn =
WaiterJohn sets mode: +o WaiterJohn

As you can see they are done differently.

 Respond  
Ghost-lit Warder   -  Sep 05, 2007

I would use the on *:text command, and why not use an ini file?

var %voices = $gettok($readini(status.ini,voices),1-,44) or even exclude the local variable and use

 if ($istok($readini(status.ini,voices),$nick,44) { etc } 

I would also make an alias to add nicks. For example:

alias addstat { 
 if ($istok($readini(status.ini,$1),$2-,44){ $addtok($readini(status.ini,voices), $2-,44) }
 else { writeini -n status.ini $1 nicks $2- }
}
 Respond  
guest598594   -  Sep 05, 2007

and u can use /mode too cuz chanservs on it

 Respond  
guest598594   -  Sep 05, 2007

That is where the /mode one would come in.
then why do u have the /cs commands

Actually on the Network I am on you can set +v , +h , +o , +a & +q using ChanServ & /mode
ECAXCLY, using chanserv

 Respond  
Scakk   -  Sep 05, 2007

why would you use a local variable? ur just settin it over and over each time u use it <--I am not a fan of global variables as I may name a varibale that same in another script and it may mess it up.

exactly! you cant do +haq w/o chanserv <--Actually on the Network I am on you can set +v , +h , +o , +a & +q using ChanServ & /mode

if the services go down for some reason, then how would you use chanserv to reop or revoice them if its down? <-- That is where the /mode one would come in.

 Respond  
guest598594   -  Sep 05, 2007

if the services go down for some reason, then how would you use chanserv to reop or revoice them if its down?

 Respond  
guest598594   -  Sep 05, 2007

why would you use a local variable? ur just settin it over and over each time u use it

also, +q and +a and +h are only available for chanserv
( For the server I am on ChanServ has +v , +h , +o , +a & +q )

exactly! you cant do +haq w/o chanserv

 Respond  
Scakk   -  Sep 05, 2007

would put the two on text\'s together
( Why would you put them together if they use two different ways to op people? )
also, +q and +a and +h are only available for chanserv
( For the server I am on ChanServ has +v , +h , +o , +a & +q )
also, i think a global variable would be better
( I will leave that up to the person that wishes to use it. )
i also think its kind of silly that they have to type !up or !ups to get their status, sholdnt it be in an on join?
( This is incase either Services go down for some reason or I do not want to have people on an on join list. )

 Respond  
guest598594   -  Sep 05, 2007

i would put the two on text\'s together

also, +q and +a and +h are only available for chanserv

also, i think a global variable would be better

nicks seperated with a space is fine since they are only one word each, delimeter as 32

i also think its kind of silly that they have to type !up or !ups to get their status, sholdnt it be in an on join?

on *:join:#:{
  set %voices NICK1 NICK2
  set %ops NICK1 NICK2
  set %voicescs NICK1 NICK2
  set %halfopscs NICK1 NICK2
  set %opscs NICK1 NICK2
  set %protectscs NICK1 NICK2
  if ($istok(%voices,$nick,32)) mode # +v $nick 
  if ($istok(%ops,$nick,32)) mode # +o $nick 
  if ($istok(%voicescs,$nick,32)) cs voice # $nick 
  if ($istok(%halfopscs,$nick,32)) cs halfop # $nick 
  if ($istok(%opscs,$nick,32)) cs op # $nick 
  if ($istok(%protectscs,$nick,32)) cs protect # $nick 
}
menu * {
  Status Giver
  .Chanserv
  ..Add an Op: $addtok(%opscs,$?=\"Who would you like to add?\",32)
  ..Add a Voice: $addtok(voicescs,$?=\"Who would you like to add?\",32)
  ..Add a protect: $addtok(protectscs,$?=\"Who would you like to add?\",32)
  ..Add a halfop: $addtok(halfopscs,$?=\"Who would you like to add?\",32)
  .W/O Chanserv: 
  ..Add an Op: $addtok(ops,$?=\"Who would you like to add?\",32)
  ..Add a Voice: $addtok(voices,$?=\"Who would you like to add?\",32)
}

i also added a menu to add nicks to voice, halfop, etc...using $addtok

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.