Help Channel Relay Script

By PurplesurgeMirc on Jun 09, 2009

Details are in the 5 comment lines at the top of the script

Staff Commands:
!remove <bantype (1-5)>
!answer
!nicklist

User Commands:
!ask

Author: Rolo @ #mIRC on PurpleSurge

;Help Relay Script created by Rolo @ #mircscript on Purplesurge
;Meant for use on a Help Channel that this bot has Operator status on
;Help Channel should ideally be abandoned aside from users coming in for help.
;A seperate Staff Channel should be used for answering questions (obviously where staff hang out)
;Bot should be on both channels

on 1:load:{
  if (!%helpnet) set %helpnet $$?="Help Network:"
  if (!%helpchan) set %helpchan $$?="Help Channel:"
  if (!%staffchan) set %staffchan $$?="Staff Channel:"
  echo 4 -st Help Relay Script Loaded
}

on *:connect: if ($network == %helpnet) join %helpchan,%staffchan

on *:text:!ask *:%helpchan:{
  if ($network == %helpnet) {
    if ($nick isreg %helpchan) .msg %staffchan $nick asked: $+(",$2-,")
    else .notice $nick You are a staff member.
  }
}

on *:text:*:%staffchan:{
  if ($network == %helpnet) {
    if ($1 == !help) .notice $nick !answer !remove !nicklist
    if ($1 == !answer) {
      if ($2 ison %helpchan) && ($2 != $me) {
        .msg %helpchan $nick answers $+($2,:,$chr(32),",$3-,")
        .notice $2 If this answered your question, please /part %helpchan
      }
      else .notice $nick Usage: !answer <nickname> <answer>
    }
    if ($1 == !remove) {
      if ($me isop %helpchan) {
        if ($2 ison %helpchan) && ($3 isnum 1-5) && ($4 isnum) && ($2 !ison %staffchan) ban -ku $+ $4 %helpchan $2 $3 $5-
        else .notice $nick Usage: !remove <nickname> <bantype (1-5)> <seconds to unban> <reason>
      }
      else .msg %staffchan I require chanops on %helpchan for that command.
    }
    if ($1 == !nicklist) .msg %staffchan $regsubex($str(-,$nick(%helpchan,0,r)),/(.)/g,$+($nick(%helpchan,\n,r),$chr(32))
  }
}

Comments

Sign in to comment.
PurplesurgeMirc   -  Jun 18, 2009

Thanks for that napa182, I think I like that better, despite killing readability.

 Respond  
napa182   -  Jun 11, 2009

or you can get rid of

if ($1 == !nicklist) {
      var %x 1
      while (%x <= $nick(%helpchan,0,r)) {
        set %nicks %nicks $nick(%helpchan,%x,r)
        inc %x
      }
      .msg %staffchan %nicks
      unset %nicks
    }

an just use somthing like this.

if ($1 == !nicklist) { .msg %staffchan $regsubex($str(-,$nick(%helpchan,0,r)),/(.)/g,$+($nick(%helpchan,\n,r),$chr(32)) }
 Respond  
|[Arkham]|   -  Jun 11, 2009

use token identifier on line "set %nicks %nicks $nick(%helpchan,%x,r)"

%nicks = $addtok(%nicks,$nick(%helpchan,%x,r),32)

 Respond  
PurplesurgeMirc   -  Jun 11, 2009

3rd comment, "Help Channel should ideally be abandoned aside from users coming in for help."

Why would people asking for help be voiced there?

 Respond  
Cheiron   -  Jun 10, 2009

it is set that way on our server napa :) helpers (voice), helpops (aop), admin (sop)

 Respond  
napa182   -  Jun 10, 2009

@WorldDMT depends on how you have ur room set up cuz some rooms +v are staff, and they get to ban kick gag an so on.

 Respond  
WorldDMT   -  Jun 10, 2009

hi

if ($nick isreg %helpchan)

+v isnt staff so use

if ($nick(#,$nick,rv))

 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.