;--------- ALIASES ---------
alias -l next.infodelay {
return 7
}
alias -l next.info {
return notice
}
alias -l ht {
return $+(helpqueue,$cid)
}
alias -l nickreg {
return $+(/(?<=^|\s)\Q,$replacexcs($1,\E,\E\\E\Q),\E(?=$|\s),/)
}
alias -l next.wipe {
if ($hget($ht)) $iif(%help(chan),hdel,hfree) $ht %help(chan)
}
alias putnotice {
if (!$isid) {
putcmd .notice $1-
}
}
alias putmsg {
if (!$isid) {
putcmd .msg $1-
}
}
alias putaction {
if (!$isid) {
putcmd .describe $1-
}
}
alias putcmd {
var %a = putcmd. $+ $cid, %c = $1
!tokenize 32 $2-
if ($2 == $null) {
if ($show) {
!echo -ac $+ $iif($active == status window,e) info * /put $+ %c $+ : insufficient parameters
}
!halt
}
if (!$timer(%a)) {
!hadd -m %a index -1
!hadd -m %a current 0
!.timer $+ %a -m 0 5000 putcmd.exec $cid
}
!hinc -m %a index
!hadd -m %a $hget(%a,index) ! $+ %c $1-
if ($calc($ticks - $hget(%a,last)) > 2000) {
putcmd.exec $cid
}
!hadd -m %a last $ticks
}
alias putcmd.exec {
var %a = putcmd. $+ $1, %c = $hget(%a,current)
!scid -r $hget(%a,%c)
!hdel %a %c
!hinc %a current
if ($hget(%a,0).item == 3) {
!.timer $+ %a off
!hfree -w %a
}
}
;--------- VARIABLE AND STATUS CHECK ---------
on *:connect:{
window @CONNECT-CHECK
.timer 1 1 echo @CONNECT-CHECK Please wait while the bot checks if there any errors.
if ($isdir(help)) {
timer 1 3 echo @CONNECT-CHECK help directory excists. The bot is still searching for errors.
}
elseif (!$isdir(help)) {
timer 1 4 echo @CONNECT-CHECK 4ERROR help directory dont excists. Making new directory 'help'.
mkdir help
}
if ($isdir(help\data)) {
timer 1 5 echo @CONNECT-CHECK help\data directory excists. The bot is still searching for errors.
}
elseif (!$isdir(help\data)) {
timer 1 6 echo @CONNECT-CHECK 4ERROR help\data directory dont excists. Making new directory 'help\data'.
mkdir help\data
}
if (%help(author) == xelent) {
.timer 1 7 echo @CONNECT-CHECK Variables excists.
}
elseif (%help(author) != xelent) {
set %help(mchan) #BX-Networks
set %help(pchan) #BX.admin
set %help(schan) #BX.support
set %help(author) xelent
set %help(version) 1.0b
set %help(trigger) !
set %help(global) ?
set %help(error) 1
.timer 1 8 echo @CONNECT-CHECK 4ERROR Variables dont excist. Creating variables '%help"''"'
}
if (%help(error) != 1) {
timer 1 9 echo @CONNECT-CHECK The error check has been completed. 0 errors occured, the bot is working 100%.
.timer 1 20 /window -c @CONNECT-CHECK
}
elseif (%help(error) == 1) {
timer 1 11 echo @CONNECT-CHECK An or some error(s) occured. Due some awesome scripting these were fixed during the check/scan.
timer 1 13 .unset %help(error)
.timer 1 25 /window -c @CONNECT-CHECK
}
}
;--------- Events ---------
on me:*:PART:%help(chan): {
next.wipe
}
on !*:PART:%help(chan): {
hadd -m $ht $chan $remtok($hget($ht,$chan),$nick,0,32)
}
on me:*:QUIT: {
next.wipe
}
on !*:QUIT: {
while ($hfind($ht,$nickreg($nick),1,r).data) hadd $ht $v1 $remtok($hget($ht,$v1),$nick,0,32)
}
on *:KICK:%help(chan): {
if ($knick == $me) {
next.wipe
}
else {
hadd -m $ht $chan $remtok($hget($ht,$chan),$knick,0,32)
}
}
on *:DISCONNECT: {
next.wipe
}
on !*:NICK: {
while ($hfind($ht,$nickreg($nick),1,r).data) hadd $ht $v1 $reptok($hget($ht,$v1),$nick,$newnick,0,32)
}
on *:VOICE:%help(chan): {
hadd -m $ht $chan $remtok($hget($ht,$chan),$vnick,0,32)
}
on *:text:*:%help(pchan):{
if ($1 == %help(trigger) $+ help) || ($1 == %help(global) $+ help) {
if ($2 == next) {
:next
if ($hget($ht,%help(chan))) {
if ($gettok($v1,1,32) ison %help(chan)) && ($v1 !isvoice %help(chan)) {
mode $v2 +v $v1
.msg %help(chan) You've been granted voice. State your question(s) directly in this channel. Do not highlight or PM the administrators. Please be patient.
}
else {
hadd $ht %help(chan) $gettok($hget($ht,%help(chan)),2-,32) | goto next
}
}
else {
$next.info $nick Help queue of %help(chan) is empty.
}
}
elseif ($2 == status) {
if ($hget($ht,%help(chan))) {
$next.info $nick $numtok($v1,32) in queue: $replace($v1,$chr(32),$+($chr(32),->,$chr(32)))
}
else {
$next.info $nick Help queue of %help(chan) is empty.
}
}
elseif ($2 == done) {
if ($3) {
kick %help(chan) $3 You've been helped and kicked from the channel due no idle.
.msg $chan $3 got kicked from %help(chan) $+ .
hadd -m $ht $chan $remtok($hget($ht,$chan),$knick,0,32)
}
elseif (!$3) {
$next.info $nick Please specify a nickname.
}
}
elseif ($2 == on) {
if ($readini(help\data\status.ini,reg,status) == on) {
.msg %help(pchan) Error: Failed to open help center, already 9open.
}
else {
writeini help\data\status.ini reg status on
msg %help(pchan) The help center is now 9open.
.msg %help(mchan) « BX-Network help Center » is now open! Need help? Use "!help".
.topic %help(pchan) help center 9open $+ .
}
}
elseif ($2 == commands) {
.putnotice $nick These commands is available for you
.putnotice $nick %help(trigger) $+ help next - Voices the next user in the queue on %help(chan) $+ .
.putnotice $nick %help(trigger) $+ help done <nick> - Kicks <nick> from %help(chan) due no idle done after user is helped.
.putnotice $nick %help(trigger) $+ help on/off - Turn on or off the help system.
.putnotice $nick %help(trigger) $+ help version - Shows the current script version.
.putnotice $nick %help(trigger) $+ help status - Display the users in the help queue.
}
elseif ($2 == off) {
if ($readini(help\data\status.ini,reg,status) == off) {
.msg %help(pchan) Error: Failed to close help center, already 4closed.
}
else {
writeini help\data\status.ini reg status off
msg %help(pchan) The help center is now 4closed.
.msg %help(mchan) « BX-Network help Center » is now closed! If you still need help, you can send us an email.
.topic %help(pchan) help center 4closed $+ .
}
}
elseif (!$2) {
.notice $nick Please specify what command to execute. If your not sure, check %help(trigger) $+ help commands
}
}
}
on *:text:*:%help(mchan):{
if ($1 == %help(trigger) $+ help) || ($1 == help) {
.putmsg $nick « BX-Network help Center » Do you need any help or have any questions? You can join our queue for assistance.
.putmsg $nick « BX-Network help Center » You can simply join our help queue by typing: /msg $me queueme
}
}
on *:text:queueme:?:{
if ($readini(help\data\status.ini,reg,status) == on) {
if (%help. [ $+ [ $nick ] ] != 1) {
.set -u300 %help. [ $+ [ $nick ] ] 1
.putmsg %help(pchan) « BX-Network help Center » - ( $nick ) Has queued himself for online help.
.putmsg $nick « BX-Network help Center » You have successfully joined the queue. You can now join %help(chan) $+ . Here an administrator will assist you.
hadd -m $ht %help(chan) $hget($ht,%help(chan)) $nick
invite $nick %help(chan)
}
elseif (%help. [ $+ [ $nick ] ] == 1) {
.msg $nick « BX-Network help Center » You have already joined the queue.
.msg %help(pchan) « BX-Network help Center » - ( $nick ) tried to queue himself again for online help.
}
}
elseif ($readini(help\data\status.ini,reg,status) == off) {
.putmsg $nick « BX-Network help Center » We're sorry but the help center is closed $+ . Please try again later..
.msg %help(pchan) « BX-Network help Center » - ( $nick ) tried to use to use our help center. If you are an certified administrator and allowed to help others you can turn on the help center by typing: %help(trigger) $+ help on
}
}