diff options
| author | 2026-01-08 07:09:32 +0000 | |
|---|---|---|
| committer | 2026-01-08 21:00:29 -0700 | |
| commit | ff5ca83741baf430add728c8e017e2dc8349c0f1 (patch) | |
| tree | 9ee2abf5a1d6ceb6298e852eee7d93980be6c354 | |
| parent | lilykarma: implement more ignores (diff) | |
jseater-chat: init
| -rw-r--r-- | jseater-chat.tcl | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/jseater-chat.tcl b/jseater-chat.tcl new file mode 100644 index 0000000..eb0a1cd --- /dev/null +++ b/jseater-chat.tcl @@ -0,0 +1,67 @@ +bind pubm * "#jseater *" jseater-privmsg + +proc jseater-privmsg {nick uhost hand chan text} { + if {([string index $text 0] == "!") && (([string index $text 1] != " ") && ([string length $text] != "1"))} { + return 0 + } + if {([string match "*@hackint/user/h2ibot" $uhost])} { + return 0 + } + if {[string index $text 0] == "\001"} { + return 0 + } + if {[isop $nick $chan]} { + set nick "@$nick" + } elseif {[isvoice $nick $chan]} { + set nick "+$nick" + } + + putserv "PRIVMSG #jseater-chat :<$nick> $text" +} + +bind ctcp * "ACTION" jseater-action + +proc jseater-action {nick uhost hand dest keyword text} { + if {$dest == "#jseater"} { + if {[isop $nick $dest]} { + set nick "@$nick" + } elseif {[isvoice $nick $dest]} { + set nick "+$nick" + } + putserv "PRIVMSG #jseater-chat :\001ACTION <$nick> $text\001" + } +} + +bind notc * "*" jseater-notice + +proc jseater-notice {nick uhost hand text {dest ""}} { + if {$dest == "#jseater"} { + if {[isop $nick $dest]} { + set nick "@$nick" + } elseif {[isvoice $nick $dest]} { + set nick "+$nick" + } + putserv "NOTICE #jseater-chat :<$nick> $text" + } +} + +bind out * "% sent" jseater-out + +proc jseater-out {queue text status} { + set botnick $::botnick + if {[botisop "#jseater"]} { + set botnick "@$botnick" + } elseif {[botisvoice "#jseater"]} { + set botnick "+$botnick" + } + if {[string match "PRIVMSG #jseater *" $text]} { + if {[string match "*\\\[remind\\\]*" $text]} { + putserv "PRIVMSG #jseater-chat :<$botnick> [join [lrange [split $text ":"] 1 end] ":"]" + } + } + if {[string match "NOTICE #jseater *" $text]} { + if {[string match "*\\\[karma\\\]*" $text]} { + putserv "NOTICE #jseater-chat :<$botnick> [join [lrange [split $text ":"] 1 end] ":"]" + } + } +} |
