[!.@]support script for bots...

By Bielie on May 27, 2010

A script i wrote for a friend.

You have to change some things or it wont work.

Change:

Your Nick in to your nick or any moderator.

staffchannel in to the channel you would like to use.

It works easy. A user types !support. And the channel gets a message that someone needs help.

You can accept it by typing !accept $chan (ops en on #staffchannel only)

Post any help bellow ;)

#support on
on $*:text:/^[!.@]support/Si:#:{
if ($(,$+(%,flood,$chan))) { msg # This channel can request support again in: $duration($var(%,flood,$chan),1).secs) | return }
    set -u180 $+(%,flood,$chan) 
}

if ($chan == %help) {
notice $nick This channel already asked for help. Please wait.....
halt
}
elseif (*Your Nick* ison $chan){ 
notice *Your Nick* $nick needs support in # $+ .
notice $nick There already is a moderator on your requested channel( $+ # $+ ) $+ . He will get to you as soon as possible.
halt
}
elseif ($chan == #staffchan) {
notice $nick If you need help in $chan just ask for it in the channel you triggered this command on.
halt
}
else {
msg # A moderator has been noticed and will come to help you as soon as possible.
msg #staffchan $nick is requesting help on $chan $+ .
set %help [ $+ [ $chan ] ] $true
halt
 }
}
on $*:text:/^[!.@]accept/Si:#:{
if {$nick !isop #staffchannel) { 
return 
}
elseif ($2- != %help) {
notice $nick $chan is not requesting any help.
halt
}
elseif ($2- == $null) {
notice $nick Please provide a channel to accept. Syntax: !accept #channel
}
else {
Notice $nick You are now helping $2- $+ .
unset %help [ $+ [ $2- ] ]
msg #staffchannel $nick is now helping channel: $2- $+ .
notice $2- $nick Has seen your support request! He will come to help you soon!
notice $nick Join $2- to help them!
halt
 }
}
#support end

Comments

Sign in to comment.
Azzar   -  Oct 21, 2010

May I reccommend: on $*:text:/^.!@/Si:#:{

 Respond  
Jethro   -  May 30, 2010

You have an extra colon in the first event. (as Auncun50 pointed out) Try to put all the triggers within the same regex match section. You're going the extra mile for two separate text events.

 Respond  
troll   -  May 30, 2010

fix the brackets

 Respond  
Aucun50   -  May 28, 2010

"on $:text:/^[!.@]support/Si:#:{" not "on $:text::/^[!.@]support/Si:#:{"

 Respond  
Jethro   -  May 27, 2010

Also, I don't see the benefit of using regex in your code.

 Respond  
napa182   -  May 27, 2010

you should really test things before you post them. Also you have bracket mismatches.
why bother using regex in ur snippet, and why all the different trigger
prefixes?

seems like a #help channel on the server should take care of users that need help.

 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.