Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias channels { return #two,#SWGhost,#SWGhost-Game }
- ON *:JOIN:$($channels): {
- if ($nick == $me) {
- .ialfill -f $chan
- mode $chan b
- mode $chan e
- mode $chan I
- .timer[CHECK_ $+ $chan $+ _OPLIST] 1 5 chk_all_op_realname $chan
- .timer[REMOVE_ $+ $chan $+ _MY_BANS] 1 6 remove_my_bans $chan
- .timer[CHECK_ $+ $chan $+ _MUTELIST] 1 8 chk_all_mute_realname $chan
- return
- }
- chk_all_op_realname $chan
- chk_all_mute_realname $chan
- }
- ON *:TEXT:*:?: {
- tokenize 32 $strip($1-)
- if ($1 == !op) {
- if (!$2) { msg $nick ( $+ $nick $+ ): Error, Insert a realname! | return }
- if (!$3) { msg $nick ( $+ $nick $+ ): Error, Insert the channel! | return }
- if ($2 == $me) { msg $nick ( $+ $nick $+ ): Error, You cannot use that on the bot! | return }
- if ($me !ison $3) { msg $nick ( $+ $nick $+ ): Error, I am not on $3 channel! | return }
- if (!$istok($channels,$3,44)) { msg $nick ( $+ $nick $+ ): I don't support the channel you enter! | return }
- if (!$chk_access($nick,$3)) { msg $nick ( $+ $nick $+ ): Error, Access denied! | return }
- var %f = ops_ $+ $3 $+ .db
- var %r = $read(%f,nw,$2)
- if (%r) { msg $nick ( $+ $nick $+ ): Error, This realname is already exists on $3 channel OP list! | return }
- write $qt(%f) $2
- chk_all_op_realname $3
- msg $nick ( $+ $nick $+ ): Realname $qt($2) has been added on $qt($3) channel OP list.
- }
- if ($1 == !deop) {
- if (!$2) { msg $nick ( $+ $nick $+ ): Error, Insert a realname! | return }
- if (!$3) { msg $nick ( $+ $nick $+ ): Error, Insert the channel! | return }
- if ($2 == $me) { msg $nick ( $+ $nick $+ ): Error, You cannot use that on the bot! | return }
- if ($me !ison $3) { msg $nick ( $+ $nick $+ ): Error, I am not on $3 channel! | return }
- if (!$istok($channels,$3,44)) { msg $nick ( $+ $nick $+ ): I don't support the channel you enter! | return }
- if (!$chk_access($nick,$3)) { msg $nick ( $+ $nick $+ ): Error, Access denied! | return }
- var %f = ops_ $+ $3 $+ .db
- var %r = $read(%f,nw,$2)
- var %rn = $readn
- if (!%r) { msg $nick ( $+ $nick $+ ): Error, This realname does not exists on $3 channel OP list! | return }
- write -dl $+ %rn $qt(%f)
- chk_all_op_realname $3
- msg $nick ( $+ $nick $+ ): Realname $qt($2) has been removed from $qt($3) channel OP list.
- }
- if ($1 == !oplist) {
- if (!$2) { msg $nick ( $+ $nick $+ ): Error, Insert the channel! | return }
- if (!$istok($channels,$2,44)) { msg $nick ( $+ $nick $+ ): I don't support the channel you enter! | return }
- if (!$chk_access($nick,$2)) { msg $nick ( $+ $nick $+ ): Error, Access denied! | return }
- var %f = ops_ $+ $2 $+ .db
- var %t = $lines(%f)
- if (!$file(%f)) { msg $nick ( $+ $nick $+ ): The OP list for $2 channel is empty! | return }
- var %i = 1
- while (%i <= %t) {
- var %r = $read(%f,n,%i)
- if (%r) { msg $nick $+([,%i,]:) %r }
- inc %i
- }
- msg $nick ( $+ $nick $+ ): End of $2 channel OP list. - (Total: %t $+ )
- }
- if ($1 == !opclear) {
- if (!$2) { msg $nick ( $+ $nick $+ ): Error, Insert the channel! | return }
- if (!$istok($channels,$2,44)) { msg $nick ( $+ $nick $+ ): I don't support the channel you enter! | return }
- if ($me !ison $2) { msg $nick ( $+ $nick $+ ): Error, I am not on $3 channel! | return }
- if (!$chk_access($nick,$2)) { msg $nick ( $+ $nick $+ ): Error, Access denied! | return }
- var %f = ops_ $+ $2 $+ .db
- var %t = $lines(%f)
- if (!$file(%f)) { msg $nick ( $+ $nick $+ ): The OP list for $2 channel is empty! | return }
- .remove $qt(%f)
- chk_all_op_realname $2
- msg $nick ( $+ $nick $+ ): OP list for $2 channel is now cleared. - (Total: %t $+ )
- }
- ; ------------
- if ($1 == !mute) {
- if (!$2) { msg $nick ( $+ $nick $+ ): Error, Insert the channel! | return }
- if ($me !ison $2) { msg $nick ( $+ $nick $+ ): Error, I am not on $3 channel! | return }
- if (!$istok($channels,$2,44)) { msg $nick ( $+ $nick $+ ): I don't support the channel you enter! | return }
- if (!$chk_access($nick,$2)) { msg $nick ( $+ $nick $+ ): Error, Access denied! | return }
- if (!$3) { msg $nick ( $+ $nick $+ ): Error, Insert a realname! | return }
- if ($ial($me).gecos == $3) { msg $nick ( $+ $nick $+ ): Error, You cannot add bot realname! | return }
- if ($ial($nick).gecos == $3) { msg $nick ( $+ $nick $+ ): Error, You cannot add your realname! | return }
- if ($4) && ($4 isnum) { var %duration = $4 }
- else { var %duration = 0 }
- var %f = mutes_ $+ $2 $+ .db
- var %r = $read(%f,nw,$3)
- if (%r) { msg $nick ( $+ $nick $+ ): Error, This realname is already exists on $2 channel MUTE list! | return }
- write $qt(%f) $3 %duration
- chk_all_mute_realname $2
- msg $nick ( $+ $nick $+ ): Realname $qt($3) has been added on $qt($2) channel MUTE list. - Duration: $iif(%duration,$v1 minutes,Never)
- }
- if ($1 == !unmute) {
- if (!$2) { msg $nick ( $+ $nick $+ ): Error, Insert the channel! | return }
- if ($me !ison $2) { msg $nick ( $+ $nick $+ ): Error, I am not on $3 channel! | return }
- if (!$istok($channels,$2,44)) { msg $nick ( $+ $nick $+ ): I don't support the channel you enter! | return }
- if (!$chk_access($nick,$2)) { msg $nick ( $+ $nick $+ ): Error, Access denied! | return }
- if (!$3) { msg $nick ( $+ $nick $+ ): Error, Insert a realname! | return }
- if ($ial($me).gecos == $3) { msg $nick ( $+ $nick $+ ): Error, You cannot add bot realname! | return }
- if ($ial($nick).gecos == $3) { msg $nick ( $+ $nick $+ ): Error, You cannot add your realname! | return }
- var %f = mutes_ $+ $2 $+ .db
- var %r = $read(%f,nw,$3 *)
- var %rn = $readn
- var %duration = $gettok(%r,2,32)
- if (!%r) { msg $nick ( $+ $nick $+ ): Error, This realname does not exists on $2 channel MUTE list! | return }
- write -dl $+ %rn $qt(%f)
- msg $nick ( $+ $nick $+ ): Realname $qt($3) has been removed from $qt($2) channel MUTE list.
- }
- if ($1 == !mutelist) {
- if (!$2) { msg $nick ( $+ $nick $+ ): Error, Insert the channel! | return }
- if (!$istok($channels,$2,44)) { msg $nick ( $+ $nick $+ ): I don't support the channel you enter! | return }
- if (!$chk_access($nick,$2)) { msg $nick ( $+ $nick $+ ): Error, Access denied! | return }
- var %f = mutes_ $+ $2 $+ .db
- var %t = $lines(%f)
- if (!$file(%f)) { msg $nick ( $+ $nick $+ ): The MUTE list for $2 channel is empty! | return }
- var %i = 1
- while (%i <= %t) {
- var %r = $read(%f,n,%i)
- var %n = $gettok(%r,1,32)
- var %d = $gettok(%r,2,32)
- if (%r) { msg $nick $+([,%i,]:) %n - Duration: $iif(%d,$v1 minutes,Never) }
- inc %i
- }
- msg $nick ( $+ $nick $+ ): End of $2 channel MUTE list. - (Total: %t $+ )
- }
- }
- alias chk_access {
- ; $chk_access(nick,#chan)
- if (!$1) || (!$2) || ($encode($network,m) !== Q2hhdEhVQg==) { return }
- var %f = $nick($2,$1).pnick
- if (*~* iswm %f) || (*&* iswm %f) { return 1 }
- return 0
- }
- alias chk_all_op_realname {
- ; /chk_all_op_realname #chan
- if (!$1) || ($me !ison $1) || ($me !isop $1) || ($encode($network,m) !== Q2hhdEhVQg==) { return }
- var %f = ops_ $+ $1 $+ .db
- var %t = $nick($1,0)
- var %i = 1
- while (%i <= %t) {
- var %n = $nick($1,%i)
- var %p = $remove($nick($1,%i).pnick,%n)
- var %a = $gettok($ial(%n).gecos,1,32)
- var %r = $read(%f,nw,%a)
- if (%n == $me) { goto next }
- if (%r) && (%n !isop $1) { mode $1 +o %n }
- if (!%r) && (%n isop $1) { mode $1 -o %n }
- :next
- inc %i
- }
- }
- alias chk_all_mute_realname {
- ; /chk_all_mute_realname #chan
- if (!$1) || ($me !ison $1) || ($me !isop $1) || ($encode($network,m) !== Q2hhdEhVQg==) { return }
- var %f = mutes_ $+ $1 $+ .db
- var %t = $nick($1,0)
- var %i = 1
- while (%i <= %t) {
- var %nick = $nick($1,%i)
- var %host = $ial(%nick).host
- var %gecos = $gettok($ial(%nick).gecos,1,32)
- var %search = $read(%f,nw,%gecos *)
- var %search_line = $readn
- var %duration = $gettok(%search,2,32)
- if (%nick == $me) || (!%gecos) || (!%nick) || (!%host) || (!%search) { goto next }
- if (!%duration) { mode $1 +b ~q:*!*@ $+ %host }
- elseif (%duration) { mode $1 +b ~t: $+ %duration $+ :~q:*!*@ $+ %host }
- :next
- inc %i
- }
- }
- alias -l remove_my_bans {
- ; /remove_my_bans <#channel>
- if (!$1) || ($me !ison $1) || ($me !isop $1) || ($encode($network,m) !== Q2hhdEhVQg==) { return }
- var %t = $ibl($1,0)
- if (!%t) { return }
- var %i = 1
- while (%i <= %t) {
- var %a = $ibl($1,%i)
- var %b = $gettok($ibl($1,%i).by,1,33)
- if (%a) && (%b) && (%b == $me) { mode $1 -b %a }
- inc %i
- }
- }
- raw 352:*: { haltdef }
- raw 315:*: { haltdef }
- raw 346:*: { haltdef }
- raw 347:*: { haltdef }
- raw 348:*: { haltdef }
- raw 349:*: { haltdef }
- raw 367:*: { haltdef }
- raw 368:*: { haltdef }
- raw 974:*: { haltdef }
Add Comment
Please, Sign In to add comment