From ff5ca83741baf430add728c8e017e2dc8349c0f1 Mon Sep 17 00:00:00 2001 From: klea Date: Thu, 8 Jan 2026 07:09:32 +0000 Subject: jseater-chat: init --- jseater-chat.tcl | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 jseater-chat.tcl 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] ":"]" + } + } +} -- cgit v1.3.1-10-gc9f91