When you pm the bot you are met with
<ChocolateOrange> ChocolateOrange operators have been informed of this pm.
<ChocolateOrange> You will be replied to soon, Your Case number is 402
In the PM.
In your set Operator channel you are met with
<~ChocolateOrange> [MartyniP2:50] Message Sent Here
To reply to the PM, First do
./pickup NUM
Then, Back in the PM they will be sent
<ChocolateOrange> Your case has been picked up by MartyniP
<ChocolateOrange> Please now ask your question/problem now.
To reply/message the user
./msg NUM Message
Then the user will be sent
<ChocolateOrange> [MartyniP] Message
Then to 'drop' or release the number of the case
./drop NUM
Then the user will be sent
<ChocolateOrange> Your case has been droped by MartyniP
It will also close the pm.
MartyniP2 is the user that PMed the bot.
MartyniP is the bot operator.
ChocolateOrange is the bot.
; Written by MartyniP
; Copyright MartyniP, MartyniProductions 2010
; www.MartyniP.co.uk
; Copyright ChocolateOrange 2010
; info.co.serv.co.cc
on *:TEXT:*:?: {
if (%caseN. [ $+ [ $nick ] ]) {
/msg $nick New line set to operator
} else {
%caseN. [ $+ [ $nick ] ] = $rand(10,999)
%case. [ $+ [ %caseN. [ $+ [ $nick ] ] ] ] = $nick
/msg $nick $me operators have been informed of this pm.
/msg $nick You will be replied to soon, Your Case number is %caseN. [ $+ [ $nick ] ]
}
/msg #OPCHAN $+(9,$chr(91),$nick,$chr(58)) $+ %caseN. [ $+ [ $nick ] ] $+ $chr(93) $+ $1-
}
on *:TEXT:./pickup *:#OPCHAN: {
if ($nick isop $chan) {
%caseOP. [ $+ [ $2 ] ] = $nick
/msg %case. [ $+ [ $2 ] ] Your case has been picked up by $nick
/msg %case. [ $+ [ $2 ] ] Please now ask your question/problem now.
}
}
on *:TEXT:./drop *:#OPCHAN: {
if ($nick isop $chan) {
/msg %case. [ $+ [ $2 ] ] Your case has been droped by $nick
/close -m %case. [ $+ [ $2 ] ]
unset %caseN. [ $+ [ %case. [ $+ [ $2 ] ] ] ]
unset %case. [ $+ [ $2 ] ]
unset %caseOP. [ $+ [ $2 ] ]
}
}
on *:TEXT:./msg *:#OPCHAN: {
if ($nick isop $chan) {
/msg %case. [ $+ [ $2 ] ] $+(4,$chr(91),$nick,$chr(93),) $3-
}
}
Why makes three active text events per command? You have to make a check to make sure the $2 is a number, not something else. You have to make sure the case numbers match with the rightful persons who request their's to be dropped. A check to see if someone already has a case number would be a plus. Something like this:
on *:TEXT:*:#OPCHAN: {
if ($nick isop $chan) && ($$2 isnum) && (!$(,$+(%,caseNUM.,$nick))) {
if ($1 == ./pickup) {
%caseOP. [ $+ [ $2 ] ] = $nick
set $+(%,caseNUM.,$nick) $2
/msg %case. [ $+ [ $2 ] ] Your case has been picked up by $nick
/msg %case. [ $+ [ $2 ] ] Please now ask your question/problem now.
}
elseif ($1-2 == ./drop $(,$+(%,caseNUM.,$nick))) {
/msg %case. [ $+ [ $2 ] ] Your case has been droped by $nick
/close -m %case. [ $+ [ $2 ] ]
unset %case*
}
elseif ($1-2 == ./msg $(,$+(%,caseNUM.,$nick))) {
/msg %case. [ $+ [ $2 ] ] $+(4,[,$nick,],) $$3-
}
}
}
A little trigger flood control is recommended and that you don't need make an OP check for each condition. One is enough.