- on *:TEXT:*:#: {
- if ($1 == .admin) {
- if ($owner($address($nick,1))) {
- if (!$2) {
- .notice $nick %ctstart ERROR! Usage: .admin add/del/list (parameter) %ctstop
- }
- elseif ($2 == add) {
- if (!$3) {
- .notice $nick %ctstart ERROR! Usage .admin add nick/host %ctstop
- }
- elseif ($3 ison $chan) {
- if (!$admin($address($3,1))) {
- write bot\admin.txt $address($3,1)
- .notice $nick %ctstart $3 ( $+ $address($3,1) $+ ) was added as admin %ctstop
- }
- else {
- .notice $nick %ctstart ERROR! $3 ( $+ $address($3,1) $+ ) is already added as admin %ctstop
- }
- }
- else {
- if (!$admin($3)) {
- write bot\admin.txt $3
- .notice $nick %ctstart NoNick ( $+ $3 $+ ) was added as admin %ctstop
- }
- else {
- .notice $nick %ctstart ERROR! NoNick ( $+ $3 $+ ) is already added as admin %ctstop
- }
- }
- }
- elseif ($2 == del) {
- if (!$3) {
- .notice $nick %ctstart ERROR! Usage .admin del nick/host/all %ctstop
- }
- elseif ($3 == all) {
- .remove bot\admin.txt
- .notice $nick %ctstart All admins removed. %ctstop
- }
- elseif ($left($3,1) == $chr(35)) {
- .notice $nick %ctstart NoName ( $+ $read(bot\admin.txt,$right($3,-1)) $+ ) was deleted as admin %ctstop
- write -dl $+ $right($3,-1) bot\admin.txt
- }
- elseif ($3 ison $chan) {
- if ($admin($address($3,1))) {
- $read(bot\ban.txt,w,$address($3,1))
- write -dl $+ $readn bot\admin.txt
- .notice $nick %ctstart $3 ( $+ $address($3,1) $+ ) was deleted as admin %ctstop
- }
- else {
- .notice $nick %ctstart ERROR! $3 ( $+ $address($3,1) $+ ) is not added as admin %ctstop
- }
- }
- else {
- if ($admin($3)) {
- $read(bot\admin.txt,w,$3)
- write -dl $+ $readn bot\admin.txt
- .notice $nick %ctstart NoNick ( $+ $3 $+ ) was deleted as admin %ctstop
- }
- else {
- .notice $nick %ctstart ERROR! NoNick ( $+ $3 $+ ) is not added as admin %ctstop
- }
- }
- }
- elseif ($2 == list) {
- .notice $nick %ctstart Admin list: %ctstop
- if ($lines(bot\admin.txt) < 1) {
- .notice $nick %ctstart EMPTY %ctstop
- }
- var %x = 1
- while (%x <= $lines(bot\admin.txt)) {
- var %admin = $addtok(%admin,$chr(35) $+ $+ %x $+ $read(bot\admin.txt,%x) -,32)
- if (%x == $lines(bot\admin.txt) || $numtok(%admin,32) >= 45 ) {
- .notice $nick %ctstart $gettok(%admin,1- $+ $calc($numtok(%admin,32) - 1),32) %ctstop
- unset %admin
- }
- inc %x
- }
- .notice $nick %ctstart End of list. %ctstop
- }
- }
- }
- if ($1 == .deop) {
- if ($admin($address($nick,1)) && $2 isop $chan) {
- set %opnick $2
- who $2 n%uah
- }
- }
- if ($1 == .op) {
- if ($admin($address($nick,1))) {
- if (!$2) {
- .notice $nick %ctstart ERROR! You must specify a user or wildmark to op %ctstop
- }
- else {
- var %x = 1
- while (%x <= $nick($chan,0,a,o)) {
- if ($2 iswm $nick($chan,%x,a,o)) { var %opnow = $addtok(%opnow,$nick($chan,%x,a,o),32) }
- var %opcounter = 0
- if (%x == $nick($chan,0,a,o) || $numtok(%opnow,32) >= 18 ) {
- .timer 1 %opcounter .msg q op $chan %opnow %ctstop
- unset %opnow
- inc %opcounter
- }
- inc %x
- }
- }
- }
- }
- if ($1 == .autoop) {
- if ($admin($address($nick,1))) {
- if (%autoop == $2) {
- .notice $nick %ctstart ERROR! AutoOp is already $2 %ctstop
- }
- else {
- .notice $nick %ctstart Autoop is now $2 %ctstop
- set %autoop $2
- if ($2 == on) {
- autoop
- .timerautoop -o 0 5 autoop
- }
- elseif ($2 == off) {
- .timerautoop off
- }
- }
- }
- }
- if ($1 == .reop) {
- reop $chan | notice $nick Done.
- }
- if ($1 == .saveop) {
- saveop $chan | notice $nick Done.
- }
- if ($1 == .protect) {
- if ($admin($address($nick,1))) {
- if (%protect == $2) {
- .notice $nick %ctstart ERROR! Protection is already $2 %ctstop
- }
- else {
- .notice $nick %ctstart Protection is now $2 %ctstop
- set %protect $2
- }
- }
- }
- }
- on *:KICK:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- set %fault Kick
- inc %counter
- who $nick n%uah
- }
- }
- on *:BAN:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- .msg q bandel $chan $banmask
- set %fault Ban
- inc %counter
- if (!%ban) {
- who $nick n%uah
- }
- set -u1 %ban 1
- }
- }
- on *:UNBAN:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- .msg q permban $chan $banmask
- set %fault unBan
- inc %counter
- if (!%ban) {
- who $nick n%uah
- }
- set -u1 %ban 1
- }
- }
- on *:MODE:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- .msg q clearchan $chan
- set %fault change Mode
- inc %counter
- if (!%ban) {
- who $nick n%uah
- }
- set -u1 %ban 1
- }
- }
- on *:TOPIC:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- set %fault change Topic
- inc %counter
- who $nick n%uah
- }
- }
- on *:OP:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- set %fault Op
- set %opnick $opnick
- inc %counter
- who $opnick n%uah
- who $nick n%uah
- }
- }
- on *:DEOP:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- .msg q op $chan $opnick
- set %fault deOp
- inc %counter
- who $nick n%uah
- }
- }
- on *:VOICE:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- .msg q devoiceall $chan
- set %fault Voice
- inc %counter
- who $nick n%uah
- }
- }
- on *:DEVOICE:#: {
- if (!$admin($address($nick,1)) && %protect == on) {
- .msg q voice $chan $vnick
- set %fault deVoice
- inc %counter
- who $nick n%uah
- }
- }
- raw 354:*: {
- /haltdef
- if (%opnick) {
- if ($4 == 0) {
- .msg q deopall %channel
- unset %opnick
- }
- else {
- .msg q chanlev %channel $chr(35) $+ $4 +d
- .msg q chanlev %channel $chr(35) $+ $4 -d
- unset %opnick
- }
- }
- else {
- if ($4 != 0) {
- .msg Q removeuser %channel $chr(35) $+ $4
- }
- .msg Q permban %channel *!* $+ $2 $+ @ $+ $3 Killed (*.quakenet.org (Do NOT %fault without permission ( $+ ID: %counter $+ )))
- }
- }
- alias owner {
- if ($1 == *!*runeo@suspended.users.quakenet.org) {
- return $true
- }
- if ($1 == *!*TheQBot@CServe.quakenet.org) {
- return $true
- }
- }
- alias admin {
- if ($owner($1)) {
- return $true
- }
- if ($read(bot\admin.txt,w,$1)) {
- return $true
- }
- }
- alias reop {
- var %t $ticks
- var %nzz = $hget($+(reop.,$1),0).item
- while (%nzz) {
- if ($hget($+(reop.,$1),%nzz).item ison $1) && ($hget($+(reop.,$1),%nzz).item !isop $1) {
- var %reopcounter = 0
- if ($hget($+(reop.,$1),%nzz).item !isop $1) { var %opop = %opop $hget($+(reop.,$1),%nzz).item }
- if ($gettok(%opop,0,32) == 6) { .timer 1 %reopcounter msg q op $1 %opop | unset %opop }
- elseif ($gettok(%opop,0,32) < 6) && ($hget($+(reop.,$1),0).item <= 6) { msg q op $1 %opop }
- inc %reopcounter
- }
- dec %nzz
- }
- }
- alias saveop {
- var %t $ticks
- if (!$1) { if ($isid) { return � DEBUG � Error: Synthax insufficient "channel" parameters � - $calc($ticks - %t) ms � } | else { echo -s ERROR Synthax insufficient "channel" parameters | halt } }
- if ($hget($+(reop.,$1))) { hfree $+(reop.,$1) }
- var %uu = $nick($1,0) | while (%uu) {
- var %nsop = $nick($1,%uu) | if (%nsop isop $1) {
- if (%nsop != Q) && (%nsop != S) {
- if (!$hget($+(reop.,$1))) hmake -w $+(reop.,$1) 600
- if (!$hget($+(reop.,$1),%nsop)) hadd -w $+(reop.,$1) %nsop %nsop
- }
- }
- dec %uu
- }
- if ($isid) { return � MSL � No Complications � - $calc($ticks - %t) ms � }
- else { echo -s Ok No Complication }
- }
- alias autoop {
- var %x = 1
- while (%x <= $nick(%channel,0,a,o)) {
- var %opnow = $addtok(%opnow,$nick(%channel,%x),32)
- var %opcounter = 0
- if (%x == $nick(%channel,0,a,o) || $numtok(%opnow,32) >= 18 ) {
- .timer 1 %opcounter .msg q op %channel %opnow %ctstop
- unset %opnow
- inc %opcounter
- }
- inc %x
- }
- }
Undefined
By: Guest | Date: Nov 11 2022 19:20 | Format: None | Expires: never | Size: 8.58 KB | Hits: 241
Latest pastes
11 hours ago
2 days ago
2 days ago
11 months ago
13 months ago