StaffMe Script

By TomG on Aug 14, 2009

On my forum, we have 2 irc channels--one for staff, and one for all of my users. I got tired of people forgetting the password to the staff channel, so I wrote this little script. Only people with operator and above can use this command. Otherwise, it sends you a notice saying that you do not meet criteria to join the staff room. The but must also be op in the channel as to which you want the user invited you.

!staffme is the only command you have to use.

On the third line, change #insertstaffchanhere to the channel that you want to have the user to be invited to.

First script :-)

on *:TEXT:!staffme:#: {
  if ($nick isop $chan) {
    invite $nick #insertstaffchanhere
    notice $nick Invite sent.
  }
  else {
    msg $chan Sorry, you dont meet the criteria, $nick
    notice $nick No staff, no invite ..
  }
}

Comments

Sign in to comment.
Warrior1968   -  Sep 24, 2009

Heres a Time Saver...
/*

  • NEW: allow channel {}
  • OLD: chrestrict
  • Allows a user to join a channel...
  • like an except from deny channel.
  • Syntax:
  • allow channel {
  • channel "channel name";
  • };
    */
    allow channel {
    channel "#your Oper channel here";
    };

If you did this in your server config, Saves time, when your staff get their O-Lines points it to your Staff channel, just a thought.

 Respond  
GlobalAnomaly   -  Aug 20, 2009

....

Instead of using

on *:TEXT:!staffme:#: {
  if ($nick isop $chan) {

You can set the channel to a variable and make it to only pick up on the command IN that channel. Let me break down my code for you.

;When you load the script it will run this..
on *:load: {
;setting the channel set for the staff only
 set %StaffChan $$?="What is the staff channel?"
;setting the channel the StaffChan is set to look for ops in
 set %UserChan $$?="What is the user channel?"
}
;This uses %UserChan because that would be the channel you want the ops to be able to ;get access to your staffchan
on *:text:!StaffMe:%UserChan: {
;checking if the user has op in %UserChan, if they do it will invite them to %StaffChan
 if ($nick isop #) { invite $nick %StaffChan | notice $nick Invite sent. }
;But if they aren't
  else {
   notice $nick Denied. You aren't op in %UserChan $+ .
   msg %StaffChan $nick tried to get in.
;It will deny them, and notify %StaffChan that they tried to get in.
  }
}
 Respond  
TomG   -  Aug 20, 2009

I left out the channel name so you could make it yourself.. As Korvin said, it is an obvious change that you would do.

 Respond  
GlobalAnomaly   -  Aug 16, 2009

What would you do if someone who was op in another channel you were in typed the command to gain access to the staff channel that was for the staff of your user channel?

on *:TEXT:!staffme:#: {
  if ($nick isop $chan) {
    invite $nick #insertstaffchanhere
    notice $nick Invite sent.
  }
  else {
    msg $chan Sorry, you dont meet the criteria, $nick
    notice $nick No staff, no invite ..
  }
}

Your code is functional, but only to a degree.

Try...

on *:load: {
 set %StaffChan $$?="What is the staff channel?"
 set %UserChan $$?="What is the user channel?"
}
on *:text:!StaffMe:%UserChan: {
 if ($nick isop #) { invite $nick %StaffChan | notice $nick Invite sent. }
  else {
   notice $nick Denied. You aren't op in %UserChan $+ .
   msg %StaffChan $nick tried to get in.
  }
}
 Respond  
Korvin   -  Aug 15, 2009

atr, thats an obvious adjustment that everyone and anyone would make -.-

 Respond  
TomG   -  Aug 15, 2009

Atr: You can set it up so it only works on the channel that its on, so that it only works for the ops #123.

 Respond  
Atr   -  Aug 15, 2009

Nice idea to it, you might need to add something in case it's used by an op on another channel, and then you're screwed xD
But other than that, not a bad first script.

 Respond  
D2K7   -  Aug 15, 2009
 on *:TEXT:!staffme:#: {
  if ($nick isop $chan) {
    invite $nick #insertstaffchanhere
    notice $nick Invite sent.
  }
  else {
    msg $chan Sorry, you dont meet the criteria, $nick
    notice $nick No staff, no invite ..
  }
} 

<-- wtf ??? Fail I'd say wtf i mean C'mon

 Respond  
Korvin   -  Aug 14, 2009

the code you have should work fine.

 Respond  
TomG   -  Aug 14, 2009

EMMURE thats weird, it didn't give me problems when I ran it :/

Script updated

 Respond  
Korvin   -  Aug 14, 2009

This is how I'd do it.

on *:TEXT:!staffme:#: {
  if ($nick isop #) {
    invite $v1 #insertstaffchanhere
    notice $v1 Invite sent.
    halt
  }
  msg # Sorry, you dont meet the criteria, $nick
  notice $nick No staff, no invite ..
}
 Respond  
Bradrin   -  Aug 14, 2009

oh sorry, took me so long to write that last comment that you posted yours before me, so mine wasn't any use :P

 Respond  
EMMURE   -  Aug 14, 2009

yea, thats how youre supposed to do it. brad, that doesnt matter. he just forgot the closing bracket, he had the internal brackets just fine cept that extra he put after the first if.

 Respond  
Bradrin   -  Aug 14, 2009

Nope

on *:TEXT:!staffme:#: {
  if (something) {
    bleh
  }
  else {
    bleh
  }
}
 Respond  
EMMURE   -  Aug 14, 2009

no, put it at the very end lol

 Respond  
TomG   -  Aug 14, 2009

Yeah pretty new. Did I fix it correctly?

 Respond  
EMMURE   -  Aug 14, 2009

you forgot closing bracket

on *:text:*:#{
bleh
}
 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.