קוד:
; ————————————————� �————————————————� ��————————————— ;
; Invite Bot by ohad
; This invite bot work only on QuakeNet (Q-Chanlev)
;
; Usefull commands:
; 1) !setchan <#channel> - to set invite channel.
; 2) !unsetchan - to unset invite channel.
; 3) !invite <nick> [+av] - to invite nick [+av is optional, if you enter it the nick wiil get auto voice]
; 4) !remove <nick> - to remove invite.
; 4) !list - to get invited list (from Q-Chanlev).
; 5) +av <nick> - to give auto voice to <nick>
; 6) -av <nick> - to remove auto voice to <nick>
; 7) !commands - to get commands from bot.
;
; To add/remove owners right click in nicklist —› Invite bot —› add/remove owner
; When you will set a channel, the bot will set the chanflag +k
; ————————————————� �————————————————� ��————————————— ;
alias theme { return 2(12 $+ $1- $+ 2)1 }
on owner:text:*:*:{
unset %v
var %t = $iif(#,#,$nick)
if (+av == $3 || +gv == $3) { var %v gv }
if ($left(%t,1) != $chr(35)) {
if ($1 == !setchan) {
if ($2 == %invite.chan) { msg %t $theme(INVIE-ERROR) channel is already %invite.chan }
elseif ($2) { set %invite.chan $2 | .msg q chanflags %invite.chan +k | msg %t $theme(INVITE) Done, the invite channel seted to: $2 $+ . }
else { msg %t $theme(INVITE-ERROR) Usage: !setchan <#channel> }
}
elseif ($1 == !unsetchan) {
if (%invite.chan) { .msg q chanflags %invite.chan -k | msg %t $theme(INVITE) Done, the invite channel unseted. | unset %invite.chan }
else { msg %t $theme(INVITE-ERROR) channel is not seted yet. }
}
elseif ($1 == !commands) {
msg %t $theme(INVITE-COMMANDS) !setchan <#channel> $chr(124) !unsetchan $chr(124) !invite <nick> [+av] $chr(124) !remove <nick> $chr(124) +av <nick> $chr(124) -av <nick>
}
}
if ($chan == %invite.chan || $left(%t,1) != $chr(35)) {
if (!%invite.chan && $regex($1,/^!(invite|remove|uninvite|list)$/i)) { msg %t $theme(INVITE-ERROR) channel is not seted yet. }
elseif ($1 == !invite) {
if ($2) { .msg q chanlev %invite.chan $2 +k $+ %v | msg %t $theme(INVITE) Done, invite sent to $2 $+ | .invite $2 %invite.chan | msg $2 Hello $+(,$2,) $+ , you are invited to $+(,%invite.chan,) by $+(,$nick,) $iif(%v,in voice) $+ . }
else { msg %t $theme(INVITE-ERROR) Usage: !invite <nick> }
}
elseif ($1 == !remove) {
if ($2) { .msg q chanlev %invite.chan $2 -kgv | msg %t $theme(INVITE) Done, $2 was removed from invited list. }
else { msg %t $theme(INVITE-ERROR) Usage: !remove <nick> }
}
elseif ($1 == +av) {
if ($2) { .msg q chanlev %invite.chan $2 +gv | msg %t $theme(INVITE) Done. }
else { msg %t $theme(INVITE-ERROR) Usage: +av <nick> }
}
elseif ($1 == -av) {
if ($2) { .msg q chanlev %invite.chan $2 -gv | $iif($2 ison %invite.chan,mode %invite.chan -v $2) | msg %t $theme(INVITE) Done. }
else { msg %t $theme(INVITE-ERROR) Usage: -av <nick> }
}
elseif ($1 == !list) { unset %invite.list | set %invite.getting.list %t | .msg q chanlev %invite.chan }
}
}
on ^*:notice:*:*:{
if (%invite.getting.list && $nick == q) {
if (%qchan.error) { halt }
if (end of list. == $1-3) { unset %qchan.getting }
elseif ($1 == total:) { $iif(%invite.list,msg %invite.getting.list $theme(INVITED-LIST) $replace(%invite.list,$chr(32),$chr(44))) | unset %invite.list | unset %invite.getting.list }
elseif ($1-2 == Can't find) { .timer 1 0 qchan.error %qchan.target its unknown or suspended channel. | set %qchan.error 1 }
elseif ($1-2 == You do) { .timer 1 0 qchan.error You dont have sufficient access on $8 to use chanlev. | set %qchan.error 1 }
elseif ($1-2 == account, or) { .timer 1 0 qchan.error You must be authed to use this dialog. | set %qchan.error 1 }
elseif (!$regex($1-,/^(Known users|End of|Username.*flags)/i)) && (k isin $2 || gv isin $2) {
set %invite.list %invite.list $1
if ($len(%invite.list) >= 800) { msg %invite.getting.list $theme(INVITED-LIST) $replace(%invite.list,$chr(32),$chr(44)) }
}
halt
}
}
menu nicklist,query {
$iif($1,Invite bot)
.$iif(!$ulist($address($1,2),owner,1),Add owner $+($chr(40),$1,$chr(41))): .guser owner $$1 2 | echo -at $theme(INVITE) Done, $$1 was added to Invite-bot owner list.
.$iif($ulist($address($1,2),owner,1),Remove owner $+($chr(40),$1,$chr(41))): .ruser owner $$1 2 | echo -at $theme(INVITE) Done, $$1 was removed from Invite-bot owner list.
}