rendered paste bodyon *:LOAD:{
;checks to see if your version is 6.1 or higher
if ($version < 6.1) {
echo -a -
echo -a Error, script not loaded:
echo -a You need mIRC version 6.1 or higher in order for this script to work.
echo -a Your current version is $version $+ .
echo -a -
;unloads script if version is lower than 6.1
unload -rs $+(",$script,")
echo -a Script successfully unloaded.
echo -a -
}
else {
echo -a -
echo -a You have just loaded Channel Service Bot.
echo -a Made by CrAzY_cAfCaSi
set %version 3.1c
set %built.on January 28, 2003, 5:06:12 PM
echo -a Channel Service Bot Version %version $+ . Built on %built.on $+ .
echo -a -
;this sets the bot trigger so it will be %trigger $+ command
set %trigger $$?="Please select the bot's trigger. You may change it later. (eg. ! ? . @ -)"
echo -a Set global trigger to ' $+ %trigger $+ '.
echo -a -
}
}
on *:UNLOAD:{
echo -a -
echo -a Thanks for using Channel Service Bot!
echo -a -
var %del.don = [ $input(Would you like to delete the databases?,y) ]
if (%del.don == $true) {
var %i = 1
while (%i <= $findfile($scriptdir,*,0) {
if ($findfile($scriptdir,*,%i) != bot.mrc) && ($findfile($scriptdir,*,%i) != 8ball.txt) && ($findfile($scriptdir,*,%i) != "Channel Service Bot readme.txt") {
remove ($findfile($scriptdir,*,%i)
}
inc %i
}
}
unset %trigger, %built.on, %version, %dynlimit.*
echo -a You have just unloaded Channel Services Bot.
echo -a -
}
on *:CONNECT:{
;this while loop checks to see the perform list
var %i = 1
while (%i <= $lines(" $+ $scriptdirbotperform.txt")) {
.timerperform $+ %i 1 $calc(%i + 1) $read(" $+ $scriptdirbotperform.txt",%i)
inc %i
}
}
on *:OPEN:?:{
close -m
}
on *:join:#:{
if ($nick == $me) {
who $chan
}
else {
if ($channels($chan) != $null) {
;this checks to see if the person joining the channel is on the banlist, if so, it bans them
var %i = 1, %x = 0
while (%i <= 9) && (%x <= $ini(" $+ $scriptdirchannels.ini",$chan $+ blist,0)) {
if ($gettok($readalltheini(" $+ $scriptdirchannels.ini",$chan $+ blist,*),%x,32) iswm $address($nick,%i)) {
ban -k $chan $ifmatch $gettok($readini(" $+ $scriptdirchannels.ini",$chan $+ blist,$ifmatch),3-,32)
}
inc %i
inc %x
}
if ($authed($nick) == 1) {
;checks to see if the person joining the chanel has any access to the channel
if ($access($chan,$nick) == Owner) || ($access($chan,$nick) == Coowner) || ($access($chan,$nick) == Master) || ($access($chan,$nick) == Op) {
mode $chan +o $nick
$iif($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick)) != $null,msg $chan $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick))))
writeini " $+ $scriptdirchannels.ini" $chan $+ host $wildsite $access($chan,$nick)
if ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting))
}
elseif ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) == None) && ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
elseif ($access($chan,$nick) == Peon) {
mode $chan +v $nick
$iif($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick)) != $null,msg $chan $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick))))
writeini " $+ $scriptdirchannels.ini" $chan $+ host $wildsite $access($chan,$nick)
if ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting))
}
elseif ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) == None) && ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
else {
if ($readini(" $+ $scriptdirchannels.ini",$chan,Voice) == Enabled) {
mode $chan +v $nick
}
if ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
}
else {
if ($readini(" $+ $scriptdirchannels.ini",$chan,Voice) == Enabled) {
mode $chan +v $nick
}
if ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
}
}
}
on *:START:{
;resets everyones auth to 0 (security reasons)
var %i = 1
while (%i <= $ini(" $+ $scriptdiraccounts.ini",Authed,0)) {
writeini " $+ $scriptdiraccounts.ini" Authed $ini(" $+ $scriptdiraccounts.ini",Authed,%i) 0
inc %i
}
var %x = 1
while (%x <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
writeini " $+ $scriptdiropers.ini" Opers $ini(" $+ $scriptdiropers.ini",Opers,%x) 0
inc %x
}
var %f = 1
while (%f <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
writeini " $+ $scriptdiropers.ini" Helpers $ini(" $+ $scriptdiropers.ini",Helpers,%f) 0
inc %f
}
}
on *:MODE:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
;checks to see if the modes conflict with the channel set modes, if so it puts them back
if ($readini(" $+ $scriptdirchannels.ini",$chan,Modes) != None) {
$restoremodes2($chan,$nick)
}
}
}
}
on ^*:NOTICE:*:?:{
haltdef
}
on *:nick:{
if ($authed($nick) == 1) {
;when someone changes their nick, it adds their new nick to the " $+ $scriptdiraccounts.ini" and removes their old one
var %i = 1, %account = $readini(" $+ $scriptdiraccounts.ini",Nicks,$nick), %hostmask = $readini(" $+ $scriptdiraccounts.ini",%account,Hostmask)
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($readini(" $+ $scriptdirchannels.ini",$ini(" $+ $scriptdirchannels.ini",%i),%hostmask) != $null) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %hostmask
writeini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $address($newnick,5) $ifmatch
}
inc %i
}
var %account = $readini(" $+ $scriptdiraccounts.ini",Nicks,$nick)
var %password = $readini(" $+ $scriptdiraccounts.ini",Passwords,$nick)
writeini " $+ $scriptdiraccounts.ini" Authed $newnick 1
writeini " $+ $scriptdiraccounts.ini" Nicks $newnick %account
writeini " $+ $scriptdiraccounts.ini" Accounts %account $newnick
writeini " $+ $scriptdiraccounts.ini" %account Nick $newnick
writeini " $+ $scriptdiraccounts.ini" %account Hostmask $address($newnick,5)
writeini " $+ $scriptdiraccounts.ini" Passwords $newnick %password
remini " $+ $scriptdiraccounts.ini" Authed $nick
remini " $+ $scriptdiraccounts.ini" Nicks $nick
remini " $+ $scriptdiraccounts.ini" Passwords $nick
}
}
on *:kick:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
;when someone is kicked, it checks whether the person being kicked is protected
if ($protection($chan) == 2) {
if ($knick == $me) {
join $chan
if ($me !isop $chan) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
elseif ($me isop $chan) {
msg $chan Possible channel takeover by $nick $+ . | halt
}
}
if ($authed($knick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$knick).level != 0) {
if ($access($chan,$nick).level <= $access($chan,$knick).level) {
mode $chan -o $nick
kick $chan $nick Sorry, that user is protected.
}
}
}
}
elseif ($protection($chan) == 1) {
if ($knick == $me) {
join $chan
if ($me !isop $chan) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
elseif ($me isop $chan) {
msg $chan Possible channel takeover by $nick $+ . | halt
}
}
if ($authed($knick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$knick).level != 0) {
if ($access($chan,$nick).level < $access($chan,$knick).level) {
mode $chan -o $nick
kick $chan $nick Sorry, that user is protected.
}
}
}
}
elseif ($protection($chan) == 0) {
if ($knick == $me) {
join $chan
if ($me !isop $chan) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
elseif ($me isop $chan) {
msg $chan Possible channel takeover by $nick $+ . | halt
}
}
return
}
}
}
}
on *:deop:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
;when someone is deopped, it checks whether the person being deopped is protected
if ($protection($chan) == 2) {
if ($opnick == $me) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
if ($authed($opnick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$opnick).level != 0) {
if ($access($chan,$nick).level <= $access($chan,$opnick).level) {
mode $chan -o+o $nick $opnick
.notice $nick Sorry, $+ $opnick $+ is protected.
}
}
}
}
elseif ($protection($chan) == 1) {
if ($opnick == $me) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
if ($authed($opnick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$opnick).level != 0) {
if ($access($chan,$nick).level < $access($chan,$opnick).level) {
mode $chan -o+o $nick $opnick
.notice $nick Sorry, $+ $opnick $+ is protected.
}
}
}
}
elseif ($protection($chan) == 0) {
if ($opnick == $me) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
return
}
}
}
}
on *:ban:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
.timerbancheck 0 15 bancheck
;when someone/a mask is banned, it checks whether the hostmask conflicts with any protected hostmasks
if ($protection($chan) == 2) {
if ($banmask iswm $address($me,2)) {
mode $chan -ob $nick $banmask
msg $chan Possible channel takeover by $nick $+ . | halt
}
if ($access($chan,$nick).level != 0) && ($access($chan,$banmask).level != 0) {
if ($access($chan,$nick).level <= $access($chan,$banmask).levelhost) {
mode $chan -b $banmask
.notice $nick Sorry, ban for $+ $banmask $+ conflicts with a protected user's hostmask. | halt
}
}
}
elseif ($protection($chan) == 1) {
if ($banmask iswm $address($me,2)) {
mode $chan -ob $nick $banmask
msg $chan Possible channel takeover by $nick $+ . | halt
}
if ($access($chan,$nick).level != 0) && ($access($chan,$banmask).level != 0) {
if ($access($chan,$nick).level < $access($chan,$banmask).levelhost) {
mode $chan -b $banmask
.notice $nick Sorry, ban for $+ $banmask $+ conflicts with a protected user's hostmask. | halt
}
}
}
elseif ($protection($chan) == 0) {
if ($banmask iswm $address($me,2)) {
mode $chan -ob $nick $banmask
msg $chan Possible channel takeover by $nick $+ . | halt
}
return
}
}
}
}
on *:TOPIC:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
if ($calc($access($chan,$nick).level - 1) >= $enftopic($chan)) {
halt
}
else {
.notice $nick The $chan topic is locked.
$iif($readini(" $+ $scriptdirchannels.ini",$chan,DefaultTopic) != None,topic $chan $ifmatch)
}
}
}
}
on *:DISCONNECT:{
;resets everyones auth to 0 (security reasons)
var %i = 1
while (%i <= $ini(" $+ $scriptdiraccounts.ini",Authed,0)) {
writeini " $+ $scriptdiraccounts.ini" Authed $ini(" $+ $scriptdiraccounts.ini",Authed,%i) 0
inc %i
}
var %x = 1
while (%x <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
writeini " $+ $scriptdiropers.ini" Opers $ini(" $+ $scriptdiropers.ini",Opers,%x) 0
inc %x
}
var %f = 1
while (%f <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
writeini " $+ $scriptdiropers.ini" Helpers $ini(" $+ $scriptdiropers.ini",Helpers,%f) 0
inc %f
}
}
on *:QUIT:{
.timerbancheck 0 15 bancheck
;unauths the person who quit
if ($authed($nick) == 1) {
writeini " $+ $scriptdiraccounts.ini" Authed $nick 0
}
if ($oper($nick) == 1) {
writeini " $+ $scriptdiropers.ini" Opers $account($nick) 0
}
elseif ($helper($nick) == 1) {
writeini " $+ $scriptdiropers.ini" Helpers $account($nick) 0
}
if ($nick == $me) {
;resets everyones auth to 0 (security reasons)
var %i = 1
while (%i <= $ini(" $+ $scriptdiraccounts.ini",Authed,0)) {
writeini " $+ $scriptdiraccounts.ini" Authed $ini(" $+ $scriptdiraccounts.ini",Authed,%i) 0
inc %i
}
var %x = 1
while (%x <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
writeini " $+ $scriptdiropers.ini" Opers $ini(" $+ $scriptdiropers.ini",Opers,%x) 0
inc %x
}
var %f = 1
while (%f <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
writeini " $+ $scriptdiropers.ini" Helpers $ini(" $+ $scriptdiropers.ini",Helpers,%f) 0
inc %f
}
}
}
;on text for private messages
on *:TEXT:*:?:{
.timerbancheck 0 15 bancheck
$bot.commands($1,$2,$3,$4,$5-).inpm
}
;on text for channel messages
on *:TEXT:*:#:{
.timerbancheck 0 15 bancheck
if ($channels($chan) != $null) {
$protectfromspam($nick,$chan)
}
if ($left($1,1) == %trigger) {
tokenize 32 $right($1,-1) $2-
$bot.commands($1,$2,$3,$4,$5-).inchan
}
}
;;;;;;;;USE: $bot.commands(commands|channel)(.inchan | .inpm)
alias -l bot.commands {
if ($prop == inchan) {
if ($1 == join) || ($1 == j) || ($1 == part) || ($1 == p) {
var %com = $1, %rest = $2-
}
elseif ($left($1,1) == $chr(35)) {
var %chan = $1, %com = $2, %rest = $3-
}
elseif ($left($2,1) == $chr(35)) {
var %com = $1, %chan = $2, %rest = $3-
}
else {
var %chan = $chan, %com = $1, %rest = $2-
}
}
elseif ($prop == inpm) {
if (sex* iswm $1) || (unf* iswm $1) || (banana* iswm $1) || (boner* iswm $1) || (penis* iswm $1) || ($1 == age) || (date* iswm $1) || (time* iswm $1) || ($1 == calc) || ($1 == calculator) || ($1 == 8ball) || ($1 == 8) || (help* iswm $1) || (version* iswm $1) || (credit* iswm $1) || (ping* iswm $1) || ($1 == god) || ($1 == addhelper) || ($1 == delhelper) || ($1 == helpers) || ($1 == opers) || ($1 == staff) || ($1 == reg) || ($1 == register) || ($1 == unreg) || ($1 == unregister) || ($1 == pass) || ($1 == auth) || ($1 == authenticate) || ($1 == ounreg) || ($1 == ounregister) || ($2 == trigger) || ($1 == join) || ($1 == j) || ($1 == part) || ($1 == p) || ($1 == allowauth) || ($1 == aa) || ($1 == rename) || ($1 == gag) || ($1 == ignore) || ($1 == ungag) || ($1 == unignore) || ($1 == gags) || ($1 == gaglist) {
var %com = $1, %rest = $2-
}
elseif (cc* iswm $1) || (crazy*cafcasi iswm $1) || ($1 == ignores) || ($1 == ignorelist) || ($1 == addperform) || ($1 == delperform) || ($1 == performs) || ($1 == performlist) || ($1 == dice) || ($1 == d) || ($1 == quit) || ($1 == disconnect) || ($1 == shutdown) || ($1 == trans) || ($1 == translation) {
var %com = $1, %rest = $2-
}
elseif ($left($1,1) == $chr(35)) {
var %chan = $1, %com = $2, %rest = $3-
}
elseif ($left($2,1) == $chr(35)) {
var %com = $1, %chan = $2, %rest = $3-
}
else {
.notice $nick You must provide a channel. | halt
}
}
tokenize 32 %rest
;checks to see if commands requiring a password are done in PM
if (%com == register) || (%com == reg) || (%com == unregister) || (%com == unreg) || (%com == pass) || (%com == auth) || (%com == authenticate) && ($prop == inchan) {
.notice $nick This command must be done in PM only. | halt
}
;this command is to register an account, syntax: REGISTER <account> <pass>
elseif (%com == register) || (%com == reg) {
if ($authed($nick) == 1) {
.notice $nick You are already authed with $+ $me $+ . Disconnect to register another account. | halt
}
if ($readini(" $+ $scriptdiraccounts.ini",Accounts,$1)) {
.notice $nick Account $+ $1 $+ is already registered. | halt
}
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (account and pass) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (pass) | halt
}
if ($1 == pass) || ($1 == account) || ($1 == $me) {
.notice $nick Your account name cannot be 'PASS' 'ACCOUNT' or ' $+ $me $+ '.
}
else {
;writes all necessary info to " $+ $scriptdiraccounts.ini"
writeini " $+ $scriptdiraccounts.ini" Nicks $nick $1
writeini " $+ $scriptdiraccounts.ini" Accounts $1 $nick
writeini " $+ $scriptdiraccounts.ini" $1 Nick $nick
writeini " $+ $scriptdiraccounts.ini" $1 Hostmask $wildsite
writeini " $+ $scriptdiraccounts.ini" Passwords $nick $encode($2,m)
writeini " $+ $scriptdiraccounts.ini" Authed $nick 1
.notice $nick Account $+ $1 $+ has been registered to you.
}
}
;this command is to unregister an account you are authed to, syntax: UNREGISTER <pass>
elseif (%com == unregister) || (%com == unreg) {
if ($authed($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (pass)
}
if ($encode($1,m) === $password($nick)) {
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($access($ini(" $+ $scriptdirchannels.ini",%i),$nick)) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $account($nick)
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $wildsite
}
inc %i
}
var %account $account($nick)
if ($oper($nick) != $null) {
remini " $+ $scriptdiropers.ini" Opers $account($nick)
}
if ($helper($nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $account($nick)
}
remini " $+ $scriptdiraccounts.ini" Accounts $account($nick)
remini " $+ $scriptdiraccounts.ini" $account($nick)
remini " $+ $scriptdiraccounts.ini" Passwords $nick
remini " $+ $scriptdiraccounts.ini" Authed $nick
remini " $+ $scriptdiraccounts.ini" Nicks $nick
.notice $nick Successfully unregistered account $+ %account $+ .
}
else {
.notice $nick Invalid password for account $+ $account($nick) $+ . (Case Sensitive)
}
}
else {
.notice $nick You are not authed with $+ $me $+ .
}
}
;this command is to change an accounts password that you are authed on, syntax: PASS <oldpass> <newpass>
elseif (%com == pass) {
if ($authed($nick) == 1) {
if (!$1) {
.notice $nick pass requires more parameters. (oldpass and newpass)
}
elseif (!$2) {
.notice $nick pass requires more parameters. (newpass)
}
if ($encode($1,m) === $password($nick)) {
writeini " $+ $scriptdiraccounts.ini" Passwords $nick $encode($2,m)
.notice $nick Password successfully changed to $+ $2 $+ .
}
else {
.notice $nick Invalid password for account $+ $account($nick) $+ . (Case Sensitive)
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;this command is to auth to an account, syntax: AUTH <account> <pass>
elseif (%com == auth) || (%com == authenticate) {
if ($authed($nick) == 1) {
.notice $nick You already authed with $+ $me $+ . | halt
}
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (account and pass) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$1)) {
.notice $nick Account $+ $1 $+ has not been registered with $+ $me $+ . | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (pass) | halt
}
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$1)
var %account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($authed(%account.nick) == 0) || ($authed(%account.nick) == $null) {
if ($address($nick,3) iswm $readini(" $+ $scriptdiraccounts.ini",$1,Hostmask)) || ($address($nick,2) iswm $readini(" $+ $scriptdiraccounts.ini",$1,Hostmask)) {
if ($1 == %account) && ($encode($2,m) === $password(%account.nick)) {
var %i = 1, %hostmask = $readini(" $+ $scriptdiraccounts.ini",$1,Hostmask)
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($readini(" $+ $scriptdirchannels.ini",$ini(" $+ $scriptdirchannels.ini",%i),%hostmask) != $null) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %hostmask
writeini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $wildsite $ifmatch
}
inc %i
}
;writes/changer any necessary info needed
remini " $+ $scriptdiraccounts.ini" Nicks %account.nick
writeini " $+ $scriptdiraccounts.ini" Nicks $nick $1
remini " $+ $scriptdiraccounts.ini" Authed %account.nick
writeini " $+ $scriptdiraccounts.ini" Authed $nick 1
writeini " $+ $scriptdiraccounts.ini" %account Hostmask $wildsite
writeini " $+ $scriptdiraccounts.ini" %account Nick $nick
remini " $+ $scriptdiraccounts.ini" Passwords %account.nick
writeini " $+ $scriptdiraccounts.ini" Passwords $nick $encode($2,m)
remini " $+ $scriptdiraccounts.ini" Accounts %account
writeini " $+ $scriptdiraccounts.ini" Accounts %account $nick
var %i = 1
var %accesschan = $ini(" $+ $scriptdirchannels.ini",0)
while (%i <= %accesschan) {
if (*host !iswm $ini(" $+ $scriptdirchannels.ini",%i)) && (*blist !iswm $ini(" $+ $scriptdirchannels.ini",%i)) && (*setinfo !iswm $ini(" $+ $scriptdirchannels.ini",%i)) {
var %channel.from.ini = $ini(" $+ $scriptdirchannels.ini",%i)
}
if ($access(%channel.from.ini,$nick) == peon) {
mode %channel.from.ini +v $nick
}
elseif ($access(%channel.from.ini,$nick).level <= 5) {
mode %channel.from.ini +o $nick
}
inc %i
}
.notice $nick You have successfully authed with $+ $me $+ .
}
else {
.notice $nick Invalid password for account $+ $1 $+ . (Case Sensitive)
}
}
else {
.notice $nick Invalid hostmask for account $+ $1 $+ .
}
}
else {
.notice $nick You are already authed with $+ $me $+ .
}
}
;this command is to unregister someone's account, syntax: OUNREGISTER <nick|*account>
elseif (%com == ounreg) || (%com == ounregister) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (nick|*account) | halt
}
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
}
else {
var %account.nick = $1
var %account.hostmask = $address($1,5)
if ($authed($1) == 0) {
.notice $nick $1 must first auth with $+ $me $+ . | halt
}
}
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($access($ini(" $+ $scriptdirchannels.ini",%i),%account.nick)) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %account.host
}
inc %i
}
var %account = $account(%account.nick)
if ($oper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Opers $account(%account.nick)
}
if ($helper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $account(%account.nick)
}
remini " $+ $scriptdiraccounts.ini" Accounts $account(%account.nick)
remini " $+ $scriptdiraccounts.ini" $account(%account.nick)
remini " $+ $scriptdiraccounts.ini" Passwords %account.nick
remini " $+ $scriptdiraccounts.ini" Authed %account.nick
remini " $+ $scriptdiraccounts.ini" Nicks %account.nick
.notice $nick Successfully unregistered account $+ %account $+ .
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You are not authed with $+ $me $+ .
}
}
;this command is to allow someone to auth to an account they have an invalid hostmask on,
;syntax: ALLOWAUTH <nick> <account>
elseif (%com == allowauth) || (%com == aa) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
$allowauth($nick,$1,$2)
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;this command is to rename someone's account name, syntax: RENAME <nick|*old-account> <[*]new-account>
elseif (%com == rename) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
$renameaccount($nick,$1,$2)
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;this command unauths someone, syntax: UNAUTH [nick]
elseif (%com == unauth) || (%com == deauth) {
if ($authed($nick) == 1) {
if (!$1) {
.notice $nick You must add CONFIRM to the end of your line to confirm unauthorization.
}
elseif ($1 == CONFIRM) {
writeini " $+ $scriptdiraccounts.ini" Authed $nick 0
.notice $nick You have unauthed from $+ $me $+ .
}
else {
if ($godstatus($nick) == 1) {
if ($authed($1) == 1) {
writeini " $+ $scriptdiraccounts.ini" Authed $1 0
.notice $nick $+ $1 $+ has been unauthed from $+ $me $+ .
}
else {
.notice $nick $+ $1 $+ isn't authed with $+ $me $+ .
}
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;registers a channel with the bot, syntax: REGCHAN <#channel> <nick|*account>
elseif (%com == registerchannel) || (%com == registerchan) || (%com == regchannel) || (%com == regchan) || (%com == channelregister) || (%com == chanregister) || (%com == channelreg) || (%com == chanreg) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
if ($channels(%chan) != $null) {
.notice $nick $+ %chan $+ is registered to someone else. | halt
}
if ($1 == $me) {
.notice $nick $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
else {
;writes all the channel info to the " $+ $scriptdirchannels.ini"
writeini " $+ $scriptdirchannels.ini" %chan %chan $asctime
writeini " $+ $scriptdirchannels.ini" %chan Registrar $account($nick)
writeini " $+ $scriptdirchannels.ini" %chan $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" %chan $+ host %account.host owner
writeini " $+ $scriptdirchannels.ini" %chan Setters Masters
writeini " $+ $scriptdirchannels.ini" %chan Modes None
writeini " $+ $scriptdirchannels.ini" %chan Toys 2
writeini " $+ $scriptdirchannels.ini" %chan Dynlimit Disabled
writeini " $+ $scriptdirchannels.ini" %chan Voice Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kick
writeini " $+ $scriptdirchannels.ini" %chan Protect 2
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic None
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 0
writeini " $+ $scriptdirchannels.ini" %chan Greeting None
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting None
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Disabled
write " $+ $scriptdirbotperform.txt" join %chan
join %chan
mode %chan +nt
.notice $nick Successfully registered $+ %chan $+ to $account(%account.nick) $+ .
}
}
else {
if ($authed($1) == 1) {
writeini " $+ $scriptdirchannels.ini" %chan %chan $asctime
writeini " $+ $scriptdirchannels.ini" %chan Registrar $account($nick)
writeini " $+ $scriptdirchannels.ini" %chan $account($1) owner
writeini " $+ $scriptdirchannels.ini" %chan $+ host $address($1,5) owner
writeini " $+ $scriptdirchannels.ini" %chan Setters Masters
writeini " $+ $scriptdirchannels.ini" %chan Modes None
writeini " $+ $scriptdirchannels.ini" %chan Toys 2
writeini " $+ $scriptdirchannels.ini" %chan Dynlimit Disabled
writeini " $+ $scriptdirchannels.ini" %chan Voice Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kick
writeini " $+ $scriptdirchannels.ini" %chan Protect 2
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic None
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 0
writeini " $+ $scriptdirchannels.ini" %chan Greeting None
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting None
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Disabled
write " $+ $scriptdirbotperform.txt" join %chan
join %chan
mode %chan +nt
.notice $nick Successfully registered $+ %chan $+ to $1 ( $+ $account($1) $+ ).
}
else {
.notice $nick $1 must first auth with $+ $me $+ .
}
}
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;unregisters a registered channel with the bot, syntax: UNREGCHAN <#channel>
elseif (%com == unregisterchannel) || (%com == unregisterchan) || (%com == unregchannel) || (%com == unregchan) || (%com == channelunregister) || (%com == chanunregister) || (%com == channelunreg) || (%com == chanunreg) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if (!$1) {
if ($godstatus($nick) == 1) {
if ($nodelete(%chan) == Enabled) {
.notice $nick $+ %chan $+ is protected from unregistration. (NoDelete) | halt
}
;removes all info the channel had
remini " $+ $scriptdirchannels.ini" %chan
remini " $+ $scriptdirchannels.ini" %chan $+ host
remini " $+ $scriptdirchannels.ini" %chan $+ blist
remini " $+ $scriptdirchannels.ini" %chan $+ setinfo
$iif($isfile(" $+ $scriptdir $+ %chan $+ quote.txt") == $true,remove " $+ $scriptdir $+ %chan $+ quote.txt")
write -dw $+ "join %chan $+ " " $+ $scriptdirbotperform.txt"
part %chan Channel unregistered by $nick $+ .
$iif(%dynlimit. [ $+ [ %chan ] ],unset %dynlimit. [ $+ [ %chan ] ])
.notice $nick Successfully unregistered $+ %chan $+ .
}
elseif ($access(%chan,$nick) == Owner) {
if ($nodelete(%chan) == Enabled) {
.notice $nick $+ %chan $+ is protected from unregistration. (NoDelete) | halt
}
.notice $nick To confirm this unregistration, you must append 'CONFIRM' to the end of your command.
}
elseif ($access(%chan,$nick) != Owner) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
elseif ($1 == CONFIRM) {
if ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
remini " $+ $scriptdirchannels.ini" %chan
remini " $+ $scriptdirchannels.ini" %chan $+ host
remini " $+ $scriptdirchannels.ini" %chan $+ blist
remini " $+ $scriptdirchannels.ini" %chan $+ setinfo
$iif($isfile(" $+ $scriptdir $+ %chan $+ quote.txt") == $true,remove " $+ $scriptdir $+ %chan $+ quote.txt")
write -dw $+ "join %chan $+ " " $+ $scriptdirbotperform.txt"
part %chan Channel unregistered by $nick $+ .
.notice $nick Successfully unregistered $+ %chan $+ .
}
elseif ($access(%chan,$nick) != Owner) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick $+ %chan $+ has not been registered with $+ $me $+ .
}
}
;moves a channels userlist, banlist, info to another channl, syntax: MOVE <#channe> <destination>
elseif (%com == move) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
if ($channels(%chan) != $null) {
if (!%chan) {
.notice $nick move requires more parameters. (channel and destination) | halt
}
elseif (!$1) {
.notice $nick move requires more parameters. (destination) | halt
}
if ($channels($1) != $null) {
.notice $nick $+ $1 $+ is registered to someone else. | halt
}
if ($left($1,1) != $chr(35)) {
.notice $nick That is not a valid channel. | halt
}
else {
$initopicchanger(" $+ $scriptdirchannels.ini",%chan,$1)
$initopicchanger(" $+ $scriptdirchannels.ini",%chan $+ host,$1 $+ host)
$initopicchanger(" $+ $scriptdirchannels.ini",%chan $+ blist,$1 $+ blist)
$initopicchanger(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$1 $+ setinfo)
write -ds $+ "join %chan" " $+ $scriptdirbotperform.txt"
write " $+ $scriptdirbotperform.txt" join $1
part %chan Channel moved to $1 $+ .
join $1
mode $1 $readini(" $+ $scriptdirchannels.ini",$1,Modes)
.notice $nick Channel registration moved from $+ %chan $+ to $+ $1 $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;toggle godmode (security override) for helpers and opers, syntax: GOD [on|off]
elseif (%com == god) || (%com == h4x) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) || ($helper($nick) != $null) {
var %helper.or.oper = $iif($helper($nick) != $null,Helpers,Opers)
if ($1 == on) || ($1 == 1) || ($1 == Enable) {
if ($godstatus($nick) == 1) {
.notice $nick Security override is already enabled. | halt
}
writeini " $+ $scriptdiropers.ini" %helper.or.oper $account($nick) 1
.notice $nick Security override has been enabled.
}
elseif ($1 == off) || ($1 == 0) || ($1 == Disable) {
if ($godstatus($nick) == 0) {
.notice $nick Security override is already disabled. | halt
}
writeini " $+ $scriptdiropers.ini" %helper.or.oper $account($nick) 0
.notice $nick Security override has been disabled.
}
else {
var %god.status = $iif($godstatus($nick) == 1,0,1)
writeini " $+ $scriptdiropers.ini" %helper.or.oper $account($nick) %god.status
.notice $nick Security override has been $iif($godstatus($nick) == 1,enabled.,disabled.)
}
}
else {
.notice $nick god is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;add a helper to the bot, syntax: ADDHELPER <nick|*account>
elseif (%com == addhelper) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick addhelper requires more parameters. (nick|*account) | halt
}
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
elseif (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
elseif ($helper(%account.nick)) {
.notice $nick %account.nick is already a helper.
}
elseif ($oper(%account.nick)) {
.notice $nick %account.nick is already an oper.
}
else {
writeini " $+ $scriptdiropers.ini" Helpers $account(%account.nick) 1
.notice $nick Added $account(%account.nick) as a helper successfully.
}
}
else {
elseif ($helper($1) != $null) {
.notice $nick $+ $1 $+ is already a helper. | halt
}
elseif ($oper($1) != $null) {
.notice $nick $+ $1 $+ is already an oper. | halt
}
if ($authed($1) == 1) {
writeini " $+ $scriptdiropers.ini" Helpers $account($1) 1
.notice $nick Added $1 ( $+ $account($1) $+ ) as a helper successfully.
}
else {
.notice $nick $1 is not authed with $+ $me $+ .
}
}
}
else {
.notice $nick addhelper is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;deletes a helper from the bot, syntax: DELHELPER <nick|*account>
elseif (%com == delhelper) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$1) {
.notice $nick delhelper requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($helper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $remove($1,*)
.notice $nick Removed $account(%account.nick) from a helper successfully.
}
else {
.notice $nick $account(%account.nick) is not a helper.
}
}
else {
elseif ($oper($1) != $null) {
.notice $nick $1 is already an oper. | halt
}
if ($authed($1) == 1) {
if ($helper($1) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $account($1)
.notice $nick Removed $1 ( $+ $account($1) $+ ) from a helper successfully.
}
else {
.notice $nick $1 is not a helper.
}
}
else {
.notice $nick $1 must first auth with $+ $me $+ .
}
}
}
else {
.notice $nick delhelper is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;people with access to the channel can set an info line for when they join the channel, syntax: SETINFO [info]
elseif (%com == setinfo) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == peon) || ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) {
if (!$1) {
.notice $nick $iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) == $null,You don't have an info line set.,$parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick))))
}
elseif ($1 == $chr(42)) {
if ($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null) {
remini " $+ $scriptdirchannels.ini" %chan $+ setinfo $account($nick)
.notice $nick Your info line has been cleared.
}
else {
.notice $nick You don't have an info line set.
}
}
else {
writeini " $+ $scriptdirchannels.ini" %chan $+ setinfo $account($nick) $parse.to.ini($1-)
.notice $nick Your info line has been set to ' $+ $1- $+ '.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;tells the user that these commands must be done manually
elseif (%com == addoper) || (%com == deloper) {
.notice $nick Sorry, that command must be done manually.
}
;adds the specified user to the channel, syntax: ADDUSER <level> <nick|*account>
elseif (%com == adduser) {
$adduser($nick,$2,%chan,$1)
}
;adds a peon to the channel userlist, syntax: ADDPEON <nick|*account>
elseif (%com == addpeon) {
$adduser($nick,$1,%chan,peon)
}
;adds an op to the channel userlist, syntax: ADDOP <nick|*account>
elseif (%com == addop) {
$adduser($nick,$1,%chan,op)
}
;adds a master to the channel userlist, syntax: ADDMASTER <nick|*account>
elseif (%com == addmaster) {
$adduser($nick,$1,%chan,master)
}
;adds a coowner to the channel userlist, syntax: ADDCOOWNER <nick|*account>
elseif (%com == addcoowner) || (%com == addco) {
$adduser($nick,$1,%chan,coowner)
}
;adds an owner to the channel userlist, syntax: ADDOWNER <nick|*account>
elseif (%com == addowner) {
$adduser($nick,$1,%chan,owner)
}
;changes a person's access level on the channel userlist, syntax: CLVL <nick|*account> <access-level>
elseif (%com == clvl) || (%com == changelvl) || (%com == changelevel) {
$clvl($nick,$1,%chan,$2)
}
;deletes a peon from the channel userlist, syntax: DELPEON <nick|*account>
elseif (%com == delpeon) {
$deluser($nick,$1,%chan,peon)
}
;deletes an op from the channel userlist, syntax: DELOP <nick|*account>
elseif (%com == delop) {
$deluser($nick,$1,%chan,op)
}
;deletes a master from the channel userlist, syntax: DELMASTER <nick|*account>
elseif (%com == delmaster) {
$deluser($nick,$1,%chan,master)
}
;deletes a coowner from the channel userlist, syntax: DELCOOWNER <nick|*account>
elseif (%com == delcoowner) || (%com == delco) {
$deluser($nick,$1,%chan,coowner)
}
;deletes an owner from the channel userlist, syntax: DELOWNER <nick|*account>
elseif (%com == delowner) {
$deluser($nick,$1,%chan,owner)
}
;deletes a user from the channel userlist, syntax: DELUSER <nick|*account>
elseif (%com == deluser) {
if ($chr(42) isin $1) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
$deluser($nick,$1,%chan,$access(%chan,%account.nick))
}
else {
$deluser($nick,$1,%chan,$access(%chan,$1))
}
}
elseif (%com == suspend) {
$suspend($nick,$1,%chan,$2)
}
elseif (%com == unsuspend) {
$unsuspend($nick,$1,%chan)
}
;displays all peons for the channel, syntax: PLIST [mask]
elseif (%com == plist) || (%com == peons) {
if ($channels(%chan) != $null) {
.notice $nick %chan peons: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,peon) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,peon))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all ops for the channel, syntax: OLIST
elseif (%com == olist) || (%com == ops) {
if ($channels(%chan) != $null) {
.notice $nick %chan ops: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,op) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,op))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all masters for the channel, syntax: MLIST
elseif (%com == mlist) || (%com == masters) {
if ($channels(%chan) != $null) {
.notice $nick %chan masters: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,master) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,master))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all coowners for the channel, syntax: CLIST
elseif (%com == clist) || (%com == coowners) {
if ($channels(%chan) != $null) {
.notice $nick %chan coowners: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,coowner))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all owners for the channel, syntax: WLIST
elseif (%com == wlist) || (%com == owners) {
if ($channels(%chan) != $null) {
.notice $nick %chan owners: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,owner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,owner))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all users for the channel, syntax: USERS
elseif (%com == users) {
if ($channels(%chan) != $null) {
.timerusers -m 1 50 .notice $nick %chan users: ( $+ $calc($readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber) $+ )
.timerowner 1 1 .notice $nick Owners $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,owner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,owner))
.timercoowner 1 2 .notice $nick Coowners $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,coowner))
.timermaster 1 3 .notice $nick Masters $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,master) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,master))
.timerop 1 4 .notice $nick Ops $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,op) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,op))
.timerpeon 1 5 .notice $nick Peons $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,peon) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,peon))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all opers of the bot, syntax: OPERS
elseif (%com == opers) || (%com == ircops) {
var %i = 1, %olist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
%olist = $instok(%olist,$ini(" $+ $scriptdiropers.ini",Opers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%olist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%olist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Opers of $me $+ : ( $+ $numtok(%names,32) $+ )
if ($ini(" $+ $scriptdiropers.ini",Opers,0) == 0) {
.notice $nick None. | halt
}
$iif(%names,.notice $nick %names)
}
;displays all helpers of the bot, syntax: HELPERS
elseif (%com == helpers) {
var %i = 1, %hlist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
var %hlist = $instok(%hlist,$ini(" $+ $scriptdiropers.ini",Helpers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%hlist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%hlist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Helpers of $me $+ : ( $+ $numtok(%names,32) $+ )
if ($ini(" $+ $scriptdiropers.ini",Helpers,0) == 0) {
.notice $nick None. | halt
}
$iif(%names,.notice $nick %names)
}
;displays all staff (helper and oper) of the bot, syntax: STAFF
elseif (%com == staff) {
.notice $nick $+ $me $+ 's staff:
if ($ini(" $+ $scriptdiropers.ini",Opers,0) == 0) {
.notice $nick Opers(0): None.
}
else {
var %i = 1, %olist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
var %olist = $instok(%olist,$ini(" $+ $scriptdiropers.ini",Opers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%olist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%olist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Opers $+ ( $+ $numtok(%names,32) $+ ): %names
}
if ($ini(" $+ $scriptdiropers.ini",Helpers,0) == 0) {
.notice $nick Helpers(0) None.
}
else {
var %i = 1, %hlist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
var %hlist = $instok(%hlist,$ini(" $+ $scriptdiropers.ini",Helpers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%hlist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%hlist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Helpers $+ ( $+ $numtok(%names,32) $+ ): %names
}
}
;invites a user to the channel, syntax: INVITE <nick>
elseif (%com == invite) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (nick)
}
else {
if ($1 !ison %chan) {
invite $1 %chan
.notice $nick Invited $+ $1 $+ to %chan $+ .
}
else {
.notice $nick $+ $1 $+ is already on %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access to %chan $+ .
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;invites yourself to the channel, syntax: INVITEME <#channel>
elseif (%com == inviteme) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($nick !ison %chan) {
invite $nick %chan
}
else {
.notice $nick You are already on $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays various info about the channel, syntax: INFO <#channel>
elseif (%com == info) {
if ($channels(%chan) != $null) {
var %ownercount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber
var %coownercount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber
var %mastercount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber
var %opcount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber
var %peoncount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber
var %totalusercount = $calc(%ownercount + %coownercount + %mastercount + %opcount + %peoncount)
var %totalbancount = $readalltheini(" $+ $scriptdirchannels.ini",%chan $+ blist,*).totalnumber
.timernoticeinfo -m 1 50 .notice $nick $+ %chan $+ info:
.timernoticeuser1 1 1 .notice $nick Owners: %ownercount Coowners: %coownercount Masters: %mastercount
.timernoticeuser2 1 2 .notice $nick Ops: %opcount Peons: %peoncount Total Users: %totalusercount Total Ban Count: %totalbancount
.timernoticebancount 1 3 .notice $nick Registered: $channels(%chan) - $readini(" $+ $scriptdirchannels.ini",%chan,Registrar)
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays various pieces of information about a channel user, including channel and bot access level
;and the user's info line. If no nick or account is provided, bot returns your own information.
;syntax: ACCESS [nick]
elseif (%com == access) {
if ($channels(%chan) != $null) {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access(%chan,%account.nick).account == $null) {
if ($oper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is an IRCOp.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) lacks access to %chan but has security override enabled. | halt
}
else {
.notice $nick $account(%account.nick) lacks access to %chan $+ . | halt
}
}
elseif ($helper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is a Helper.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) lacks access to %chan but has security override enabled. | halt
}
else {
.notice $nick $account(%account.nick) lacks access to %chan $+ . | halt
}
}
else {
.notice $nick $account(%account.nick) lacks access to %chan $+ . | halt
}
}
if ($access(%chan,%account.nick).account != $null) {
if ($oper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is an IRCOp.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick).account) != $null,.notice $nick $chr(91) $+ $account(%account.nick).account $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
else {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
}
elseif ($helper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is a Helper.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
else {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
}
else {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
}
}
if ($1 == $me) {
.notice $nick $+ $me $+ is the channel service bot. | halt
}
elseif (!$1) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == $null) {
if ($oper($nick) != $null) {
.notice $nick $nick is an IRCOp.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan $+ .
}
}
elseif ($helper($nick)) {
.notice $nick $nick is a Helper.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan $+ .
}
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan $+ .
}
}
if ($access(%chan,$nick) != $null) {
if ($oper($nick) != $null) {
.notice $nick $nick is an IRCOp.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
}
elseif ($helper($nick)) {
.notice $nick $nick is a Helper.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
if ($authed($1) == 1) {
if ($access(%chan,$1) == $null) {
if ($oper($1) != $null) {
.notice $nick $1 is an IRCOp.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan $+ .
}
}
if ($helper($1) != $null) {
.notice $nick $1 is a Helper.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan $+ .
}
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan $+ .
}
}
if ($access(%chan,$1) != $null) {
if ($oper($1) != $null) {
.notice $nick $1 is an IRCOp.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
}
elseif ($helper($1) != $null) {
.notice $nick $1 is a Helper.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
}
}
else {
.notice $nick $1 must first auth with $+ $me $+ .
}
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;ops/voices you if you have access, syntax: UP
elseif (%com == up) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Owner) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Op) {
if ($nick isop %chan) {
.notice $nick You are already opped in $+ %chan $+ . | halt
}
else {
mode %chan +o $nick
}
}
elseif ($access(%chan,$nick) == Peon) {
if ($nick isvoice %chan) {
.notice $nick You are already voiced in $+ %chan $+ . | halt
}
else {
mode %chan +v $nick
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deops/devoices you in the channel, syntax DOWN
elseif (%com == down) {
if ($channels(%chan) != $null) {
if ($nick !isop %chan) && ($nick !isvoice %chan) {
.notice $nick You are not opped or voiced in $+ %chan $+ . | halt
}
else {
mode %chan -ov $nick $nick
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;giveownership of the channel to another user, syntax: GIVEOWNERSHIP [nick|*account]
elseif (%com == giveownership) {
$giveownership($nick,$1,%chan)
}
;sets the setters level for the channel, syntax: SET SETTERS <value>
elseif (%com == set) && ($1 == setters) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
;checks the current channel's setters
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == setters) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == 2) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan Setters Masters
.notice $nick Setters 0 - Masters and above may change settings.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan Setters Coowners
.notice $nick Setters 1 - Coowners and above may change settings.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan Setters Owners
.notice $nick Setters 2 - Owners may change settings.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid setters setting.
}
}
else {
if ($setters(%chan) == Masters) {
.notice $nick Setters 0 - Masters and above may change settings.
}
elseif ($setters(%chan) == Coowners) {
.notice $nick Setters 1 - Coowners and above may change settings.
}
elseif ($setters(%chan) == Owners) {
.notice $nick Setters 2 - Owners may change settings.
}
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;adjusts user limit to prevent join floods, syntax: SET DYNLIMIT <value>
elseif (%com == set) && ($1 == dynlimit) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == dynlimit) {
if ($2 != $null) {
if ($2 == 0) || ($2 == Disable) {
writeini " $+ $scriptdirchannels.ini" %chan Dynlimit Disabled
.timerdynlimit [ $+ [ %chan ] $+ ] off
.notice $nick Dynlimit - Disabled.
}
elseif ($2 == 1) || ($2 == Enable) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic Enabled
.timerdynlimit [ $+ [ %chan ] ] 0 300 chanlimit %chan
.notice $nick Dynlimit - Enabled.
mode %chan +l $calc($nick(%chan,0) + 7)
}
else {
.notice $nick $+ $2 $+ is an invalid binary value.
}
}
else {
.notice $nick Dynlimit - $dynlimit(%chan) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the default topic for the channel, syntax: SET DEFAULTTOPIC <new-topic>
elseif (%com == set) && ($1 == topic) || ($1 == defaulttopic) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == topic) || ($1 == defaulttopic) {
if ($2 != $null) {
if ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic None
topic %chan $chr(3)
.notice $nick DefaultTopic - None.
}
else {
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic $parse.to.ini($2-)
topic %chan $2-
.notice $nick DefaultTopic - $2-
}
}
elseif ($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic) == None) {
.notice $nick DefaultTopic - None. | halt
}
else {
.notice $nick DefaultTopic - $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic))
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the access level required to change the topic, syntax: SET ENFTOPIC <value>
elseif (%com == set) && ($1 == enftopic) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == enftopic) {
if ($2 != $null) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 0
.notice $nick EnfTopic - Anyone may change the topic.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 1
.notice $nick EnfTopic - Ops and above may change the topic.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 2
.notice $nick EnfTopic - Masters and above may change the topic.
}
elseif ($2 == 3) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 3
.notice $nick EnfTopic - Coowners and above may change the topic.
}
elseif ($2 == 4) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 4
.notice $nick EnfTopic - Only owners may change the topic.
}
elseif ($2 == 5) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 5
.notice $nick EnfTopic - No one may change the topic.
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid topic lock enforcement setting.
}
}
else {
.notice $nick EnfTopic - $enftopic(%chan).words $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;changes the current channel's topic, syntax: TOPIC [topic]
elseif (%com == topic) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($calc($access(%chan,$nick).level - 1) >= $enftopic(%chan)) || ($godstatus($nick) == 1) {
if ($1 == $null) {
if ($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic) != None) {
topic %chan $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic))
.notice $nick Topic is now ' $+ $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic)) $+ '.
}
else {
.notice $nick $+ %chan $+ does not have a default topic set.
}
}
else {
topic %chan $1-
.notice $nick Topic is now ' $+ $1- $+ '.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel greeting, syntax: SET GREETING <greeting>
elseif (%com == set) && ($1 == greeting) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == greeting) {
if ($2 != $null) {
if ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan Greeting None
.notice $nick Greeting - None.
}
else {
writeini " $+ $scriptdirchannels.ini" %chan Greeting $parse.to.ini($2-)
.notice $nick Greeting - $2-
}
}
elseif ($readini(" $+ $scriptdirchannels.ini",%chan,Greeting) == None) {
.notice $nick Greeting - None. | halt
}
else {
.notice $nick Greeting - $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,Greeting))
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel greeting, syntax: SET USERGREETING <user-greeting>
elseif (%com == set) && ($1 == usergreeting) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == usergreeting) {
if ($2 != $null) {
if ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting None
.notice $nick UserGreeting - None.
}
else {
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting $parse.to.ini($2-)
.notice $nick UserGreeting - $2-
}
}
elseif ($readini(" $+ $scriptdirchannels.ini",%chan,UserGreeting) == None) {
.notice $nick UserGreeting - None. | halt
}
else {
.notice $nick UserGreeting - $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,UserGreeting))
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel toys option, syntax: SET TOYS <value>
elseif (%com == set) && ($1 == toys) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == toys) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == 2) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan Toys 0
.notice $nick Toys - Toys are completely disabled.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan Toys 1
.notice $nick Toys - Toys will only reply privately.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan Toys 2
.notice $nick Toys - Toys will reply publicly.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid toys setting.
}
}
else {
if ($toys(%chan) == 0) {
.notice $nick Toys $toys(%chan) - Toys are completely disabled
}
elseif ($toys(%chan) == 1) {
.notice $nick Toys $toys(%chan) - Toys will only reply privately.
}
elseif ($toys(%chan) == 2) {
.notice $nick Toys $toys(%chan) - Toys will reply publicly.
}
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel default modes, syntax: SET MODES <modes>
elseif (%com == set) && ($1 == modes) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == modes) {
if ($2 != $null) {
if ($2 == $chr(42)) {
$modelock(%chan,$nick,$2-) | return
}
var %i = 1, %length = $len($remove($2,+,-))
while (%i <= %length) {
if ($mid($remove($2,+,-),%i,1) !isin $chanmodes) {
.notice $nick $+ $2 $+ is an invalid mode lock setting. | halt
}
inc %i
}
$modelock(%chan,$nick,$2,$3,$5)
}
else {
$restoremodes(%chan,$nick).info
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;change the channel modes, syntax: MODE [mode]
elseif (%com == mode) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 != $null) {
var %i = 1, %length = $len($remove($1,+,-))
while (%i <= %length) {
if ($mid($remove($1,+,-),%i,1) !isin $chanmodes) {
.notice $nick $+ $1 $+ is an invalid mode lock setting. | halt
}
inc %i
}
$modechange(%chan,$nick,$1,$2,$3,$4)
}
else {
$restoremodes(%chan,$nick)
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel voice, syntax: SET VOICE <value>
elseif (%com == set) && ($1 == voice) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == voice) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == off) || ($2 == 1) || ($2 == on) {
if ($2 == 0) || ($2 == off) {
writeini " $+ $scriptdirchannels.ini" %chan Voice Disabled
.notice $nick Voice - Disabled.
}
elseif ($2 == 1) || ($1 == on) {
writeini " $+ $scriptdirchannels.ini" %chan Voice Enabled
.notice $nick Voice - Enabled.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid voice setting.
}
}
else {
.notice $nick Voice - $readini(" $+ $scriptdirchannels.ini",%chan,Voice) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel protect, syntax: SET PROTECT <value>
elseif (%com == set) && ($1 == protect) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == protect) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == 2) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan Protect 0
.notice $nick Protect 0 - No users will be protected.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan Protect 1
.notice $nick Protect 1 - Users will be protected from those of lower access.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan Protect 2
.notice $nick Protect 2 - Users will be protected from those of equal or lower access.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid protect setting.
}
}
else {
if ($protection(%chan) == 0) {
.notice $nick Protect 0 - No users will be protected.
}
elseif ($protection(%chan) == 1) {
.notice $nick Protect 1 - Users will be protected from those of lower access.
}
elseif ($protection(%chan) == 2) {
.notice $nick Protect 2 - Users will be protected from those of equal or lower access.
}
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel spam option, syntax: SET SPAM <off|number of line> <time>
elseif (%com == set) && ($1 == spam) || ($1 == spamprotect) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == spam) || ($1 == spamprotect) {
if ($2 != $null) {
if ($2 == off) || ($2 == 0) || ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect Disabled
.notice $nick SpamProtect - Disabled.
}
elseif ($2 isnum) && ($3 != $null) {
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect $2 $timeduration($3)
.notice $nick SpamProtect - $2 line $+ $iif(1 < $2,s,$chr(32)) in $duration($timeduration($3)) $+ .
}
elseif ($2 isnum) && ($3 == $null) {
.notice $nick $+ %com $lower($1) $+ requires more parameters. (duration)
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid $+ $lower($1) $+ setting.
}
}
else {
.notice $nick SpamProtect - $iif($spamprotect(%chan) == disabled,Disabled,$gettok($spamprotect(%chan),1,32) line $+ $iif(1 < $gettok($spamprotect(%chan),1,32),s,$chr(32)) in $duration($gettok($spamprotect(%chan),2,32))) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel spampunish option, syntax: SET SPAMPUNISH <kick|ban|kickban|timeban [duration]>
elseif (%com == set) && ($1 == spampunish) || ($1 == spamprotectpunish) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == spampunish) || ($1 == spamprotectpunish) {
if ($2 != $null) {
if ($2 == kick) || ($2 == k) {
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kick
.notice $nick SpamPunish - kick.
}
elseif ($2 == ban) || ($2 == b) {
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish ban
.notice $nick SpamPunish - ban.
}
elseif ($2 == kickban) || ($2 == kb) {
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kickban
.notice $nick SpamPunish - kickban.
}
elseif ($2 == timeban) || ($2 == tb) {
if (!$3) {
.notice $nick $+ %com $lower($1) $+ requires more parameters. (duration)
}
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish timeban $timeduration($3)
.notice $nick SpamPunish - timeban $duration($timeduration($3)) $+ .
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid $+ $lower($1) $+ setting.
}
}
else {
.notice $nick SpamPunish - $iif($spampunish(%chan) == disabled,Disabled,$gettok($spampunish(%chan),1,32) $iif($gettok($spampunish(%chan),2,32) != $null,$duration($gettok($spampunish(%chan),2,32)))) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel no delete option, syntax: SET NODELETE <value>
elseif (%com == set) && ($1 == nodelete) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($1 == nodelete) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == on) || ($2 == off) {
if ($2 == 0) || ($2 == off) {
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Disabled
.notice $nick NoDelete - Disabled
}
elseif ($2 == 1) || ($2 == on) {
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Enabled
.notice $nick NoDelete - Enabled
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid nodelete setting.
}
}
else {
.notice $nick NoDelete - $nodelete(%chan)
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
else {
.notice $nick nodelete is a privileged setting.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the global trigger, syntax: SET TRIGGER <trigger>
elseif (%com == set) && ($1 == trigger) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($1 == trigger) {
if ($2 != $null) {
set %trigger $2
.notice $nick Set global trigger to ' $+ $2 $+ '
}
else {
.notice $nick Global trigger is set to ' $+ %trigger $+ '
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
else {
.notice $nick trigger is a privileged setting.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;shows the channel set options and their values, syntax: SET
elseif (%com == set) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($1 == $null) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
.timerset1 -m 1 50 .notice $nick $+ %chan $+ settings:
.timerset2 1 1 .notice $nick Topic: $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic)) $chr(3) $chr($1) $chr(3) $chr($1) EnfTopic: $enftopic(%chan).words $chr(3) $chr($1) $chr(3) $chr($1) Setters: $readini(" $+ $scriptdirchannels.ini",%chan,Setters) NoDelete: $nodelete(%chan) $chr(3) $chr($1) $chr(3) $chr($1) SpamProtect: $iif($spamprotect(%chan) == disabled,Disabled,$gettok($spamprotect(%chan),1,32) line $+ $iif(1 < $gettok($spamprotect(%chan),1,32),s,$chr(32)) in $duration($gettok($spamprotect(%chan),2,32)))
.timerset3 1 2 .notice $nick Greeting: $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,Greeting)) $chr(3) $chr($1) $chr(3) $chr($1) UserGreeting: $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,UserGreeting)) $chr(3) $chr($1) $chr(3) $chr($1) Mode Lock: $restoremodes(%chan,$nick).info2 SpamPunish: $gettok($spampunish(%chan),1,32) $iif($gettok($spampunish(%chan),2,32) != $null,$duration($ifmatch))
.timerset4 1 3 .notice $nick Voice: $readini(" $+ $scriptdirchannels.ini",%chan,Voice) $chr(3) $chr($1) $chr(3) $chr($1) Toys: $iif($toys(%chan) == 0,Toys are completely disabled,$iif($toys(%chan) == 1,Toys will only reply privately,Toys will reply publicly)) $chr(3) $chr($1) $chr(3) $chr($1) Protection: $iif($protection(%chan) == 0,No users will be protected.,$iif($protection(%chan) == 1,Users will be protected from those of lower access.,Users will be protected from those of equal or lower access.))
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;voices all users in the channel, syntax: VOICEALL
elseif (%com == voiceall) || (%com == va) || (%com == vall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) {
var %n = $iif(%n,%n) $nick(%chan,%i)
}
}
mmode %chan + v %n
.notice $nick Voiced all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;voices specified users in the channel, syntax: VOICE <user[s]>
elseif (%com == voice) || (%com == v) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan + $+ $str(v,$numtok($1-6,32)) $1-6
.notice $nick Voiced users in $+ %chan $+ .
tokenize 32 $7-
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;devoices all users in the channel, syntax: DEVOICEALL
elseif (%com == devoiceall) || (%com == dva) || (%com == dvall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) {
var %n = $iif(%n,%n) $nick(%chan,%i)
}
}
mmode %chan - v %n
.notice $nick Devoiced all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;devoices specified users in the channel, syntax: DEVOICE <user[s]>
elseif (%com == devoice) || (%com == dv) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(v,$numtok($1-6,32)) $1-6
.notice $nick Devoiced users in $+ %chan $+ .
tokenize 32 $7-
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;ops all users in the channel, syntax: OPALL
elseif (%com == opall) || (%com == oall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) {
var %n = $iif(%n,%n) $nick($chan,%i)
}
}
mmode %chan + o %n
.notice $nick Opped all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;op specified users in the channel, syntax: OP <user[s]>
elseif (%com == op) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan + $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Opped users in $+ %chan $+ .
tokenize 32 $7-
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deoppes all users in the channel, syntax: DEOPALL
elseif (%com == deopall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) && ($nick(%chan,%i) != $nick) {
var %n = $iif(%n,%n) $nick($chan,%i)
}
}
mmode %chan - o %n
.notice $nick Deopped all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deop specified users in the channel, syntax: DEOP <user[s]>
elseif (%com == deop) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 == $me) {
.notice $nick You cannot deop the channel service bot. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
if ($protection(%chan) == 2) {
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($access(%chan,$nick).level <= $access(%chan,$gettok($1-6,%i,32)).level) {
.notice $nick Sorry, $+ $gettok($1-6,%i,32) $+ is protected. | halt
}
else {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Deopped users in $+ %chan $+ .
tokenize 32 $7-
inc %i
}
}
elseif ($protection(%chan) == 1) {
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($access(%chan,$nick).level <= $access(%chan,$gettok($1-6,%i,32)).level) {
.notice $nick Sorry, $+ $gettok($1-6,%i,32) $+ is protected. | halt
}
else {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Deopped users in $+ %chan $+ .
tokenize 32 $7-
inc %i
}
}
else {
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Deopped users in $+ %chan $+ .
tokenize 32 $7-
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;kicks a user in the channel, syntax KICK <nick>
elseif (%com == kick) || (%com == k) || (%com == pwn) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $me) {
.notice $nick You cannot kick the channel service bot. | halt
}
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (nick) | halt
}
if ($1 ison %chan) {
if ($protection(%chan) == 2) {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
kick %chan $1 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kicked $+ $1 $+ from %chan $+ .
}
}
elseif ($protection(%chan) == 1) {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
kick %chan $1 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kicked $+ $1 $+ from %chan $+ .
}
}
elseif ($protection(%chan) == 0) {
kick %chan $1 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kicked $+ $1 $+ from %chan $+ .
}
}
else {
.notice $nick $+ $1 $+ isn't currently in $+ %chan $+ .
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;ban a nick/hostmask in the channel, syntax: BAN <nick|hostmask>
elseif (%com == ban) || (%com == b) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $me) {
.notice $nick You cannot ban the channel service bot. | halt
}
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($protection(%chan) == 2) {
if (*!*@* !iswm $1) {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
if ($1 ison %chan) {
mode %chan -ov $1 $1
}
mode %chan +b $address($1,2)
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if (*!*@* !iswm $1) {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
if ($1 ison %chan) {
mode %chan -ov $1 $1
}
mode %chan +b $address($1,2)
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban %chan $1 2
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 0) {
if (*!*@* !iswm $1) {
if ($1 ison %chan) {
mode %chan -ov $1 $1
}
mode %chan +b $address($1,2)
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
else {
ban %chan $1
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;kicks and bans all users from a channel, syntax: KBA
elseif (%com == kickbanall) || (%com == kba) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
mode %chan +imsb *!*@*
var %i = 1
var %total.nick = $nick(%chan,0)
while (%i <= %total.nick) {
if ($nick(%chan,%i) != $me) && ($nick(%chan,%i) != $nick) {
.timerkick $+ $nick(%chan,%i) -m 1 150 kick %chan $nick($chan,%i) $iif($1 == $null,Kick requested by $nick $+ .,$1-)
}
inc %i
}
.notice $nick Kicked and banned all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;kickbans a nick/hostmask in the channel, syntax: KICKBAN <nick|hostmask>
elseif (%com == kickban) || (%com == kb) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($1 == $me) || ($1 iswm $address($me,2)) {
.notice $nick You cannot kickban the channel service bot. | halt
}
if ($protection(%chan) == 2) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban %chan $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 0) {
if (*!*@* iswm $1) {
ban %chan $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;permanently bans a hostmask/nick from a channel, sytax: ADDBAN <nick|hostmask>
elseif (%com == addban) || (%com == permban) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($1 == $me) || ($1 iswm $address($me,2)) {
.notice $nick You cannot kickban the channel service bot. | halt
}
if ($protection(%chan) == 2) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $1 $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $1 $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 0) {
if (*!*@* iswm $1) {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $1 $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deletes a ban from the banlist, syntax: DELBAN <hostmask>
elseif (%com == delban) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
else {
$unbannick($nick,%chan,$1).delban
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;unbans all hostmasks in the channel, syntax: UNBANALL
elseif (%com == unbanall) || (%com == uba) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($ibl(%chan,0) == 0) {
.notice $nick No channel bans found on $+ %chan $+ .
}
else {
var %i = 1, %bannedusers, %banCount = $ibl(%chan,0)
while (%i <= %banCount) {
%bannedusers = %bannedusers $ibl(%chan,%i)
if ($modespl // %i) || (%i == %banCount) {
mode %chan - $+ $str(b,$numtok(%bannedusers,32)) %bannedusers
unset %bannedusers
}
inc %i
}
.notice $nick Removed all channel bans from $+ %chan $+ .
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;unbans a user from the channel, syntax: UNBANME
elseif (%com == unbanme) || (%com == ubm) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
$unbannick($nick,%chan)
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;unbans a nick/hostmask from the channel, syntax: UNBAN <nick|hostmask>
elseif (%com == unban) || (%com == ub) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (nick|mask) | halt
}
else {
$unbannick($nick,%chan,$1)
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;timebans a nick/hostmask from a channel, syntax: TIMEBAN <duration> <nick|hostmask>
elseif (%com == timeban) || (%com == tb) || (%com == addtimedban) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($1 == $me) || ($1 iswm $address($me,2)) {
.notice $nick You cannot kickban the channel service bot. | halt
}
if ($protection(%chan) == 2) {
if ($1 ison %chan) {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -ku $+ $timeduration($2) %chan $1 2 $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -u $+ $timeduration($2) %chan $1 2
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
inc %i
}
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if ($1 ison %chan) {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -ku $+ $timeduration($2) %chan $1 2 $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -u $+ $timeduration($2) %chan $1 2
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
inc %i
}
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
}
}
}
if ($protection(%chan) == 0) {
if ($1 ison %chan) {
ban -ku $+ $timeduration($2) %chan $1 2 $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
}
else {
ban -u $+ $timeduration($2) %chan $1 2
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
inc %i
}
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all timbans/addbans from the channel, syntax: BLIST
elseif (%com == blist) || (%com == shitlist) || (%com == bans) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
.notice $nick %chan bans: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan $+ blist,*).totalnumber $+ )
if ($ini(" $+ $scriptdirchannels.ini",%chan $+ blist,0) == 0) {
.notice $nick None | halt
}
var %gettokctime1 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),1,32)
var %gettokctime2 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),2,32)
var %gettokbanreason = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),3-,32)
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",%chan $+ blist,0)) {
var %gettokctime1 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),1,32)
var %gettokctime2 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),2,32)
var %gettokbanreason = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),3-,32)
.timerbannotice $+ $ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i) 1 1 .notice $nick Mask: $+ $ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i) $+ Timeleft: $+ $iif(%gettokctime1 = $calc(%gettokctime2 - 1),None $+ $chr(44) permanently banned.,$duration($calc((%gettokctime1 + %gettokctime2) - $ctime)))) $+ Reason: $+ %gettokbanreason $+
inc %i
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;check your lag with the bot, syntax: PING
elseif (ping* iswm %com) {
if ($prop == inpm) {
set %pingtime $ticks
ctcp $nick ping
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) == 1) {
set %pingtime $ticks
ctcp $nick ping
}
elseif ($toys(%chan) == 2) {
set %pingtime $ticks
set %pingtime.chan %chan
ctcp $nick ping
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;have the bot say something, syntax SAY <test>
elseif (%com == say) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (text) | halt
}
else {
msg %chan $1-
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot emote something, syntax EMOTE <test>
elseif (%com == emote) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (text) | halt
}
else {
describe %chan $1-
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;sends a raw message to the server, syntax: RAW <raw-line>
elseif (%com == raw) || (%com == dump) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (raw line) | halt
}
elseif ($1 == run) || ($1 == format) {
.notice $nick Sorry, that command must be done manually. (Security Feature) | halt
}
else {
.raw $eval($1-,2)
.notice $nick Raw line sent.
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot join a channel, syntax: JOIN <channel>
elseif (%com == join) || (%com == j) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (channel) | halt
}
elseif ($me ison $1) {
.notice $nick I am already in $+ $1 $+ . | halt
}
else {
if ($left($1,1) == $chr(35)) {
join $1
.notice $nick I have joined $+ $1 $+ .
}
else {
.notice $nick You must provide a valid channel name.
}
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot part a channel, syntax: PART <channel>
elseif (%com == part) || (%com == p) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (channel) | halt
}
elseif ($me !ison $1) {
.notice $nick $+ $me $+ does not seem to be on $+ $1 $+ . | halt
}
else {
if ($left($1,1) == $chr(35)) {
part $1 $iif($2 == $null,Part requested by $nick $+ .,$2-)
.notice $nick I have parted $+ $1 $+ .
}
else {
.notice $nick You must provide a valid channel name.
}
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot part all channels, syntax: PARTALL
elseif (%com == partall) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
partall $iif($1 == $null,Part requested by $nick $+ .,$1-)
.notice $nick I have parted all channels.
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot disconnect/quit, syntax: QUIT [quit-message]
elseif (%com == quit) || (%com == disconnect) || (%com == shutdown) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
.notice $nick $+ $me $+ will now quit.
quit $iif($1 == $null,Quit requested by $nick $+ .,$1-)
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot restart, syntax: RESTART [quit-message]
elseif (%com == restart) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %server = $server
.notice $nick $+ $me $+ will now restart.
.timerquit 1 1 quit [ $iif($1 == $null,Restart requested by $nick $+ .,$1-) ]
.timerserver 1 1 server %server
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot gag/ignore a hostmask, syntax: GAG <nick|hostmask>
elseif (%com == gag) || (%com == ignore) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (hostmask|nick duration) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (duration) | halt
}
else {
ignore -u $+ $timeduration($2) $1 2
.notice $nick I have added $+ $1 $+ to my gag list.
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot ungag/unignore a hostmask, syntax: UNGAG <nick|hostmask>
elseif (%com == ungag) || (%com == unignore) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (hostmask|nick) | halt
}
else {
var %i = 1
while (%i <= $ignore(0)) {
if ($1 iswm $ignore(%i)) {
if ($address($1,2) != $null) {
ignore -r $1 2
.notice $nick I have removed $+ $1 $+ from my gag list. | halt
}
else {
ignore -r $ignore(%i)
.notice $nick I have removed $+ $1 $+ from my gag list. | halt
}
}
else {
.notice $nick Sorry, $+ $1 $+ is not on my gag list. | halt
}
inc %i
}
else {
.notice $nick Sorry, no gags were found.
}
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;lists all gags/ignores on the bot, syntax: GAGLIST
elseif (%com == gaglist) || (%com == gags) || (%com == ignorelist) || (%com == ignores) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($ignore(0) == 0) {
.notice $nick Sorry, no gags were found. | halt
}
.notice $nick gags: ( $+ $ignore(0) $+ )
var %i = 1
while (%i <= $ignore(0)) {
.timerignorenotice $+ %i 1 %i .notice $nick $ignore(%i) Timeleft: $duration($ignore(%i).secs)
inc %i
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;add a command to the perform list, syntax: ADDPERFORM command
elseif (%com == addperform) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (command) | halt
}
var %checkperform = 1
while (%checkperform <= $lines(" $+ $scriptdirbotperform.txt")) {
if ($read(" $+ $scriptdirbotperform.txt",w,$1-%checkperform) != $null) {
.notice $nick That command is already in the perform list. | halt
}
inc %checkperform
}
write " $+ $scriptdirbotperform.txt" $1-
.notice $nick Added new command to perform list.
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;delete a command to the perform list, syntax: DELPERFORM command
elseif (%com == delperform) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (line-number or command) | halt
}
if ($1 isnum) {
if ($read(" $+ $scriptdirbotperform.txt",$1) != $null) {
write -dl $+ $1 " $+ $scriptdirbotperform.txt"
.notice $nick Deleted command number $1 from the perform list.
}
else {
.notice $nick That line number does not exist.
}
}
else {
var %checkperform = 1
while (%checkperform <= $lines(" $+ $scriptdirbotperform.txt")) {
if (!$read(" $+ $scriptdirbotperform.txt",w,$1-,%checkperform)) {
.notice $nick That command is not in the perform list. | halt
}
inc %checkperform
}
write -ds $+ "$1-" " $+ $scriptdirbotperform.txt"
.notice $nick Deleted a command from the perform list.
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;check all the commands in the perform list, syntax: PERFORMLIST
elseif (%com == performlist) || (%com == performs) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($lines(" $+ $scriptdirbotperform.txt") == 0) {
.notice $nick You do not have any commands in your perform list. | halt
}
.notice $nick perform list: ( $+ $lines(" $+ $scriptdirbotperform.txt") $+ )
var %performlist = 1
while (%performlist <= $lines(" $+ $scriptdirbotperform.txt")) {
.timerperformlist $+ %performlist 1 $calc(%performlist + 1) .notice $nick Command %performlist $+ : $read(" $+ $scriptdirbotperform.txt",%performlist)
inc %performlist
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;adds a quote to the channel database, syntaax: ADDQUOTE <quote>
elseif (%com == addquote) || (%com == quoteadd) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (quote) | halt
}
write " $+ $scriptdir $+ %chan $+ quote.txt" [ $+ $nick $+ ]: $1-
.notice $nick You have stored your $ord($lines(" $+ $scriptdir $+ %chan $+ quote.txt")) quote.
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deletes a quote to the channel database, syntaax: DELQUOTE <quote-number|all>
elseif (%com == delquote) || (%com == quotedel) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if ($lines(" $+ $scriptdir $+ %chan $+ quote.txt") == 0) {
.notice $nick There are no quotes in the database. | halt
}
elseif (!$1) {
.notice $nick $+ %com $+ requires more parameters. (quote-number) (There are $lines(" $+ $scriptdir $+ %chan $+ quote.txt") quotes in the database.) | halt
}
elseif ($1 == all) {
if ($2 == CONFIRM) {
.notice $nick Deleted $lines(" $+ $scriptdir $+ %chan $+ quote.txt") quotes from the database.
remove " $+ $scriptdir $+ %chan $+ quote.txt"
}
else {
.notice $nick To confirm this deletion, you must append 'CONFIRM' to the end of your command.
}
}
elseif ($1 isnum) && ($read(" $+ $scriptdir $+ %chan $+ quote.txt",$1) != $null) {
write -dl $+ $1 " $+ $scriptdir $+ %chan $+ quote.txt"
.notice $nick You have deleted the $ord($1) quote from the database. There are $lines(" $+ $scriptdir $+ %chan $+ quote.txt") quotes left.
}
else {
.notice $nick $+ $1 $+ is an invalid number.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sais a quote from the channel database, syntaax: SAYQUOTE [quote-number]
elseif (%com == sayquote) || (%com == quotesay) || (%com == quote) || (%com == q) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if ($lines(" $+ $scriptdir $+ %chan $+ quote.txt") == 0) {
.notice $nick There are no quotes in the database. | halt
}
elseif (!$1) {
var %quote = $read(" $+ $scriptdir $+ %chan $+ quote.txt")
var %quote.num = $quotesearch(%chan,%quote).sayquote
$iif($toys(%chan) == 1,.notice $nick ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote,msg %chan $+ $nick $+ : ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote)
}
elseif ($1 isnum) && ($read(%chan $+ quote.txt,$1) != $null) {
var %quote = $read(" $+ $scriptdir $+ %chan $+ quote.txt",$1)
var %quote.num = $quotesearch(%chan,%quote).sayquote
$iif($toys(%chan) == 1,.notice $nick ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote,msg %chan $+ $nick $+ : ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote)
}
else {
.notice $nick $+ $1 $+ is an invalid number.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;searches a quote by author/string, syntax: SEARCHQUOTE <author|string>
elseif (%com == searchquote) || (%com == quotesearch) || (%com == qsearch) || (%com == squote) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if ($lines(" $+ $scriptdir $+ %chan $+ quote.txt") == 0) {
.notice $nick There are no quotes in the database. | halt
}
elseif (!$1) {
.notice $nick $+ %com $+ requires more parametes. (author|string)
}
else {
$iif($toys(%chan) == 1,.notice $nick $quotesearch(%chan,$1-),msg %chan $+ $nick $+ : $quotesearch(%chan,$1-))
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;starts a vote, syntax: VOTE <question>
elseif (%com == vote) || (%com == startvote) || (%com == votestart) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (question) | halt
}
set $+(%,%chan,question) $1-
set $+(%,%chan,enablevote) 1
set $+(%,%chan,yes) 0
set $+(%,%chan,no) 0
msg $chan Voting has been enabled for: [ $+ [ % [ $+ [ %chan $+ question ] ] ] $+ ] - Use voteyes or voteno to vote. (You have one minute to vote)
.timer $+ %chan $+ results 1 60 voteresults %chan
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;votes yes if channel has a vote going on, syntax: VOTEYES
elseif (%com == voteyes) || (%com == yesvote) {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (% [ $+ [ %chan $+ enablevote ] ] == 1) {
if ($read(voters $+ %chan $+ .txt,w,$address($nick,3)) == $null) {
write voters $+ %chan $+ .txt $address($nick,3)
inc % [ $+ [ %chan $+ yes ] ] 1
.notice $nick Voted yes.
}
else {
.notice $nick You already voted.
}
}
else {
.notice $nick Voting is currently disabled.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;votes yes if channel has a vote going on, syntax: VOTENO
elseif (%com == voteno) || (%com == novote) {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (% [ $+ [ %chan $+ enablevote ] ] == 1) {
if ($read(voters $+ %chan $+ .txt,w,$address($nick,3)) == $null) {
write voters $+ %chan $+ .txt $address($nick,3)
inc % [ $+ [ %chan $+ no ] ] 1
.notice $nick Voted no.
}
else {
.notice $nick You already voted.
}
}
else {
.notice $nick Voting is currently disabled.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;a little toy here that responds with 'I don't want to be part of your sick fantasies!', syntax: SEX
elseif (sex* iswm %com) || (unf* iswm %com) || (banana* iswm %com) || (boner* iswm %com) || (penis* iswm %com) {
if ($prop == inpm) {
.notice $nick I don't want to be part of your sick fantasies!
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick I don't want to be part of your sick fantasies!,msg %chan $+ $nick $+ : I don't want to be part of your sick fantasies!)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;get your current age, syntax: AGE <month> <day> <year>
elseif (%com == age) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (month day year) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (day year) | halt
}
elseif (!$3) {
.notice $nick $+ %com $+ requires more parameters. (year) | halt
}
else {
.notice $nick You are $age($1 $iif($chr(44) isin $2,$remove($2,$chr(44)),$2) $3)
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (month day year) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (day year) | halt
}
elseif (!$3) {
.notice $nick $+ %com $+ requires more parameters. (year) | halt
}
else {
$iif($toys(%chan) == 1,.notice $nick You are $age($1 $iif($chr(44) isin $2,$remove($2,$chr(44)),$2) $3),msg %chan $+ $nick $+ : You are $age($1 $iif($chr(44) isin $2,$remove($2,$chr(44)),$2) $3))
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns the current date, syntax: DATE
elseif (date* iswm %com) {
if ($prop == inpm) {
.notice $nick The date today is $+ $date(dddd mmmm dd $+ $chr(44) yyyy) $+ .
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick The date today is $+ $date(dddd mmmm dd $+ $chr(44) yyyy) $+ .,msg %chan $+ $nick $+ : The date today is $+ $date(dddd mmmm dd $+ $chr(44) yyyy) $+ .)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns the current time, syntax: TIME
elseif (time* iswm %com) {
if ($prop == inpm) {
.notice $nick The time right now is $+ $asctime(hh:nn:ss TT zzz) $+ .
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick The time right now is $+ $asctime(hh:nn:ss TT zzz) $+ .,msg %chan $+ $nick $+ : The time right now is $+ $asctime(hh:nn:ss TT zzz) $+ .)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns the answer to the calculations provided, syntax: CALC <calculations>
elseif (%com == calc) || (%com == calculator) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (numbers) | halt
}
if ($left($1,1) isnum) {
.notice $nick $1- = $calc($1-)
}
else {
.notice $nick Sorry, you can only calculate numbers.
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (numbers) | halt
}
if ($left($1,1) isnum) {
$iif($toys(%chan) == 1,.notice $nick $1- = $calc($1-),msg %chan $+ $nick $+ : $1- = $calc($1-))
}
else {
.notice $nick Sorry, you can only calculate numbers.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;ask the magic 8ball a question, syntax: 8BALL <question>
elseif (%com == 8ball) || (%com == 8) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (question) | halt
}
else {
.notice $nick $+ $nick $+ : $read("Channel Service Bot/8ball.txt"))
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (question) | halt
}
else {
$iif($toys(%chan) == 1,.notice $nick $+ $nick $+ : $read("Channel Service Bot/8ball.txt"),msg %chan $+ $nick $+ : $read("Channel Service Bot/8ball.txt"))
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;rolls the dice, syntax: DICE <number>
elseif (%com == dice) || (%com == d) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (number) | halt
}
if ($1 == 1) || ($1 !isnum) {
.notice $nick $1 is an invalid number. Please use a number greater than 1 with this command.
}
else {
.notice $nick A $r(1,$1) shows on the $1 $+ -sided die.
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (number) | halt
}
if ($1 == 1) || ($1 !isnum) {
.notice $nick $1 is an invalid number. Please use a number greater than 1 with this command.
}
else {
$iif($toys(%chan) == 1,.notice $nick A $r(1,$1) shows on the $1 $+ -sided die.,msg %chan $+ $nick $+ : A $r(1,$1) shows on the $1 $+ -sided die.)
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;just a little toy here, syntax: CC
elseif (cc* iswm %com) || (crazy*cafcasi iswm %com) {
if ($prop == inpm) {
.notice $nick Watcha want from CC?
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick Watcha want from CC?,msg %chan $+ $nick $+ : Watcha want from CC?)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns current version of the bot, syntax: VERSION
elseif (version* iswm %com) || (credit* iswm %com) {
if ($prop == inpm) {
.notice $nick Channel Service Bot: Version $+ %version $+ . Built by: CrAzY_CaFcAsi on %built.on $+ .
}
else {
.notice $nick Channel Service Bot: Version $+ %version $+ . Built by: CrAzY_CaFcAsi on %built.on $+ .
}
}
;translation
elseif (%com == translation) || (%com == translate) || (%com == trans) {
if ($prop == inpm) {
goto start
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) == 0) {
.notice $nick Toys are disabled in $+ %chan $+ . | halt
}
:start
if (%trans.inuse == 1) {
.notice $nick Sorry, the translation script is currently in use. | halt
}
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (from-language and to-language and text) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (to-language and text) | halt
}
elseif (!$3) {
.notice $nick $+ %com $+ requires more parameters. (text) | halt
}
if ($1 != $2) {
if ($1 == en) || ($1 == en) || ($+($1,_,$2) == de_fr) || ($+($2,_,$1) == fr_de) {
if ($translang($1) != $null) {
if ($translang($2) != $null) {
set %trans.inuse 1
set %trans.langs $+($lower($1),_,$lower($2))
set %trans.info $3-
if ($prop == inpm) {
goto start2
}
if ($toys(%chan) == 2) {
set %trans.msg %chan
}
if ($toys(%chan) == 1) {
:start2
set %trans.msg $nick
}
if ($sock(trans) != $null) {
sockclose trans
}
sockopen trans babelfish.altavista.com 80
}
else {
.notice $nick You must provide a valid language to translate to.
}
}
else {
.notice $nick You must provide a valid language to translate from.
}
}
else {
.notice $nick You must translate from english or to english.
}
}
else {
.notice $nick You cannot translate from $translang($1) to $translang($1) $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;help file for every command of the bot, syntax: HELP
elseif (%com == help) {
if ($1 == $null) {
.timerhelp1 -m 1 50 .notice $nick USER - User management.
.timerhelp2 1 1 .notice $nick CHANNEL - Channel management.
.timerhelp3 1 2 .notice $nick BAN MANAGEMENT - Ban management.
.timerhelp4 1 3 .notice $nick OPER - Oper commands.
.timerhelp5 1 4 .notice $nick MISC - Misc. commands.
}
elseif ($1 == user) {
.timerhelpuser1 -m 1 50 .notice $nick ACCESS ADDCOOWNER ADDMASTER ADDOP ADDPEON OP VOICE
.timerhelpuser2 1 1 .notice $nick GIVEOWNERSHIP CLVL DELUSER UP DOWN DEOP DEVOICE SUSPEND UNSUSPEND
}
elseif ($1 == access) {
.notice $nick /msg $me ACCESS <#channel> [nick|*account]
.notice $nick Reports various pieces of information about a channel user, including channel and bot access level, and the user's info line. If no nick or account is provided, $me returns your own information.
}
elseif ($1 == adduser) {
.timeradduser1 -m 1 50 .notice $nick /msg $me ADDUSER <#channel> <level> <nick|*account>
.timeradduser2 1 1 .notice $nick This command adds someone to the channel user list with the specified access level. (You may only add users to levels less than your own.)
.timeradduser3 1 2 .notice $nick The level may be one of peon, op, master, coowner or owner (only bot staff may add owners).
}
elseif ($1 == addcoowner) {
.notice $nick /msg $me ADDCOOWNER <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as a coowner.
}
elseif ($1 == addmaster) {
.notice $nick /msg $me ADDMASTER <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as a master.
}
elseif ($1 == addop) {
.notice $nick /msg $me ADDOP <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as an op.
}
elseif ($1 == addpeon) {
.notice $nick /msg $me ADDPEON <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as a peon.
}
elseif ($1 == giveownership) {
.notice $nick /msg $me GIVEOWNERSHIP <#channel> <nick|*account>
.notice $nick Transfer ownership of the channel from you to another user on the channel's userlist. You are demoted to coowner, and they are promoted to owner.
}
elseif ($1 == clvl) {
.notice $nick /msg $me CLVL <#channel> <nick|*account> <level>
.notice $nick Modifies a channel user's access level. You cannot give users access greater than or equal to your own.
}
elseif ($1 == deluser) {
.notice $nick /msg $me DELUSER <#channel> <nick|*account>
.notice $nick Deletes a user from the channel userlist.
}
elseif ($1 == delcoowner) {
.notice $nick /msg $me DELCOOWNER <#channel> <nick|*account>
.notice $nick Deletes a coowner from the channel userlist.
}
elseif ($1 == delmaster) {
.notice $nick /msg $me DELMASTER <#channel> <nick|*account>
.notice $nick Deletes a master from the channel userlist.
}
elseif ($1 == delop) {
.notice $nick /msg $me DELOP <#channel> <nick|*account>
.notice $nick Deletes an op from the channel userlist.
}
elseif ($1 == delpeon) {
.notice $nick /msg $me DELPEON <#channel> <nick|*account>
.notice $nick Deletes a peon from the channel userlist.
}
elseif ($1 == up) {
.notice $nick /msg $me UP <#channel>
.notice $nick For a peon, this will cause $+ $me $+ to voice the user executing the command. For anyone of level op on higher on the userlist, this will cause $+ $me $+ to op the user executing the command.
}
elseif ($1 == down) {
.notice $nick /msg $me DOWN <#channel>
.notice $nick This command will devoice/deop you in the selected channel.
}
elseif ($1 == op) {
.notice $nick /msg $me OP <#channel> <nick> [nick]...
.notice $nick This command makes $me op the specified user[s].
}
elseif ($1 == deop) {
.notice $nick /msg $me DEOP <#channel> <nick> [nick]...
.notice $nick This command makes $me deop the specified user[s].
}
elseif ($1 == voice) || ($1 == v) {
.notice $nick /msg $me VOICE <#channel> <nick> [nick]...
.notice $nick This command makes $me voice the specified user[s].
}
elseif ($1 == devoice) || ($1 == dv) {
.notice $nick /msg $me DEVOICE <#channel> <nick> [nick]...
.notice $nick This command makes $me devoice the specified user[s].
}
elseif ($1 == suspend) {
.notice $nick /msg $me SUSPEND <#channel> <nick> <duration>
.notice $nick This disables the target's access to the channel. That access can be restored using the unsuspend command.
}
elseif ($1 == unsuspend) {
.notice $nick /msg $me UNSUSPEND <#channel> <nick>
.notice $nick This restores the target's access to the channel (after it has been suspended).
}
elseif ($1 == channel) {
.notice $nick USERS WLIST CLIST MLIST OLIST PLIST INVITEME
.notice $nick TOPIC MODE INVITE SET SETINFO INFO
}
elseif ($1 == users) {
.notice $nick /msg ChanServ USERS <#channel>
.notice $nick Displays the userlist for the specified channel.
}
elseif ($1 == wlist) || (%1 == owners) {
.notice $nick /msg ChanServ WLIST <#channel>
.notice $nick This command lists all users of level owner on a channel's userlist.
}
elseif ($1 == clist) || (%1 == coowners) {
.notice $nick /msg ChanServ CLIST <#channel>
.notice $nick This command lists all users of level coowner on a channel's userlist.
}
elseif ($1 == mlist) || (%1 == masters) {
.notice $nick /msg ChanServ MLIST <#channel>
.notice $nick This command lists all users of level master on a channel's userlist.
}
elseif ($1 == olist) || ($1 == ops) {
.notice $nick /msg ChanServ OLIST <#channel>
.notice $nick This command lists all users of level op on a channel's userlist.
}
elseif ($1 == plist) || ($1 == peons) {
.notice $nick /msg ChanServ PLIST <#channel>
.notice $nick This command lists all users of level peon on a channel's userlist.
}
elseif ($1 == topic) {
.notice $nick /msg $me TOPIC <#channel> [topic]
.notice $nick Sets the current topic for the specified channel. If no topic is specified, then sets the current topic to the default topic.
}
elseif ($1 == mode) {
.notice $nick /msg $me MODE <#channel> [mode]
.notice $nick Sets the current modes for the specified channel. If no mode is specified, then sets the current modes to the default modes.
}
elseif ($1 == invite) {
.notice $nick /msg $me INVITE <#channel> <nick>
.notice $nick Invite a user to the specified channel.
}
elseif ($1 == inviteme) {
.notice $nick /msg $me INVITEME <#channel>
.notice $nick $+ $me $+ will invite you to the specified channel. You must have access to the channel.
}
elseif ($1 == set) {
if ($2 == $null) {
.timerset1 -m 1 50 .notice $nick /msg $me SET <#channel> [<parameter> [setting]]
.timerset2 1 1 .notice $nick This command will set various channel options. With no arguments, it will show the current values of all channel options.
.timerset3 1 2 .notice $nick DEFAULTTOPIC ENFTOPIC GREETING USERGREETING SETTERS VOICE PROTECT TOYS MODES SPAMPROTECT SPAMPUNISH DYNLIMIT NODELETE TRIGGER
}
elseif ($2 == dynlimit) {
.notice $nick /msg $me SET <#channel> DYNLIMIT <value>
.notice $nick Adjusts user limit (+l channel mode) to prevent join floods.
}
elseif ($2 == topic) || ($2 == defaulttopic) {
.notice $nick /msg $me SET <#channel> $upper($2) <new default topic>
.notice $nick This changes the default topic for the channel. ChanServ will set the IRC topic to this value when the topic command is used with no arguments.
}
elseif ($2 == enftopic) {
.timerenftopic1 -m 1 50 .notice $nick /msg $me SET <#channel> ENFTOPIC <value>
.timerenftopic2 1 1 .notice $nick This setting restricts the minimum access someone must have to change the channel topic. Valid settings are:
.timerenftopic3 1 2 .notice $nick 0 Anyone may change the topic
.timerenftopic4 1 3 .notice $nick 1 Ops and above may change the topic
.timerenftopic5 1 4 .notice $nick 2 Masters and above may change the topic
.timerenftopic6 1 5 .notice $nick 3 Coowners and above may change the topic
.timerenftopic7 1 6 .notice $nick 4 Only owners may change the topic
.timerenftopic8 1 7 .notice $nick 5 No one may change the topic
}
elseif ($2 == greeting) {
.notice $nick /msg $me SET <#channel> $upper($2) <new greeting>
.notice $nick A greeting message for visitors to the channel.
}
elseif ($2 == usergreeting) {
.notice $nick /msg $me SET <#channel> $upper($2) <new usergreeting>
.notice $nick A greeting message for users on the channel's userlist.
}
elseif ($2 == setters) {
.timersetsetters1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetsetters2 1 1 .notice $nick This setting restricts the protection that ChanServ enforces. Valid settings are:
.timersetsetters3 1 2 .notice $nick 0 Masters and above may change settings.
.timersetsetters4 1 3 .notice $nick 1 Coowners and above may change settings.
.timersetsetters5 1 4 .notice $nick 2 Owners may change settings.
}
elseif ($2 == voice) {
.timersetvoice1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetvoice2 1 1 .notice $nick Toggles whether $+ $me $+ will autovoice people on join.
.timersetvoice3 1 2 .notice $nick 0 Disables autovoice on join.
.timersetvoice4 1 3 .notice $nick 1 Enables autovoice on join.
}
elseif ($2 == toys) {
.timersettoys1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersettoys2 1 1 .notice $nick Toggles whether toys such as 8BALL will be enabled in the channel.
.timersettoys3 1 2 .notice $nick 0 Toys are completely disabled.
.timersettoys4 1 3 .notice $nick 1 Toys will only reply privately.
.timersettoys5 1 4 .notice $nick 2 Toys will reply publicly.
}
elseif ($2 == protect) {
.timersetprotect1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetprotect2 1 1 .notice $nick The protection level $+ $me $+ provides.
.timersetprotect3 1 2 .notice $nick 0 No users will be protected.
.timersetprotect4 1 3 .notice $nick 1 Users will be protected from those of lower access.
.timersetprotect5 1 4 .notice $nick 2 Users will be protected from those of equal or lower access.
}
elseif ($2 == modes) {
.notice $nick /msg $me SET <#channel> $upper($2) <new modes>
.notice $nick Sets the channel's default modes.
}
elseif ($2 == spam) || ($2 == spamprotect) {
.notice $nick /msg $me SET <#channel> $upper($2) <number-of-lines> <duration>
.notice $nick $+ $me $+ will punish all spammers that spam number-of-lines in the duration provided.
}
elseif ($2 == spampunish) || ($2 == punishspam) {
.notice $nick /msg $me SET <#channel> $upper($2) <punishment> [duration]
.notice $nick $+ $me $+ will punish all spammers that spam number-of-lines in the certain duration. (This will not work if spamprotect is disabled.) Punishments consist of kick, ban, kickban, or timeban.
}
elseif ($2 == nodelete) {
.timersetnodelete1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetnodelete2 1 1 .notice $nick Prevents channel deletion.
.timersetnodelete3 1 2 .notice $nick 0 Doesn't prevent channel deletion.
.timersetnodelete4 1 3 .notice $nick 1 Prevents channel deletion.
}
elseif ($2 == trigger) {
.notice $nick /msg $me SET $upper($2) <new trigger>
.notice $nick Sets the global channel trigger.
}
else {
.notice $nick No help on that topic.
}
}
elseif ($1 == setinfo) {
.notice $nick /msg $me SETINFO <#channel> <info>
.notice $nick This command will set a user defined information message to be displayed when you join the channel. By setting the message to '*', you will clear your message.
}
elseif ($1 == info) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick This command responds with various pieces of information about a channel's users, status, and registration.
}
elseif ($1 == ban) && ($2 == management) {
.notice $nick KICK BAN KICKBAN BANS TIMEBAN
.notice $nick UNBAN DELBAN UNBANME UNBANALL
}
elseif ($1 == kick) || ($1 == k) {
.notice $nick /msg $me $upper($1) <#channel> <nick> [reason]
.notice $nick Kicks the user matching the given nick with the specified reason. If no reason is provided, a default will be used.
}
elseif ($1 == ban) || ($1 == b) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick>
.notice $nick This command will temporarily add a ban for the user specified as the parameter. Masks are to be supplied in the format <Nick>!<Ident>@<Host> and usually contain wildcards. If a nick is specified, a mask is automatically generated (though not completely foolproof). This ban is removed either by removing it from the channel ban list using any irc client, or sending the UNBAN or UNBANALL commands.
}
elseif ($1 == kickban) || ($1 == kb) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick> [reason]
.notice $nick Kicks and bans with the specified reason any users with a matching nick or hostmask. If no reason is provided, a default one will be used.
}
elseif ($1 == bans) || ($1 == blist) || ($1 == shitlist) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick This command lists all permanent and timed bans in the channel.
}
elseif ($1 == timeban) || ($1 == tb) || ($1 == addtimedban) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick> <duration> [reason]
.notice $nick Adds an automatically expiring ban to the channel ban list. This command behaves in the exact same fashion as ADDBAN with the exception that the bans are automatically removed after the user-supplied duration. Timed bans can be removed with the DELBAN command, as with permanent bans. (See "help durations")
}
elseif ($1 == unban) || ($1 == ub) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick>
.notice $nick Unbans the specified nick or hostmask. If a nick is given, $+ $me $+ determines what hostmask to unban.
}
elseif ($1 == unbanme) || ($1 == ubm) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Unbans your hostmask from the specified channel.
}
elseif ($1 == unbanall) || ($1 == uba) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Clears the specified channel's banlist.
}
elseif ($1 == delban) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick>
.notice $nick Deletes a ban from the channel ban list. This command works for both permanent and timed bans alike.
}
elseif ($1 == durations) {
.notice $nick [<n>y][<n>M][<n>w][<n>d][<n>h][<n>m][<n>[s]]
.notice $nick The valid duration letters are y (for year, or 360 days), M (for month, or 30 days), w (for week, or 7 days), d (for day, or 24 hours), h (for hour, or 60 minutes), m (for minute, or 60 seconds), and s (for second).
}
elseif ($1 == oper) {
.timerhelpoper1 -m 1 50 .notice $nick SAY EMOTE GOD REGCHAN UNREGCHAN KBA ADDOWNER MOVE DELOWNER
.timerhelpoper2 1 1 .notice $nick OPALL DEOPALL VOICEALL DEVOICEALL RAW QUIT RENAME JOIN PART UNAUTH
.timerhelpoper3 1 2 .notice $nick PARTALL GAG UNGAG GAGLIST RESTART ADDPERFORM DELPERFORM PERFORMLIST
}
elseif ($1 == say) {
.notice $nick /msg $me SAY <#channel|nick> <text>
.notice $nick Makes $me send a message to the specified channel or nick.
}
elseif ($1 == emote) {
.notice $nick /msg $me EMOTE <#channel|nick> <text>
.notice $nick Makes $me send a CTCP ACTION message to the specified channel or nick.
}
elseif ($1 == god) || ($1 == h4x) {
.notice $nick /msg $me $upper($1) [on|off]
.notice $nick Toggles security override, which grants you complete access to all channels. Please use carefully.
}
elseif ($1 == regchan) || ($1 == registerchannel) || ($1 == registerchan) || ($1 == regchannel) {
.notice $nick /msg $me $upper($1) <#channel> <nick|*account>
.notice $nick Registers a channel with $+ $me $+ , automatically granting owner access to the specified user.
}
elseif ($1 == unregchan) || ($1 == unregisterchannel) || ($1 == unregisterchan) || ($1 == unregchannel) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Unregisters a channel that is registered with $+ $me $+ . IMPORTANT: Once the channel is unregistered, the userlist cannot be recovered. If you are not bot staff, you must add CONFIRM to the end of your line to confirm channel unregistration.
}
elseif ($1 == move) {
.notice $nick /msg $me MOVE <#channel> <destination>
.notice $nick Transfers a channel's registration to a different channel along with the settings and user/ban lists.
}
elseif ($1 == rename) {
.notice $nick /msg $me RENAME <nick|*old-account> <[*]new-account>
.notice $nick Renames an account.
}
elseif ($1 == kickbanall) || ($1 == kba) || ($1 == takeover) {
.notice $nick /msg $me $upper($1) <#channel> [reason]
.notice $nick Kick and bans all members of the specified channel except for the user issuing the command.
}
elseif ($1 == addowner) {
.notice $nick /msg $me ADDOWNER <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as an owner.
}
elseif ($1 == delowner) {
.notice $nick /msg $me DELOWNER <#channel> <nick|*account>
.notice $nick Deletes an owner from the channel userlist.
}
elseif ($1 == opall) || ($1 == oall) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Ops all members of the specified channel.
}
elseif ($1 == deopall) {
.notice $nick /msg $me DEOPALL <#channel>
.notice $nick Deops all members of the specified channel.
}
elseif ($1 == voiceall) || ($1 == va) || ($1 == vall) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Voices all members of the specified channel.
}
elseif ($1 == devoiceall) || ($1 == dva) || ($1 == dvall) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Devoices all members of the specified channel.
}
elseif ($1 == raw) || ($1 == dump) {
.notice $nick /msg $me $upper($1) <raw line>
.notice $nick Dumps a raw server message into the stream.
}
elseif ($1 == quit) || ($1 == disconnect) || ($1 == shutdown) {
.notice $nick /msg $me $upper($1) [reason]
.notice $nick Makes $+ $me $+ quit.
}
elseif ($1 == join) || ($1 == j) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Makes $+ $me $+ join the specified channel.
}
elseif ($1 == part) || ($1 == p) {
.notice $nick /msg $me $upper($1) <#channel> [reason]
.notice $nick Makes $+ $me $+ part the specified channel.
}
elseif ($1 == partall) {
.notice $nick /msg $me PARTALL [reason]
.notice $nick Makes $+ $me $+ part all channels.
}
elseif ($1 == unauth) || ($1 == deauth) {
.notice $nick /msg $me $upper($1) [nick]
.notice $nick Unauths yourself from $+ $me $+ . You must add CONFIRM to the end of your line to confirm unauthorization. If 'nick' is specified, 'nick' will be unauthed from $+ $me $+ .
}
elseif ($1 == gag) || ($1 == ignore) {
.notice $nick /msg $me $upper($1) <hostmask> <duration>
.notice $nick Gags all users matching the specified hostmask and the duration supplied.
}
elseif ($1 == ungag) || ($1 == unignore) {
.notice $nick /msg $me $upper($1) <hostmask>
.notice $nick Ungags the hostmask specified.
}
elseif ($1 == gaglist) || ($1 == ignorelist) || ($1 == gags) || ($1 == ignores) {
.notice $nick /msg $me $upper($1)
.notice $nick Shows all current gags. This includes hostmasks and duration.
}
elseif ($1 == addperform) {
.notice $nick /msg $me $upper($1) <command>
.notice $nick Adds a command to the perform list.
}
elseif ($1 == delperform) {
.notice $nick /msg $me $upper($1) <number|command>
.notice $nick Deletes a command from the perform list. If a number is specified instead of a command, will delete the number from the perform list.
}
elseif ($1 == performlist) || ($1 == performs) {
.notice $nick /msg $me $upper($1)
.notice $nick Shows all current commands in the perform list.
}
elseif ($1 == restart) {
.notice $nick /msg $me RESTART [reason]
.notice $nick Makes $+ $me $+ restart.
}
elseif ($1 == misc) {
.notice $nick TIME DATE 8BALL VERSION IRCOPS STAFF ADDQUOTE DELQUOTE STARTVOTE VOTEYES
.notice $nick PING SEX AGE CALC HELPERS DICE SAYQUOTE SEARCHQUOTE VOTENO TRANSLATION
}
elseif ($1 == addquote) || ($1 == quoteadd) {
.notice $nick /msg $me $upper($1) <channel> <quote>
.notice $nick Adds a quote to the channel database.
}
elseif ($1 == delquote) || ($1 == quotedel) {
.notice $nick /msg $me $upper($1) <channel> <quote-number|all>
.notice $nick Deletes a quote from the channel database. If all is given instead of a quote-number, you must append 'CONFIRM' to the end of your line to confirm the quote channel database deletion.
}
elseif ($1 == sayquote) || ($1 == quotesay) || ($1 == quote) || ($1 == q) {
.notice $nick /msg $me $upper($1) <channel> [quote-number]
.notice $nick Will return the quote for the specified number. If no quote number is given, will return a random quote.
}
elseif ($1 == searchquote) || ($1 == quotesearch) || ($1 == qsearch) || ($1 == searchq) {
.notice $nick /msg $me $upper($1) <channel> <author|string>
.notice $nick Will search for the specified string or author for any quote in the channel database.
}
elseif ($1 == time) {
.notice $nick /msg $me TIME
.notice $nick Tells you the current time with Greenwich Mean Time.
}
elseif ($1 == date) {
.notice $nick /msg $me DATE
.notice $nick Tells you the current date.
}
elseif ($1 == 8ball) || ($1 == 8) {
.notice $nick /msg $me $upper($1) <question>
.notice $nick Ask the magic 8ball a question.
}
elseif ($1 == dice) || ($1 == d) {
.notice $nick /msg $me $upper($1) <number>
.notice $nick Rolls a dice with the specified number and returns a random number from one to the numbe provided.
}
elseif ($1 == version) || ($1 == credits) {
.notice $nick /msg $me $upper($1)
.notice $nick Shows the current version of $+ $me $+ and the creator of $+ $me $+ .
}
elseif ($1 == ping) {
.notice $nick /msg $me PING
.notice $nick Shows your current lag status with $+ $me $+ .
}
elseif ($1 == sex) || ($1 == unf) || ($1 == banana) || ($1 == boner) || ($1 == penis) {
.notice $nick I'm sorry, but I can't give you help regarding your sex life. But if you're so desperate you'll ask an IRC service bot for advice, you need therapy.
}
elseif ($1 == age) {
.notice $nick /msg $me AGE <month> <day> <year>
.notice $nick Tells you your current age with the info supplied.
}
elseif ($1 == calculator) || ($1 == calc) {
.notice $nick /msg $me $upper($1) <numbers>
.notice $nick Calculates the given numbers.
}
elseif ($1 == ircops) || ($1 == opers) {
.notice $nick /msg $me $upper($1)
.notice $nick Lists all the IRC operators of $+ $me $+ .
}
elseif ($1 == helpers) {
.notice $nick /msg $me HELPERS
.notice $nick Lists all the helpers of $+ $me $+ .
}
elseif ($1 == staff) {
.notice $nick /msg $me STAFF
.notice $nick Lists all the IRC operators and helpers of $+ $me $+ .
}
elseif ($1 == register) || ($1 == reg) {
.notice $nick /msg $me $upper($1) <account> <pass>
.notice $nick Registers a specified account with $+ $me $+ , adding your current hostmask to your new account. You will be required to know the password you specify with $+ $1 $+ in order to be able to use auth to authenticate to your account.
}
elseif ($1 == unregister) || ($1 == unreg) {
.notice $nick /msg $me $upper($1) <pass>
.notice $nick Unregisters the account you are authenticated to.
}
elseif ($1 == vote) || ($1 == startvote) || ($1 == votestart) {
.notice $nick /msg $me $upper($1) <#channel> <question>
.notice $nick Starts a vote with the specified question. You may use VOTEYES or VOTENO to vote.
}
elseif ($1 == voteyes) || ($1 == yesvote) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Votes yes if the specified channel has a current vote going.
}
elseif ($1 == voteno) || ($1 == novote) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Votes no if the specified channel has a current vote going.
}
elseif ($1 == auth) || ($1 == authenticate) {
.notice $nick /msg $me $upper($1) <account> <pass>
.notice $nick Authenticates yourself with $+ $me $+ to the specified account. You must use auth before you have any access to $+ $me $+ , including channels that are registered with $+ $me $+ .
}
elseif ($1 == pass) {
.notice $nick /msg $me PASS <oldpass> <newpass>
.notice $nick Changes your $+ $me $+ password.
}
elseif ($1 == ounregister) || ($1 == oureg) {
.notice $nick /msg $me $upper($1) <nick|*account>
.notice $nick Unregisters the specified account.
}
elseif ($1 == allowauth) || ($1 == aa) {
.notice $nick /msg $me $upper($1) <nick> <account>
.notice $nick Allows the specified nick to auth to the specified account. The nick has 90 seconds to auth to the account or else the hostmask gets reset to what it was before.
}
elseif ($1 == translation) || ($1 == translate) || ($1 == trans) {
.notice $nick /msg $me $upper($1) <from-languge> <to-language> <text>
.notice $nick This translates text from a certain language to another language. Languages consist of English (en), French (fr), German (de), Italian (it), Portuguese (pt), Spanish (es), Chinese (zh), Japanese (ja), and Korean (ko).
}
else {
.notice $nick No help on that topic.
}
}
else {
.notice $nick $+ %com $+ is an unknown command.
}
}
;;;;;;;;sockets for translation
on *:sockopen:trans:{
sockwrite -n $sockname GET /babelfish/tr?doit=done&urltext= $+ $replace([ %trans.info ],$chr(32),+) $+ &lp= $+ %trans.langs $+ &Info=basic HTTP/1.1
sockwrite -n $sockname Host: babelfish.altavista.com
sockwrite -n $sockname User-Agent: Translation Script by CC.
sockwrite -n $sockname
}
on *:sockread:trans:{
sockread %temp
if (10px isin %temp) {
$iif($chr(35) isin %trans.msg,msg %trans.msg Translation: $gettok($gettok([ %temp ],5,62),1,60),.notice %trans.msg Translation: $gettok($gettok([ %temp ],5,62),1,60))
sockclose trans
unset %temp, %trans.*
halt
}
elseif (</body> isin %temp) {
$iif($chr(35) isin %trans.msg,msg %trans.msg I could not find a translation for ' $+ %trans.info $+ ',.notice %trans.msg I could not find a translation for $+ %trans.info $+ ))
sockclose trans
unset %temp
unset %trans.*
}
}
;;;;;;;;USE: $age(month day year)
alias age {
return $calc($ctime - $ctime($3 $1 $2)) seconds old. ( $+ $calc(($ctime - $ctime($3 $1 $2)) /60 /60 /24 /365) years $+ )
}
;;;;;;;;USE: PING
on *:ctcpreply:*ping*: {
if (%pingtime.chan != $null) {
msg %pingtime.chan $+ $nick $+ : Pong! ( $+ $calc($calc($ticks - %pingtime) / 1000) $+ s)
unset %pingtime.chan
}
else {
.notice $nick $+ $nick $+ : Pong! ( $+ $calc($calc($ticks - %pingtime) / 1000) $+ s)
}
}
ctcp 1:VERSION:?: {
.notice $nick Channel Service Bot: Version $+ %version $+ . Built by: CrAzY_CaFcAsi on %built.on $+ . | halt
}
;;;;;;;;USE: $account(nick)
alias Account {
return $readini(" $+ $scriptdiraccounts.ini",Nicks,$1)
}
;;;;;;;;USE: $password(nick)
alias Password {
return $readini(" $+ $scriptdiraccounts.ini",Passwords,$1)
}
;;;;;;;;USE: $authed(nick)
alias Authed {
return $readini(" $+ $scriptdiraccounts.ini",Authed,$1)
}
;;;;;;;;USE: $channels(channel)
alias channels {
return $readini(" $+ $scriptdirchannels.ini",$1,$1)
}
;;;;;;;;USE: $nodelete(channel)
alias nodelete {
return $readini(" $+ $scriptdirchannels.ini",$1,NoDelete)
}
;;;;;;;;USE: $setters(channel)
alias setters {
return $readini(" $+ $scriptdirchannels.ini",$1,Setters)
}
;;;;;;;;USE: $toys(channel)
alias toys {
return $readini(" $+ $scriptdirchannels.ini",$1,Toys)
}
;;;;;;;;USE: $protection(channel)
alias protection {
return $readini(" $+ $scriptdirchannels.ini",$1,Protect)
}
;;;;;;;;USE: $spamprotect(channel)
alias spamprotect {
return $readini(" $+ $scriptdirchannels.ini",$1,SpamProtect)
}
;;;;;;;;USE: $spampunish(channel)
alias spampunish {
return $readini(" $+ $scriptdirchannels.ini",$1,SpamPunish)
}
;;;;;;;;USE: $dynlimit(channel)
alias dynlimit {
return $readini(" $+ $scriptdirchannels.ini",$1,Dynlimit)
}
;;;;;;;;USE: chanlimit channel
alias chanlimit {
if ($calc($nick($1,0) + 7) != %dynlimit. [ $+ [ $1 ] ]) {
if ($chan($1).limit != $calc($nick($1,0) + 7)) {
mode $1 +l $calc($nick($1,0) + 7)
set %dynlimit. [ $+ [ $1 ] ] $calc($nick($1,0) + 7)
}
}
}
;;;;;;;;USE: $enftopic(channel)
alias enftopic {
if ($prop == words) {
if ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 0) {
return Anyone may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 1) {
return Ops and above may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 2) {
return Masters and above may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 3) {
return Coowners and above may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 4) {
return Only owners may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 5) {
return No one may change the topic
}
}
else {
return $readini(" $+ $scriptdirchannels.ini",$1,EnfTopic)
}
}
;;;;;;;;USE: $parse.to.ini(text)
alias parse.to.ini {
return $replace($1-,$chr(2),$chr(244),$chr(15),$chr(245),$chr(3),$chr(246),$chr(31),$chr(243),$chr(22),$chr(242))
}
;;;;;;;;USE: $parse.from.ini(text)
alias parse.from.ini {
return $replace($1-,$chr(244),$chr(2),$chr(245),$chr(15),$chr(246),$chr(3),$chr(243),$chr(31),$chr(242),$chr(22))
}
;;;;;;;;USE: $oper(nick)
alias oper {
return $readini(" $+ $scriptdiropers.ini",Opers,$account($1))
}
;;;;;;;;USE: $helper(nick)
alias helper {
return $readini(" $+ $scriptdiropers.ini",Helpers,$account($1))
}
;;;;;;;;USE: $godstatus(nick)
alias godstatus {
if ($oper($1) != $null) {
return $readini(" $+ $scriptdiropers.ini",Opers,$account($1))
}
if ($helper($1) != $null) {
return $readini(" $+ $scriptdiropers.ini",Helpers,$account($1))
}
}
;;;;;;;;USE: /addoper nick|*account
alias addoper {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
echo -a -
echo -a Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
echo -a -
}
}
else {
var %account.nick = $1
if ($authed($1) == 0) {
echo -a -
echo -a $1 must first auth with $+ $me $+ . | halt
echo -a -
}
}
if (!$1) {
echo -a -
echo -a addoper requires more parameters. (nick|*account) | halt
echo -a -
}
if ($oper(%account.nick) != $null) {
echo -a -
echo -a %account.nick is already an oper. | halt
echo -a -
}
if ($helper(%account.nick) != $null) {
echo -a -
echo -a %account.nick is already a helper. | halt
echo -a -
}
else {
writeini " $+ $scriptdiropers.ini" Opers $account(%account.nick) 1
echo -a -
echo -a Added $+ %account.nick $+ as an oper successfully. | halt
echo -a -
}
}
;;;;;;;;USE: /deloper nick|*account
alias deloper {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
echo -a Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
}
else {
var %account.nick = $1
if ($authed($1) == 0) {
echo -a -
echo -a $1 must first auth with $+ $me $+ . | halt
echo -a -
}
}
if (!$1) {
echo -a deloper requires more parameters. (nick|*account) | halt
}
if ($oper(%account.nick) == $null) {
echo -a %account.nick is not an oper. | halt
}
else {
remini " $+ $scriptdiropers.ini" Opers $account(%account.nick)
echo -a Removed $+ %account.nick $+ from an oper successfully. | halt
}
}
;;;;;;;;USE: $access(channel,nick)[.level || .host || .levelhost ]
alias access {
if ($prop == level) {
if ($authed($2) == 1) {
var %user.level = $readini(" $+ $scriptdirchannels.ini",$1,$account($2)), %access.levels = peon.op.master.coowner.owner
if ($godstatus($2) == 1) {
return 6
}
elseif ($findtok(%access.levels,%user.level,1,46) != $null) {
return $findtok(%access.levels,%user.level,1,46)
}
else {
return 0
}
}
else {
return 0
}
}
elseif ($prop == host) {
var %i = 1, %topic.num = $ini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),0)
while (%i <= %topic.num) {
inc %i
var %host.word.two = $gettok($readalltheini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),*),%i,32)
if ($2 iswm %host.word.two) {
return %host.word.two
}
}
}
elseif ($prop == levelhost) {
var %host = $address($2,5), %access.levels = peon.op.master.coowner.owner
if ($godstatus($2) == 1) {
return 6
}
elseif ($findtok(%access.levels,$readini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),$iif(@ isin $2,$2,%host)),1,46) != $null) {
return $findtok(%access.levels,$readini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),$iif(@ isin $2,$2,%host)),1,46)
}
else {
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),0)) {
inc %i
var %host.word.two = $gettok($readalltheini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),*),%i,32), %access.levels = peon.op.master.coowner.owner
if ($2 iswm %host.word.two) {
return $findtok(%access.levels,$readini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),%host.word.two),1,46)
}
else {
return 0
}
}
}
}
elseif ($prop == account) {
return $readini(" $+ $scriptdirchannels.ini",$1,$account($2))
}
else {
if ($authed($2) == 1) {
return $readini(" $+ $scriptdirchannels.ini",$1,$account($2))
}
}
}
;;;;;;;;USE: $timeduration(seconds)
alias timeduration {
if ($right($1,1) === s) {
return $remove($1,s)
}
elseif ($right($1,1) === m) {
return $calc($remove($1,m)*60)
}
elseif ($right($1,1) === h) {
return $calc($remove($1,h)*3600)
}
elseif ($right($1,1) === d) {
return $calc($remove($1,d)*86400)
}
elseif ($right($1,1) === w) {
return $calc($remove($1,w)*604800)
}
elseif ($right($1,1) === M) {
return $calc($remove($1,M)*2592000)
}
elseif ($right($1,1) === y) { 360
return $calc($remove($1,y)*31104000)
}
elseif ($1 isnum) {
return $1
}
else {
return $null
}
}
;;;;;;;;USE: $unbannick(nick,channel)[.delban]
alias unbannick {
if ($prop == delban) {
if (*!*@* iswm $3) {
var %i = 1
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm $3) || ($3 iswm $ibl($2,%i)) {
var %found = $ibl($2,%i)
}
if (%found != $null) {
break
}
inc %i
}
var %f = 1
while (%f <= $ini(" $+ $scriptdirchannels.ini",$2 $+ blist,0)) {
if ($gettok($readalltheini(" $+ $scriptdirchannels.ini",$2 $+ blist,*),%f,32) iswm $3) {
var %found.in.ini = $ifmatch
}
if (%found.in.ini != $null) {
break
}
inc %f
}
if (%found != $null) && (%found.in.ini != $null) {
mode $2 -b %found
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found != $null) && (%found.in.ini == $null) {
mode $2 -b %found
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found.in.ini != $null) && (%found == $null) {
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
else {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
}
else {
var %host = $address($3,5)
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm %host) {
var %found = $addtok(%found,$ibl($2,%i),32)
}
inc %i
}
var %f = 1
while (%f <= $ini(" $+ $scriptdirchannels.ini",$2 $+ blist,0)) {
if ($gettok($readalltheini(" $+ $scriptdirchannels.ini",%chan $+ blist,*),%f,32) iswm $address($3,5)) {
var %found.in.ini $ifmatch
}
inc %f
}
if (%found != $null) && (%found.in.ini != $null) {
mode $2 -b %found
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found != $null) && (%found.in.ini == $null) {
mode $2 -b %found
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found.in.ini != $null) && (%found == $null) {
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
else {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
}
}
else {
if ($3 != $null) {
if (*!*@* iswm $3) {
var %i = 1
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm $3) || ($3 iswm $ibl($2,%i)) {
var %found = $ibl($2,%i)
}
if (%found != $null) {
break
}
inc %i
}
if (%found != $null) {
mode $2 -b %found
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
else {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
}
else {
var %host = $address($3,5)
var %i = 1
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm %host) {
var %found = $addtok(%found,$ibl($2,%i),32)
}
inc %i
}
if (%found == $null) {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
while ($gettok(%found,1,32) != $null) {
mode $2 - $+ $str(b,$numtok($gettok(%found,1-6,32),32)) $gettok(%found,1-6,32)
%found = $deltok(%found,1-6,32)
}
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
}
elseif ($3 == $null) {
var %host = $address($1,5)
var %i = 1
while (%i <= $ibl($2,%i)) {
if ($ibl($2,%i) iswm %host) {
var %found = $addtok(%found,$ibl($2,%i),32)
}
inc %i
}
if (%found == $null ) {
.notice $1 Sorry, no ban found for $+ $1 $+ . | return
}
while ($gettok(%found,1,32) != $null) {
mode $2 - $+ $str(b,$numtok($gettok(%found,1-6,32),32)) $gettok(%found,1-6,32)
%found = $deltok(%found,1-6,32)
}
.notice $1 Matching ban(s) for $+ $1 $+ removed. | return
}
}
}
;;;;;;;;USE: $suspend(nick,suspended-nick,channel,duration)
alias suspend {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($access($3,$1).level > 2) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 suspend requires more parameters. (nick and duration) | halt
}
if ($timer(suspend $+ $($3 $+ $2,2)) != $null) {
.notice $1 $+ $2 $+ is already suspended! ( $+ $duration($timer(suspend $+ $($3 $+ $2,2)).secs) left $+ ) | halt
}
if (!$4) {
.notice $1 suspend requires more parameters. (duration) | halt
}
var %access.nick2 = $readini(" $+ $scriptdirchannels.ini",$3,$account($2))
var %host.nick2 = $readini(" $+ $scriptdiraccounts.ini",$account($2),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host %host.nick2
mode $3 -ov $2 $2
.notice $1 $+ $2 $+ 's access to $+ $3 $+ has been suspended.
.timersuspend $+ $($3 $+ $2,2) 1 $timeduration($4) { writeini " $+ $scriptdirchannels.ini" $3 $account($2) %access.nick2 }
.timersuspend $+ $($3 $+ $2 $+ 2,2) 1 $timeduration($4) { writeini " $+ $scriptdirchannels.ini" $3 $+ host %host.nick2 %access.nick2 }
}
else {
.notice $1 $2 outranks you (command has no effect).
}
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command. | halt
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $unsuspend(nick,suspended-nick,channel)
alias unsuspend {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($access($3,$1).level > 2) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
elseif ($access($3,$2) == $null) && ($timer(suspend $+ $($3 $+ $2,2)) == $null) {
.notice $1 $2 lacks access to $3 $+ . | halt
}
elseif (!$2) {
.notice $1 unsuspend requires more parameters. (nick) | halt
}
elseif ($timer(suspend $+ $($3 $+ $2,2)) == $null) {
.notice $1 $+ $2 $+ is not suspended! | halt
}
$timer(suspend $+ $($3 $+ $2,2)).com
$timer(suspend $+ $($3 $+ $2 $+ 2,2)).com
.timersuspend $+ $($3 $+ $2,2) off
.timersuspend $+ $($3 $+ $2 $+ 2,2) off
.notice $1 $+ $2 $+ 's access to $+ $3 $+ has been restored.
}
else {
.notice $1 $2 outranks you (command has no effect).
}
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command. | halt
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $adduser(nick,newuser,channel,accesslevel)
alias adduser {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($mid($2,1,1) == $chr(42)) {
var %account.nick $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if ($4 == peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host peon
.notice $1 Added new peon $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host op
.notice $1 Added new op $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host master
.notice $1 Added new master $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host coowner
.notice $1 Added new coowner $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host owner
.notice $1 Added new owner $account(%account.nick) to the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
if ($authed($2) == 1) {
if ($4 == peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) peon
.notice $1 Added new peon $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) op
.notice $1 Added new op $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) master
.notice $1 Added new master $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) coowner
.notice $1 Added new coowner $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) owner
.notice $1 Added new owner $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 $2 must first auth with $+ $me $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $clvl(nick,changee,channel,newlevel)
alias clvl {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if (!$2) {
.notice $1 clvl requires more parameters. (nick|*account and level) | halt
}
elseif (!$4) {
.notice $1 clvl requires more parameters. (access level) | halt
}
if ($access($3,$1) == op) || ($access($3,$1) == peon) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
elseif ($access($3,$1) == $null) {
.notice $1 You lack access to %chan $+ . | halt
}
if ($mid($2,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if ($access($3,%account.nick) != $null) {
if ($4 == peon) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host peon
.notice $1 $account(%account.nick) is now a peon in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host peon
.notice $1 $account(%account.nick) is now a peon in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == op) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host op
.notice $1 $account(%account.nick) is now an op in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host op
.notice $1 $account(%account.nick) is now an op in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == master) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host master
.notice $1 $account(%account.nick) is now a master in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host master
.notice $1 $account(%account.nick) is now a master in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == coowner) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host coowner
.notice $1 $account(%account.nick) is now a coowner in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host coowner
.notice $1 $account(%account.nick) is now a coowner in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host owner
.notice $1 $account(%account.nick) is now an owner in $3 $+ .
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 $+ $4 $+ is an invalid access level.
}
}
}
else {
if ($authed($2) == 1) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
if ($4 == $access($3,$2)) {
.notice $1 $account($2) is already a $access($3,$2) on the channel userlist. | halt
}
if ($access($3,$2) != $null) {
if ($4 == peon) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) peon
.notice $1 $2 ( $+ $account($2) $+ ) is now a peon in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == op) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) op
.notice $1 $2 ( $+ $account($2) $+ ) is now an op in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == master) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) master
.notice $1 $2 ( $+ $account($2) $+ ) is now a master in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == coowner) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) coowner
.notice $1 $2 ( $+ $account($2) $+ ) is now a coowner in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account($2) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) owner
.notice $1 $2 ( $+ $account($2) $+ ) is now an owner in $3 $+ .
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 $+ $4 $+ is an invalid access level.
}
}
}
else {
.notice $1 $2 must first auth with $+ $me $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $deluser(nick,removednick,channel,removednickaccess)
alias deluser {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($mid($2,1,1) == $chr(42)) {
var %account.nick $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
if ($4 == Peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Peon) {
.notice $1 %account.nick is not a peon. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted a peon $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Op) {
.notice $1 %account.nick is not an op. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted an op $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Master) {
.notice $1 %account.nick is not a master. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted a master $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Coowner) {
.notice $1 %account.nick is not a coowner. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted a coowner $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Owner) {
if ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Owner) {
.notice $1 %account.nick is not an owner. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted an owner $account(%account.nick) from the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
if ($4 == Peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Peon) {
.notice $1 $2 is not a peon. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted a peon $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Op) {
.notice $1 $2 is not an op. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted an op $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Master) {
.notice $1 $2 is not a master. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted a master $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Coowner) {
.notice $1 $2 is not a coowner. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted a coowner $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Owner) {
if ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Owner) {
.notice $1 $2 is not an owner. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted an owner $account($2) from the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USER: $giveownership(nick,newowner,channel)
alias giveownership {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($access($3,$1) == owner) || ($godstatus($1) == 1) {
if (!$2) {
if ($readalltheini(" $+ $scriptdirchannels.ini",$3,owner) == $null) {
.notice $nick There are currently no owners in $+ $3 $+ . You must use the addowner to add one. | halt
}
else {
.notice $1 giveownership requires more parameters. (nick|*account) | halt
}
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
}
elseif ($access($3,$1) == $null) {
.notice $1 You lack access to $3 $+ . | halt
}
else {
.notice $1 You lack sufficient access in $3 to use this command. | halt
}
if ($mid($2,1,1) == $chr(42)) {
var %account.nick $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == owner) && ($access($3,$1) == owner) {
.notice $nick You already have ownership of $+ $3 $+ . | halt
}
if ($account(%account.nick) == $account($1)) {
.notice $nick You cannot give ownership to yourself. | halt
}
if ($access($3,%account.nick) != $null) {
if ($readalltheini(" $+ $scriptdirchannels.ini",$3,owner) == $null) {
.notice $nick There are currently no owners in $+ $3 $+ . You must use the addowner to add one. | halt
}
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
writeini " $+ $scriptdirchannels.ini" $3 $account($1) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($1,5) coowner
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host owner
.notice $1 Ownership of $3 has been transferred to account $+ $account(%account.nick) $+ .
}
elseif ($access($3,$1) == $null) {
.notice $1 You lack access to $3 $+ .
}
else {
.notice $1 You lack sufficient access in $3 to use this command.
}
}
else {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) lacks access to $+ $3 $+ .
}
}
else {
if ($authed($2) == 1) {
if ($access($3,$2) != $null) {
if ($readalltheini(" $+ $scriptdirchannels.ini",$3,owner) == $null) {
.notice $nick There are currently no owners in $+ $3 $+ . You must use the addowner to add one. | halt
}
if ($2 == $1) {
.notice $nick You cannot give ownership to yourself. | halt
}
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account($1) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($1,5) coowner
writeini " $+ $scriptdirchannels.ini" $3 $account($2) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) owner
.notice $1 Ownership of $3 has been transferred to account $+ $account($2) $+ .
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 $2 ( $+ $account($2) $+ ) lacks access to $+ $3 $+ .
}
}
else {
.notice $1 $2 must first auth with $+ $me $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: bancheck
alias bancheck {
if ($read(" $+ $scriptdirchannels.ini",w,*blist]) = 0) {
echo -a No channel banlists found for $readn $+ .
}
else {
;checks to see if any ban is finished from the banlist, if so it unbans them
var %flag = 1
var %channelsinini = 0
var %linenumber = 0
while (%flag != 0) {
%line = $read(" $+ $scriptdirchannels.ini",w,[#*blist],$calc(%linenumber + 1))
var %linenumber = $readn
var %bannumber = 1
while (%bannumber <= $ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),0)) {
var %linefromblist = $readini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),$ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),%bannumber))
if ($ctime >= $calc($gettok(%linefromblist,1,32) + $gettok(%linefromblist,2,32))) {
ban -r $left($right(%line,-1),-6) $ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),%bannumber)
remini " $+ $scriptdirchannels.ini" $left($right(%line,-1),-1) $ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),%bannumber)
}
inc %bannumber
}
if (!$read(" $+ $scriptdirchannels.ini",w,[#*blist],$calc(%linenumber + 1))) {
var %flag = 0
}
}
}
}
;;;;;;;;USE: $modechange(channel,nick,modes,[key|limit])
alias modechange {
if ($mid($3,1,1) != $chr(45)) && ($mid($3,1,1) != $chr(43)) {
.notice $nick You must specify a positive or a negative mode. | return
}
if ($4 != $null) && ($5 != $null) && ($4 !isnum) && ($5 !isnum) {
.notice $nick The limit must be numbers only. | halt
}
var %count = 1
var %sign = $null
while ($mid($3,%count,1) != $null) {
if ($mid($3,%count,1) == $chr(43)) {
%sign = p
}
elseif ($mid($3,%count,1) == $chr(45)) {
%sign = n
}
else {
if (%sign == p) {
var %posmodes = %posmodes $+ $mid($3,%count,1)
}
else {
var %negmodes = %negmodes $+ $mid($3,%count,1)
}
}
inc %count
}
if (*l* iswm %posmodes) || (*l* iswm %negmodes) {
if ($4 != $null) && ($5 != $null) {
if ($4 isnum) {
var %limit = $4
var %key = $5
}
elseif ($5 isnum) {
var %key = $4
var %limit = $5
}
else {
.notice $nick The limit must be numbers only. | return
}
}
elseif ($4 != $null) {
if ($4 !isnum) {
.notice $nick The limit must be numbers only. | return
}
var %limit = $4
}
}
elseif (*k* iswm %posmodes) || (*k* iswm %negmodes) {
var %key = $4
}
if ($chanmodes != $null) {
var %lettermode = 1
while (%lettermode <= $len($remove($chanmodes,$chr(44)))) {
var %themodes = %themodes $+ $mid($remove($chanmodes,$chr(44)),%lettermode,1) $+ $chr(44)
inc %lettermode
}
var %themodes = $left(%themodes,-1)
}
var %count = 1
while ($gettok(%themodes,%count,44) != $null) {
if ($gettok(%themodes,%count,44) isincs %posmodes) {
var %posmodes1 = %posmodes1 $+ $gettok(%themodes,%count,44)
}
elseif ($gettok(%themodes,%count,44) isincs %negmodes) {
var %negmodes1 = %negmodes1 $+ $gettok(%themodes,%count,44)
}
inc %count
}
;MODES ASKED FOR COMPLETED IN FORM %posmodes1 %negmodes1 %key %limit
var %morecheck = $readini(" $+ $scriptdirchannels.ini",$1,Modes)
if (%morecheck != None) {
var %botposmodes = $iif($gettok(%morecheck,1,44 ) == z,$null,$gettok(%morecheck,1,44))
var %botnegmodes = $iif($gettok(%morecheck,2,44 ) == z,$null,$gettok(%morecheck,2,44))
var %botkey = $iif($gettok(%morecheck,3,44) == z,$null,$gettok(%morecheck,3,44))
var %botlimit = $iif($gettok(%morecheck,4,44) == z,$null,$gettok(%morecheck,4,44))
if (%posmodes1 != $null) && (k isincs %posmodes1) && (%key != %botkey) {
var %noposmodes = k
var %nolimitkey = %key
%posmodes1 = $removecs(%posmodes1,k)
%key = $null
}
if (%posmodes1 != $null) && (l isincs %posmodes1) && (%limit != %botlimit) {
var %noposmodes = $iif( %noposmodes , kl , l) | var %nolimitkey = $iif( %nolimitkey , %nolimitkey %limit , %limit ) | %posmodes1 = $removecs( %posmodes1 , l ) | %limit = $null
}
if ( $regex( %posmodes , /[ $+ %botnegmodes $+ ]/g ) > 0 ) {
var %i = 1
while ($mid(%posmodes1,%i,1) != $null) {
if ($mid(%posmodes1,%i,1) isincs %botnegmodes) {
if ($mid(%posmodes1,%i,1) == l) {
%limit = $null
}
if ($mid(%posmodes1,%i,1) == k) {
%key = $null
}
var %noposmodes = %noposmodes $+ $mid(%posmodes1,%i,1)
var %posmodes1 = $removecs(%posmodes1,$mid(%posmodes1,%i,1))
var %noinc = 1
}
if (%noinc != 1) {
inc %i
}
else {
%noinc = 0
}
inc %i
}
}
if ($regex(%negmodes1,/[ $+ %botposmodes $+ ]/g ) > 0) {
var %i = 1
while ($mid(%negmodes1,%i,1) != $null) {
if ($mid(%negmodes1,%i,1) isincs %botposmodes) {
var %nonegmodes = %nonegmodes $+ $mid(%negmodes1,%i,1)
%negmodes1 = $removecs(%negmodes1,$mid(%negmodes1,%i,1))
var %noinc = 1
}
if (%noinc != 1) {
inc %i
}
else {
%noinc = 0
}
}
}
var %conflict = $iif(%noposmodes,+ $+ %noposmodes) $+ $iif(%nonegmodes,- $+ %nonegmodes) $+ $iif(%nolimitkey,$chr(32) $+ %nolimitkey)
}
else {
mode $1 $3-
}
var %modechange = $iif(%posmodes1 != $null,+ $+ %posmodes1) $+ $iif(%negmodes1 != $null,- $+ %negmodes1) $iif(%key != $null,%key %limit,%limit)
.notice $2 $iif(%noposmodes || %nonegmodes,Mode Conflict: %conflict $+ $chr(32)) $+ $iif(%posmodes1 || %negmodes1,Modes set: %modechange)
if (%posmodes1 != $null) || (%negmodes1 != $null) {
mode $1 $iif(%negmodes1 != $null,- $+ %negmodes1) $iif(%key!= $null,%key)
mode $1 $iif(%posmodes1 != $null,+ $+ %posmodes1 $iif(%key != $null,%key %limit,%limit))
}
}
;;;;;;;;USE: $modelock(channel,nick,modes,[key|limit])
alias modelock {
if ($chr(42) == $3) {
writeini " $+ $scriptdirchannels.ini" $1 Modes None
.notice $2 Modes - None
return
}
if ($mid($3,1,1) != $chr(45)) && ($mid($3,1,1) != $chr(43)) {
.notice $2 You must specify a positive or a negative mode. | return
}
if (*l* iswm $3) && ($4 != $null) && ($5 != $null) && ($4 !isnum) && ($5 !isnum) {
.notice $2 The limit must be numbers only. | return
}
var %count = 1
var %sign = $null
while ($mid($3,%count,1) != $null) {
if ($mid($3,%count,1) == $chr(43)) {
%sign = p
}
elseif ($mid($3,%count,1) == $chr(45)) {
%sign = n
}
else {
if (%sign == p) {
var %posmodes = %posmodes $+ $mid($3,%count,1)
}
else {
var %negmodes = %negmodes $+ $mid($3,%count,1)
}
}
inc %count
}
if (*l* iswm %posmodes) {
if ($4 != $null) {
if ($4 !isnum) {
.notice $2 The limit must be numbers only. | return
}
var %limit = $4
}
elseif ($4 != $null) && ($5 != $null) {
if ($4 isnum) {
var %limit = $4
var %key = $5
}
elseif ($5 isnum) {
var %key = $4
var %limit = $5
}
else {
.notice $2 The limit must be numbers only. | return
}
}
}
elseif (*k* iswm %posmodes) {
var %key = $4
}
if ($chanmodes != $null) {
var %lettermode = 1
while (%lettermode <= $len($remove($chanmodes,$chr(44)))) {
var %themodes = %themodes $+ $mid($remove($chanmodes,$chr(44)),%lettermode,1) $+ $chr(44)
inc %lettermode
}
var %themodes = $left(%themodes,-1)
}
var %count = 1
while ($gettok(%themodes,%count,44) != $null) {
if ($gettok(%themodes,%count,44) isincs %posmodes) {
var %posmodes1 = %posmodes1 $+ $gettok(%themodes,%count,44)
}
elseif ($gettok(%themodes,%count,44) isincs %negmodes) {
var %negmodes1 = %negmodes1 $+ $gettok(%themodes,%count,44)
}
inc %count
}
writeini " $+ $scriptdirchannels.ini" $1 Modes $iif(%posmodes1 != $null,%posmodes1,z) $+ , $+ $iif(%negmodes1 != $null,%negmodes1,z) $+ , $+ $iif(%key != $null,%key,z) $+ , $+ $iif(%limit != $null,%limit,z)
.notice $2 Modes - $3-
mode $1 $iif(%posmodes1 != $null,+ $+ %posmodes1) $+ $iif(%negmodes1 != $null,- $+ %negmodes1) $iif(%key != $null,%key) $iif(%limit != $null,%limit)
}
;;;;;;;;USE: $restoremodes(channel,nick)
alias restoremodes {
if ($prop != info2) {
if ($readini(" $+ $scriptdirchannels.ini",$1,Modes) == None) {
.notice $2 There are no modes set for $1 $+ . | return
}
}
var %chanmodes = $chan($1).mode
var %morecheck = $readini(" $+ $scriptdirchannels.ini",$1,Modes)
var %posmodes1 = $remove($gettok(%chanmodes,1,32),+)
var %posmodes2 = $gettok(%morecheck,1,44)
if ($regex(%posmodes1,/[ $+ %posmodes2 $+ ]/g) == $len(%posmodes1)) && ($deltok(%chanmodes,1,32) == $iif($gettok(%morecheck,4,44) == $null,$gettok(%morecheck,4,44),$gettok(%morecheck,4,44) $gettok(%morecheck,3,44))) {
.notice $2 Modes do not need to be changed. | return
}
var %botposmodes = $iif($gettok(%morecheck,1,44) == z,$null,$gettok(%morecheck,1,44))
var %botnegmodes = $iif($gettok(%morecheck,2,44) == z,$null,$gettok(%morecheck,2,44))
var %botkey = $iif($gettok(%morecheck,3,44) == z,$null,$gettok(%morecheck,3,44))
var %botlimit = $iif($gettok(%morecheck,4,44) == z,$null,$gettok(%morecheck,4,44))
var %chanposmodes = $remove($gettok(%chanmodes,1,32),+)
if ($numtok(%chanmodes,32) == 3) {
var %chankey = $gettok(%chanmodes,3,32)
var %chanlimit = $gettok(%chanmodes,2,32)
}
elseif (*l* iswm $gettok(%chanmodes,1,32)) {
var %chanlimit = $gettok(%chanmodes,2,32)
}
else {
var %chankey = $gettok(%chanmodes,2,32)
}
if (*k* iswm %chanposmodes) && (%chankey != %botkey) && ($regex(%botnegmodes,/[k]/g) == 0) {
%botnegmodes = %botnegmodes $+ k
}
if (%botkey == %chankey) || (*k* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,k)
}
if (*l* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,l)
}
var %ending = $null
if (%botlimit != $null) && (%botkey != $null) {
var %ending = %botkey %botlimit
}
elseif (%botlimit != $null) && (%botkey == $null) {
var %ending = %botlimit
}
elseif (%botlimit == $null) && (%botkey != $null) {
var %ending = %botkey
}
if ($prop == info) {
$iif(%botnegmodes || %botposmodes,.notice $2 Modes - $iif(%botposmodes,+ $+ %botposmodes) $+ $iif(%botnegmodes,- $+ %botnegmodes)) $iif(%ending, %ending)
return
}
if ($prop == info2) {
if ($readini(" $+ $scriptdirchannels.ini",$1,Modes) == None) {
return No modes set
}
else {
return $iif(%botnegmodes || %botposmodes,$iif(%botposmodes,+ $+ %botposmodes) $+ $iif(%botnegmodes,- $+ %botnegmodes)) $iif(%ending, %ending)
}
}
$iif(%botnegmodes,mode $1 - $+ %botnegmodes $iif(%chankey != $null,%chankey))
$iif(%botposmodes,mode $1 + $+ %botposmodes %ending)
.notice $2 Channel modes restored.
}
;;;;;;;;USE: $restoremodes2(channel)
alias restoremodes2 {
var %chanmodes = $chan($1).mode
var %morecheck = $readini(" $+ $scriptdirchannels.ini",$1,Modes)
var %posmodes1 = $remove($gettok(%chanmodes,1,32),+)
var %posmodes2 = $gettok(%morecheck,1,44)
if ($regex(%posmodes1,/[ $+ %posmodes2 $+ ]/g) == $len(%posmodes1)) && ($deltok(%chanmodes,1,32) == $iif($gettok(%morecheck,4,44) == $null,$gettok(%morecheck,4,44),$gettok(%morecheck,4,44) $gettok(%morecheck,3,44))) {
return
}
var %botposmodes = $iif($gettok(%morecheck,1,44) == z,$null,$gettok(%morecheck,1,44))
var %botnegmodes = $iif($gettok(%morecheck,2,44) == z,$null,$gettok(%morecheck,2,44))
var %botkey = $iif($gettok(%morecheck,3,44) == z,$null,$gettok(%morecheck,3,44))
var %botlimit = $iif($gettok(%morecheck,4,44) == z,$null,$gettok(%morecheck,4,44))
var %chanposmodes = $remove($gettok(%chanmodes,1,32),+)
if ($numtok(%chanmodes,32) == 3) {
var %chankey = $gettok(%chanmodes,3,32)
var %chanlimit = $gettok(%chanmodes,2,32)
}
elseif (*l* iswm $gettok(%chanmodes,1,32)) {
var %chanlimit = $gettok(%chanmodes,2,32)
}
else {
var %chankey = $gettok(%chanmodes,2,32)
}
if (*k* iswm %chanposmodes) && (%chankey != %botkey) && ($regex(%botnegmodes,/[k]/g) == 0) {
%botnegmodes = %botnegmodes $+ k
}
if (%botkey == %chankey) || (*k* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,k)
}
if (*l* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,l)
}
var %ending = $null
if (%botlimit != $null) && (%botkey != $null) {
var %ending = %botkey %botlimit
}
elseif (%botlimit != $null) && (%botkey == $null) {
var %ending = %botlimit
}
elseif (%botlimit == $null) && (%botkey != $null) {
var %ending = %botkey
}
.notice $2 Modes conflicting with $+ $iif(%botposmodes,+ $+ %botposmodes) $+ $iif(%botnegmodes,- $+ %botnegmodes) $iif(%ending, %ending) $+ are not allowed in $1 $+ .
mode $1 - $+ %botnegmodes $iif(%chankey != $null,%chankey)
mode $1 + $+ %botposmodes %ending
}
;;;;;;;;USE: $allowauth($nick,nick,account)
alias allowauth {
if (!$2) {
.notice $1 $+ %com $+ requires more parameters. (nick and account) | halt
}
if (!$3) {
.notice $1 $+ %com $+ requires more parameters. (account) | halt
}
if ($authed($2) == 1) || ($authed($3) == 1) {
.notice $1 Someone is already authed to account $+ $2 $+ . | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$3)) {
.notice $1 Account $+ $3 $+ has not been registered with $+ $me $+ . | halt
}
if ($address($2,5) iswm $readini(" $+ $scriptdiraccounts.ini",$3,Hostmask)) {
.notice $1 $+ $2 $+ 's hostmask is already valid with $3 $+ 's account. | halt
}
else {
var %old.hostmask = $readini(" $+ $scriptdiraccounts.ini",$3,Hostmask)
var %new.hostmask = $address($2,5)
writeini " $+ $scriptdiraccounts.ini" $3 Hostmask %new.hostmask
;checks to see if the user has authed in the requires 90 seconds, if not it resets the hostmask
.timercheckifauthed $+ $2 1 90 checkifauthed $2 $3
.notice $1 Hostmask for account $+ $3 $+ changed. $2 may now auth to account $3 $+ . (90 seconds)
}
}
;;;;;;;;USE: $renameaccount($nick,nick|*account,[*]account)
alias renameaccount {
if (!$2) {
.notice $nick rename requires more parameters. (nick|*old-account and [*]new-account)
}
elseif (!$3) {
.notice $nick rename requires more parameters. ([*]new-account)
}
else {
if ($mid($2,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
}
else {
var %account.nick = $2
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($authed(%account.nick) == 0) {
.notice $1 %account.nick must first auth with $+ $me $+ . | halt
}
}
if ($mid($3,1,1) == $chr(42)) {
var %new.account = $remove($3,*)
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($readini(" $+ $scriptdiraccounts.ini",Accounts,%new.account) != $null) {
.notice $1 Account $+ %new.account $+ is already registered. | halt
}
}
else {
var %new.account = $3
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($readini(" $+ $scriptdiraccounts.ini",Accounts,%new.account) != $null) {
.notice $1 Account $+ %new.account $+ is already registered. | halt
}
}
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($readini(" $+ $scriptdirchannels.ini",$ini(" $+ $scriptdirchannels.ini",%i),%old.account) != $null) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %old.account
writeini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %new.account $ifmatch
}
inc %i
}
if ($oper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Opers %old.account
writeini " $+ $scriptdiropers.ini" Opers %new.account $ifmatch
}
if ($helper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers %old.account
writeini " $+ $scriptdiropers.ini" Opers %new.account $ifmatch
}
remini " $+ $scriptdiraccounts.ini" Nicks %account.nick
writeini " $+ $scriptdiraccounts.ini" Nicks $nick %new.account
var %if.authed = $readini(" $+ $scriptdiraccounts.ini",Authed,%account.nick)
remini " $+ $scriptdiraccounts.ini" Authed %account.nick
writeini " $+ $scriptdiraccounts.ini" Authed %account.nick %if.authed
remini " $+ $scriptdiraccounts.ini" %old.account
writeini " $+ $scriptdiraccounts.ini" %new.account Hostmask $wildsite
writeini " $+ $scriptdiraccounts.ini" %new.account Nick %account.nick
var %password = $password(%account.nick)
remini " $+ $scriptdiraccounts.ini" Passwords %account.nick
writeini " $+ $scriptdiraccounts.ini" Passwords %account.nick %password
remini " $+ $scriptdiraccounts.ini" Accounts %old.account
writeini " $+ $scriptdiraccounts.ini" Accounts %new.account %account.nick
.notice $1 Successfully renamed account $+ %old.account $+ to $+ %new.account $+
}
}
;;;;;;;;USE: $readalltheini(ini,topic,value|*item*)[.totalnumber]
alias readalltheini {
if ($prop == totalnumber) {
var %x, %i = 0
while (%i < $ini($1,$2,0)) {
inc %i
if ($3 iswm $readini($1,$2,$ini($1,$2,%i))) {
%x = %x $ini($1,$2,%i)
}
}
return $numtok(%x,32)
}
else {
var %x, %i = 0
while (%i < $ini($1,$2,0)) {
inc %i
if ($3 iswm $readini($1,$2,$ini($1,$2,%i))) {
%x = %x $ini($1,$2,%i)
}
}
return %x
}
}
;;;;;;;;USE: $userlist(ini,topic,value)
alias userlist {
var %names, %num = 1
while (%num <= $numtok($readalltheini($1,$2,$3),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($readalltheini($1,$2,$3),%num,32)
inc %num
}
return %names
}
;;;;;;;;USE: $initopicchanger(name.ini,oldtopic,newtopic)
alias initopicchanger {
if ($read(" $+ $scriptdirchannels.ini",w,$+([,$1,])) != $null) {
write $+(-w"[,$2,]") $+(",$1,") $+([,$3,])
}
}
;;;;;;;;USE: mmode <#channel> <+/-> <v/o> <nicks>
alias mmode {
var %cmd mode $1 $2, %m $3
tokenize 32 $4-
while $0 {
%cmd $+ $str(%m,$numtok($1-6,32)) $1-6
tokenize 32 $7-
}
}
;;;;;;;;USE: $quotesearch(channel,string)[.sayquote]
alias quotesearch {
var %quote.search = 1, %number.of.lines = 0, %line.numbers
while ($read(" $+ $scriptdir $+ $1 $+ quote.txt",nw,$+(*,$2-,*),%quote.search)) {
%quote.search = $calc($readn + 1)
%line.numbers = %line.numbers $+ $iif(%line.numbers == $null,$chr(32),$chr(44)) $readn
%number.of.lines = $calc(%number.of.lines + 1)
}
if ($prop == sayquote) {
return %line.numbers
}
else {
if (%line.numbers == $null) {
return Sorry, no match found for $+ $2- $+ .
}
else {
return Found $+ $2- $+ in %number.of.lines $+ / $+ $lines(" $+ $scriptdir $+ $1 $+ quote.txt") quotes in quotes number %line.numbers $+ .
}
}
}
;;;;;;;;USE: $protectfromspam(nick,channel)
alias protectfromspam {
if ($spamprotect($2) != disabled) {
if ($access($2,$1) == $null) || ($authed($2) == 0) {
inc -u [ $+ [ $timeduration($gettok($spamprotect($2),2,32)) ] ] %spam. [ $+ [ $1 ] ]
if (%spam. [ $+ [ $1 ] ] == $gettok($spamprotect($2),1,32)) {
if ($spampunish($2) == kick) {
kick $2 $1 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
elseif ($spampunish($2) == ban) {
ban $2 $1 2 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
elseif ($spampunish($2) == kickban) {
ban -k $2 $1 2 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
elseif (timeban* iswm $spampunish($2)) {
writeini " $+ $scriptdirchannels.ini" $2 $+ blist $address($1,2) $ctime $gettok($spamprotect($2),2,32) Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
ban -ku $+ $gettok($spamprotect($2),2,32) $2 $1 2 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
}
}
}
}
Yes: % [ $+ [ $1 $+ yes ] ] - No: % [ $+ [ $1 $+ no ] ]
;;;;;;;;USE: voteresults <channel>
alias voteresults {
var %y = % [ $+ [ $1 $+ yes ] ]
var %n = % [ $+ [ $1 $+ no ] ]
msg $1 Vote results for [ $+ [ % [ $+ [ $1 $+ question ] ] ] $+ ] - $iif(%n > %y,No won with %n $+ / $+ $calc(%y + %n) votes.,$iif(%n = %y,No vote won; had equal amount of votes. ( $+ %n each),Yes won with %y $+ / $+ $calc(%y + %n) votes.))
unset % $+ $1 $+ question
unset % $+ $1 $+ enablevote
unset % $+ $1 $+ yes
unset % $+ $1 $+ no
$iif(voters $+ $1 $+ .txt,.remove voters $+ $1 $+ .txt)
}
;;;;;;;;USE: checkifauthed nick account
alias checkifauthed {
$iif($authed($1) == 0,writeini " $+ $scriptdiraccounts.ini" $2 Hostmask %old.hostmask)
}
;;;;;;;;USE $translang(language)
alias translang {
if ($1 == en) return English
elseif ($1 == fr) return French
elseif ($1 == de) return German
elseif ($1 == it) return Italian
elseif ($1 == pt) return Portuguese
elseif ($1 == es) return Spanish
elseif ($1 == zh) return Chinese
elseif ($1 == ja) return Japanese
elseif ($1 == ko) return Korean
else return $null
}
on *:open:?: { msg $nick #1,0P14lease 1T14ype - 1a14uth 1.14:1. 14 username password to create an auth if you would like to register a channel type .join #channelname then type regchan #channelname authname}
Total Paste Views: 1 — Trackback (0) — PermaLink
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
update paste below
;This a channel service bot (a copy (replica) of chanserv from srvx). You can register channels to different users and set the protection level
;etc. anyway you would like it. I update this bot daily and will release a new version often.
;Userlevels are: Oper > Helper | Owner > Coowner > Master > Op > Peon > Regular User
;The GOD command toggles security override, (complete access to all registered channels) and the ability to register channels,
;rename accounts, allowauth users.. etc.
;Last Updates
;Month day year: v(version): update
;Jan. 28, 2003: v3.1c: fixed bug where VOICEALL and DEVOICEALL didnt work in PM
;Jan. 28, 2003: v3.1b: fixed bug with unsuspending a user
;Dec. 28, 2003: v3.1a: added UNSUSPEND command, you can now unsuspend a suspended user
;Dec. 28, 2003: v3.0e: added SUSPEND command, you can now suspend a users access from the channel for a certain duration
;Dec. 27, 2003: v3.0d: added notice protection, the bot cannot recieve notices now
;Dec. 27, 2003: v3.0c: added SET DYNLIMIT command, prevents join floods
;Dec. 26, 2003: v3.0b: added SET ENFTOPIC command, can now lock the topic
;Nov. 12, 2003: v3.0a: added translation script
;Oct. 14, 2003: v2.1c: added an UNAUTH command, unauths user
;Oct. 14, 2003: v2.1b: fixed ALLOWAUTH command that didnt add the newhost
;Oct. 13, 2003: v2.1a: added voting system, STARTVOTE, VOTEYES, and VOTENO
;Oct. 06, 2003: v2.0b: added SET SPAMPUNISH command, you can set what punishment you want for people spamming
;Oct. 06, 2003: v2.0a: added SET SPAMPROTECT command, you can set the 'x' number lines in 'y' number of seconds
;Oct. 03, 2003: v1.4e: added SEARCHQUOTE, searches for any given string
;Oct. 01, 2003: v1.4d: added ADDQUOTE, DELQUOTE, and SAYQUOTE
;Oct. 01, 2003: v1.4c: added DICE game, rolls a dice with the specified number
;Sept. 30, 2003: v1.4b: added an option for SET TOYS command, if toys will reply to channel, nick, or not reply at all
;Sept. 30, 2003: v1.4a: fixed bug where it didnt voice user when SET VOICE was enabled
;Sept. 29, 2003: v1.3d: added ctcp version reply
;Sept. 28, 2003: v1.3c: added ADDPERFORM, DELPERFORM, and PERFORMLIST; you can now add/del different commands to/from the perform list
;Sept. 21, 2003: v1.3b: added a 90 second timer in the ALLOWAUTH command, so if user doesnt auth in 90s, it changes the account hostmask changes back to normal
;Sept. 21, 2003: v1.3a: added a timer for KICKBANALL command so bot doesnt flood off, it will kb someone every 1.5s
;Sept. 20, 2003: v1.2d: fixed deluser bug where it sais "must first auth with $me"
;Sept. 20, 2003: v1.2c: added RENAME command, renames account names.
;Sept. 20, 2003: v1.2b: added channel MOVE command, moved all channels users/info/bans to another channel
;Sept. 19, 2003: v1.2a: added INVITEME command, any person on the userlist may use this command
;Sept. 19, 2003: v1.1d: added added HELP commands for the commands that MUST be done in PM only
;Sept. 19, 2003: v1.1c: added an ALLOWAUTH command which lets people auth to an account if they had an invalid hostmask.
;Sept. 19, 2003: v1.1b: fixed the bug for the on kick/deop/ban that worked on users without access
;Sept. 18, 2003: v1.1a: added aliases for *LIST (eg. mlist or masters would work)
;Sept. 17, 2003: v1.0d: added on authentication, if you have access to channel, it ops/voices you
;Sept. 17, 2003: v1.0c: fixed ADDUSER bug so people without access that do ADDUSER will get you lack access and not requires more params.
;Sept. 17, 2003: v1.0b: added INFO command, displays various info about a channel
;Sept. 16, 2003: v1.0a: added total number of users in command USERS, *LIST, OPERS, HELPERS, STAFF
on *:LOAD:{
;checks to see if your version is 6.1 or higher
if ($version < 6.1) {
echo -a -
echo -a Error, script not loaded:
echo -a You need mIRC version 6.1 or higher in order for this script to work.
echo -a Your current version is $version $+ .
echo -a -
;unloads script if version is lower than 6.1
unload -rs $+(",$script,")
echo -a Script successfully unloaded.
echo -a -
}
else {
echo -a -
echo -a You have just loaded Channel Service Bot.
echo -a Made by CrAzY_cAfCaSi
set %version 3.1c
set %built.on January 28, 2003, 5:06:12 PM
echo -a Channel Service Bot Version %version $+ . Built on %built.on $+ .
echo -a -
;this sets the bot trigger so it will be %trigger $+ command
set %trigger $$?="Please select the bot's trigger. You may change it later. (eg. ! ? . @ -)"
echo -a Set global trigger to ' $+ %trigger $+ '.
echo -a -
}
}
on *:UNLOAD:{
echo -a -
echo -a Thanks for using Channel Service Bot!
echo -a -
var %del.don = [ $input(Would you like to delete the databases?,y) ]
if (%del.don == $true) {
var %i = 1
while (%i <= $findfile($scriptdir,*,0) {
if ($findfile($scriptdir,*,%i) != bot.mrc) && ($findfile($scriptdir,*,%i) != 8ball.txt) && ($findfile($scriptdir,*,%i) != "Channel Service Bot readme.txt") {
remove ($findfile($scriptdir,*,%i)
}
inc %i
}
}
unset %trigger, %built.on, %version, %dynlimit.*
echo -a You have just unloaded Channel Services Bot.
echo -a -
}
on *:CONNECT:{
;this while loop checks to see the perform list
var %i = 1
while (%i <= $lines(" $+ $scriptdirbotperform.txt")) {
.timerperform $+ %i 1 $calc(%i + 1) $read(" $+ $scriptdirbotperform.txt",%i)
inc %i
}
}
on *:OPEN:?:{
close -m
}
on *:join:#:{
if ($nick == $me) {
who $chan
}
else {
if ($channels($chan) != $null) {
;this checks to see if the person joining the channel is on the banlist, if so, it bans them
var %i = 1, %x = 0
while (%i <= 9) && (%x <= $ini(" $+ $scriptdirchannels.ini",$chan $+ blist,0)) {
if ($gettok($readalltheini(" $+ $scriptdirchannels.ini",$chan $+ blist,*),%x,32) iswm $address($nick,%i)) {
ban -k $chan $ifmatch $gettok($readini(" $+ $scriptdirchannels.ini",$chan $+ blist,$ifmatch),3-,32)
}
inc %i
inc %x
}
if ($authed($nick) == 1) {
;checks to see if the person joining the chanel has any access to the channel
if ($access($chan,$nick) == Owner) || ($access($chan,$nick) == Coowner) || ($access($chan,$nick) == Master) || ($access($chan,$nick) == Op) {
mode $chan +o $nick
$iif($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick)) != $null,msg $chan $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick))))
writeini " $+ $scriptdirchannels.ini" $chan $+ host $wildsite $access($chan,$nick)
if ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting))
}
elseif ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) == None) && ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
elseif ($access($chan,$nick) == Peon) {
mode $chan +v $nick
$iif($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick)) != $null,msg $chan $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick))))
writeini " $+ $scriptdirchannels.ini" $chan $+ host $wildsite $access($chan,$nick)
if ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting))
}
elseif ($readini(" $+ $scriptdirchannels.ini",$chan,UserGreeting) == None) && ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
else {
if ($readini(" $+ $scriptdirchannels.ini",$chan,Voice) == Enabled) {
mode $chan +v $nick
}
if ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
}
else {
if ($readini(" $+ $scriptdirchannels.ini",$chan,Voice) == Enabled) {
mode $chan +v $nick
}
if ($readini(" $+ $scriptdirchannels.ini",$chan,Greeting) != None) {
.notice $nick $parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan,Greeting))
}
}
}
}
}
on *:START:{
;resets everyones auth to 0 (security reasons)
var %i = 1
while (%i <= $ini(" $+ $scriptdiraccounts.ini",Authed,0)) {
writeini " $+ $scriptdiraccounts.ini" Authed $ini(" $+ $scriptdiraccounts.ini",Authed,%i) 0
inc %i
}
var %x = 1
while (%x <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
writeini " $+ $scriptdiropers.ini" Opers $ini(" $+ $scriptdiropers.ini",Opers,%x) 0
inc %x
}
var %f = 1
while (%f <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
writeini " $+ $scriptdiropers.ini" Helpers $ini(" $+ $scriptdiropers.ini",Helpers,%f) 0
inc %f
}
}
on *:MODE:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
;checks to see if the modes conflict with the channel set modes, if so it puts them back
if ($readini(" $+ $scriptdirchannels.ini",$chan,Modes) != None) {
$restoremodes2($chan,$nick)
}
}
}
}
on ^*:NOTICE:*:?:{
haltdef
}
on *:nick:{
if ($authed($nick) == 1) {
;when someone changes their nick, it adds their new nick to the " $+ $scriptdiraccounts.ini" and removes their old one
var %i = 1, %account = $readini(" $+ $scriptdiraccounts.ini",Nicks,$nick), %hostmask = $readini(" $+ $scriptdiraccounts.ini",%account,Hostmask)
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($readini(" $+ $scriptdirchannels.ini",$ini(" $+ $scriptdirchannels.ini",%i),%hostmask) != $null) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %hostmask
writeini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $address($newnick,5) $ifmatch
}
inc %i
}
var %account = $readini(" $+ $scriptdiraccounts.ini",Nicks,$nick)
var %password = $readini(" $+ $scriptdiraccounts.ini",Passwords,$nick)
writeini " $+ $scriptdiraccounts.ini" Authed $newnick 1
writeini " $+ $scriptdiraccounts.ini" Nicks $newnick %account
writeini " $+ $scriptdiraccounts.ini" Accounts %account $newnick
writeini " $+ $scriptdiraccounts.ini" %account Nick $newnick
writeini " $+ $scriptdiraccounts.ini" %account Hostmask $address($newnick,5)
writeini " $+ $scriptdiraccounts.ini" Passwords $newnick %password
remini " $+ $scriptdiraccounts.ini" Authed $nick
remini " $+ $scriptdiraccounts.ini" Nicks $nick
remini " $+ $scriptdiraccounts.ini" Passwords $nick
}
}
on *:kick:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
;when someone is kicked, it checks whether the person being kicked is protected
if ($protection($chan) == 2) {
if ($knick == $me) {
join $chan
if ($me !isop $chan) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
elseif ($me isop $chan) {
msg $chan Possible channel takeover by $nick $+ . | halt
}
}
if ($authed($knick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$knick).level != 0) {
if ($access($chan,$nick).level <= $access($chan,$knick).level) {
mode $chan -o $nick
kick $chan $nick Sorry, that user is protected.
}
}
}
}
elseif ($protection($chan) == 1) {
if ($knick == $me) {
join $chan
if ($me !isop $chan) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
elseif ($me isop $chan) {
msg $chan Possible channel takeover by $nick $+ . | halt
}
}
if ($authed($knick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$knick).level != 0) {
if ($access($chan,$nick).level < $access($chan,$knick).level) {
mode $chan -o $nick
kick $chan $nick Sorry, that user is protected.
}
}
}
}
elseif ($protection($chan) == 0) {
if ($knick == $me) {
join $chan
if ($me !isop $chan) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
elseif ($me isop $chan) {
msg $chan Possible channel takeover by $nick $+ . | halt
}
}
return
}
}
}
}
on *:deop:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
;when someone is deopped, it checks whether the person being deopped is protected
if ($protection($chan) == 2) {
if ($opnick == $me) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
if ($authed($opnick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$opnick).level != 0) {
if ($access($chan,$nick).level <= $access($chan,$opnick).level) {
mode $chan -o+o $nick $opnick
.notice $nick Sorry, $+ $opnick $+ is protected.
}
}
}
}
elseif ($protection($chan) == 1) {
if ($opnick == $me) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
if ($authed($opnick) == 1) {
if ($access($chan,$nick).level != 0) && ($access($chan,$opnick).level != 0) {
if ($access($chan,$nick).level < $access($chan,$opnick).level) {
mode $chan -o+o $nick $opnick
.notice $nick Sorry, $+ $opnick $+ is protected.
}
}
}
}
elseif ($protection($chan) == 0) {
if ($opnick == $me) {
msg $chan Possible channel takeover by $nick $+ . (I need OP's to function properly.) | halt
}
return
}
}
}
}
on *:ban:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
.timerbancheck 0 15 bancheck
;when someone/a mask is banned, it checks whether the hostmask conflicts with any protected hostmasks
if ($protection($chan) == 2) {
if ($banmask iswm $address($me,2)) {
mode $chan -ob $nick $banmask
msg $chan Possible channel takeover by $nick $+ . | halt
}
if ($access($chan,$nick).level != 0) && ($access($chan,$banmask).level != 0) {
if ($access($chan,$nick).level <= $access($chan,$banmask).levelhost) {
mode $chan -b $banmask
.notice $nick Sorry, ban for $+ $banmask $+ conflicts with a protected user's hostmask. | halt
}
}
}
elseif ($protection($chan) == 1) {
if ($banmask iswm $address($me,2)) {
mode $chan -ob $nick $banmask
msg $chan Possible channel takeover by $nick $+ . | halt
}
if ($access($chan,$nick).level != 0) && ($access($chan,$banmask).level != 0) {
if ($access($chan,$nick).level < $access($chan,$banmask).levelhost) {
mode $chan -b $banmask
.notice $nick Sorry, ban for $+ $banmask $+ conflicts with a protected user's hostmask. | halt
}
}
}
elseif ($protection($chan) == 0) {
if ($banmask iswm $address($me,2)) {
mode $chan -ob $nick $banmask
msg $chan Possible channel takeover by $nick $+ . | halt
}
return
}
}
}
}
on *:TOPIC:#:{
if ($channels($chan) != $null) {
if ($nick != $me) {
if ($calc($access($chan,$nick).level - 1) >= $enftopic($chan)) {
halt
}
else {
.notice $nick The $chan topic is locked.
$iif($readini(" $+ $scriptdirchannels.ini",$chan,DefaultTopic) != None,topic $chan $ifmatch)
}
}
}
}
on *:DISCONNECT:{
;resets everyones auth to 0 (security reasons)
var %i = 1
while (%i <= $ini(" $+ $scriptdiraccounts.ini",Authed,0)) {
writeini " $+ $scriptdiraccounts.ini" Authed $ini(" $+ $scriptdiraccounts.ini",Authed,%i) 0
inc %i
}
var %x = 1
while (%x <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
writeini " $+ $scriptdiropers.ini" Opers $ini(" $+ $scriptdiropers.ini",Opers,%x) 0
inc %x
}
var %f = 1
while (%f <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
writeini " $+ $scriptdiropers.ini" Helpers $ini(" $+ $scriptdiropers.ini",Helpers,%f) 0
inc %f
}
}
on *:QUIT:{
.timerbancheck 0 15 bancheck
;unauths the person who quit
if ($authed($nick) == 1) {
writeini " $+ $scriptdiraccounts.ini" Authed $nick 0
}
if ($oper($nick) == 1) {
writeini " $+ $scriptdiropers.ini" Opers $account($nick) 0
}
elseif ($helper($nick) == 1) {
writeini " $+ $scriptdiropers.ini" Helpers $account($nick) 0
}
if ($nick == $me) {
;resets everyones auth to 0 (security reasons)
var %i = 1
while (%i <= $ini(" $+ $scriptdiraccounts.ini",Authed,0)) {
writeini " $+ $scriptdiraccounts.ini" Authed $ini(" $+ $scriptdiraccounts.ini",Authed,%i) 0
inc %i
}
var %x = 1
while (%x <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
writeini " $+ $scriptdiropers.ini" Opers $ini(" $+ $scriptdiropers.ini",Opers,%x) 0
inc %x
}
var %f = 1
while (%f <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
writeini " $+ $scriptdiropers.ini" Helpers $ini(" $+ $scriptdiropers.ini",Helpers,%f) 0
inc %f
}
}
}
;on text for private messages
on *:TEXT:*:?:{
.timerbancheck 0 15 bancheck
$bot.commands($1,$2,$3,$4,$5-).inpm
}
;on text for channel messages
on *:TEXT:*:#:{
.timerbancheck 0 15 bancheck
if ($channels($chan) != $null) {
$protectfromspam($nick,$chan)
}
if ($left($1,1) == %trigger) {
tokenize 32 $right($1,-1) $2-
$bot.commands($1,$2,$3,$4,$5-).inchan
}
}
;;;;;;;;USE: $bot.commands(commands|channel)(.inchan | .inpm)
alias -l bot.commands {
if ($prop == inchan) {
if ($1 == join) || ($1 == j) || ($1 == part) || ($1 == p) {
var %com = $1, %rest = $2-
}
elseif ($left($1,1) == $chr(35)) {
var %chan = $1, %com = $2, %rest = $3-
}
elseif ($left($2,1) == $chr(35)) {
var %com = $1, %chan = $2, %rest = $3-
}
else {
var %chan = $chan, %com = $1, %rest = $2-
}
}
elseif ($prop == inpm) {
if (sex* iswm $1) || (unf* iswm $1) || (banana* iswm $1) || (boner* iswm $1) || (penis* iswm $1) || ($1 == age) || (date* iswm $1) || (time* iswm $1) || ($1 == calc) || ($1 == calculator) || ($1 == 8ball) || ($1 == 8) || (help* iswm $1) || (version* iswm $1) || (credit* iswm $1) || (ping* iswm $1) || ($1 == god) || ($1 == addhelper) || ($1 == delhelper) || ($1 == helpers) || ($1 == opers) || ($1 == staff) || ($1 == reg) || ($1 == register) || ($1 == unreg) || ($1 == unregister) || ($1 == pass) || ($1 == auth) || ($1 == authenticate) || ($1 == ounreg) || ($1 == ounregister) || ($2 == trigger) || ($1 == join) || ($1 == j) || ($1 == part) || ($1 == p) || ($1 == allowauth) || ($1 == aa) || ($1 == rename) || ($1 == gag) || ($1 == ignore) || ($1 == ungag) || ($1 == unignore) || ($1 == gags) || ($1 == gaglist) {
var %com = $1, %rest = $2-
}
elseif (cc* iswm $1) || (crazy*cafcasi iswm $1) || ($1 == ignores) || ($1 == ignorelist) || ($1 == addperform) || ($1 == delperform) || ($1 == performs) || ($1 == performlist) || ($1 == dice) || ($1 == d) || ($1 == quit) || ($1 == disconnect) || ($1 == shutdown) || ($1 == trans) || ($1 == translation) {
var %com = $1, %rest = $2-
}
elseif ($left($1,1) == $chr(35)) {
var %chan = $1, %com = $2, %rest = $3-
}
elseif ($left($2,1) == $chr(35)) {
var %com = $1, %chan = $2, %rest = $3-
}
else {
.notice $nick You must provide a channel. | halt
}
}
tokenize 32 %rest
;checks to see if commands requiring a password are done in PM
if (%com == register) || (%com == reg) || (%com == unregister) || (%com == unreg) || (%com == pass) || (%com == auth) || (%com == authenticate) && ($prop == inchan) {
.notice $nick This command must be done in PM only. | halt
}
;this command is to register an account, syntax: REGISTER <account> <pass>
elseif (%com == register) || (%com == reg) {
if ($authed($nick) == 1) {
.notice $nick You are already authed with $+ $me $+ . Disconnect to register another account. | halt
}
if ($readini(" $+ $scriptdiraccounts.ini",Accounts,$1)) {
.notice $nick Account $+ $1 $+ is already registered. | halt
}
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (account and pass) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (pass) | halt
}
if ($1 == pass) || ($1 == account) || ($1 == $me) {
.notice $nick Your account name cannot be 'PASS' 'ACCOUNT' or ' $+ $me $+ '.
}
else {
;writes all necessary info to " $+ $scriptdiraccounts.ini"
writeini " $+ $scriptdiraccounts.ini" Nicks $nick $1
writeini " $+ $scriptdiraccounts.ini" Accounts $1 $nick
writeini " $+ $scriptdiraccounts.ini" $1 Nick $nick
writeini " $+ $scriptdiraccounts.ini" $1 Hostmask $wildsite
writeini " $+ $scriptdiraccounts.ini" Passwords $nick $encode($2,m)
writeini " $+ $scriptdiraccounts.ini" Authed $nick 1
.notice $nick Account $+ $1 $+ has been registered to you.
}
}
;this command is to unregister an account you are authed to, syntax: UNREGISTER <pass>
elseif (%com == unregister) || (%com == unreg) {
if ($authed($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (pass)
}
if ($encode($1,m) === $password($nick)) {
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($access($ini(" $+ $scriptdirchannels.ini",%i),$nick)) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $account($nick)
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $wildsite
}
inc %i
}
var %account $account($nick)
if ($oper($nick) != $null) {
remini " $+ $scriptdiropers.ini" Opers $account($nick)
}
if ($helper($nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $account($nick)
}
remini " $+ $scriptdiraccounts.ini" Accounts $account($nick)
remini " $+ $scriptdiraccounts.ini" $account($nick)
remini " $+ $scriptdiraccounts.ini" Passwords $nick
remini " $+ $scriptdiraccounts.ini" Authed $nick
remini " $+ $scriptdiraccounts.ini" Nicks $nick
.notice $nick Successfully unregistered account $+ %account $+ .
}
else {
.notice $nick Invalid password for account $+ $account($nick) $+ . (Case Sensitive)
}
}
else {
.notice $nick You are not authed with $+ $me $+ .
}
}
;this command is to change an accounts password that you are authed on, syntax: PASS <oldpass> <newpass>
elseif (%com == pass) {
if ($authed($nick) == 1) {
if (!$1) {
.notice $nick pass requires more parameters. (oldpass and newpass)
}
elseif (!$2) {
.notice $nick pass requires more parameters. (newpass)
}
if ($encode($1,m) === $password($nick)) {
writeini " $+ $scriptdiraccounts.ini" Passwords $nick $encode($2,m)
.notice $nick Password successfully changed to $+ $2 $+ .
}
else {
.notice $nick Invalid password for account $+ $account($nick) $+ . (Case Sensitive)
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;this command is to auth to an account, syntax: AUTH <account> <pass>
elseif (%com == auth) || (%com == authenticate) {
if ($authed($nick) == 1) {
.notice $nick You already authed with $+ $me $+ . | halt
}
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (account and pass) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$1)) {
.notice $nick Account $+ $1 $+ has not been registered with $+ $me $+ . | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (pass) | halt
}
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$1)
var %account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($authed(%account.nick) == 0) || ($authed(%account.nick) == $null) {
if ($address($nick,3) iswm $readini(" $+ $scriptdiraccounts.ini",$1,Hostmask)) || ($address($nick,2) iswm $readini(" $+ $scriptdiraccounts.ini",$1,Hostmask)) {
if ($1 == %account) && ($encode($2,m) === $password(%account.nick)) {
var %i = 1, %hostmask = $readini(" $+ $scriptdiraccounts.ini",$1,Hostmask)
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($readini(" $+ $scriptdirchannels.ini",$ini(" $+ $scriptdirchannels.ini",%i),%hostmask) != $null) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %hostmask
writeini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $wildsite $ifmatch
}
inc %i
}
;writes/changer any necessary info needed
remini " $+ $scriptdiraccounts.ini" Nicks %account.nick
writeini " $+ $scriptdiraccounts.ini" Nicks $nick $1
remini " $+ $scriptdiraccounts.ini" Authed %account.nick
writeini " $+ $scriptdiraccounts.ini" Authed $nick 1
writeini " $+ $scriptdiraccounts.ini" %account Hostmask $wildsite
writeini " $+ $scriptdiraccounts.ini" %account Nick $nick
remini " $+ $scriptdiraccounts.ini" Passwords %account.nick
writeini " $+ $scriptdiraccounts.ini" Passwords $nick $encode($2,m)
remini " $+ $scriptdiraccounts.ini" Accounts %account
writeini " $+ $scriptdiraccounts.ini" Accounts %account $nick
var %i = 1
var %accesschan = $ini(" $+ $scriptdirchannels.ini",0)
while (%i <= %accesschan) {
if (*host !iswm $ini(" $+ $scriptdirchannels.ini",%i)) && (*blist !iswm $ini(" $+ $scriptdirchannels.ini",%i)) && (*setinfo !iswm $ini(" $+ $scriptdirchannels.ini",%i)) {
var %channel.from.ini = $ini(" $+ $scriptdirchannels.ini",%i)
}
if ($access(%channel.from.ini,$nick) == peon) {
mode %channel.from.ini +v $nick
}
elseif ($access(%channel.from.ini,$nick).level <= 5) {
mode %channel.from.ini +o $nick
}
inc %i
}
.notice $nick You have successfully authed with $+ $me $+ .
}
else {
.notice $nick Invalid password for account $+ $1 $+ . (Case Sensitive)
}
}
else {
.notice $nick Invalid hostmask for account $+ $1 $+ .
}
}
else {
.notice $nick You are already authed with $+ $me $+ .
}
}
;this command is to unregister someone's account, syntax: OUNREGISTER <nick|*account>
elseif (%com == ounreg) || (%com == ounregister) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (nick|*account) | halt
}
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
}
else {
var %account.nick = $1
var %account.hostmask = $address($1,5)
if ($authed($1) == 0) {
.notice $nick $1 must first auth with $+ $me $+ . | halt
}
}
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($access($ini(" $+ $scriptdirchannels.ini",%i),%account.nick)) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %account.host
}
inc %i
}
var %account = $account(%account.nick)
if ($oper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Opers $account(%account.nick)
}
if ($helper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $account(%account.nick)
}
remini " $+ $scriptdiraccounts.ini" Accounts $account(%account.nick)
remini " $+ $scriptdiraccounts.ini" $account(%account.nick)
remini " $+ $scriptdiraccounts.ini" Passwords %account.nick
remini " $+ $scriptdiraccounts.ini" Authed %account.nick
remini " $+ $scriptdiraccounts.ini" Nicks %account.nick
.notice $nick Successfully unregistered account $+ %account $+ .
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You are not authed with $+ $me $+ .
}
}
;this command is to allow someone to auth to an account they have an invalid hostmask on,
;syntax: ALLOWAUTH <nick> <account>
elseif (%com == allowauth) || (%com == aa) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
$allowauth($nick,$1,$2)
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;this command is to rename someone's account name, syntax: RENAME <nick|*old-account> <[*]new-account>
elseif (%com == rename) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
$renameaccount($nick,$1,$2)
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;this command unauths someone, syntax: UNAUTH [nick]
elseif (%com == unauth) || (%com == deauth) {
if ($authed($nick) == 1) {
if (!$1) {
.notice $nick You must add CONFIRM to the end of your line to confirm unauthorization.
}
elseif ($1 == CONFIRM) {
writeini " $+ $scriptdiraccounts.ini" Authed $nick 0
.notice $nick You have unauthed from $+ $me $+ .
}
else {
if ($godstatus($nick) == 1) {
if ($authed($1) == 1) {
writeini " $+ $scriptdiraccounts.ini" Authed $1 0
.notice $nick $+ $1 $+ has been unauthed from $+ $me $+ .
}
else {
.notice $nick $+ $1 $+ isn't authed with $+ $me $+ .
}
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;registers a channel with the bot, syntax: REGCHAN <#channel> <nick|*account>
elseif (%com == registerchannel) || (%com == registerchan) || (%com == regchannel) || (%com == regchan) || (%com == channelregister) || (%com == chanregister) || (%com == channelreg) || (%com == chanreg) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
if ($channels(%chan) != $null) {
.notice $nick $+ %chan $+ is registered to someone else. | halt
}
if ($1 == $me) {
.notice $nick $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
else {
;writes all the channel info to the " $+ $scriptdirchannels.ini"
writeini " $+ $scriptdirchannels.ini" %chan %chan $asctime
writeini " $+ $scriptdirchannels.ini" %chan Registrar $account($nick)
writeini " $+ $scriptdirchannels.ini" %chan $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" %chan $+ host %account.host owner
writeini " $+ $scriptdirchannels.ini" %chan Setters Masters
writeini " $+ $scriptdirchannels.ini" %chan Modes None
writeini " $+ $scriptdirchannels.ini" %chan Toys 2
writeini " $+ $scriptdirchannels.ini" %chan Dynlimit Disabled
writeini " $+ $scriptdirchannels.ini" %chan Voice Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kick
writeini " $+ $scriptdirchannels.ini" %chan Protect 2
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic None
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 0
writeini " $+ $scriptdirchannels.ini" %chan Greeting None
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting None
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Disabled
write " $+ $scriptdirbotperform.txt" join %chan
join %chan
mode %chan +nt
.notice $nick Successfully registered $+ %chan $+ to $account(%account.nick) $+ .
}
}
else {
if ($authed($1) == 1) {
writeini " $+ $scriptdirchannels.ini" %chan %chan $asctime
writeini " $+ $scriptdirchannels.ini" %chan Registrar $account($nick)
writeini " $+ $scriptdirchannels.ini" %chan $account($1) owner
writeini " $+ $scriptdirchannels.ini" %chan $+ host $address($1,5) owner
writeini " $+ $scriptdirchannels.ini" %chan Setters Masters
writeini " $+ $scriptdirchannels.ini" %chan Modes None
writeini " $+ $scriptdirchannels.ini" %chan Toys 2
writeini " $+ $scriptdirchannels.ini" %chan Dynlimit Disabled
writeini " $+ $scriptdirchannels.ini" %chan Voice Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect Disabled
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kick
writeini " $+ $scriptdirchannels.ini" %chan Protect 2
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic None
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 0
writeini " $+ $scriptdirchannels.ini" %chan Greeting None
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting None
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Disabled
write " $+ $scriptdirbotperform.txt" join %chan
join %chan
mode %chan +nt
.notice $nick Successfully registered $+ %chan $+ to $1 ( $+ $account($1) $+ ).
}
else {
.notice $nick $1 must first auth with $+ $me $+ .
}
}
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;unregisters a registered channel with the bot, syntax: UNREGCHAN <#channel>
elseif (%com == unregisterchannel) || (%com == unregisterchan) || (%com == unregchannel) || (%com == unregchan) || (%com == channelunregister) || (%com == chanunregister) || (%com == channelunreg) || (%com == chanunreg) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if (!$1) {
if ($godstatus($nick) == 1) {
if ($nodelete(%chan) == Enabled) {
.notice $nick $+ %chan $+ is protected from unregistration. (NoDelete) | halt
}
;removes all info the channel had
remini " $+ $scriptdirchannels.ini" %chan
remini " $+ $scriptdirchannels.ini" %chan $+ host
remini " $+ $scriptdirchannels.ini" %chan $+ blist
remini " $+ $scriptdirchannels.ini" %chan $+ setinfo
$iif($isfile(" $+ $scriptdir $+ %chan $+ quote.txt") == $true,remove " $+ $scriptdir $+ %chan $+ quote.txt")
write -dw $+ "join %chan $+ " " $+ $scriptdirbotperform.txt"
part %chan Channel unregistered by $nick $+ .
$iif(%dynlimit. [ $+ [ %chan ] ],unset %dynlimit. [ $+ [ %chan ] ])
.notice $nick Successfully unregistered $+ %chan $+ .
}
elseif ($access(%chan,$nick) == Owner) {
if ($nodelete(%chan) == Enabled) {
.notice $nick $+ %chan $+ is protected from unregistration. (NoDelete) | halt
}
.notice $nick To confirm this unregistration, you must append 'CONFIRM' to the end of your command.
}
elseif ($access(%chan,$nick) != Owner) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
elseif ($1 == CONFIRM) {
if ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
remini " $+ $scriptdirchannels.ini" %chan
remini " $+ $scriptdirchannels.ini" %chan $+ host
remini " $+ $scriptdirchannels.ini" %chan $+ blist
remini " $+ $scriptdirchannels.ini" %chan $+ setinfo
$iif($isfile(" $+ $scriptdir $+ %chan $+ quote.txt") == $true,remove " $+ $scriptdir $+ %chan $+ quote.txt")
write -dw $+ "join %chan $+ " " $+ $scriptdirbotperform.txt"
part %chan Channel unregistered by $nick $+ .
.notice $nick Successfully unregistered $+ %chan $+ .
}
elseif ($access(%chan,$nick) != Owner) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick $+ %chan $+ has not been registered with $+ $me $+ .
}
}
;moves a channels userlist, banlist, info to another channl, syntax: MOVE <#channe> <destination>
elseif (%com == move) {
if ($authed($nick) == 1) {
if ($godstatus($nick) == 1) {
if ($channels(%chan) != $null) {
if (!%chan) {
.notice $nick move requires more parameters. (channel and destination) | halt
}
elseif (!$1) {
.notice $nick move requires more parameters. (destination) | halt
}
if ($channels($1) != $null) {
.notice $nick $+ $1 $+ is registered to someone else. | halt
}
if ($left($1,1) != $chr(35)) {
.notice $nick That is not a valid channel. | halt
}
else {
$initopicchanger(" $+ $scriptdirchannels.ini",%chan,$1)
$initopicchanger(" $+ $scriptdirchannels.ini",%chan $+ host,$1 $+ host)
$initopicchanger(" $+ $scriptdirchannels.ini",%chan $+ blist,$1 $+ blist)
$initopicchanger(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$1 $+ setinfo)
write -ds $+ "join %chan" " $+ $scriptdirbotperform.txt"
write " $+ $scriptdirbotperform.txt" join $1
part %chan Channel moved to $1 $+ .
join $1
mode $1 $readini(" $+ $scriptdirchannels.ini",$1,Modes)
.notice $nick Channel registration moved from $+ %chan $+ to $+ $1 $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
else {
.notice $nick You must have security override (helping mode) on to use this command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;toggle godmode (security override) for helpers and opers, syntax: GOD [on|off]
elseif (%com == god) || (%com == h4x) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) || ($helper($nick) != $null) {
var %helper.or.oper = $iif($helper($nick) != $null,Helpers,Opers)
if ($1 == on) || ($1 == 1) || ($1 == Enable) {
if ($godstatus($nick) == 1) {
.notice $nick Security override is already enabled. | halt
}
writeini " $+ $scriptdiropers.ini" %helper.or.oper $account($nick) 1
.notice $nick Security override has been enabled.
}
elseif ($1 == off) || ($1 == 0) || ($1 == Disable) {
if ($godstatus($nick) == 0) {
.notice $nick Security override is already disabled. | halt
}
writeini " $+ $scriptdiropers.ini" %helper.or.oper $account($nick) 0
.notice $nick Security override has been disabled.
}
else {
var %god.status = $iif($godstatus($nick) == 1,0,1)
writeini " $+ $scriptdiropers.ini" %helper.or.oper $account($nick) %god.status
.notice $nick Security override has been $iif($godstatus($nick) == 1,enabled.,disabled.)
}
}
else {
.notice $nick god is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;add a helper to the bot, syntax: ADDHELPER <nick|*account>
elseif (%com == addhelper) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick addhelper requires more parameters. (nick|*account) | halt
}
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
elseif (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
elseif ($helper(%account.nick)) {
.notice $nick %account.nick is already a helper.
}
elseif ($oper(%account.nick)) {
.notice $nick %account.nick is already an oper.
}
else {
writeini " $+ $scriptdiropers.ini" Helpers $account(%account.nick) 1
.notice $nick Added $account(%account.nick) as a helper successfully.
}
}
else {
elseif ($helper($1) != $null) {
.notice $nick $+ $1 $+ is already a helper. | halt
}
elseif ($oper($1) != $null) {
.notice $nick $+ $1 $+ is already an oper. | halt
}
if ($authed($1) == 1) {
writeini " $+ $scriptdiropers.ini" Helpers $account($1) 1
.notice $nick Added $1 ( $+ $account($1) $+ ) as a helper successfully.
}
else {
.notice $nick $1 is not authed with $+ $me $+ .
}
}
}
else {
.notice $nick addhelper is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;deletes a helper from the bot, syntax: DELHELPER <nick|*account>
elseif (%com == delhelper) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$1) {
.notice $nick delhelper requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($helper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $remove($1,*)
.notice $nick Removed $account(%account.nick) from a helper successfully.
}
else {
.notice $nick $account(%account.nick) is not a helper.
}
}
else {
elseif ($oper($1) != $null) {
.notice $nick $1 is already an oper. | halt
}
if ($authed($1) == 1) {
if ($helper($1) != $null) {
remini " $+ $scriptdiropers.ini" Helpers $account($1)
.notice $nick Removed $1 ( $+ $account($1) $+ ) from a helper successfully.
}
else {
.notice $nick $1 is not a helper.
}
}
else {
.notice $nick $1 must first auth with $+ $me $+ .
}
}
}
else {
.notice $nick delhelper is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;people with access to the channel can set an info line for when they join the channel, syntax: SETINFO [info]
elseif (%com == setinfo) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == peon) || ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) {
if (!$1) {
.notice $nick $iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) == $null,You don't have an info line set.,$parse.from.ini($readini(" $+ $scriptdirchannels.ini",$chan $+ setinfo,$account($nick))))
}
elseif ($1 == $chr(42)) {
if ($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null) {
remini " $+ $scriptdirchannels.ini" %chan $+ setinfo $account($nick)
.notice $nick Your info line has been cleared.
}
else {
.notice $nick You don't have an info line set.
}
}
else {
writeini " $+ $scriptdirchannels.ini" %chan $+ setinfo $account($nick) $parse.to.ini($1-)
.notice $nick Your info line has been set to ' $+ $1- $+ '.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;tells the user that these commands must be done manually
elseif (%com == addoper) || (%com == deloper) {
.notice $nick Sorry, that command must be done manually.
}
;adds the specified user to the channel, syntax: ADDUSER <level> <nick|*account>
elseif (%com == adduser) {
$adduser($nick,$2,%chan,$1)
}
;adds a peon to the channel userlist, syntax: ADDPEON <nick|*account>
elseif (%com == addpeon) {
$adduser($nick,$1,%chan,peon)
}
;adds an op to the channel userlist, syntax: ADDOP <nick|*account>
elseif (%com == addop) {
$adduser($nick,$1,%chan,op)
}
;adds a master to the channel userlist, syntax: ADDMASTER <nick|*account>
elseif (%com == addmaster) {
$adduser($nick,$1,%chan,master)
}
;adds a coowner to the channel userlist, syntax: ADDCOOWNER <nick|*account>
elseif (%com == addcoowner) || (%com == addco) {
$adduser($nick,$1,%chan,coowner)
}
;adds an owner to the channel userlist, syntax: ADDOWNER <nick|*account>
elseif (%com == addowner) {
$adduser($nick,$1,%chan,owner)
}
;changes a person's access level on the channel userlist, syntax: CLVL <nick|*account> <access-level>
elseif (%com == clvl) || (%com == changelvl) || (%com == changelevel) {
$clvl($nick,$1,%chan,$2)
}
;deletes a peon from the channel userlist, syntax: DELPEON <nick|*account>
elseif (%com == delpeon) {
$deluser($nick,$1,%chan,peon)
}
;deletes an op from the channel userlist, syntax: DELOP <nick|*account>
elseif (%com == delop) {
$deluser($nick,$1,%chan,op)
}
;deletes a master from the channel userlist, syntax: DELMASTER <nick|*account>
elseif (%com == delmaster) {
$deluser($nick,$1,%chan,master)
}
;deletes a coowner from the channel userlist, syntax: DELCOOWNER <nick|*account>
elseif (%com == delcoowner) || (%com == delco) {
$deluser($nick,$1,%chan,coowner)
}
;deletes an owner from the channel userlist, syntax: DELOWNER <nick|*account>
elseif (%com == delowner) {
$deluser($nick,$1,%chan,owner)
}
;deletes a user from the channel userlist, syntax: DELUSER <nick|*account>
elseif (%com == deluser) {
if ($chr(42) isin $1) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
$deluser($nick,$1,%chan,$access(%chan,%account.nick))
}
else {
$deluser($nick,$1,%chan,$access(%chan,$1))
}
}
elseif (%com == suspend) {
$suspend($nick,$1,%chan,$2)
}
elseif (%com == unsuspend) {
$unsuspend($nick,$1,%chan)
}
;displays all peons for the channel, syntax: PLIST [mask]
elseif (%com == plist) || (%com == peons) {
if ($channels(%chan) != $null) {
.notice $nick %chan peons: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,peon) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,peon))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all ops for the channel, syntax: OLIST
elseif (%com == olist) || (%com == ops) {
if ($channels(%chan) != $null) {
.notice $nick %chan ops: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,op) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,op))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all masters for the channel, syntax: MLIST
elseif (%com == mlist) || (%com == masters) {
if ($channels(%chan) != $null) {
.notice $nick %chan masters: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,master) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,master))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all coowners for the channel, syntax: CLIST
elseif (%com == clist) || (%com == coowners) {
if ($channels(%chan) != $null) {
.notice $nick %chan coowners: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,coowner))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all owners for the channel, syntax: WLIST
elseif (%com == wlist) || (%com == owners) {
if ($channels(%chan) != $null) {
.notice $nick %chan owners: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber $+ )
.notice $nick $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,owner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,owner))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all users for the channel, syntax: USERS
elseif (%com == users) {
if ($channels(%chan) != $null) {
.timerusers -m 1 50 .notice $nick %chan users: ( $+ $calc($readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber + $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber) $+ )
.timerowner 1 1 .notice $nick Owners $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,owner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,owner))
.timercoowner 1 2 .notice $nick Coowners $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,coowner))
.timermaster 1 3 .notice $nick Masters $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,master) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,master))
.timerop 1 4 .notice $nick Ops $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,op) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,op))
.timerpeon 1 5 .notice $nick Peons $+ ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber $+ ) $+ : $iif($readalltheini(" $+ $scriptdirchannels.ini",%chan,peon) == $null,None.,$userlist(" $+ $scriptdirchannels.ini",%chan,peon))
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all opers of the bot, syntax: OPERS
elseif (%com == opers) || (%com == ircops) {
var %i = 1, %olist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
%olist = $instok(%olist,$ini(" $+ $scriptdiropers.ini",Opers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%olist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%olist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Opers of $me $+ : ( $+ $numtok(%names,32) $+ )
if ($ini(" $+ $scriptdiropers.ini",Opers,0) == 0) {
.notice $nick None. | halt
}
$iif(%names,.notice $nick %names)
}
;displays all helpers of the bot, syntax: HELPERS
elseif (%com == helpers) {
var %i = 1, %hlist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
var %hlist = $instok(%hlist,$ini(" $+ $scriptdiropers.ini",Helpers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%hlist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%hlist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Helpers of $me $+ : ( $+ $numtok(%names,32) $+ )
if ($ini(" $+ $scriptdiropers.ini",Helpers,0) == 0) {
.notice $nick None. | halt
}
$iif(%names,.notice $nick %names)
}
;displays all staff (helper and oper) of the bot, syntax: STAFF
elseif (%com == staff) {
.notice $nick $+ $me $+ 's staff:
if ($ini(" $+ $scriptdiropers.ini",Opers,0) == 0) {
.notice $nick Opers(0): None.
}
else {
var %i = 1, %olist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Opers,0)) {
var %olist = $instok(%olist,$ini(" $+ $scriptdiropers.ini",Opers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%olist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%olist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Opers $+ ( $+ $numtok(%names,32) $+ ): %names
}
if ($ini(" $+ $scriptdiropers.ini",Helpers,0) == 0) {
.notice $nick Helpers(0) None.
}
else {
var %i = 1, %hlist = $null
while (%i <= $ini(" $+ $scriptdiropers.ini",Helpers,0)) {
var %hlist = $instok(%hlist,$ini(" $+ $scriptdiropers.ini",Helpers,%i),*,255)
inc %i
}
var %names, %num = 1
while (%num <= $numtok($replace(%hlist,$chr(255),$chr(32)),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($replace(%hlist,$chr(255),$chr(32)),%num,32)
inc %num
}
.notice $nick Helpers $+ ( $+ $numtok(%names,32) $+ ): %names
}
}
;invites a user to the channel, syntax: INVITE <nick>
elseif (%com == invite) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (nick)
}
else {
if ($1 !ison %chan) {
invite $1 %chan
.notice $nick Invited $+ $1 $+ to %chan $+ .
}
else {
.notice $nick $+ $1 $+ is already on %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access to %chan $+ .
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;invites yourself to the channel, syntax: INVITEME <#channel>
elseif (%com == inviteme) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($nick !ison %chan) {
invite $nick %chan
}
else {
.notice $nick You are already on $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays various info about the channel, syntax: INFO <#channel>
elseif (%com == info) {
if ($channels(%chan) != $null) {
var %ownercount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,owner).totalnumber
var %coownercount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,coowner).totalnumber
var %mastercount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,master).totalnumber
var %opcount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,op).totalnumber
var %peoncount = $readalltheini(" $+ $scriptdirchannels.ini",%chan,peon).totalnumber
var %totalusercount = $calc(%ownercount + %coownercount + %mastercount + %opcount + %peoncount)
var %totalbancount = $readalltheini(" $+ $scriptdirchannels.ini",%chan $+ blist,*).totalnumber
.timernoticeinfo -m 1 50 .notice $nick $+ %chan $+ info:
.timernoticeuser1 1 1 .notice $nick Owners: %ownercount Coowners: %coownercount Masters: %mastercount
.timernoticeuser2 1 2 .notice $nick Ops: %opcount Peons: %peoncount Total Users: %totalusercount Total Ban Count: %totalbancount
.timernoticebancount 1 3 .notice $nick Registered: $channels(%chan) - $readini(" $+ $scriptdirchannels.ini",%chan,Registrar)
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays various pieces of information about a channel user, including channel and bot access level
;and the user's info line. If no nick or account is provided, bot returns your own information.
;syntax: ACCESS [nick]
elseif (%com == access) {
if ($channels(%chan) != $null) {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
.notice $nick Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access(%chan,%account.nick).account == $null) {
if ($oper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is an IRCOp.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) lacks access to %chan but has security override enabled. | halt
}
else {
.notice $nick $account(%account.nick) lacks access to %chan $+ . | halt
}
}
elseif ($helper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is a Helper.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) lacks access to %chan but has security override enabled. | halt
}
else {
.notice $nick $account(%account.nick) lacks access to %chan $+ . | halt
}
}
else {
.notice $nick $account(%account.nick) lacks access to %chan $+ . | halt
}
}
if ($access(%chan,%account.nick).account != $null) {
if ($oper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is an IRCOp.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick).account) != $null,.notice $nick $chr(91) $+ $account(%account.nick).account $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
else {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
}
elseif ($helper(%account.nick) != $null) {
.notice $nick $account(%account.nick) is a Helper.
if ($godstatus(%account.nick) == 1) {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
else {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
}
else {
.notice $nick $account(%account.nick) is $iif($left($access(%chan,%account.nick).account,1) == o, an $+ $access(%chan,%account.nick).account $+ , a $+ $access(%chan,%account.nick).account $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)) != $null,.notice $nick $chr(91) $+ $account(%account.nick) $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account(%account.nick)))) | halt
}
}
}
if ($1 == $me) {
.notice $nick $+ $me $+ is the channel service bot. | halt
}
elseif (!$1) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == $null) {
if ($oper($nick) != $null) {
.notice $nick $nick is an IRCOp.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan $+ .
}
}
elseif ($helper($nick)) {
.notice $nick $nick is a Helper.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan $+ .
}
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) lacks access to %chan $+ .
}
}
if ($access(%chan,$nick) != $null) {
if ($oper($nick) != $null) {
.notice $nick $nick is an IRCOp.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
}
elseif ($helper($nick)) {
.notice $nick $nick is a Helper.
if ($godstatus($nick) == 1) {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
}
else {
.notice $nick $nick ( $+ $account($nick) $+ ) is $iif($left($access(%chan,$nick),1) == o,an $+ $access(%chan,$nick) $+ , a $+ $access(%chan,$nick) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)) != $null,.notice $nick $chr(91) $+ $nick $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($nick)))) | halt
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
if ($authed($1) == 1) {
if ($access(%chan,$1) == $null) {
if ($oper($1) != $null) {
.notice $nick $1 is an IRCOp.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan $+ .
}
}
if ($helper($1) != $null) {
.notice $nick $1 is a Helper.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan but has security override enabled.
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan $+ .
}
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) lacks access to %chan $+ .
}
}
if ($access(%chan,$1) != $null) {
if ($oper($1) != $null) {
.notice $nick $1 is an IRCOp.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
}
elseif ($helper($1) != $null) {
.notice $nick $1 is a Helper.
if ($godstatus($1) == 1) {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan and has security override enabled.
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
}
else {
.notice $nick $1 ( $+ $account($1) $+ ) is $iif($left($access(%chan,$1),1) == o,an $+ $access(%chan,$1) $+ , a $+ $access(%chan,$1) $+ ) in %chan $+ .
$iif($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)) != $null,.notice $nick $chr(91) $+ $1 $+ $chr(93) $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan $+ setinfo,$account($1)))) | halt
}
}
}
else {
.notice $nick $1 must first auth with $+ $me $+ .
}
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;ops/voices you if you have access, syntax: UP
elseif (%com == up) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Owner) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Op) {
if ($nick isop %chan) {
.notice $nick You are already opped in $+ %chan $+ . | halt
}
else {
mode %chan +o $nick
}
}
elseif ($access(%chan,$nick) == Peon) {
if ($nick isvoice %chan) {
.notice $nick You are already voiced in $+ %chan $+ . | halt
}
else {
mode %chan +v $nick
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deops/devoices you in the channel, syntax DOWN
elseif (%com == down) {
if ($channels(%chan) != $null) {
if ($nick !isop %chan) && ($nick !isvoice %chan) {
.notice $nick You are not opped or voiced in $+ %chan $+ . | halt
}
else {
mode %chan -ov $nick $nick
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;giveownership of the channel to another user, syntax: GIVEOWNERSHIP [nick|*account]
elseif (%com == giveownership) {
$giveownership($nick,$1,%chan)
}
;sets the setters level for the channel, syntax: SET SETTERS <value>
elseif (%com == set) && ($1 == setters) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
;checks the current channel's setters
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == setters) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == 2) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan Setters Masters
.notice $nick Setters 0 - Masters and above may change settings.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan Setters Coowners
.notice $nick Setters 1 - Coowners and above may change settings.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan Setters Owners
.notice $nick Setters 2 - Owners may change settings.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid setters setting.
}
}
else {
if ($setters(%chan) == Masters) {
.notice $nick Setters 0 - Masters and above may change settings.
}
elseif ($setters(%chan) == Coowners) {
.notice $nick Setters 1 - Coowners and above may change settings.
}
elseif ($setters(%chan) == Owners) {
.notice $nick Setters 2 - Owners may change settings.
}
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;adjusts user limit to prevent join floods, syntax: SET DYNLIMIT <value>
elseif (%com == set) && ($1 == dynlimit) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == dynlimit) {
if ($2 != $null) {
if ($2 == 0) || ($2 == Disable) {
writeini " $+ $scriptdirchannels.ini" %chan Dynlimit Disabled
.timerdynlimit [ $+ [ %chan ] $+ ] off
.notice $nick Dynlimit - Disabled.
}
elseif ($2 == 1) || ($2 == Enable) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic Enabled
.timerdynlimit [ $+ [ %chan ] ] 0 300 chanlimit %chan
.notice $nick Dynlimit - Enabled.
mode %chan +l $calc($nick(%chan,0) + 7)
}
else {
.notice $nick $+ $2 $+ is an invalid binary value.
}
}
else {
.notice $nick Dynlimit - $dynlimit(%chan) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the default topic for the channel, syntax: SET DEFAULTTOPIC <new-topic>
elseif (%com == set) && ($1 == topic) || ($1 == defaulttopic) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == topic) || ($1 == defaulttopic) {
if ($2 != $null) {
if ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic None
topic %chan $chr(3)
.notice $nick DefaultTopic - None.
}
else {
writeini " $+ $scriptdirchannels.ini" %chan DefaultTopic $parse.to.ini($2-)
topic %chan $2-
.notice $nick DefaultTopic - $2-
}
}
elseif ($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic) == None) {
.notice $nick DefaultTopic - None. | halt
}
else {
.notice $nick DefaultTopic - $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic))
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the access level required to change the topic, syntax: SET ENFTOPIC <value>
elseif (%com == set) && ($1 == enftopic) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == enftopic) {
if ($2 != $null) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 0
.notice $nick EnfTopic - Anyone may change the topic.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 1
.notice $nick EnfTopic - Ops and above may change the topic.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 2
.notice $nick EnfTopic - Masters and above may change the topic.
}
elseif ($2 == 3) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 3
.notice $nick EnfTopic - Coowners and above may change the topic.
}
elseif ($2 == 4) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 4
.notice $nick EnfTopic - Only owners may change the topic.
}
elseif ($2 == 5) {
writeini " $+ $scriptdirchannels.ini" %chan EnfTopic 5
.notice $nick EnfTopic - No one may change the topic.
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid topic lock enforcement setting.
}
}
else {
.notice $nick EnfTopic - $enftopic(%chan).words $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;changes the current channel's topic, syntax: TOPIC [topic]
elseif (%com == topic) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($calc($access(%chan,$nick).level - 1) >= $enftopic(%chan)) || ($godstatus($nick) == 1) {
if ($1 == $null) {
if ($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic) != None) {
topic %chan $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic))
.notice $nick Topic is now ' $+ $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic)) $+ '.
}
else {
.notice $nick $+ %chan $+ does not have a default topic set.
}
}
else {
topic %chan $1-
.notice $nick Topic is now ' $+ $1- $+ '.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel greeting, syntax: SET GREETING <greeting>
elseif (%com == set) && ($1 == greeting) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == greeting) {
if ($2 != $null) {
if ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan Greeting None
.notice $nick Greeting - None.
}
else {
writeini " $+ $scriptdirchannels.ini" %chan Greeting $parse.to.ini($2-)
.notice $nick Greeting - $2-
}
}
elseif ($readini(" $+ $scriptdirchannels.ini",%chan,Greeting) == None) {
.notice $nick Greeting - None. | halt
}
else {
.notice $nick Greeting - $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,Greeting))
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel greeting, syntax: SET USERGREETING <user-greeting>
elseif (%com == set) && ($1 == usergreeting) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == usergreeting) {
if ($2 != $null) {
if ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting None
.notice $nick UserGreeting - None.
}
else {
writeini " $+ $scriptdirchannels.ini" %chan UserGreeting $parse.to.ini($2-)
.notice $nick UserGreeting - $2-
}
}
elseif ($readini(" $+ $scriptdirchannels.ini",%chan,UserGreeting) == None) {
.notice $nick UserGreeting - None. | halt
}
else {
.notice $nick UserGreeting - $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,UserGreeting))
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel toys option, syntax: SET TOYS <value>
elseif (%com == set) && ($1 == toys) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == toys) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == 2) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan Toys 0
.notice $nick Toys - Toys are completely disabled.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan Toys 1
.notice $nick Toys - Toys will only reply privately.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan Toys 2
.notice $nick Toys - Toys will reply publicly.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid toys setting.
}
}
else {
if ($toys(%chan) == 0) {
.notice $nick Toys $toys(%chan) - Toys are completely disabled
}
elseif ($toys(%chan) == 1) {
.notice $nick Toys $toys(%chan) - Toys will only reply privately.
}
elseif ($toys(%chan) == 2) {
.notice $nick Toys $toys(%chan) - Toys will reply publicly.
}
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel default modes, syntax: SET MODES <modes>
elseif (%com == set) && ($1 == modes) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == modes) {
if ($2 != $null) {
if ($2 == $chr(42)) {
$modelock(%chan,$nick,$2-) | return
}
var %i = 1, %length = $len($remove($2,+,-))
while (%i <= %length) {
if ($mid($remove($2,+,-),%i,1) !isin $chanmodes) {
.notice $nick $+ $2 $+ is an invalid mode lock setting. | halt
}
inc %i
}
$modelock(%chan,$nick,$2,$3,$5)
}
else {
$restoremodes(%chan,$nick).info
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;change the channel modes, syntax: MODE [mode]
elseif (%com == mode) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 != $null) {
var %i = 1, %length = $len($remove($1,+,-))
while (%i <= %length) {
if ($mid($remove($1,+,-),%i,1) !isin $chanmodes) {
.notice $nick $+ $1 $+ is an invalid mode lock setting. | halt
}
inc %i
}
$modechange(%chan,$nick,$1,$2,$3,$4)
}
else {
$restoremodes(%chan,$nick)
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel voice, syntax: SET VOICE <value>
elseif (%com == set) && ($1 == voice) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == voice) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == off) || ($2 == 1) || ($2 == on) {
if ($2 == 0) || ($2 == off) {
writeini " $+ $scriptdirchannels.ini" %chan Voice Disabled
.notice $nick Voice - Disabled.
}
elseif ($2 == 1) || ($1 == on) {
writeini " $+ $scriptdirchannels.ini" %chan Voice Enabled
.notice $nick Voice - Enabled.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid voice setting.
}
}
else {
.notice $nick Voice - $readini(" $+ $scriptdirchannels.ini",%chan,Voice) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel protect, syntax: SET PROTECT <value>
elseif (%com == set) && ($1 == protect) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == protect) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == 2) {
if ($2 == 0) {
writeini " $+ $scriptdirchannels.ini" %chan Protect 0
.notice $nick Protect 0 - No users will be protected.
}
elseif ($2 == 1) {
writeini " $+ $scriptdirchannels.ini" %chan Protect 1
.notice $nick Protect 1 - Users will be protected from those of lower access.
}
elseif ($2 == 2) {
writeini " $+ $scriptdirchannels.ini" %chan Protect 2
.notice $nick Protect 2 - Users will be protected from those of equal or lower access.
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid protect setting.
}
}
else {
if ($protection(%chan) == 0) {
.notice $nick Protect 0 - No users will be protected.
}
elseif ($protection(%chan) == 1) {
.notice $nick Protect 1 - Users will be protected from those of lower access.
}
elseif ($protection(%chan) == 2) {
.notice $nick Protect 2 - Users will be protected from those of equal or lower access.
}
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel spam option, syntax: SET SPAM <off|number of line> <time>
elseif (%com == set) && ($1 == spam) || ($1 == spamprotect) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == spam) || ($1 == spamprotect) {
if ($2 != $null) {
if ($2 == off) || ($2 == 0) || ($2 == $chr(42)) {
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect Disabled
.notice $nick SpamProtect - Disabled.
}
elseif ($2 isnum) && ($3 != $null) {
writeini " $+ $scriptdirchannels.ini" %chan SpamProtect $2 $timeduration($3)
.notice $nick SpamProtect - $2 line $+ $iif(1 < $2,s,$chr(32)) in $duration($timeduration($3)) $+ .
}
elseif ($2 isnum) && ($3 == $null) {
.notice $nick $+ %com $lower($1) $+ requires more parameters. (duration)
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid $+ $lower($1) $+ setting.
}
}
else {
.notice $nick SpamProtect - $iif($spamprotect(%chan) == disabled,Disabled,$gettok($spamprotect(%chan),1,32) line $+ $iif(1 < $gettok($spamprotect(%chan),1,32),s,$chr(32)) in $duration($gettok($spamprotect(%chan),2,32))) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel spampunish option, syntax: SET SPAMPUNISH <kick|ban|kickban|timeban [duration]>
elseif (%com == set) && ($1 == spampunish) || ($1 == spamprotectpunish) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
var %setters = $setters(%chan)
if (%setters != $null) {
if ($setters(%chan) == Masters) {
var %setters.number = 3
}
elseif ($setters(%chan) == Coowners) {
var %setters.number = 4
}
elseif ($setters(%chan) == Owners) {
var %setters.number = 5
}
}
if ($setters(%chan) == %setters) {
if ($access(%chan,$nick).level >= %setters.number) {
if ($1 == spampunish) || ($1 == spamprotectpunish) {
if ($2 != $null) {
if ($2 == kick) || ($2 == k) {
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kick
.notice $nick SpamPunish - kick.
}
elseif ($2 == ban) || ($2 == b) {
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish ban
.notice $nick SpamPunish - ban.
}
elseif ($2 == kickban) || ($2 == kb) {
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish kickban
.notice $nick SpamPunish - kickban.
}
elseif ($2 == timeban) || ($2 == tb) {
if (!$3) {
.notice $nick $+ %com $lower($1) $+ requires more parameters. (duration)
}
writeini " $+ $scriptdirchannels.ini" %chan SpamPunish timeban $timeduration($3)
.notice $nick SpamPunish - timeban $duration($timeduration($3)) $+ .
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid $+ $lower($1) $+ setting.
}
}
else {
.notice $nick SpamPunish - $iif($spampunish(%chan) == disabled,Disabled,$gettok($spampunish(%chan),1,32) $iif($gettok($spampunish(%chan),2,32) != $null,$duration($gettok($spampunish(%chan),2,32)))) $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the channel no delete option, syntax: SET NODELETE <value>
elseif (%com == set) && ($1 == nodelete) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($1 == nodelete) {
if ($2 != $null) {
if ($2 isnum) && ($2 == 0) || ($2 == 1) || ($2 == on) || ($2 == off) {
if ($2 == 0) || ($2 == off) {
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Disabled
.notice $nick NoDelete - Disabled
}
elseif ($2 == 1) || ($2 == on) {
writeini " $+ $scriptdirchannels.ini" %chan NoDelete Enabled
.notice $nick NoDelete - Enabled
}
}
else {
.notice $nick ' $+ $2 $+ ' is an invalid nodelete setting.
}
}
else {
.notice $nick NoDelete - $nodelete(%chan)
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
else {
.notice $nick nodelete is a privileged setting.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sets the global trigger, syntax: SET TRIGGER <trigger>
elseif (%com == set) && ($1 == trigger) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($1 == trigger) {
if ($2 != $null) {
set %trigger $2
.notice $nick Set global trigger to ' $+ $2 $+ '
}
else {
.notice $nick Global trigger is set to ' $+ %trigger $+ '
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
else {
.notice $nick trigger is a privileged setting.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;shows the channel set options and their values, syntax: SET
elseif (%com == set) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($1 == $null) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
.timerset1 -m 1 50 .notice $nick $+ %chan $+ settings:
.timerset2 1 1 .notice $nick Topic: $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,DefaultTopic)) $chr(3) $chr($1) $chr(3) $chr($1) EnfTopic: $enftopic(%chan).words $chr(3) $chr($1) $chr(3) $chr($1) Setters: $readini(" $+ $scriptdirchannels.ini",%chan,Setters) NoDelete: $nodelete(%chan) $chr(3) $chr($1) $chr(3) $chr($1) SpamProtect: $iif($spamprotect(%chan) == disabled,Disabled,$gettok($spamprotect(%chan),1,32) line $+ $iif(1 < $gettok($spamprotect(%chan),1,32),s,$chr(32)) in $duration($gettok($spamprotect(%chan),2,32)))
.timerset3 1 2 .notice $nick Greeting: $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,Greeting)) $chr(3) $chr($1) $chr(3) $chr($1) UserGreeting: $parse.from.ini($readini(" $+ $scriptdirchannels.ini",%chan,UserGreeting)) $chr(3) $chr($1) $chr(3) $chr($1) Mode Lock: $restoremodes(%chan,$nick).info2 SpamPunish: $gettok($spampunish(%chan),1,32) $iif($gettok($spampunish(%chan),2,32) != $null,$duration($ifmatch))
.timerset4 1 3 .notice $nick Voice: $readini(" $+ $scriptdirchannels.ini",%chan,Voice) $chr(3) $chr($1) $chr(3) $chr($1) Toys: $iif($toys(%chan) == 0,Toys are completely disabled,$iif($toys(%chan) == 1,Toys will only reply privately,Toys will reply publicly)) $chr(3) $chr($1) $chr(3) $chr($1) Protection: $iif($protection(%chan) == 0,No users will be protected.,$iif($protection(%chan) == 1,Users will be protected from those of lower access.,Users will be protected from those of equal or lower access.))
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick $+ $1 $+ is not a valid set option.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;voices all users in the channel, syntax: VOICEALL
elseif (%com == voiceall) || (%com == va) || (%com == vall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) {
var %n = $iif(%n,%n) $nick(%chan,%i)
}
}
mmode %chan + v %n
.notice $nick Voiced all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;voices specified users in the channel, syntax: VOICE <user[s]>
elseif (%com == voice) || (%com == v) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan + $+ $str(v,$numtok($1-6,32)) $1-6
.notice $nick Voiced users in $+ %chan $+ .
tokenize 32 $7-
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;devoices all users in the channel, syntax: DEVOICEALL
elseif (%com == devoiceall) || (%com == dva) || (%com == dvall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) {
var %n = $iif(%n,%n) $nick(%chan,%i)
}
}
mmode %chan - v %n
.notice $nick Devoiced all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;devoices specified users in the channel, syntax: DEVOICE <user[s]>
elseif (%com == devoice) || (%com == dv) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(v,$numtok($1-6,32)) $1-6
.notice $nick Devoiced users in $+ %chan $+ .
tokenize 32 $7-
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;ops all users in the channel, syntax: OPALL
elseif (%com == opall) || (%com == oall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) {
var %n = $iif(%n,%n) $nick($chan,%i)
}
}
mmode %chan + o %n
.notice $nick Opped all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;op specified users in the channel, syntax: OP <user[s]>
elseif (%com == op) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan + $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Opped users in $+ %chan $+ .
tokenize 32 $7-
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deoppes all users in the channel, syntax: DEOPALL
elseif (%com == deopall) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %n, %i = 0
while (%i <= $nick(%chan,0)) {
inc %i
if ($nick(%chan,%i) != $me) && ($nick(%chan,%i) != $nick) {
var %n = $iif(%n,%n) $nick($chan,%i)
}
}
mmode %chan - o %n
.notice $nick Deopped all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deop specified users in the channel, syntax: DEOP <user[s]>
elseif (%com == deop) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == Op) || ($access(%chan,$nick) == Master) || ($access(%chan,$nick) == Coowner) || ($access(%chan,$nick) == Owner) || ($godstatus($nick) == 1) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. | halt
}
elseif ($1 == $me) {
.notice $nick You cannot deop the channel service bot. | halt
}
elseif ($1 != $null) {
tokenize 32 $1-
if ($protection(%chan) == 2) {
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($access(%chan,$nick).level <= $access(%chan,$gettok($1-6,%i,32)).level) {
.notice $nick Sorry, $+ $gettok($1-6,%i,32) $+ is protected. | halt
}
else {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Deopped users in $+ %chan $+ .
tokenize 32 $7-
inc %i
}
}
elseif ($protection(%chan) == 1) {
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($access(%chan,$nick).level <= $access(%chan,$gettok($1-6,%i,32)).level) {
.notice $nick Sorry, $+ $gettok($1-6,%i,32) $+ is protected. | halt
}
else {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Deopped users in $+ %chan $+ .
tokenize 32 $7-
inc %i
}
}
else {
var %i = 1
while (%i <= $numtok($1-6,32)) {
if ($gettok($1-6,%i,32) !ison %chan) {
.notice $nick $+ $me $+ could not process some of the nicks you provided. | halt
}
inc %i
}
mode %chan - $+ $str(o,$numtok($1-6,32)) $1-6
.notice $nick Deopped users in $+ %chan $+ .
tokenize 32 $7-
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;kicks a user in the channel, syntax KICK <nick>
elseif (%com == kick) || (%com == k) || (%com == pwn) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $me) {
.notice $nick You cannot kick the channel service bot. | halt
}
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (nick) | halt
}
if ($1 ison %chan) {
if ($protection(%chan) == 2) {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
kick %chan $1 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kicked $+ $1 $+ from %chan $+ .
}
}
elseif ($protection(%chan) == 1) {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
kick %chan $1 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kicked $+ $1 $+ from %chan $+ .
}
}
elseif ($protection(%chan) == 0) {
kick %chan $1 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kicked $+ $1 $+ from %chan $+ .
}
}
else {
.notice $nick $+ $1 $+ isn't currently in $+ %chan $+ .
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;ban a nick/hostmask in the channel, syntax: BAN <nick|hostmask>
elseif (%com == ban) || (%com == b) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $me) {
.notice $nick You cannot ban the channel service bot. | halt
}
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($protection(%chan) == 2) {
if (*!*@* !iswm $1) {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
if ($1 ison %chan) {
mode %chan -ov $1 $1
}
mode %chan +b $address($1,2)
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if (*!*@* !iswm $1) {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
if ($1 ison %chan) {
mode %chan -ov $1 $1
}
mode %chan +b $address($1,2)
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban %chan $1 2
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 0) {
if (*!*@* !iswm $1) {
if ($1 ison %chan) {
mode %chan -ov $1 $1
}
mode %chan +b $address($1,2)
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
else {
ban %chan $1
.notice $nick Banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;kicks and bans all users from a channel, syntax: KBA
elseif (%com == kickbanall) || (%com == kba) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
mode %chan +imsb *!*@*
var %i = 1
var %total.nick = $nick(%chan,0)
while (%i <= %total.nick) {
if ($nick(%chan,%i) != $me) && ($nick(%chan,%i) != $nick) {
.timerkick $+ $nick(%chan,%i) -m 1 150 kick %chan $nick($chan,%i) $iif($1 == $null,Kick requested by $nick $+ .,$1-)
}
inc %i
}
.notice $nick Kicked and banned all users in $+ %chan $+ .
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;kickbans a nick/hostmask in the channel, syntax: KICKBAN <nick|hostmask>
elseif (%com == kickban) || (%com == kb) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($1 == $me) || ($1 iswm $address($me,2)) {
.notice $nick You cannot kickban the channel service bot. | halt
}
if ($protection(%chan) == 2) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban %chan $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 0) {
if (*!*@* iswm $1) {
ban %chan $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Kickbanned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;permanently bans a hostmask/nick from a channel, sytax: ADDBAN <nick|hostmask>
elseif (%com == addban) || (%com == permban) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($1 == $me) || ($1 iswm $address($me,2)) {
.notice $nick You cannot kickban the channel service bot. | halt
}
if ($protection(%chan) == 2) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $1 $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if (*!*@* iswm $1) {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $1 $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($protection(%chan) == 0) {
if (*!*@* iswm $1) {
mode %chan +b $1
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
inc %i
}
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $1 $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
else {
ban -k %chan $1 2 $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $calc($ctime + 1) $iif($2 == $null,Bye.,$2-) ( $+ $nick $+ )
.notice $nick Permanently banned $+ $1 $+ from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deletes a ban from the banlist, syntax: DELBAN <hostmask>
elseif (%com == delban) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
else {
$unbannick($nick,%chan,$1).delban
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;unbans all hostmasks in the channel, syntax: UNBANALL
elseif (%com == unbanall) || (%com == uba) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($ibl(%chan,0) == 0) {
.notice $nick No channel bans found on $+ %chan $+ .
}
else {
var %i = 1, %bannedusers, %banCount = $ibl(%chan,0)
while (%i <= %banCount) {
%bannedusers = %bannedusers $ibl(%chan,%i)
if ($modespl // %i) || (%i == %banCount) {
mode %chan - $+ $str(b,$numtok(%bannedusers,32)) %bannedusers
unset %bannedusers
}
inc %i
}
.notice $nick Removed all channel bans from $+ %chan $+ .
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;unbans a user from the channel, syntax: UNBANME
elseif (%com == unbanme) || (%com == ubm) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
$unbannick($nick,%chan)
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;unbans a nick/hostmask from the channel, syntax: UNBAN <nick|hostmask>
elseif (%com == unban) || (%com == ub) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == op) || ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (nick|mask) | halt
}
else {
$unbannick($nick,%chan,$1)
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;timebans a nick/hostmask from a channel, syntax: TIMEBAN <duration> <nick|hostmask>
elseif (%com == timeban) || (%com == tb) || (%com == addtimedban) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
if ($1 == $null) {
.notice $nick $+ %com $+ requires more parameters. (mask|nick) | halt
}
if ($1 == $me) || ($1 iswm $address($me,2)) {
.notice $nick You cannot kickban the channel service bot. | halt
}
if ($protection(%chan) == 2) {
if ($1 ison %chan) {
if ($access(%chan,$nick).level <= $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -ku $+ $timeduration($2) %chan $1 2 $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
}
}
else {
if ($access(%chan,$nick).level <= $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -u $+ $timeduration($2) %chan $1 2
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
inc %i
}
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
}
}
}
elseif ($protection(%chan) == 1) {
if ($1 ison %chan) {
if ($access(%chan,$nick).level < $access(%chan,$1).level) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -ku $+ $timeduration($2) %chan $1 2 $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
}
}
else {
if ($access(%chan,$nick).level < $access(%chan,$1).levelhost) {
.notice $nick Sorry, $+ $1 $+ is protected.
}
else {
ban -u $+ $timeduration($2) %chan $1 2
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
inc %i
}
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
}
}
}
if ($protection(%chan) == 0) {
if ($1 ison %chan) {
ban -ku $+ $timeduration($2) %chan $1 2 $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
}
else {
ban -u $+ $timeduration($2) %chan $1 2
var %i = 1
while (%i <= $ial($1,0)) {
kick %chan $ial($1,%i).nick $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
writeini " $+ $scriptdirchannels.ini" %chan $+ blist $address($1,2) $ctime $timeduration($2) $iif($3 == $null,Bye.,$3-) ( $+ $nick $+ )
inc %i
}
.notice $nick Banned $+ $1 $+ for $duration($timeduration($2)) from %chan $+ .
}
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;displays all timbans/addbans from the channel, syntax: BLIST
elseif (%com == blist) || (%com == shitlist) || (%com == bans) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) == master) || ($access(%chan,$nick) == coowner) || ($access(%chan,$nick) == owner) || ($godstatus($nick) == 1) {
.notice $nick %chan bans: ( $+ $readalltheini(" $+ $scriptdirchannels.ini",%chan $+ blist,*).totalnumber $+ )
if ($ini(" $+ $scriptdirchannels.ini",%chan $+ blist,0) == 0) {
.notice $nick None | halt
}
var %gettokctime1 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),1,32)
var %gettokctime2 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),2,32)
var %gettokbanreason = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),3-,32)
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",%chan $+ blist,0)) {
var %gettokctime1 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),1,32)
var %gettokctime2 = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),2,32)
var %gettokbanreason = $gettok($readini(" $+ $scriptdirchannels.ini",%chan $+ blist,$ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i)),3-,32)
.timerbannotice $+ $ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i) 1 1 .notice $nick Mask: $+ $ini(" $+ $scriptdirchannels.ini",%chan $+ blist,%i) $+ Timeleft: $+ $iif(%gettokctime1 = $calc(%gettokctime2 - 1),None $+ $chr(44) permanently banned.,$duration($calc((%gettokctime1 + %gettokctime2) - $ctime)))) $+ Reason: $+ %gettokbanreason $+
inc %i
}
}
elseif ($access(%chan,$nick) != $null) {
.notice $nick You lack sufficient access in %chan to use this command.
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;check your lag with the bot, syntax: PING
elseif (ping* iswm %com) {
if ($prop == inpm) {
set %pingtime $ticks
ctcp $nick ping
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) == 1) {
set %pingtime $ticks
ctcp $nick ping
}
elseif ($toys(%chan) == 2) {
set %pingtime $ticks
set %pingtime.chan %chan
ctcp $nick ping
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;have the bot say something, syntax SAY <test>
elseif (%com == say) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (text) | halt
}
else {
msg %chan $1-
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot emote something, syntax EMOTE <test>
elseif (%com == emote) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (text) | halt
}
else {
describe %chan $1-
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;sends a raw message to the server, syntax: RAW <raw-line>
elseif (%com == raw) || (%com == dump) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (raw line) | halt
}
elseif ($1 == run) || ($1 == format) {
.notice $nick Sorry, that command must be done manually. (Security Feature) | halt
}
else {
.raw $eval($1-,2)
.notice $nick Raw line sent.
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot join a channel, syntax: JOIN <channel>
elseif (%com == join) || (%com == j) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (channel) | halt
}
elseif ($me ison $1) {
.notice $nick I am already in $+ $1 $+ . | halt
}
else {
if ($left($1,1) == $chr(35)) {
join $1
.notice $nick I have joined $+ $1 $+ .
}
else {
.notice $nick You must provide a valid channel name.
}
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot part a channel, syntax: PART <channel>
elseif (%com == part) || (%com == p) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (channel) | halt
}
elseif ($me !ison $1) {
.notice $nick $+ $me $+ does not seem to be on $+ $1 $+ . | halt
}
else {
if ($left($1,1) == $chr(35)) {
part $1 $iif($2 == $null,Part requested by $nick $+ .,$2-)
.notice $nick I have parted $+ $1 $+ .
}
else {
.notice $nick You must provide a valid channel name.
}
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot part all channels, syntax: PARTALL
elseif (%com == partall) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
partall $iif($1 == $null,Part requested by $nick $+ .,$1-)
.notice $nick I have parted all channels.
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot disconnect/quit, syntax: QUIT [quit-message]
elseif (%com == quit) || (%com == disconnect) || (%com == shutdown) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
.notice $nick $+ $me $+ will now quit.
quit $iif($1 == $null,Quit requested by $nick $+ .,$1-)
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot restart, syntax: RESTART [quit-message]
elseif (%com == restart) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
var %server = $server
.notice $nick $+ $me $+ will now restart.
.timerquit 1 1 quit [ $iif($1 == $null,Restart requested by $nick $+ .,$1-) ]
.timerserver 1 1 server %server
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot gag/ignore a hostmask, syntax: GAG <nick|hostmask>
elseif (%com == gag) || (%com == ignore) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (hostmask|nick duration) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (duration) | halt
}
else {
ignore -u $+ $timeduration($2) $1 2
.notice $nick I have added $+ $1 $+ to my gag list.
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;have the bot ungag/unignore a hostmask, syntax: UNGAG <nick|hostmask>
elseif (%com == ungag) || (%com == unignore) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (hostmask|nick) | halt
}
else {
var %i = 1
while (%i <= $ignore(0)) {
if ($1 iswm $ignore(%i)) {
if ($address($1,2) != $null) {
ignore -r $1 2
.notice $nick I have removed $+ $1 $+ from my gag list. | halt
}
else {
ignore -r $ignore(%i)
.notice $nick I have removed $+ $1 $+ from my gag list. | halt
}
}
else {
.notice $nick Sorry, $+ $1 $+ is not on my gag list. | halt
}
inc %i
}
else {
.notice $nick Sorry, no gags were found.
}
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;lists all gags/ignores on the bot, syntax: GAGLIST
elseif (%com == gaglist) || (%com == gags) || (%com == ignorelist) || (%com == ignores) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($ignore(0) == 0) {
.notice $nick Sorry, no gags were found. | halt
}
.notice $nick gags: ( $+ $ignore(0) $+ )
var %i = 1
while (%i <= $ignore(0)) {
.timerignorenotice $+ %i 1 %i .notice $nick $ignore(%i) Timeleft: $duration($ignore(%i).secs)
inc %i
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;add a command to the perform list, syntax: ADDPERFORM command
elseif (%com == addperform) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (command) | halt
}
var %checkperform = 1
while (%checkperform <= $lines(" $+ $scriptdirbotperform.txt")) {
if ($read(" $+ $scriptdirbotperform.txt",w,$1-%checkperform) != $null) {
.notice $nick That command is already in the perform list. | halt
}
inc %checkperform
}
write " $+ $scriptdirbotperform.txt" $1-
.notice $nick Added new command to perform list.
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;delete a command to the perform list, syntax: DELPERFORM command
elseif (%com == delperform) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (line-number or command) | halt
}
if ($1 isnum) {
if ($read(" $+ $scriptdirbotperform.txt",$1) != $null) {
write -dl $+ $1 " $+ $scriptdirbotperform.txt"
.notice $nick Deleted command number $1 from the perform list.
}
else {
.notice $nick That line number does not exist.
}
}
else {
var %checkperform = 1
while (%checkperform <= $lines(" $+ $scriptdirbotperform.txt")) {
if (!$read(" $+ $scriptdirbotperform.txt",w,$1-,%checkperform)) {
.notice $nick That command is not in the perform list. | halt
}
inc %checkperform
}
write -ds $+ "$1-" " $+ $scriptdirbotperform.txt"
.notice $nick Deleted a command from the perform list.
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;check all the commands in the perform list, syntax: PERFORMLIST
elseif (%com == performlist) || (%com == performs) {
if ($authed($nick) == 1) {
if ($oper($nick) != $null) {
if ($lines(" $+ $scriptdirbotperform.txt") == 0) {
.notice $nick You do not have any commands in your perform list. | halt
}
.notice $nick perform list: ( $+ $lines(" $+ $scriptdirbotperform.txt") $+ )
var %performlist = 1
while (%performlist <= $lines(" $+ $scriptdirbotperform.txt")) {
.timerperformlist $+ %performlist 1 $calc(%performlist + 1) .notice $nick Command %performlist $+ : $read(" $+ $scriptdirbotperform.txt",%performlist)
inc %performlist
}
}
else {
.notice $nick $+ %com $+ is a privileged command.
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
;adds a quote to the channel database, syntaax: ADDQUOTE <quote>
elseif (%com == addquote) || (%com == quoteadd) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (quote) | halt
}
write " $+ $scriptdir $+ %chan $+ quote.txt" [ $+ $nick $+ ]: $1-
.notice $nick You have stored your $ord($lines(" $+ $scriptdir $+ %chan $+ quote.txt")) quote.
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;deletes a quote to the channel database, syntaax: DELQUOTE <quote-number|all>
elseif (%com == delquote) || (%com == quotedel) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if ($lines(" $+ $scriptdir $+ %chan $+ quote.txt") == 0) {
.notice $nick There are no quotes in the database. | halt
}
elseif (!$1) {
.notice $nick $+ %com $+ requires more parameters. (quote-number) (There are $lines(" $+ $scriptdir $+ %chan $+ quote.txt") quotes in the database.) | halt
}
elseif ($1 == all) {
if ($2 == CONFIRM) {
.notice $nick Deleted $lines(" $+ $scriptdir $+ %chan $+ quote.txt") quotes from the database.
remove " $+ $scriptdir $+ %chan $+ quote.txt"
}
else {
.notice $nick To confirm this deletion, you must append 'CONFIRM' to the end of your command.
}
}
elseif ($1 isnum) && ($read(" $+ $scriptdir $+ %chan $+ quote.txt",$1) != $null) {
write -dl $+ $1 " $+ $scriptdir $+ %chan $+ quote.txt"
.notice $nick You have deleted the $ord($1) quote from the database. There are $lines(" $+ $scriptdir $+ %chan $+ quote.txt") quotes left.
}
else {
.notice $nick $+ $1 $+ is an invalid number.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;sais a quote from the channel database, syntaax: SAYQUOTE [quote-number]
elseif (%com == sayquote) || (%com == quotesay) || (%com == quote) || (%com == q) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if ($lines(" $+ $scriptdir $+ %chan $+ quote.txt") == 0) {
.notice $nick There are no quotes in the database. | halt
}
elseif (!$1) {
var %quote = $read(" $+ $scriptdir $+ %chan $+ quote.txt")
var %quote.num = $quotesearch(%chan,%quote).sayquote
$iif($toys(%chan) == 1,.notice $nick ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote,msg %chan $+ $nick $+ : ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote)
}
elseif ($1 isnum) && ($read(%chan $+ quote.txt,$1) != $null) {
var %quote = $read(" $+ $scriptdir $+ %chan $+ quote.txt",$1)
var %quote.num = $quotesearch(%chan,%quote).sayquote
$iif($toys(%chan) == 1,.notice $nick ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote,msg %chan $+ $nick $+ : ( $+ %quote.num $+ / $+ $lines(" $+ $scriptdir $+ %chan $+ quote.txt") $+ ) %quote)
}
else {
.notice $nick $+ $1 $+ is an invalid number.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;searches a quote by author/string, syntax: SEARCHQUOTE <author|string>
elseif (%com == searchquote) || (%com == quotesearch) || (%com == qsearch) || (%com == squote) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if ($lines(" $+ $scriptdir $+ %chan $+ quote.txt") == 0) {
.notice $nick There are no quotes in the database. | halt
}
elseif (!$1) {
.notice $nick $+ %com $+ requires more parametes. (author|string)
}
else {
$iif($toys(%chan) == 1,.notice $nick $quotesearch(%chan,$1-),msg %chan $+ $nick $+ : $quotesearch(%chan,$1-))
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;starts a vote, syntax: VOTE <question>
elseif (%com == vote) || (%com == startvote) || (%com == votestart) {
if ($channels(%chan) != $null) {
if ($authed($nick) == 1) {
if ($access(%chan,$nick) != $null) || ($godstatus($nick) == 1) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (question) | halt
}
set $+(%,%chan,question) $1-
set $+(%,%chan,enablevote) 1
set $+(%,%chan,yes) 0
set $+(%,%chan,no) 0
msg $chan Voting has been enabled for: [ $+ [ % [ $+ [ %chan $+ question ] ] ] $+ ] - Use voteyes or voteno to vote. (You have one minute to vote)
.timer $+ %chan $+ results 1 60 voteresults %chan
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick You lack access to %chan $+ .
}
}
else {
.notice $nick You must first auth with $+ $me $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;votes yes if channel has a vote going on, syntax: VOTEYES
elseif (%com == voteyes) || (%com == yesvote) {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (% [ $+ [ %chan $+ enablevote ] ] == 1) {
if ($read(voters $+ %chan $+ .txt,w,$address($nick,3)) == $null) {
write voters $+ %chan $+ .txt $address($nick,3)
inc % [ $+ [ %chan $+ yes ] ] 1
.notice $nick Voted yes.
}
else {
.notice $nick You already voted.
}
}
else {
.notice $nick Voting is currently disabled.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;votes yes if channel has a vote going on, syntax: VOTENO
elseif (%com == voteno) || (%com == novote) {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (% [ $+ [ %chan $+ enablevote ] ] == 1) {
if ($read(voters $+ %chan $+ .txt,w,$address($nick,3)) == $null) {
write voters $+ %chan $+ .txt $address($nick,3)
inc % [ $+ [ %chan $+ no ] ] 1
.notice $nick Voted no.
}
else {
.notice $nick You already voted.
}
}
else {
.notice $nick Voting is currently disabled.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
;a little toy here that responds with 'I don't want to be part of your sick fantasies!', syntax: SEX
elseif (sex* iswm %com) || (unf* iswm %com) || (banana* iswm %com) || (boner* iswm %com) || (penis* iswm %com) {
if ($prop == inpm) {
.notice $nick I don't want to be part of your sick fantasies!
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick I don't want to be part of your sick fantasies!,msg %chan $+ $nick $+ : I don't want to be part of your sick fantasies!)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;get your current age, syntax: AGE <month> <day> <year>
elseif (%com == age) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (month day year) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (day year) | halt
}
elseif (!$3) {
.notice $nick $+ %com $+ requires more parameters. (year) | halt
}
else {
.notice $nick You are $age($1 $iif($chr(44) isin $2,$remove($2,$chr(44)),$2) $3)
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (month day year) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (day year) | halt
}
elseif (!$3) {
.notice $nick $+ %com $+ requires more parameters. (year) | halt
}
else {
$iif($toys(%chan) == 1,.notice $nick You are $age($1 $iif($chr(44) isin $2,$remove($2,$chr(44)),$2) $3),msg %chan $+ $nick $+ : You are $age($1 $iif($chr(44) isin $2,$remove($2,$chr(44)),$2) $3))
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns the current date, syntax: DATE
elseif (date* iswm %com) {
if ($prop == inpm) {
.notice $nick The date today is $+ $date(dddd mmmm dd $+ $chr(44) yyyy) $+ .
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick The date today is $+ $date(dddd mmmm dd $+ $chr(44) yyyy) $+ .,msg %chan $+ $nick $+ : The date today is $+ $date(dddd mmmm dd $+ $chr(44) yyyy) $+ .)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns the current time, syntax: TIME
elseif (time* iswm %com) {
if ($prop == inpm) {
.notice $nick The time right now is $+ $asctime(hh:nn:ss TT zzz) $+ .
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick The time right now is $+ $asctime(hh:nn:ss TT zzz) $+ .,msg %chan $+ $nick $+ : The time right now is $+ $asctime(hh:nn:ss TT zzz) $+ .)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns the answer to the calculations provided, syntax: CALC <calculations>
elseif (%com == calc) || (%com == calculator) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (numbers) | halt
}
if ($left($1,1) isnum) {
.notice $nick $1- = $calc($1-)
}
else {
.notice $nick Sorry, you can only calculate numbers.
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (numbers) | halt
}
if ($left($1,1) isnum) {
$iif($toys(%chan) == 1,.notice $nick $1- = $calc($1-),msg %chan $+ $nick $+ : $1- = $calc($1-))
}
else {
.notice $nick Sorry, you can only calculate numbers.
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;ask the magic 8ball a question, syntax: 8BALL <question>
elseif (%com == 8ball) || (%com == 8) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (question) | halt
}
else {
.notice $nick $+ $nick $+ : $read("Channel Service Bot/8ball.txt"))
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (question) | halt
}
else {
$iif($toys(%chan) == 1,.notice $nick $+ $nick $+ : $read("Channel Service Bot/8ball.txt"),msg %chan $+ $nick $+ : $read("Channel Service Bot/8ball.txt"))
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;rolls the dice, syntax: DICE <number>
elseif (%com == dice) || (%com == d) {
if ($prop == inpm) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (number) | halt
}
if ($1 == 1) || ($1 !isnum) {
.notice $nick $1 is an invalid number. Please use a number greater than 1 with this command.
}
else {
.notice $nick A $r(1,$1) shows on the $1 $+ -sided die.
}
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (number) | halt
}
if ($1 == 1) || ($1 !isnum) {
.notice $nick $1 is an invalid number. Please use a number greater than 1 with this command.
}
else {
$iif($toys(%chan) == 1,.notice $nick A $r(1,$1) shows on the $1 $+ -sided die.,msg %chan $+ $nick $+ : A $r(1,$1) shows on the $1 $+ -sided die.)
}
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;just a little toy here, syntax: CC
elseif (cc* iswm %com) || (crazy*cafcasi iswm %com) {
if ($prop == inpm) {
.notice $nick Watcha want from CC?
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) != 0) {
$iif($toys(%chan) == 1,.notice $nick Watcha want from CC?,msg %chan $+ $nick $+ : Watcha want from CC?)
}
else {
.notice $nick Toys are disabled in $+ %chan $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;returns current version of the bot, syntax: VERSION
elseif (version* iswm %com) || (credit* iswm %com) {
if ($prop == inpm) {
.notice $nick Channel Service Bot: Version $+ %version $+ . Built by: CrAzY_CaFcAsi on %built.on $+ .
}
else {
.notice $nick Channel Service Bot: Version $+ %version $+ . Built by: CrAzY_CaFcAsi on %built.on $+ .
}
}
;translation
elseif (%com == translation) || (%com == translate) || (%com == trans) {
if ($prop == inpm) {
goto start
}
else {
if ($channels(%chan) != $null) {
if ($toys(%chan) == 0) {
.notice $nick Toys are disabled in $+ %chan $+ . | halt
}
:start
if (%trans.inuse == 1) {
.notice $nick Sorry, the translation script is currently in use. | halt
}
if (!$1) {
.notice $nick $+ %com $+ requires more parameters. (from-language and to-language and text) | halt
}
elseif (!$2) {
.notice $nick $+ %com $+ requires more parameters. (to-language and text) | halt
}
elseif (!$3) {
.notice $nick $+ %com $+ requires more parameters. (text) | halt
}
if ($1 != $2) {
if ($1 == en) || ($1 == en) || ($+($1,_,$2) == de_fr) || ($+($2,_,$1) == fr_de) {
if ($translang($1) != $null) {
if ($translang($2) != $null) {
set %trans.inuse 1
set %trans.langs $+($lower($1),_,$lower($2))
set %trans.info $3-
if ($prop == inpm) {
goto start2
}
if ($toys(%chan) == 2) {
set %trans.msg %chan
}
if ($toys(%chan) == 1) {
:start2
set %trans.msg $nick
}
if ($sock(trans) != $null) {
sockclose trans
}
sockopen trans babelfish.altavista.com 80
}
else {
.notice $nick You must provide a valid language to translate to.
}
}
else {
.notice $nick You must provide a valid language to translate from.
}
}
else {
.notice $nick You must translate from english or to english.
}
}
else {
.notice $nick You cannot translate from $translang($1) to $translang($1) $+ .
}
}
else {
.notice $nick %chan has not been registered with $+ $me $+ .
}
}
}
;help file for every command of the bot, syntax: HELP
elseif (%com == help) {
if ($1 == $null) {
.timerhelp1 -m 1 50 .notice $nick USER - User management.
.timerhelp2 1 1 .notice $nick CHANNEL - Channel management.
.timerhelp3 1 2 .notice $nick BAN MANAGEMENT - Ban management.
.timerhelp4 1 3 .notice $nick OPER - Oper commands.
.timerhelp5 1 4 .notice $nick MISC - Misc. commands.
}
elseif ($1 == user) {
.timerhelpuser1 -m 1 50 .notice $nick ACCESS ADDCOOWNER ADDMASTER ADDOP ADDPEON OP VOICE
.timerhelpuser2 1 1 .notice $nick GIVEOWNERSHIP CLVL DELUSER UP DOWN DEOP DEVOICE SUSPEND UNSUSPEND
}
elseif ($1 == access) {
.notice $nick /msg $me ACCESS <#channel> [nick|*account]
.notice $nick Reports various pieces of information about a channel user, including channel and bot access level, and the user's info line. If no nick or account is provided, $me returns your own information.
}
elseif ($1 == adduser) {
.timeradduser1 -m 1 50 .notice $nick /msg $me ADDUSER <#channel> <level> <nick|*account>
.timeradduser2 1 1 .notice $nick This command adds someone to the channel user list with the specified access level. (You may only add users to levels less than your own.)
.timeradduser3 1 2 .notice $nick The level may be one of peon, op, master, coowner or owner (only bot staff may add owners).
}
elseif ($1 == addcoowner) {
.notice $nick /msg $me ADDCOOWNER <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as a coowner.
}
elseif ($1 == addmaster) {
.notice $nick /msg $me ADDMASTER <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as a master.
}
elseif ($1 == addop) {
.notice $nick /msg $me ADDOP <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as an op.
}
elseif ($1 == addpeon) {
.notice $nick /msg $me ADDPEON <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as a peon.
}
elseif ($1 == giveownership) {
.notice $nick /msg $me GIVEOWNERSHIP <#channel> <nick|*account>
.notice $nick Transfer ownership of the channel from you to another user on the channel's userlist. You are demoted to coowner, and they are promoted to owner.
}
elseif ($1 == clvl) {
.notice $nick /msg $me CLVL <#channel> <nick|*account> <level>
.notice $nick Modifies a channel user's access level. You cannot give users access greater than or equal to your own.
}
elseif ($1 == deluser) {
.notice $nick /msg $me DELUSER <#channel> <nick|*account>
.notice $nick Deletes a user from the channel userlist.
}
elseif ($1 == delcoowner) {
.notice $nick /msg $me DELCOOWNER <#channel> <nick|*account>
.notice $nick Deletes a coowner from the channel userlist.
}
elseif ($1 == delmaster) {
.notice $nick /msg $me DELMASTER <#channel> <nick|*account>
.notice $nick Deletes a master from the channel userlist.
}
elseif ($1 == delop) {
.notice $nick /msg $me DELOP <#channel> <nick|*account>
.notice $nick Deletes an op from the channel userlist.
}
elseif ($1 == delpeon) {
.notice $nick /msg $me DELPEON <#channel> <nick|*account>
.notice $nick Deletes a peon from the channel userlist.
}
elseif ($1 == up) {
.notice $nick /msg $me UP <#channel>
.notice $nick For a peon, this will cause $+ $me $+ to voice the user executing the command. For anyone of level op on higher on the userlist, this will cause $+ $me $+ to op the user executing the command.
}
elseif ($1 == down) {
.notice $nick /msg $me DOWN <#channel>
.notice $nick This command will devoice/deop you in the selected channel.
}
elseif ($1 == op) {
.notice $nick /msg $me OP <#channel> <nick> [nick]...
.notice $nick This command makes $me op the specified user[s].
}
elseif ($1 == deop) {
.notice $nick /msg $me DEOP <#channel> <nick> [nick]...
.notice $nick This command makes $me deop the specified user[s].
}
elseif ($1 == voice) || ($1 == v) {
.notice $nick /msg $me VOICE <#channel> <nick> [nick]...
.notice $nick This command makes $me voice the specified user[s].
}
elseif ($1 == devoice) || ($1 == dv) {
.notice $nick /msg $me DEVOICE <#channel> <nick> [nick]...
.notice $nick This command makes $me devoice the specified user[s].
}
elseif ($1 == suspend) {
.notice $nick /msg $me SUSPEND <#channel> <nick> <duration>
.notice $nick This disables the target's access to the channel. That access can be restored using the unsuspend command.
}
elseif ($1 == unsuspend) {
.notice $nick /msg $me UNSUSPEND <#channel> <nick>
.notice $nick This restores the target's access to the channel (after it has been suspended).
}
elseif ($1 == channel) {
.notice $nick USERS WLIST CLIST MLIST OLIST PLIST INVITEME
.notice $nick TOPIC MODE INVITE SET SETINFO INFO
}
elseif ($1 == users) {
.notice $nick /msg ChanServ USERS <#channel>
.notice $nick Displays the userlist for the specified channel.
}
elseif ($1 == wlist) || (%1 == owners) {
.notice $nick /msg ChanServ WLIST <#channel>
.notice $nick This command lists all users of level owner on a channel's userlist.
}
elseif ($1 == clist) || (%1 == coowners) {
.notice $nick /msg ChanServ CLIST <#channel>
.notice $nick This command lists all users of level coowner on a channel's userlist.
}
elseif ($1 == mlist) || (%1 == masters) {
.notice $nick /msg ChanServ MLIST <#channel>
.notice $nick This command lists all users of level master on a channel's userlist.
}
elseif ($1 == olist) || ($1 == ops) {
.notice $nick /msg ChanServ OLIST <#channel>
.notice $nick This command lists all users of level op on a channel's userlist.
}
elseif ($1 == plist) || ($1 == peons) {
.notice $nick /msg ChanServ PLIST <#channel>
.notice $nick This command lists all users of level peon on a channel's userlist.
}
elseif ($1 == topic) {
.notice $nick /msg $me TOPIC <#channel> [topic]
.notice $nick Sets the current topic for the specified channel. If no topic is specified, then sets the current topic to the default topic.
}
elseif ($1 == mode) {
.notice $nick /msg $me MODE <#channel> [mode]
.notice $nick Sets the current modes for the specified channel. If no mode is specified, then sets the current modes to the default modes.
}
elseif ($1 == invite) {
.notice $nick /msg $me INVITE <#channel> <nick>
.notice $nick Invite a user to the specified channel.
}
elseif ($1 == inviteme) {
.notice $nick /msg $me INVITEME <#channel>
.notice $nick $+ $me $+ will invite you to the specified channel. You must have access to the channel.
}
elseif ($1 == set) {
if ($2 == $null) {
.timerset1 -m 1 50 .notice $nick /msg $me SET <#channel> [<parameter> [setting]]
.timerset2 1 1 .notice $nick This command will set various channel options. With no arguments, it will show the current values of all channel options.
.timerset3 1 2 .notice $nick DEFAULTTOPIC ENFTOPIC GREETING USERGREETING SETTERS VOICE PROTECT TOYS MODES SPAMPROTECT SPAMPUNISH DYNLIMIT NODELETE TRIGGER
}
elseif ($2 == dynlimit) {
.notice $nick /msg $me SET <#channel> DYNLIMIT <value>
.notice $nick Adjusts user limit (+l channel mode) to prevent join floods.
}
elseif ($2 == topic) || ($2 == defaulttopic) {
.notice $nick /msg $me SET <#channel> $upper($2) <new default topic>
.notice $nick This changes the default topic for the channel. ChanServ will set the IRC topic to this value when the topic command is used with no arguments.
}
elseif ($2 == enftopic) {
.timerenftopic1 -m 1 50 .notice $nick /msg $me SET <#channel> ENFTOPIC <value>
.timerenftopic2 1 1 .notice $nick This setting restricts the minimum access someone must have to change the channel topic. Valid settings are:
.timerenftopic3 1 2 .notice $nick 0 Anyone may change the topic
.timerenftopic4 1 3 .notice $nick 1 Ops and above may change the topic
.timerenftopic5 1 4 .notice $nick 2 Masters and above may change the topic
.timerenftopic6 1 5 .notice $nick 3 Coowners and above may change the topic
.timerenftopic7 1 6 .notice $nick 4 Only owners may change the topic
.timerenftopic8 1 7 .notice $nick 5 No one may change the topic
}
elseif ($2 == greeting) {
.notice $nick /msg $me SET <#channel> $upper($2) <new greeting>
.notice $nick A greeting message for visitors to the channel.
}
elseif ($2 == usergreeting) {
.notice $nick /msg $me SET <#channel> $upper($2) <new usergreeting>
.notice $nick A greeting message for users on the channel's userlist.
}
elseif ($2 == setters) {
.timersetsetters1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetsetters2 1 1 .notice $nick This setting restricts the protection that ChanServ enforces. Valid settings are:
.timersetsetters3 1 2 .notice $nick 0 Masters and above may change settings.
.timersetsetters4 1 3 .notice $nick 1 Coowners and above may change settings.
.timersetsetters5 1 4 .notice $nick 2 Owners may change settings.
}
elseif ($2 == voice) {
.timersetvoice1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetvoice2 1 1 .notice $nick Toggles whether $+ $me $+ will autovoice people on join.
.timersetvoice3 1 2 .notice $nick 0 Disables autovoice on join.
.timersetvoice4 1 3 .notice $nick 1 Enables autovoice on join.
}
elseif ($2 == toys) {
.timersettoys1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersettoys2 1 1 .notice $nick Toggles whether toys such as 8BALL will be enabled in the channel.
.timersettoys3 1 2 .notice $nick 0 Toys are completely disabled.
.timersettoys4 1 3 .notice $nick 1 Toys will only reply privately.
.timersettoys5 1 4 .notice $nick 2 Toys will reply publicly.
}
elseif ($2 == protect) {
.timersetprotect1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetprotect2 1 1 .notice $nick The protection level $+ $me $+ provides.
.timersetprotect3 1 2 .notice $nick 0 No users will be protected.
.timersetprotect4 1 3 .notice $nick 1 Users will be protected from those of lower access.
.timersetprotect5 1 4 .notice $nick 2 Users will be protected from those of equal or lower access.
}
elseif ($2 == modes) {
.notice $nick /msg $me SET <#channel> $upper($2) <new modes>
.notice $nick Sets the channel's default modes.
}
elseif ($2 == spam) || ($2 == spamprotect) {
.notice $nick /msg $me SET <#channel> $upper($2) <number-of-lines> <duration>
.notice $nick $+ $me $+ will punish all spammers that spam number-of-lines in the duration provided.
}
elseif ($2 == spampunish) || ($2 == punishspam) {
.notice $nick /msg $me SET <#channel> $upper($2) <punishment> [duration]
.notice $nick $+ $me $+ will punish all spammers that spam number-of-lines in the certain duration. (This will not work if spamprotect is disabled.) Punishments consist of kick, ban, kickban, or timeban.
}
elseif ($2 == nodelete) {
.timersetnodelete1 -m 1 50 .notice $nick /msg $me SET <#channel> $upper($2) <value>
.timersetnodelete2 1 1 .notice $nick Prevents channel deletion.
.timersetnodelete3 1 2 .notice $nick 0 Doesn't prevent channel deletion.
.timersetnodelete4 1 3 .notice $nick 1 Prevents channel deletion.
}
elseif ($2 == trigger) {
.notice $nick /msg $me SET $upper($2) <new trigger>
.notice $nick Sets the global channel trigger.
}
else {
.notice $nick No help on that topic.
}
}
elseif ($1 == setinfo) {
.notice $nick /msg $me SETINFO <#channel> <info>
.notice $nick This command will set a user defined information message to be displayed when you join the channel. By setting the message to '*', you will clear your message.
}
elseif ($1 == info) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick This command responds with various pieces of information about a channel's users, status, and registration.
}
elseif ($1 == ban) && ($2 == management) {
.notice $nick KICK BAN KICKBAN BANS TIMEBAN
.notice $nick UNBAN DELBAN UNBANME UNBANALL
}
elseif ($1 == kick) || ($1 == k) {
.notice $nick /msg $me $upper($1) <#channel> <nick> [reason]
.notice $nick Kicks the user matching the given nick with the specified reason. If no reason is provided, a default will be used.
}
elseif ($1 == ban) || ($1 == b) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick>
.notice $nick This command will temporarily add a ban for the user specified as the parameter. Masks are to be supplied in the format <Nick>!<Ident>@<Host> and usually contain wildcards. If a nick is specified, a mask is automatically generated (though not completely foolproof). This ban is removed either by removing it from the channel ban list using any irc client, or sending the UNBAN or UNBANALL commands.
}
elseif ($1 == kickban) || ($1 == kb) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick> [reason]
.notice $nick Kicks and bans with the specified reason any users with a matching nick or hostmask. If no reason is provided, a default one will be used.
}
elseif ($1 == bans) || ($1 == blist) || ($1 == shitlist) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick This command lists all permanent and timed bans in the channel.
}
elseif ($1 == timeban) || ($1 == tb) || ($1 == addtimedban) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick> <duration> [reason]
.notice $nick Adds an automatically expiring ban to the channel ban list. This command behaves in the exact same fashion as ADDBAN with the exception that the bans are automatically removed after the user-supplied duration. Timed bans can be removed with the DELBAN command, as with permanent bans. (See "help durations")
}
elseif ($1 == unban) || ($1 == ub) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick>
.notice $nick Unbans the specified nick or hostmask. If a nick is given, $+ $me $+ determines what hostmask to unban.
}
elseif ($1 == unbanme) || ($1 == ubm) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Unbans your hostmask from the specified channel.
}
elseif ($1 == unbanall) || ($1 == uba) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Clears the specified channel's banlist.
}
elseif ($1 == delban) {
.notice $nick /msg $me $upper($1) <#channel> <mask|nick>
.notice $nick Deletes a ban from the channel ban list. This command works for both permanent and timed bans alike.
}
elseif ($1 == durations) {
.notice $nick [<n>y][<n>M][<n>w][<n>d][<n>h][<n>m][<n>[s]]
.notice $nick The valid duration letters are y (for year, or 360 days), M (for month, or 30 days), w (for week, or 7 days), d (for day, or 24 hours), h (for hour, or 60 minutes), m (for minute, or 60 seconds), and s (for second).
}
elseif ($1 == oper) {
.timerhelpoper1 -m 1 50 .notice $nick SAY EMOTE GOD REGCHAN UNREGCHAN KBA ADDOWNER MOVE DELOWNER
.timerhelpoper2 1 1 .notice $nick OPALL DEOPALL VOICEALL DEVOICEALL RAW QUIT RENAME JOIN PART UNAUTH
.timerhelpoper3 1 2 .notice $nick PARTALL GAG UNGAG GAGLIST RESTART ADDPERFORM DELPERFORM PERFORMLIST
}
elseif ($1 == say) {
.notice $nick /msg $me SAY <#channel|nick> <text>
.notice $nick Makes $me send a message to the specified channel or nick.
}
elseif ($1 == emote) {
.notice $nick /msg $me EMOTE <#channel|nick> <text>
.notice $nick Makes $me send a CTCP ACTION message to the specified channel or nick.
}
elseif ($1 == god) || ($1 == h4x) {
.notice $nick /msg $me $upper($1) [on|off]
.notice $nick Toggles security override, which grants you complete access to all channels. Please use carefully.
}
elseif ($1 == regchan) || ($1 == registerchannel) || ($1 == registerchan) || ($1 == regchannel) {
.notice $nick /msg $me $upper($1) <#channel> <nick|*account>
.notice $nick Registers a channel with $+ $me $+ , automatically granting owner access to the specified user.
}
elseif ($1 == unregchan) || ($1 == unregisterchannel) || ($1 == unregisterchan) || ($1 == unregchannel) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Unregisters a channel that is registered with $+ $me $+ . IMPORTANT: Once the channel is unregistered, the userlist cannot be recovered. If you are not bot staff, you must add CONFIRM to the end of your line to confirm channel unregistration.
}
elseif ($1 == move) {
.notice $nick /msg $me MOVE <#channel> <destination>
.notice $nick Transfers a channel's registration to a different channel along with the settings and user/ban lists.
}
elseif ($1 == rename) {
.notice $nick /msg $me RENAME <nick|*old-account> <[*]new-account>
.notice $nick Renames an account.
}
elseif ($1 == kickbanall) || ($1 == kba) || ($1 == takeover) {
.notice $nick /msg $me $upper($1) <#channel> [reason]
.notice $nick Kick and bans all members of the specified channel except for the user issuing the command.
}
elseif ($1 == addowner) {
.notice $nick /msg $me ADDOWNER <#channel> <nick|*account>
.notice $nick Adds the specified nick or account to the channel userlist as an owner.
}
elseif ($1 == delowner) {
.notice $nick /msg $me DELOWNER <#channel> <nick|*account>
.notice $nick Deletes an owner from the channel userlist.
}
elseif ($1 == opall) || ($1 == oall) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Ops all members of the specified channel.
}
elseif ($1 == deopall) {
.notice $nick /msg $me DEOPALL <#channel>
.notice $nick Deops all members of the specified channel.
}
elseif ($1 == voiceall) || ($1 == va) || ($1 == vall) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Voices all members of the specified channel.
}
elseif ($1 == devoiceall) || ($1 == dva) || ($1 == dvall) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Devoices all members of the specified channel.
}
elseif ($1 == raw) || ($1 == dump) {
.notice $nick /msg $me $upper($1) <raw line>
.notice $nick Dumps a raw server message into the stream.
}
elseif ($1 == quit) || ($1 == disconnect) || ($1 == shutdown) {
.notice $nick /msg $me $upper($1) [reason]
.notice $nick Makes $+ $me $+ quit.
}
elseif ($1 == join) || ($1 == j) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Makes $+ $me $+ join the specified channel.
}
elseif ($1 == part) || ($1 == p) {
.notice $nick /msg $me $upper($1) <#channel> [reason]
.notice $nick Makes $+ $me $+ part the specified channel.
}
elseif ($1 == partall) {
.notice $nick /msg $me PARTALL [reason]
.notice $nick Makes $+ $me $+ part all channels.
}
elseif ($1 == unauth) || ($1 == deauth) {
.notice $nick /msg $me $upper($1) [nick]
.notice $nick Unauths yourself from $+ $me $+ . You must add CONFIRM to the end of your line to confirm unauthorization. If 'nick' is specified, 'nick' will be unauthed from $+ $me $+ .
}
elseif ($1 == gag) || ($1 == ignore) {
.notice $nick /msg $me $upper($1) <hostmask> <duration>
.notice $nick Gags all users matching the specified hostmask and the duration supplied.
}
elseif ($1 == ungag) || ($1 == unignore) {
.notice $nick /msg $me $upper($1) <hostmask>
.notice $nick Ungags the hostmask specified.
}
elseif ($1 == gaglist) || ($1 == ignorelist) || ($1 == gags) || ($1 == ignores) {
.notice $nick /msg $me $upper($1)
.notice $nick Shows all current gags. This includes hostmasks and duration.
}
elseif ($1 == addperform) {
.notice $nick /msg $me $upper($1) <command>
.notice $nick Adds a command to the perform list.
}
elseif ($1 == delperform) {
.notice $nick /msg $me $upper($1) <number|command>
.notice $nick Deletes a command from the perform list. If a number is specified instead of a command, will delete the number from the perform list.
}
elseif ($1 == performlist) || ($1 == performs) {
.notice $nick /msg $me $upper($1)
.notice $nick Shows all current commands in the perform list.
}
elseif ($1 == restart) {
.notice $nick /msg $me RESTART [reason]
.notice $nick Makes $+ $me $+ restart.
}
elseif ($1 == misc) {
.notice $nick TIME DATE 8BALL VERSION IRCOPS STAFF ADDQUOTE DELQUOTE STARTVOTE VOTEYES
.notice $nick PING SEX AGE CALC HELPERS DICE SAYQUOTE SEARCHQUOTE VOTENO TRANSLATION
}
elseif ($1 == addquote) || ($1 == quoteadd) {
.notice $nick /msg $me $upper($1) <channel> <quote>
.notice $nick Adds a quote to the channel database.
}
elseif ($1 == delquote) || ($1 == quotedel) {
.notice $nick /msg $me $upper($1) <channel> <quote-number|all>
.notice $nick Deletes a quote from the channel database. If all is given instead of a quote-number, you must append 'CONFIRM' to the end of your line to confirm the quote channel database deletion.
}
elseif ($1 == sayquote) || ($1 == quotesay) || ($1 == quote) || ($1 == q) {
.notice $nick /msg $me $upper($1) <channel> [quote-number]
.notice $nick Will return the quote for the specified number. If no quote number is given, will return a random quote.
}
elseif ($1 == searchquote) || ($1 == quotesearch) || ($1 == qsearch) || ($1 == searchq) {
.notice $nick /msg $me $upper($1) <channel> <author|string>
.notice $nick Will search for the specified string or author for any quote in the channel database.
}
elseif ($1 == time) {
.notice $nick /msg $me TIME
.notice $nick Tells you the current time with Greenwich Mean Time.
}
elseif ($1 == date) {
.notice $nick /msg $me DATE
.notice $nick Tells you the current date.
}
elseif ($1 == 8ball) || ($1 == 8) {
.notice $nick /msg $me $upper($1) <question>
.notice $nick Ask the magic 8ball a question.
}
elseif ($1 == dice) || ($1 == d) {
.notice $nick /msg $me $upper($1) <number>
.notice $nick Rolls a dice with the specified number and returns a random number from one to the numbe provided.
}
elseif ($1 == version) || ($1 == credits) {
.notice $nick /msg $me $upper($1)
.notice $nick Shows the current version of $+ $me $+ and the creator of $+ $me $+ .
}
elseif ($1 == ping) {
.notice $nick /msg $me PING
.notice $nick Shows your current lag status with $+ $me $+ .
}
elseif ($1 == sex) || ($1 == unf) || ($1 == banana) || ($1 == boner) || ($1 == penis) {
.notice $nick I'm sorry, but I can't give you help regarding your sex life. But if you're so desperate you'll ask an IRC service bot for advice, you need therapy.
}
elseif ($1 == age) {
.notice $nick /msg $me AGE <month> <day> <year>
.notice $nick Tells you your current age with the info supplied.
}
elseif ($1 == calculator) || ($1 == calc) {
.notice $nick /msg $me $upper($1) <numbers>
.notice $nick Calculates the given numbers.
}
elseif ($1 == ircops) || ($1 == opers) {
.notice $nick /msg $me $upper($1)
.notice $nick Lists all the IRC operators of $+ $me $+ .
}
elseif ($1 == helpers) {
.notice $nick /msg $me HELPERS
.notice $nick Lists all the helpers of $+ $me $+ .
}
elseif ($1 == staff) {
.notice $nick /msg $me STAFF
.notice $nick Lists all the IRC operators and helpers of $+ $me $+ .
}
elseif ($1 == register) || ($1 == reg) {
.notice $nick /msg $me $upper($1) <account> <pass>
.notice $nick Registers a specified account with $+ $me $+ , adding your current hostmask to your new account. You will be required to know the password you specify with $+ $1 $+ in order to be able to use auth to authenticate to your account.
}
elseif ($1 == unregister) || ($1 == unreg) {
.notice $nick /msg $me $upper($1) <pass>
.notice $nick Unregisters the account you are authenticated to.
}
elseif ($1 == vote) || ($1 == startvote) || ($1 == votestart) {
.notice $nick /msg $me $upper($1) <#channel> <question>
.notice $nick Starts a vote with the specified question. You may use VOTEYES or VOTENO to vote.
}
elseif ($1 == voteyes) || ($1 == yesvote) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Votes yes if the specified channel has a current vote going.
}
elseif ($1 == voteno) || ($1 == novote) {
.notice $nick /msg $me $upper($1) <#channel>
.notice $nick Votes no if the specified channel has a current vote going.
}
elseif ($1 == auth) || ($1 == authenticate) {
.notice $nick /msg $me $upper($1) <account> <pass>
.notice $nick Authenticates yourself with $+ $me $+ to the specified account. You must use auth before you have any access to $+ $me $+ , including channels that are registered with $+ $me $+ .
}
elseif ($1 == pass) {
.notice $nick /msg $me PASS <oldpass> <newpass>
.notice $nick Changes your $+ $me $+ password.
}
elseif ($1 == ounregister) || ($1 == oureg) {
.notice $nick /msg $me $upper($1) <nick|*account>
.notice $nick Unregisters the specified account.
}
elseif ($1 == allowauth) || ($1 == aa) {
.notice $nick /msg $me $upper($1) <nick> <account>
.notice $nick Allows the specified nick to auth to the specified account. The nick has 90 seconds to auth to the account or else the hostmask gets reset to what it was before.
}
elseif ($1 == translation) || ($1 == translate) || ($1 == trans) {
.notice $nick /msg $me $upper($1) <from-languge> <to-language> <text>
.notice $nick This translates text from a certain language to another language. Languages consist of English (en), French (fr), German (de), Italian (it), Portuguese (pt), Spanish (es), Chinese (zh), Japanese (ja), and Korean (ko).
}
else {
.notice $nick No help on that topic.
}
}
else {
.notice $nick $+ %com $+ is an unknown command.
}
}
;;;;;;;;sockets for translation
on *:sockopen:trans:{
sockwrite -n $sockname GET /babelfish/tr?doit=done&urltext= $+ $replace([ %trans.info ],$chr(32),+) $+ &lp= $+ %trans.langs $+ &Info=basic HTTP/1.1
sockwrite -n $sockname Host: babelfish.altavista.com
sockwrite -n $sockname User-Agent: Translation Script by CC.
sockwrite -n $sockname
}
on *:sockread:trans:{
sockread %temp
if (10px isin %temp) {
$iif($chr(35) isin %trans.msg,msg %trans.msg Translation: $gettok($gettok([ %temp ],5,62),1,60),.notice %trans.msg Translation: $gettok($gettok([ %temp ],5,62),1,60))
sockclose trans
unset %temp, %trans.*
halt
}
elseif (</body> isin %temp) {
$iif($chr(35) isin %trans.msg,msg %trans.msg I could not find a translation for ' $+ %trans.info $+ ',.notice %trans.msg I could not find a translation for $+ %trans.info $+ ))
sockclose trans
unset %temp
unset %trans.*
}
}
;;;;;;;;USE: $age(month day year)
alias age {
return $calc($ctime - $ctime($3 $1 $2)) seconds old. ( $+ $calc(($ctime - $ctime($3 $1 $2)) /60 /60 /24 /365) years $+ )
}
;;;;;;;;USE: PING
on *:ctcpreply:*ping*: {
if (%pingtime.chan != $null) {
msg %pingtime.chan $+ $nick $+ : Pong! ( $+ $calc($calc($ticks - %pingtime) / 1000) $+ s)
unset %pingtime.chan
}
else {
.notice $nick $+ $nick $+ : Pong! ( $+ $calc($calc($ticks - %pingtime) / 1000) $+ s)
}
}
ctcp 1:VERSION:?: {
.notice $nick Channel Service Bot: Version $+ %version $+ . Built by: CrAzY_CaFcAsi on %built.on $+ . | halt
}
;;;;;;;;USE: $account(nick)
alias Account {
return $readini(" $+ $scriptdiraccounts.ini",Nicks,$1)
}
;;;;;;;;USE: $password(nick)
alias Password {
return $readini(" $+ $scriptdiraccounts.ini",Passwords,$1)
}
;;;;;;;;USE: $authed(nick)
alias Authed {
return $readini(" $+ $scriptdiraccounts.ini",Authed,$1)
}
;;;;;;;;USE: $channels(channel)
alias channels {
return $readini(" $+ $scriptdirchannels.ini",$1,$1)
}
;;;;;;;;USE: $nodelete(channel)
alias nodelete {
return $readini(" $+ $scriptdirchannels.ini",$1,NoDelete)
}
;;;;;;;;USE: $setters(channel)
alias setters {
return $readini(" $+ $scriptdirchannels.ini",$1,Setters)
}
;;;;;;;;USE: $toys(channel)
alias toys {
return $readini(" $+ $scriptdirchannels.ini",$1,Toys)
}
;;;;;;;;USE: $protection(channel)
alias protection {
return $readini(" $+ $scriptdirchannels.ini",$1,Protect)
}
;;;;;;;;USE: $spamprotect(channel)
alias spamprotect {
return $readini(" $+ $scriptdirchannels.ini",$1,SpamProtect)
}
;;;;;;;;USE: $spampunish(channel)
alias spampunish {
return $readini(" $+ $scriptdirchannels.ini",$1,SpamPunish)
}
;;;;;;;;USE: $dynlimit(channel)
alias dynlimit {
return $readini(" $+ $scriptdirchannels.ini",$1,Dynlimit)
}
;;;;;;;;USE: chanlimit channel
alias chanlimit {
if ($calc($nick($1,0) + 7) != %dynlimit. [ $+ [ $1 ] ]) {
if ($chan($1).limit != $calc($nick($1,0) + 7)) {
mode $1 +l $calc($nick($1,0) + 7)
set %dynlimit. [ $+ [ $1 ] ] $calc($nick($1,0) + 7)
}
}
}
;;;;;;;;USE: $enftopic(channel)
alias enftopic {
if ($prop == words) {
if ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 0) {
return Anyone may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 1) {
return Ops and above may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 2) {
return Masters and above may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 3) {
return Coowners and above may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 4) {
return Only owners may change the topic
}
elseif ($readini(" $+ $scriptdirchannels.ini",$1,EnfTopic) == 5) {
return No one may change the topic
}
}
else {
return $readini(" $+ $scriptdirchannels.ini",$1,EnfTopic)
}
}
;;;;;;;;USE: $parse.to.ini(text)
alias parse.to.ini {
return $replace($1-,$chr(2),$chr(244),$chr(15),$chr(245),$chr(3),$chr(246),$chr(31),$chr(243),$chr(22),$chr(242))
}
;;;;;;;;USE: $parse.from.ini(text)
alias parse.from.ini {
return $replace($1-,$chr(244),$chr(2),$chr(245),$chr(15),$chr(246),$chr(3),$chr(243),$chr(31),$chr(242),$chr(22))
}
;;;;;;;;USE: $oper(nick)
alias oper {
return $readini(" $+ $scriptdiropers.ini",Opers,$account($1))
}
;;;;;;;;USE: $helper(nick)
alias helper {
return $readini(" $+ $scriptdiropers.ini",Helpers,$account($1))
}
;;;;;;;;USE: $godstatus(nick)
alias godstatus {
if ($oper($1) != $null) {
return $readini(" $+ $scriptdiropers.ini",Opers,$account($1))
}
if ($helper($1) != $null) {
return $readini(" $+ $scriptdiropers.ini",Helpers,$account($1))
}
}
;;;;;;;;USE: /addoper nick|*account
alias addoper {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
echo -a -
echo -a Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
echo -a -
}
}
else {
var %account.nick = $1
if ($authed($1) == 0) {
echo -a -
echo -a $1 must first auth with $+ $me $+ . | halt
echo -a -
}
}
if (!$1) {
echo -a -
echo -a addoper requires more parameters. (nick|*account) | halt
echo -a -
}
if ($oper(%account.nick) != $null) {
echo -a -
echo -a %account.nick is already an oper. | halt
echo -a -
}
if ($helper(%account.nick) != $null) {
echo -a -
echo -a %account.nick is already a helper. | halt
echo -a -
}
else {
writeini " $+ $scriptdiropers.ini" Opers $account(%account.nick) 1
echo -a -
echo -a Added $+ %account.nick $+ as an oper successfully. | halt
echo -a -
}
}
;;;;;;;;USE: /deloper nick|*account
alias deloper {
if ($mid($1,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($1,*))) {
echo -a Account $+ $remove($1,*) $+ has not been registered with $+ $me $+ . | halt
}
}
else {
var %account.nick = $1
if ($authed($1) == 0) {
echo -a -
echo -a $1 must first auth with $+ $me $+ . | halt
echo -a -
}
}
if (!$1) {
echo -a deloper requires more parameters. (nick|*account) | halt
}
if ($oper(%account.nick) == $null) {
echo -a %account.nick is not an oper. | halt
}
else {
remini " $+ $scriptdiropers.ini" Opers $account(%account.nick)
echo -a Removed $+ %account.nick $+ from an oper successfully. | halt
}
}
;;;;;;;;USE: $access(channel,nick)[.level || .host || .levelhost ]
alias access {
if ($prop == level) {
if ($authed($2) == 1) {
var %user.level = $readini(" $+ $scriptdirchannels.ini",$1,$account($2)), %access.levels = peon.op.master.coowner.owner
if ($godstatus($2) == 1) {
return 6
}
elseif ($findtok(%access.levels,%user.level,1,46) != $null) {
return $findtok(%access.levels,%user.level,1,46)
}
else {
return 0
}
}
else {
return 0
}
}
elseif ($prop == host) {
var %i = 1, %topic.num = $ini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),0)
while (%i <= %topic.num) {
inc %i
var %host.word.two = $gettok($readalltheini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),*),%i,32)
if ($2 iswm %host.word.two) {
return %host.word.two
}
}
}
elseif ($prop == levelhost) {
var %host = $address($2,5), %access.levels = peon.op.master.coowner.owner
if ($godstatus($2) == 1) {
return 6
}
elseif ($findtok(%access.levels,$readini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),$iif(@ isin $2,$2,%host)),1,46) != $null) {
return $findtok(%access.levels,$readini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),$iif(@ isin $2,$2,%host)),1,46)
}
else {
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),0)) {
inc %i
var %host.word.two = $gettok($readalltheini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),*),%i,32), %access.levels = peon.op.master.coowner.owner
if ($2 iswm %host.word.two) {
return $findtok(%access.levels,$readini(" $+ $scriptdirchannels.ini",$iif(host isin $1,$1,$1 $+ host),%host.word.two),1,46)
}
else {
return 0
}
}
}
}
elseif ($prop == account) {
return $readini(" $+ $scriptdirchannels.ini",$1,$account($2))
}
else {
if ($authed($2) == 1) {
return $readini(" $+ $scriptdirchannels.ini",$1,$account($2))
}
}
}
;;;;;;;;USE: $timeduration(seconds)
alias timeduration {
if ($right($1,1) === s) {
return $remove($1,s)
}
elseif ($right($1,1) === m) {
return $calc($remove($1,m)*60)
}
elseif ($right($1,1) === h) {
return $calc($remove($1,h)*3600)
}
elseif ($right($1,1) === d) {
return $calc($remove($1,d)*86400)
}
elseif ($right($1,1) === w) {
return $calc($remove($1,w)*604800)
}
elseif ($right($1,1) === M) {
return $calc($remove($1,M)*2592000)
}
elseif ($right($1,1) === y) { 360
return $calc($remove($1,y)*31104000)
}
elseif ($1 isnum) {
return $1
}
else {
return $null
}
}
;;;;;;;;USE: $unbannick(nick,channel)[.delban]
alias unbannick {
if ($prop == delban) {
if (*!*@* iswm $3) {
var %i = 1
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm $3) || ($3 iswm $ibl($2,%i)) {
var %found = $ibl($2,%i)
}
if (%found != $null) {
break
}
inc %i
}
var %f = 1
while (%f <= $ini(" $+ $scriptdirchannels.ini",$2 $+ blist,0)) {
if ($gettok($readalltheini(" $+ $scriptdirchannels.ini",$2 $+ blist,*),%f,32) iswm $3) {
var %found.in.ini = $ifmatch
}
if (%found.in.ini != $null) {
break
}
inc %f
}
if (%found != $null) && (%found.in.ini != $null) {
mode $2 -b %found
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found != $null) && (%found.in.ini == $null) {
mode $2 -b %found
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found.in.ini != $null) && (%found == $null) {
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
else {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
}
else {
var %host = $address($3,5)
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm %host) {
var %found = $addtok(%found,$ibl($2,%i),32)
}
inc %i
}
var %f = 1
while (%f <= $ini(" $+ $scriptdirchannels.ini",$2 $+ blist,0)) {
if ($gettok($readalltheini(" $+ $scriptdirchannels.ini",%chan $+ blist,*),%f,32) iswm $address($3,5)) {
var %found.in.ini $ifmatch
}
inc %f
}
if (%found != $null) && (%found.in.ini != $null) {
mode $2 -b %found
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found != $null) && (%found.in.ini == $null) {
mode $2 -b %found
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
elseif (%found.in.ini != $null) && (%found == $null) {
remini " $+ $scriptdirchannels.ini" $2 $+ blist %found.in.ini
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
else {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
}
}
else {
if ($3 != $null) {
if (*!*@* iswm $3) {
var %i = 1
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm $3) || ($3 iswm $ibl($2,%i)) {
var %found = $ibl($2,%i)
}
if (%found != $null) {
break
}
inc %i
}
if (%found != $null) {
mode $2 -b %found
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
else {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
}
else {
var %host = $address($3,5)
var %i = 1
while (%i <= $ibl($2,0)) {
if ($ibl($2,%i) iswm %host) {
var %found = $addtok(%found,$ibl($2,%i),32)
}
inc %i
}
if (%found == $null) {
.notice $1 Sorry, no ban found for $+ $3 $+ . | return
}
while ($gettok(%found,1,32) != $null) {
mode $2 - $+ $str(b,$numtok($gettok(%found,1-6,32),32)) $gettok(%found,1-6,32)
%found = $deltok(%found,1-6,32)
}
.notice $1 Matching ban(s) for $+ $3 $+ removed. | return
}
}
elseif ($3 == $null) {
var %host = $address($1,5)
var %i = 1
while (%i <= $ibl($2,%i)) {
if ($ibl($2,%i) iswm %host) {
var %found = $addtok(%found,$ibl($2,%i),32)
}
inc %i
}
if (%found == $null ) {
.notice $1 Sorry, no ban found for $+ $1 $+ . | return
}
while ($gettok(%found,1,32) != $null) {
mode $2 - $+ $str(b,$numtok($gettok(%found,1-6,32),32)) $gettok(%found,1-6,32)
%found = $deltok(%found,1-6,32)
}
.notice $1 Matching ban(s) for $+ $1 $+ removed. | return
}
}
}
;;;;;;;;USE: $suspend(nick,suspended-nick,channel,duration)
alias suspend {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($access($3,$1).level > 2) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 suspend requires more parameters. (nick and duration) | halt
}
if ($timer(suspend $+ $($3 $+ $2,2)) != $null) {
.notice $1 $+ $2 $+ is already suspended! ( $+ $duration($timer(suspend $+ $($3 $+ $2,2)).secs) left $+ ) | halt
}
if (!$4) {
.notice $1 suspend requires more parameters. (duration) | halt
}
var %access.nick2 = $readini(" $+ $scriptdirchannels.ini",$3,$account($2))
var %host.nick2 = $readini(" $+ $scriptdiraccounts.ini",$account($2),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host %host.nick2
mode $3 -ov $2 $2
.notice $1 $+ $2 $+ 's access to $+ $3 $+ has been suspended.
.timersuspend $+ $($3 $+ $2,2) 1 $timeduration($4) { writeini " $+ $scriptdirchannels.ini" $3 $account($2) %access.nick2 }
.timersuspend $+ $($3 $+ $2 $+ 2,2) 1 $timeduration($4) { writeini " $+ $scriptdirchannels.ini" $3 $+ host %host.nick2 %access.nick2 }
}
else {
.notice $1 $2 outranks you (command has no effect).
}
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command. | halt
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $unsuspend(nick,suspended-nick,channel)
alias unsuspend {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($access($3,$1).level > 2) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
elseif ($access($3,$2) == $null) && ($timer(suspend $+ $($3 $+ $2,2)) == $null) {
.notice $1 $2 lacks access to $3 $+ . | halt
}
elseif (!$2) {
.notice $1 unsuspend requires more parameters. (nick) | halt
}
elseif ($timer(suspend $+ $($3 $+ $2,2)) == $null) {
.notice $1 $+ $2 $+ is not suspended! | halt
}
$timer(suspend $+ $($3 $+ $2,2)).com
$timer(suspend $+ $($3 $+ $2 $+ 2,2)).com
.timersuspend $+ $($3 $+ $2,2) off
.timersuspend $+ $($3 $+ $2 $+ 2,2) off
.notice $1 $+ $2 $+ 's access to $+ $3 $+ has been restored.
}
else {
.notice $1 $2 outranks you (command has no effect).
}
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command. | halt
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $adduser(nick,newuser,channel,accesslevel)
alias adduser {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($mid($2,1,1) == $chr(42)) {
var %account.nick $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if ($4 == peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host peon
.notice $1 Added new peon $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host op
.notice $1 Added new op $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host master
.notice $1 Added new master $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host coowner
.notice $1 Added new coowner $account(%account.nick) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,%account.nick).account != $null) {
.notice $1 $account(%account.nick) is already on the $+ $3 $+ userlist. (as $access($3,%account.nick).account $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host owner
.notice $1 Added new owner $account(%account.nick) to the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
if ($authed($2) == 1) {
if ($4 == peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) peon
.notice $1 Added new peon $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) op
.notice $1 Added new op $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) master
.notice $1 Added new master $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) coowner
.notice $1 Added new coowner $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
if (!$2) {
.notice $1 add $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if ($access($3,$2) != $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is already on the $+ $3 $+ userlist. (as $access($3,$2) $+ ) | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) owner
.notice $1 Added new owner $2 ( $+ $account($2) $+ ) to the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 $2 must first auth with $+ $me $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $clvl(nick,changee,channel,newlevel)
alias clvl {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
if (!$2) {
.notice $1 clvl requires more parameters. (nick|*account and level) | halt
}
elseif (!$4) {
.notice $1 clvl requires more parameters. (access level) | halt
}
if ($access($3,$1) == op) || ($access($3,$1) == peon) {
.notice $nick You lack sufficient access in %chan to use this command. | halt
}
elseif ($access($3,$1) == $null) {
.notice $1 You lack access to %chan $+ . | halt
}
if ($mid($2,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
if ($access($3,%account.nick) != $null) {
if ($4 == peon) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host peon
.notice $1 $account(%account.nick) is now a peon in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host peon
.notice $1 $account(%account.nick) is now a peon in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == op) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host op
.notice $1 $account(%account.nick) is now an op in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host op
.notice $1 $account(%account.nick) is now an op in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == master) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host master
.notice $1 $account(%account.nick) is now a master in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host master
.notice $1 $account(%account.nick) is now a master in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == coowner) {
if ($access($3,$1).level > $access($3,%account.nick).level) {
if ($access($3,%account.nick) == $null) {
.notice $1 $account(%account.nick) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host coowner
.notice $1 $account(%account.nick) is now a coowner in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,%account.nick).level) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host coowner
.notice $1 $account(%account.nick) is now a coowner in $3 $+ .
}
else {
.notice $1 $+ $account(%account.nick) $+ outranks you (command has no effect).
}
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host owner
.notice $1 $account(%account.nick) is now an owner in $3 $+ .
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 $+ $4 $+ is an invalid access level.
}
}
}
else {
if ($authed($2) == 1) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
if ($4 == $access($3,$2)) {
.notice $1 $account($2) is already a $access($3,$2) on the channel userlist. | halt
}
if ($access($3,$2) != $null) {
if ($4 == peon) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) peon
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) peon
.notice $1 $2 ( $+ $account($2) $+ ) is now a peon in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == op) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) op
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) op
.notice $1 $2 ( $+ $account($2) $+ ) is now an op in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == master) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) master
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) master
.notice $1 $2 ( $+ $account($2) $+ ) is now a master in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == coowner) {
if ($access($3,$1).level > $access($3,$2).level) {
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
writeini " $+ $scriptdirchannels.ini" $3 $account($2) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) coowner
.notice $1 $2 ( $+ $account($2) $+ ) is now a coowner in $3 $+ .
}
elseif ($access($3,$1).level = $access($3,$2).level) {
.notice $1 $+ $account($2) $+ outranks you (command has no effect).
}
}
elseif ($4 == owner) {
if ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account($2) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) owner
.notice $1 $2 ( $+ $account($2) $+ ) is now an owner in $3 $+ .
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 $+ $4 $+ is an invalid access level.
}
}
}
else {
.notice $1 $2 must first auth with $+ $me $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: $deluser(nick,removednick,channel,removednickaccess)
alias deluser {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($mid($2,1,1) == $chr(42)) {
var %account.nick $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
if ($4 == Peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Peon) {
.notice $1 %account.nick is not a peon. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted a peon $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Op) {
.notice $1 %account.nick is not an op. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted an op $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Master) {
.notice $1 %account.nick is not a master. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted a master $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Coowner) {
.notice $1 %account.nick is not a coowner. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted a coowner $account(%account.nick) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Owner) {
if ($godstatus($1) == 1) {
if ($access($3,%account.nick) != Owner) {
.notice $1 %account.nick is not an owner. | halt
}
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == $null) {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) is not on the $+ $3 $+ userlist. | halt
}
var %account.hostmask = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
remini " $+ $scriptdirchannels.ini" $3 $account(%account.nick)
remini " $+ $scriptdirchannels.ini" $3 $+ host %account.hostmask
.notice $1 Deleted an owner $account(%account.nick) from the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
if ($4 == Peon) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Peon) {
.notice $1 $2 is not a peon. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted a peon $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Op) {
if ($access($3,$1) == Master) || ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Op) {
.notice $1 $2 is not an op. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted an op $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Master) {
if ($access($3,$1) == Coowner) || ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Master) {
.notice $1 $2 is not a master. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted a master $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Coowner) {
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Coowner) {
.notice $1 $2 is not a coowner. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted a coowner $account($2) from the $3 userlist.
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
elseif ($4 == Owner) {
if ($godstatus($1) == 1) {
if (!$2) {
.notice $1 del $+ $lower($4) $+ requires more parameters. (nick|*account) | halt
}
if ($authed($2) == 0) {
.notice $1 $2 must first auth with $+ $me $+ . | halt
}
if ($access($3,$2) != Owner) {
.notice $1 $2 is not an owner. | halt
}
if ($access($3,$2) == $null) {
.notice $1 $2 ( $+ $account($2) $+ ) is not on the $+ $3 $+ userlist. | halt
}
remini " $+ $scriptdirchannels.ini" $3 $account($2)
remini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5)
.notice $1 Deleted an owner $account($2) from the $3 userlist.
}
else {
.notice $1 You must have security override (helping mode) on to use this command.
}
}
else {
.notice $1 You lack access to $3 $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USER: $giveownership(nick,newowner,channel)
alias giveownership {
if ($channels($3) != $null) {
if ($authed($1) == 1) {
if ($access($3,$1) == owner) || ($godstatus($1) == 1) {
if (!$2) {
if ($readalltheini(" $+ $scriptdirchannels.ini",$3,owner) == $null) {
.notice $nick There are currently no owners in $+ $3 $+ . You must use the addowner to add one. | halt
}
else {
.notice $1 giveownership requires more parameters. (nick|*account) | halt
}
}
if ($2 == $me) {
.notice $1 $+ $me $+ is a channel service bot; you can only use that command on real users. | halt
}
}
elseif ($access($3,$1) == $null) {
.notice $1 You lack access to $3 $+ . | halt
}
else {
.notice $1 You lack sufficient access in $3 to use this command. | halt
}
if ($mid($2,1,1) == $chr(42)) {
var %account.nick $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
if ($access($3,%account.nick) == owner) && ($access($3,$1) == owner) {
.notice $nick You already have ownership of $+ $3 $+ . | halt
}
if ($account(%account.nick) == $account($1)) {
.notice $nick You cannot give ownership to yourself. | halt
}
if ($access($3,%account.nick) != $null) {
if ($readalltheini(" $+ $scriptdirchannels.ini",$3,owner) == $null) {
.notice $nick There are currently no owners in $+ $3 $+ . You must use the addowner to add one. | halt
}
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
var %account.host = $readini(" $+ $scriptdiraccounts.ini",$account(%account.nick),Hostmask)
writeini " $+ $scriptdirchannels.ini" $3 $account($1) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($1,5) coowner
writeini " $+ $scriptdirchannels.ini" $3 $account(%account.nick) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host %account.host owner
.notice $1 Ownership of $3 has been transferred to account $+ $account(%account.nick) $+ .
}
elseif ($access($3,$1) == $null) {
.notice $1 You lack access to $3 $+ .
}
else {
.notice $1 You lack sufficient access in $3 to use this command.
}
}
else {
.notice $1 %account.nick ( $+ $account(%account.nick) $+ ) lacks access to $+ $3 $+ .
}
}
else {
if ($authed($2) == 1) {
if ($access($3,$2) != $null) {
if ($readalltheini(" $+ $scriptdirchannels.ini",$3,owner) == $null) {
.notice $nick There are currently no owners in $+ $3 $+ . You must use the addowner to add one. | halt
}
if ($2 == $1) {
.notice $nick You cannot give ownership to yourself. | halt
}
if ($access($3,$1) == Owner) || ($godstatus($1) == 1) {
writeini " $+ $scriptdirchannels.ini" $3 $account($1) coowner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($1,5) coowner
writeini " $+ $scriptdirchannels.ini" $3 $account($2) owner
writeini " $+ $scriptdirchannels.ini" $3 $+ host $address($2,5) owner
.notice $1 Ownership of $3 has been transferred to account $+ $account($2) $+ .
}
elseif ($access($3,$1) != $null) {
.notice $1 You lack sufficient access in $3 to use this command.
}
else {
.notice $1 You lack access to $3 $+ .
}
}
else {
.notice $1 $2 ( $+ $account($2) $+ ) lacks access to $+ $3 $+ .
}
}
else {
.notice $1 $2 must first auth with $+ $me $+ .
}
}
}
else {
.notice $1 You must first auth with $+ $me $+ .
}
}
else {
.notice $1 $3 has not been registered with $+ $me $+ .
}
}
;;;;;;;;USE: bancheck
alias bancheck {
if ($read(" $+ $scriptdirchannels.ini",w,*blist]) = 0) {
echo -a No channel banlists found for $readn $+ .
}
else {
;checks to see if any ban is finished from the banlist, if so it unbans them
var %flag = 1
var %channelsinini = 0
var %linenumber = 0
while (%flag != 0) {
%line = $read(" $+ $scriptdirchannels.ini",w,[#*blist],$calc(%linenumber + 1))
var %linenumber = $readn
var %bannumber = 1
while (%bannumber <= $ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),0)) {
var %linefromblist = $readini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),$ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),%bannumber))
if ($ctime >= $calc($gettok(%linefromblist,1,32) + $gettok(%linefromblist,2,32))) {
ban -r $left($right(%line,-1),-6) $ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),%bannumber)
remini " $+ $scriptdirchannels.ini" $left($right(%line,-1),-1) $ini(" $+ $scriptdirchannels.ini",$left($right(%line,-1),-1),%bannumber)
}
inc %bannumber
}
if (!$read(" $+ $scriptdirchannels.ini",w,[#*blist],$calc(%linenumber + 1))) {
var %flag = 0
}
}
}
}
;;;;;;;;USE: $modechange(channel,nick,modes,[key|limit])
alias modechange {
if ($mid($3,1,1) != $chr(45)) && ($mid($3,1,1) != $chr(43)) {
.notice $nick You must specify a positive or a negative mode. | return
}
if ($4 != $null) && ($5 != $null) && ($4 !isnum) && ($5 !isnum) {
.notice $nick The limit must be numbers only. | halt
}
var %count = 1
var %sign = $null
while ($mid($3,%count,1) != $null) {
if ($mid($3,%count,1) == $chr(43)) {
%sign = p
}
elseif ($mid($3,%count,1) == $chr(45)) {
%sign = n
}
else {
if (%sign == p) {
var %posmodes = %posmodes $+ $mid($3,%count,1)
}
else {
var %negmodes = %negmodes $+ $mid($3,%count,1)
}
}
inc %count
}
if (*l* iswm %posmodes) || (*l* iswm %negmodes) {
if ($4 != $null) && ($5 != $null) {
if ($4 isnum) {
var %limit = $4
var %key = $5
}
elseif ($5 isnum) {
var %key = $4
var %limit = $5
}
else {
.notice $nick The limit must be numbers only. | return
}
}
elseif ($4 != $null) {
if ($4 !isnum) {
.notice $nick The limit must be numbers only. | return
}
var %limit = $4
}
}
elseif (*k* iswm %posmodes) || (*k* iswm %negmodes) {
var %key = $4
}
if ($chanmodes != $null) {
var %lettermode = 1
while (%lettermode <= $len($remove($chanmodes,$chr(44)))) {
var %themodes = %themodes $+ $mid($remove($chanmodes,$chr(44)),%lettermode,1) $+ $chr(44)
inc %lettermode
}
var %themodes = $left(%themodes,-1)
}
var %count = 1
while ($gettok(%themodes,%count,44) != $null) {
if ($gettok(%themodes,%count,44) isincs %posmodes) {
var %posmodes1 = %posmodes1 $+ $gettok(%themodes,%count,44)
}
elseif ($gettok(%themodes,%count,44) isincs %negmodes) {
var %negmodes1 = %negmodes1 $+ $gettok(%themodes,%count,44)
}
inc %count
}
;MODES ASKED FOR COMPLETED IN FORM %posmodes1 %negmodes1 %key %limit
var %morecheck = $readini(" $+ $scriptdirchannels.ini",$1,Modes)
if (%morecheck != None) {
var %botposmodes = $iif($gettok(%morecheck,1,44 ) == z,$null,$gettok(%morecheck,1,44))
var %botnegmodes = $iif($gettok(%morecheck,2,44 ) == z,$null,$gettok(%morecheck,2,44))
var %botkey = $iif($gettok(%morecheck,3,44) == z,$null,$gettok(%morecheck,3,44))
var %botlimit = $iif($gettok(%morecheck,4,44) == z,$null,$gettok(%morecheck,4,44))
if (%posmodes1 != $null) && (k isincs %posmodes1) && (%key != %botkey) {
var %noposmodes = k
var %nolimitkey = %key
%posmodes1 = $removecs(%posmodes1,k)
%key = $null
}
if (%posmodes1 != $null) && (l isincs %posmodes1) && (%limit != %botlimit) {
var %noposmodes = $iif( %noposmodes , kl , l) | var %nolimitkey = $iif( %nolimitkey , %nolimitkey %limit , %limit ) | %posmodes1 = $removecs( %posmodes1 , l ) | %limit = $null
}
if ( $regex( %posmodes , /[ $+ %botnegmodes $+ ]/g ) > 0 ) {
var %i = 1
while ($mid(%posmodes1,%i,1) != $null) {
if ($mid(%posmodes1,%i,1) isincs %botnegmodes) {
if ($mid(%posmodes1,%i,1) == l) {
%limit = $null
}
if ($mid(%posmodes1,%i,1) == k) {
%key = $null
}
var %noposmodes = %noposmodes $+ $mid(%posmodes1,%i,1)
var %posmodes1 = $removecs(%posmodes1,$mid(%posmodes1,%i,1))
var %noinc = 1
}
if (%noinc != 1) {
inc %i
}
else {
%noinc = 0
}
inc %i
}
}
if ($regex(%negmodes1,/[ $+ %botposmodes $+ ]/g ) > 0) {
var %i = 1
while ($mid(%negmodes1,%i,1) != $null) {
if ($mid(%negmodes1,%i,1) isincs %botposmodes) {
var %nonegmodes = %nonegmodes $+ $mid(%negmodes1,%i,1)
%negmodes1 = $removecs(%negmodes1,$mid(%negmodes1,%i,1))
var %noinc = 1
}
if (%noinc != 1) {
inc %i
}
else {
%noinc = 0
}
}
}
var %conflict = $iif(%noposmodes,+ $+ %noposmodes) $+ $iif(%nonegmodes,- $+ %nonegmodes) $+ $iif(%nolimitkey,$chr(32) $+ %nolimitkey)
}
else {
mode $1 $3-
}
var %modechange = $iif(%posmodes1 != $null,+ $+ %posmodes1) $+ $iif(%negmodes1 != $null,- $+ %negmodes1) $iif(%key != $null,%key %limit,%limit)
.notice $2 $iif(%noposmodes || %nonegmodes,Mode Conflict: %conflict $+ $chr(32)) $+ $iif(%posmodes1 || %negmodes1,Modes set: %modechange)
if (%posmodes1 != $null) || (%negmodes1 != $null) {
mode $1 $iif(%negmodes1 != $null,- $+ %negmodes1) $iif(%key!= $null,%key)
mode $1 $iif(%posmodes1 != $null,+ $+ %posmodes1 $iif(%key != $null,%key %limit,%limit))
}
}
;;;;;;;;USE: $modelock(channel,nick,modes,[key|limit])
alias modelock {
if ($chr(42) == $3) {
writeini " $+ $scriptdirchannels.ini" $1 Modes None
.notice $2 Modes - None
return
}
if ($mid($3,1,1) != $chr(45)) && ($mid($3,1,1) != $chr(43)) {
.notice $2 You must specify a positive or a negative mode. | return
}
if (*l* iswm $3) && ($4 != $null) && ($5 != $null) && ($4 !isnum) && ($5 !isnum) {
.notice $2 The limit must be numbers only. | return
}
var %count = 1
var %sign = $null
while ($mid($3,%count,1) != $null) {
if ($mid($3,%count,1) == $chr(43)) {
%sign = p
}
elseif ($mid($3,%count,1) == $chr(45)) {
%sign = n
}
else {
if (%sign == p) {
var %posmodes = %posmodes $+ $mid($3,%count,1)
}
else {
var %negmodes = %negmodes $+ $mid($3,%count,1)
}
}
inc %count
}
if (*l* iswm %posmodes) {
if ($4 != $null) {
if ($4 !isnum) {
.notice $2 The limit must be numbers only. | return
}
var %limit = $4
}
elseif ($4 != $null) && ($5 != $null) {
if ($4 isnum) {
var %limit = $4
var %key = $5
}
elseif ($5 isnum) {
var %key = $4
var %limit = $5
}
else {
.notice $2 The limit must be numbers only. | return
}
}
}
elseif (*k* iswm %posmodes) {
var %key = $4
}
if ($chanmodes != $null) {
var %lettermode = 1
while (%lettermode <= $len($remove($chanmodes,$chr(44)))) {
var %themodes = %themodes $+ $mid($remove($chanmodes,$chr(44)),%lettermode,1) $+ $chr(44)
inc %lettermode
}
var %themodes = $left(%themodes,-1)
}
var %count = 1
while ($gettok(%themodes,%count,44) != $null) {
if ($gettok(%themodes,%count,44) isincs %posmodes) {
var %posmodes1 = %posmodes1 $+ $gettok(%themodes,%count,44)
}
elseif ($gettok(%themodes,%count,44) isincs %negmodes) {
var %negmodes1 = %negmodes1 $+ $gettok(%themodes,%count,44)
}
inc %count
}
writeini " $+ $scriptdirchannels.ini" $1 Modes $iif(%posmodes1 != $null,%posmodes1,z) $+ , $+ $iif(%negmodes1 != $null,%negmodes1,z) $+ , $+ $iif(%key != $null,%key,z) $+ , $+ $iif(%limit != $null,%limit,z)
.notice $2 Modes - $3-
mode $1 $iif(%posmodes1 != $null,+ $+ %posmodes1) $+ $iif(%negmodes1 != $null,- $+ %negmodes1) $iif(%key != $null,%key) $iif(%limit != $null,%limit)
}
;;;;;;;;USE: $restoremodes(channel,nick)
alias restoremodes {
if ($prop != info2) {
if ($readini(" $+ $scriptdirchannels.ini",$1,Modes) == None) {
.notice $2 There are no modes set for $1 $+ . | return
}
}
var %chanmodes = $chan($1).mode
var %morecheck = $readini(" $+ $scriptdirchannels.ini",$1,Modes)
var %posmodes1 = $remove($gettok(%chanmodes,1,32),+)
var %posmodes2 = $gettok(%morecheck,1,44)
if ($regex(%posmodes1,/[ $+ %posmodes2 $+ ]/g) == $len(%posmodes1)) && ($deltok(%chanmodes,1,32) == $iif($gettok(%morecheck,4,44) == $null,$gettok(%morecheck,4,44),$gettok(%morecheck,4,44) $gettok(%morecheck,3,44))) {
.notice $2 Modes do not need to be changed. | return
}
var %botposmodes = $iif($gettok(%morecheck,1,44) == z,$null,$gettok(%morecheck,1,44))
var %botnegmodes = $iif($gettok(%morecheck,2,44) == z,$null,$gettok(%morecheck,2,44))
var %botkey = $iif($gettok(%morecheck,3,44) == z,$null,$gettok(%morecheck,3,44))
var %botlimit = $iif($gettok(%morecheck,4,44) == z,$null,$gettok(%morecheck,4,44))
var %chanposmodes = $remove($gettok(%chanmodes,1,32),+)
if ($numtok(%chanmodes,32) == 3) {
var %chankey = $gettok(%chanmodes,3,32)
var %chanlimit = $gettok(%chanmodes,2,32)
}
elseif (*l* iswm $gettok(%chanmodes,1,32)) {
var %chanlimit = $gettok(%chanmodes,2,32)
}
else {
var %chankey = $gettok(%chanmodes,2,32)
}
if (*k* iswm %chanposmodes) && (%chankey != %botkey) && ($regex(%botnegmodes,/[k]/g) == 0) {
%botnegmodes = %botnegmodes $+ k
}
if (%botkey == %chankey) || (*k* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,k)
}
if (*l* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,l)
}
var %ending = $null
if (%botlimit != $null) && (%botkey != $null) {
var %ending = %botkey %botlimit
}
elseif (%botlimit != $null) && (%botkey == $null) {
var %ending = %botlimit
}
elseif (%botlimit == $null) && (%botkey != $null) {
var %ending = %botkey
}
if ($prop == info) {
$iif(%botnegmodes || %botposmodes,.notice $2 Modes - $iif(%botposmodes,+ $+ %botposmodes) $+ $iif(%botnegmodes,- $+ %botnegmodes)) $iif(%ending, %ending)
return
}
if ($prop == info2) {
if ($readini(" $+ $scriptdirchannels.ini",$1,Modes) == None) {
return No modes set
}
else {
return $iif(%botnegmodes || %botposmodes,$iif(%botposmodes,+ $+ %botposmodes) $+ $iif(%botnegmodes,- $+ %botnegmodes)) $iif(%ending, %ending)
}
}
$iif(%botnegmodes,mode $1 - $+ %botnegmodes $iif(%chankey != $null,%chankey))
$iif(%botposmodes,mode $1 + $+ %botposmodes %ending)
.notice $2 Channel modes restored.
}
;;;;;;;;USE: $restoremodes2(channel)
alias restoremodes2 {
var %chanmodes = $chan($1).mode
var %morecheck = $readini(" $+ $scriptdirchannels.ini",$1,Modes)
var %posmodes1 = $remove($gettok(%chanmodes,1,32),+)
var %posmodes2 = $gettok(%morecheck,1,44)
if ($regex(%posmodes1,/[ $+ %posmodes2 $+ ]/g) == $len(%posmodes1)) && ($deltok(%chanmodes,1,32) == $iif($gettok(%morecheck,4,44) == $null,$gettok(%morecheck,4,44),$gettok(%morecheck,4,44) $gettok(%morecheck,3,44))) {
return
}
var %botposmodes = $iif($gettok(%morecheck,1,44) == z,$null,$gettok(%morecheck,1,44))
var %botnegmodes = $iif($gettok(%morecheck,2,44) == z,$null,$gettok(%morecheck,2,44))
var %botkey = $iif($gettok(%morecheck,3,44) == z,$null,$gettok(%morecheck,3,44))
var %botlimit = $iif($gettok(%morecheck,4,44) == z,$null,$gettok(%morecheck,4,44))
var %chanposmodes = $remove($gettok(%chanmodes,1,32),+)
if ($numtok(%chanmodes,32) == 3) {
var %chankey = $gettok(%chanmodes,3,32)
var %chanlimit = $gettok(%chanmodes,2,32)
}
elseif (*l* iswm $gettok(%chanmodes,1,32)) {
var %chanlimit = $gettok(%chanmodes,2,32)
}
else {
var %chankey = $gettok(%chanmodes,2,32)
}
if (*k* iswm %chanposmodes) && (%chankey != %botkey) && ($regex(%botnegmodes,/[k]/g) == 0) {
%botnegmodes = %botnegmodes $+ k
}
if (%botkey == %chankey) || (*k* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,k)
}
if (*l* !iswm %chanposmodes) {
%botnegmodes = $remove(%botnegmodes,l)
}
var %ending = $null
if (%botlimit != $null) && (%botkey != $null) {
var %ending = %botkey %botlimit
}
elseif (%botlimit != $null) && (%botkey == $null) {
var %ending = %botlimit
}
elseif (%botlimit == $null) && (%botkey != $null) {
var %ending = %botkey
}
.notice $2 Modes conflicting with $+ $iif(%botposmodes,+ $+ %botposmodes) $+ $iif(%botnegmodes,- $+ %botnegmodes) $iif(%ending, %ending) $+ are not allowed in $1 $+ .
mode $1 - $+ %botnegmodes $iif(%chankey != $null,%chankey)
mode $1 + $+ %botposmodes %ending
}
;;;;;;;;USE: $allowauth($nick,nick,account)
alias allowauth {
if (!$2) {
.notice $1 $+ %com $+ requires more parameters. (nick and account) | halt
}
if (!$3) {
.notice $1 $+ %com $+ requires more parameters. (account) | halt
}
if ($authed($2) == 1) || ($authed($3) == 1) {
.notice $1 Someone is already authed to account $+ $2 $+ . | halt
}
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$3)) {
.notice $1 Account $+ $3 $+ has not been registered with $+ $me $+ . | halt
}
if ($address($2,5) iswm $readini(" $+ $scriptdiraccounts.ini",$3,Hostmask)) {
.notice $1 $+ $2 $+ 's hostmask is already valid with $3 $+ 's account. | halt
}
else {
var %old.hostmask = $readini(" $+ $scriptdiraccounts.ini",$3,Hostmask)
var %new.hostmask = $address($2,5)
writeini " $+ $scriptdiraccounts.ini" $3 Hostmask %new.hostmask
;checks to see if the user has authed in the requires 90 seconds, if not it resets the hostmask
.timercheckifauthed $+ $2 1 90 checkifauthed $2 $3
.notice $1 Hostmask for account $+ $3 $+ changed. $2 may now auth to account $3 $+ . (90 seconds)
}
}
;;;;;;;;USE: $renameaccount($nick,nick|*account,[*]account)
alias renameaccount {
if (!$2) {
.notice $nick rename requires more parameters. (nick|*old-account and [*]new-account)
}
elseif (!$3) {
.notice $nick rename requires more parameters. ([*]new-account)
}
else {
if ($mid($2,1,1) == $chr(42)) {
var %account.nick = $readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if (!$readini(" $+ $scriptdiraccounts.ini",Accounts,$remove($2,*))) {
.notice $1 Account $+ $remove($2,*) $+ has not been registered with $+ $me $+ . | halt
}
}
else {
var %account.nick = $2
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($authed(%account.nick) == 0) {
.notice $1 %account.nick must first auth with $+ $me $+ . | halt
}
}
if ($mid($3,1,1) == $chr(42)) {
var %new.account = $remove($3,*)
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($readini(" $+ $scriptdiraccounts.ini",Accounts,%new.account) != $null) {
.notice $1 Account $+ %new.account $+ is already registered. | halt
}
}
else {
var %new.account = $3
var %old.account = $readini(" $+ $scriptdiraccounts.ini",Nicks,%account.nick)
if ($readini(" $+ $scriptdiraccounts.ini",Accounts,%new.account) != $null) {
.notice $1 Account $+ %new.account $+ is already registered. | halt
}
}
var %i = 1
while (%i <= $ini(" $+ $scriptdirchannels.ini",0)) {
if ($readini(" $+ $scriptdirchannels.ini",$ini(" $+ $scriptdirchannels.ini",%i),%old.account) != $null) {
remini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %old.account
writeini " $+ $scriptdirchannels.ini" $ini(" $+ $scriptdirchannels.ini",%i) %new.account $ifmatch
}
inc %i
}
if ($oper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Opers %old.account
writeini " $+ $scriptdiropers.ini" Opers %new.account $ifmatch
}
if ($helper(%account.nick) != $null) {
remini " $+ $scriptdiropers.ini" Helpers %old.account
writeini " $+ $scriptdiropers.ini" Opers %new.account $ifmatch
}
remini " $+ $scriptdiraccounts.ini" Nicks %account.nick
writeini " $+ $scriptdiraccounts.ini" Nicks $nick %new.account
var %if.authed = $readini(" $+ $scriptdiraccounts.ini",Authed,%account.nick)
remini " $+ $scriptdiraccounts.ini" Authed %account.nick
writeini " $+ $scriptdiraccounts.ini" Authed %account.nick %if.authed
remini " $+ $scriptdiraccounts.ini" %old.account
writeini " $+ $scriptdiraccounts.ini" %new.account Hostmask $wildsite
writeini " $+ $scriptdiraccounts.ini" %new.account Nick %account.nick
var %password = $password(%account.nick)
remini " $+ $scriptdiraccounts.ini" Passwords %account.nick
writeini " $+ $scriptdiraccounts.ini" Passwords %account.nick %password
remini " $+ $scriptdiraccounts.ini" Accounts %old.account
writeini " $+ $scriptdiraccounts.ini" Accounts %new.account %account.nick
.notice $1 Successfully renamed account $+ %old.account $+ to $+ %new.account $+
}
}
;;;;;;;;USE: $readalltheini(ini,topic,value|*item*)[.totalnumber]
alias readalltheini {
if ($prop == totalnumber) {
var %x, %i = 0
while (%i < $ini($1,$2,0)) {
inc %i
if ($3 iswm $readini($1,$2,$ini($1,$2,%i))) {
%x = %x $ini($1,$2,%i)
}
}
return $numtok(%x,32)
}
else {
var %x, %i = 0
while (%i < $ini($1,$2,0)) {
inc %i
if ($3 iswm $readini($1,$2,$ini($1,$2,%i))) {
%x = %x $ini($1,$2,%i)
}
}
return %x
}
}
;;;;;;;;USE: $userlist(ini,topic,value)
alias userlist {
var %names, %num = 1
while (%num <= $numtok($readalltheini($1,$2,$3),32)) {
%names = %names $+ $iif(%num != 1,$chr(44),$null) $gettok($readalltheini($1,$2,$3),%num,32)
inc %num
}
return %names
}
;;;;;;;;USE: $initopicchanger(name.ini,oldtopic,newtopic)
alias initopicchanger {
if ($read(" $+ $scriptdirchannels.ini",w,$+([,$1,])) != $null) {
write $+(-w"[,$2,]") $+(",$1,") $+([,$3,])
}
}
;;;;;;;;USE: mmode <#channel> <+/-> <v/o> <nicks>
alias mmode {
var %cmd mode $1 $2, %m $3
tokenize 32 $4-
while $0 {
%cmd $+ $str(%m,$numtok($1-6,32)) $1-6
tokenize 32 $7-
}
}
;;;;;;;;USE: $quotesearch(channel,string)[.sayquote]
alias quotesearch {
var %quote.search = 1, %number.of.lines = 0, %line.numbers
while ($read(" $+ $scriptdir $+ $1 $+ quote.txt",nw,$+(*,$2-,*),%quote.search)) {
%quote.search = $calc($readn + 1)
%line.numbers = %line.numbers $+ $iif(%line.numbers == $null,$chr(32),$chr(44)) $readn
%number.of.lines = $calc(%number.of.lines + 1)
}
if ($prop == sayquote) {
return %line.numbers
}
else {
if (%line.numbers == $null) {
return Sorry, no match found for $+ $2- $+ .
}
else {
return Found $+ $2- $+ in %number.of.lines $+ / $+ $lines(" $+ $scriptdir $+ $1 $+ quote.txt") quotes in quotes number %line.numbers $+ .
}
}
}
;;;;;;;;USE: $protectfromspam(nick,channel)
alias protectfromspam {
if ($spamprotect($2) != disabled) {
if ($access($2,$1) == $null) || ($authed($2) == 0) {
inc -u [ $+ [ $timeduration($gettok($spamprotect($2),2,32)) ] ] %spam. [ $+ [ $1 ] ]
if (%spam. [ $+ [ $1 ] ] == $gettok($spamprotect($2),1,32)) {
if ($spampunish($2) == kick) {
kick $2 $1 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
elseif ($spampunish($2) == ban) {
ban $2 $1 2 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
elseif ($spampunish($2) == kickban) {
ban -k $2 $1 2 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
elseif (timeban* iswm $spampunish($2)) {
writeini " $+ $scriptdirchannels.ini" $2 $+ blist $address($1,2) $ctime $gettok($spamprotect($2),2,32) Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
ban -ku $+ $gettok($spamprotect($2),2,32) $2 $1 2 Spamming. ( $+ $gettok($spamprotect($2),1,32) line $+ $iif(1 < $gettok($spamprotect($2),1,32),s,$chr(32)) in $duration($gettok($spamprotect($2),2,32)) $+ )
}
}
}
}
}
Yes: % [ $+ [ $1 $+ yes ] ] - No: % [ $+ [ $1 $+ no ] ]
;;;;;;;;USE: voteresults <channel>
alias voteresults {
var %y = % [ $+ [ $1 $+ yes ] ]
var %n = % [ $+ [ $1 $+ no ] ]
msg $1 Vote results for [ $+ [ % [ $+ [ $1 $+ question ] ] ] $+ ] - $iif(%n > %y,No won with %n $+ / $+ $calc(%y + %n) votes.,$iif(%n = %y,No vote won; had equal amount of votes. ( $+ %n each),Yes won with %y $+ / $+ $calc(%y + %n) votes.))
unset % $+ $1 $+ question
unset % $+ $1 $+ enablevote
unset % $+ $1 $+ yes
unset % $+ $1 $+ no
$iif(voters $+ $1 $+ .txt,.remove voters $+ $1 $+ .txt)
}
;;;;;;;;USE: checkifauthed nick account
alias checkifauthed {
$iif($authed($1) == 0,writeini " $+ $scriptdiraccounts.ini" $2 Hostmask %old.hostmask)
}
;;;;;;;;USE $translang(language)
alias translang {
if ($1 == en) return English
elseif ($1 == fr) return French
elseif ($1 == de) return German
elseif ($1 == it) return Italian
elseif ($1 == pt) return Portuguese
elseif ($1 == es) return Spanish
elseif ($1 == zh) return Chinese
elseif ($1 == ja) return Japanese
elseif ($1 == ko) return Korean
else return $null
}
on *:open:?: { msg $nick #1,0P14lease 1T14ype - 1a14uth 1.14:1. 14 username password to create an auth if you would like to register a channel type .join #channelname then type regchan #channelname authname} details of the post (optional)
Note: Only the paste content is required, though the following information can be useful to others.