Filename: Private: No Yes Filetype: Auto ABAP Sophia Apex Azure CLI Batch Bicep C Cameligo Clojure CoffeeScript C++ C# CSP CSS Cypher Dart Dockerfile ECL Elixir Flow9 FreeMarker2 FreeMarker2 (Angle/Bracket) FreeMarker2 (Angle/Dollar) FreeMarker2 (Auto/Bracket) FreeMarker2 (Auto/Dollar) FreeMarker2 (Bracket/Bracket) FreeMarker2 (Bracket/Dollar) F# Go GraphQL Handlebars Terraform HTML Ini Java JavaScript Julia Kotlin Less Lexon Liquid Lua Modula-3 Markdown MDX MIPS DAX MySQL Objective-C Pascal Pascaligo Perl PostgreSQL PHP Plain text ATS PQ PowerShell Protobuf Pug Python Q# R Razor Redis Redshift ReStructuredText Ruby Rust Small Basic Scala Scheme Sass Shell Solidity SPARQL SQL StructuredText Swift SV Tcl Twig TypeScript TypeSpec Visual Basic V WebGPU Shading Language XML YAML Indentation: Spaces Tabs 1 2 3 4 5 6 7 8 Clone # commands trigger proc trig {} { return "." } bind pub o|o [trig]op chan:op bind pub o|o [trig]deop chan:deop bind pub V|V [trig]v chan:voice bind pub V|V [trig]voice chan:voice bind pub V|V [trig]devoice chan:devoice bind pub o|o [trig]b chan:ban bind pub o|o [trig]ban chan:ban bind pub o|o [trig]unban chan:unban bind pub o|o [trig]k chan:kick bind pub o|o [trig]kick chan:kick bind pub m|m [trig]ex chan:except bind pub m|m [trig]except chan:except bind pub m|m [trig]unex chan:unexcept bind pub m|m [trig]unexcept chan:unexcept bind pub m|m [trig]listex chan:listexceptions bind pub m|m [trig]listexceptions chan:listexceptions bind pub o|o [trig]t chan:topic bind pub o|o [trig]topic chan:topic bind pub n [trig]addshit chan:addshit bind pub n [trig]delshit chan:delshit bind pub n [trig]addjunk chan:addjunk bind pub n [trig]deljunk chan:deljunk bind pub n [trig]enable chan:enable bind pub n [trig]disable chan:disable bind pub n [trig]permauth chan:permauth bind dcc n addshit dcc:addshit bind dcc n delshit dcc:delshit bind dcc n addjunk dcc:addjunk bind dcc n deljunk dcc:deljunk bind dcc n enable dcc:enable bind dcc n disable dcc:disable bind dcc n permauth dcc:permauth bind pub -|- [trig]help chan:help bind msg -|- auth msg:auth bind sign -|- * sign:deauth bind nick -|- * nick:deauth proc auth {handle} { global botnick if {[getuser $handle XTRA AUTH] == 1} {return 1} if {[getuser $handle XTRA AUTH] == "PERM"} {return 1} if {[getuser $handle XTRA AUTH] == 0} { puthelp "NOTICE [hand2nick $handle] :Type /MSG $botnick AUTH <password> to identify first" } return 0 } proc sign:deauth {nick uhost hand chan arg} { if {$hand == "*"} {return 1} if {[getuser $hand XTRA AUTH] == "DEAD"} {return 1} if {[getuser $hand XTRA AUTH] == "PERM"} {return 1} setuser $hand XTRA AUTH "0" return 1 } proc nick:deauth {nick uhost hand chan newnick} { if {$hand == "*"} {return 1} if {[getuser $hand XTRA AUTH] == "DEAD"} {return 1} if {[getuser $hand XTRA AUTH] == "PERM"} {return 1} if {[string tolower [finduser $newnick!$uhost]]==[string tolower $hand]} {return 1} setuser $hand XTRA AUTH "0" return 1 } proc chan:op {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { foreach n $arg { pushmode $chan +o $n } } else { pushmode $chan +o $nick } } return 0 } proc chan:deop {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { foreach n $arg { pushmode $chan -o $n } } else { pushmode $chan -o $nick } return 1 } return 0 } proc chan:voice {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { foreach n $arg { pushmode $chan +v $n } } else { pushmode $chan +v $nick } } return 0 } proc chan:devoice {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { foreach n $arg { pushmode $chan -v $n } } else { pushmode $chan -v $nick } } return 0 } proc chan:ban {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 5} { if {[onchan $arg $chan]} { pushmode $chan +b *!*[regsub -all "\[~\]" [getchanhost $arg $chan] ""] } else { pushmode $chan +b $arg } return 1 } else { puthelp "NOTICE $nick :Usage: [trig]ban <nick!user@host>" } } return 0 } proc chan:unban {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 1} { pushmode $chan -b $arg return 1 } else { puthelp "NOTICE $nick :Usage: [trig]unban <nick!user@host>" } } return 0 } proc chan:kick {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { set victim [lindex $arg 0] set reason [lrange $arg 1 end] if {$reason==""} {set reason "Requested..."} if {[onchan $victim $chan]} { putserv "KICK $chan $victim :$reason" return 1 } else { puthelp "NOTICE $nick :$victim is not on $chan" } } else { puthelp "NOTICE $nick :Usage: [trig]kick <nick> \[reason\]" } } return 0 } proc chan:except {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { if {[string tolower [lindex $arg 1]]=="--global"} { newexempt [lindex $arg 0] $hand "" } else { newchanexempt $chan [lindex $arg 0] $hand "" } return 1 } else { puthelp "NOTICE $nick :Usage: [trig]except <nick!user@host> \[--global\]" } } return 0 } proc chan:unexcept {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { set exc [lindex $arg 0] if {([killexempt $exc]) || ([killchanexempt $chan $exc])} { puthelp "NOTICE $nick :Exception '$exc' removed" return 1 } else { puthelp "NOTICE $nick :Exception '$exc' not exist" } } else { puthelp "NOTICE $nick :Usage: [trig]unexcept <nick!user@host>" } } return 0 } proc chan:listexceptions {nick uhost hand chan arg} { if {[string match "*all*" $arg]} { puthelp "NOTICE $nick :Global exceptions :" foreach exc [exemptlist] { puthelp "NOTICE $nick : [fill:string [lindex $exc 0] 47] ([lindex $exc 5]![strftime %d-%m-%y@%H:%M [lindex $exc 3]])" } puthelp "NOTICE $nick :Channel exceptions :" foreach exc [exemptlist $chan] { puthelp "NOTICE $nick : [fill:string [lindex $exc 0] 47] ([lindex $exc 5]![strftime %d-%m-%y@%H:%M [lindex $exc 3]])" } return 1 } if {[string match "*glob*" $arg]} { puthelp "NOTICE $nick :Global exceptions :" foreach exc [exemptlist] { puthelp "NOTICE $nick : [fill:string [lindex $exc 0] 47] ([lindex $exc 5]![strftime %d-%m-%y@%H:%M [lindex $exc 3]])" } return 1 } puthelp "NOTICE $nick :Channel exceptions :" foreach exc [exemptlist $chan] { puthelp "NOTICE $nick : [fill:string [lindex $exc 0] 47] ([lindex $exc 5]![strftime %d-%m-%y@%H:%M [lindex $exc 3]])" } return 1 } proc fill:string {main len {fill " "}} { set l [string length $main] if {$l > $len} { return $main } set x $len incr x -$l set out $main while {$x != 0} { append out $fill incr x -1 } return $out } proc chan:topic {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { putserv "TOPIC $chan :$arg" return 1 } else { puthelp "NOTICE $nick :Usage: [trig]topic <new-topic>" } } return 0 } # @TODO! proc chan:addshit {nick uhost hand chan arg} { } proc chan:delshit {nick uhost hand chan arg} { } proc chan:addjunk {nick uhost hand chan arg} { } proc chan:deljunk {nick uhost hand chan arg} { } proc chan:enable {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { set h [lindex $arg 0] if {![validuser $h]} { puthelp "NOTICE $nick :'$h' is not a valid handle id" return 0 } setuser $h XTRA AUTH 0 puthelp "NOTICE $nick :Channel commands for '$h' enabled" return 1 } else { puthelp "NOTICE $nick :Usage: [trig]enable <handle>" } } return 0 } proc chan:disable {nick uhost hand chan arg} { if {[auth $hand]} { if {[string length $arg] > 0} { set h [lindex $arg 0] if {![validuser $h]} { puthelp "NOTICE $nick :'$h' is not a valid handle id" return 0 } setuser $h XTRA AUTH "DEAD" puthelp "NOTICE $nick :Channel commands for '$h' disabled" return 1 } } return 0 } proc chan:permauth {nick uhost hand chan arg} { if {[string length $arg] > 0} { set h [lindex $arg 0] if {![validuser $h]} { puthelp "NOTICE $nick :'$h' is not a valid handle" return 0 } setuser $h XTRA AUTH "PERM" puthelp "NOTICE $nick :'$h' is now permanently authenticated" return 1 } else { puthelp "NOTICE $nick :Usage: !permauth <handle>" } return 0 } # @TODO! proc dcc:addshit {hand idx {arg ""}} { } proc dcc:delshit {hand idx {arg ""}} { } proc dcc:addjunk {hand idx {arg ""}} { } proc dcc:deljunk {hand idx {arg ""}} { } proc dcc:enable {hand idx {arg ""}} { if {[string length $arg] > 0} { set h [lindex $arg 0] if {![validuser $h]} { putdcc $idx "'$h' is not a valid handle" return 0 } setuser $h XTRA AUTH 0 putdcc $idx "Channel commands for '$h' enabled" return 1 } else { putdcc $idx "Usage: .enable <handle>" } return 0 } proc dcc:disable {hand idx {arg ""}} { if {[string length $arg] > 0} { set h [lindex $arg 0] if {![validuser $h]} { putdcc $idx "'$h' is not a valid handle" return 0 } setuser $h XTRA AUTH "DEAD" putdcc $idx "Channel commands for '$h' disabled" return 1 } else { putdcc $idx "Usage: .disable <handle>" } return 0 } proc dcc:permauth {hand idx {arg ""}} { if {[string length $arg] > 0} { set h [lindex $arg 0] if {![validuser $h]} { putdcc $idx "'$h' is not a valid handle" return 0 } setuser $h XTRA AUTH "PERM" putdcc $idx "'$h' is now permanently authenticated" return 1 } else { putdcc $idx "Usage: .permauth <handle>" } return 0 } proc msg:auth {nick uhost hand arg} { if {$hand=="*"} {return 0} if {[getuser $hand XTRA AUTH]=="DEAD"} {return 0} set passwd [lindex $arg 0] if [passwdok $hand $passwd] { setuser $hand XTRA AUTH 1 puthelp "NOTICE $nick :Password accepted." putlog "($nick!$uhost) !$hand! AUTH ..." } else { puthelp "NOTICE $nick :Password incorrect!" putlog "($nick!$uhost) !$hand! failed AUTH" } return 0 } proc chan:help {nick uhost hand chan {arg ""}} { global botnick puthelp "NOTICE $nick :Channel commands :" puthelp "NOTICE $nick :------------------------------" puthelp "NOTICE $nick : [trig]op [trig]deop" puthelp "NOTICE $nick : [trig]voice [trig]devoice" puthelp "NOTICE $nick : [trig]kick [trig]topic" puthelp "NOTICE $nick : [trig]ban [trig]unban" if {[matchattr $hand m]} { puthelp "NOTICE $nick : [trig]except [trig]unexcept" puthelp "NOTICE $nick : [trig]listexceptions" } if {[matchattr $hand n]} { puthelp "NOTICE $nick : [trig]addshit [trig]delshit" puthelp "NOTICE $nick : [trig]enable [trig]disable" } puthelp "NOTICE $nick :----------------------------------" puthelp "NOTICE $nick :Commands require /msg $botnick auth <password>" return 0 } putlog "*** ChanCMD.TCL * Polizei.Co * Loaded !!" Paste