From 985dcb2901d2527b79976df787035425294200b9 Mon Sep 17 00:00:00 2001 From: fireonlive Date: Fri, 9 Aug 2024 19:04:10 +0000 Subject: init --- .gitignore | 2 + .gitmodules | 3 + 8ball.tcl | 25 + CONTENTS | 71 ++ accountscript.tcl | 141 ++++ action.fix.tcl | 24 + alltools.tcl | 439 +++++++++++++ archivebot-chat.tcl | 68 ++ atme.tcl | 37 ++ atmisc.tcl | 136 ++++ autobotchk | 484 ++++++++++++++ bmotion | 1 + cmd_resolve.tcl | 46 ++ compat.tcl | 136 ++++ dccwhois.tcl | 162 +++++ down-the-tube-chat.tcl | 67 ++ firechannels.tcl | 56 ++ fix-solanum-ban-caching.tcl | 14 + forwardedSpamProtection.tcl | 10 + getops.tcl | 369 +++++++++++ klined.tcl | 177 +++++ lilykarma.tcl | 563 ++++++++++++++++ nitterhealth.tcl | 42 ++ notes2.tcl | 218 +++++++ pixseen/pixseen-msggen.tcl | 85 +++ pixseen/pixseen-msgs/en.msg | 302 +++++++++ pixseen/pixseen.tcl | 1339 ++++++++++++++++++++++++++++++++++++++ ques5.tcl | 368 +++++++++++ quotepong.tcl | 289 +++++++++ remind.tcl | 330 ++++++++++ sentinel.tcl | 1442 +++++++++++++++++++++++++++++++++++++++++ tcl.tcl | 69 ++ telegrab-chat.tcl | 67 ++ tell.tcl | 94 +++ tiktok2proxitok.tcl | 49 ++ transferinliner.tcl | 78 +++ twitter2nitter-pre-expand.tcl | 63 ++ twitter2nitter.tcl | 90 +++ userinfo.tcl | 286 ++++++++ weed | 591 +++++++++++++++++ wiki.tcl | 111 ++++ youtube.tcl | 247 +++++++ 42 files changed, 9191 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 8ball.tcl create mode 100644 CONTENTS create mode 100644 accountscript.tcl create mode 100644 action.fix.tcl create mode 100644 alltools.tcl create mode 100644 archivebot-chat.tcl create mode 100644 atme.tcl create mode 100644 atmisc.tcl create mode 100755 autobotchk create mode 160000 bmotion create mode 100644 cmd_resolve.tcl create mode 100644 compat.tcl create mode 100644 dccwhois.tcl create mode 100644 down-the-tube-chat.tcl create mode 100644 firechannels.tcl create mode 100644 fix-solanum-ban-caching.tcl create mode 100644 forwardedSpamProtection.tcl create mode 100644 getops.tcl create mode 100644 klined.tcl create mode 100644 lilykarma.tcl create mode 100644 nitterhealth.tcl create mode 100644 notes2.tcl create mode 100644 pixseen/pixseen-msggen.tcl create mode 100644 pixseen/pixseen-msgs/en.msg create mode 100644 pixseen/pixseen.tcl create mode 100644 ques5.tcl create mode 100644 quotepong.tcl create mode 100644 remind.tcl create mode 100644 sentinel.tcl create mode 100644 tcl.tcl create mode 100644 telegrab-chat.tcl create mode 100644 tell.tcl create mode 100644 tiktok2proxitok.tcl create mode 100644 transferinliner.tcl create mode 100644 twitter2nitter-pre-expand.tcl create mode 100644 twitter2nitter.tcl create mode 100644 userinfo.tcl create mode 100755 weed create mode 100644 wiki.tcl create mode 100644 youtube.tcl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b07dec --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.db +*.dat diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9d0bbbe --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "bmotion"] + path = bmotion + url = https://github.com/jamesoff/bmotion diff --git a/8ball.tcl b/8ball.tcl new file mode 100644 index 0000000..e0d89d2 --- /dev/null +++ b/8ball.tcl @@ -0,0 +1,25 @@ +setudef flag 8ball + +bind pub * "!8ball" 8ball + +set 8ballantifloodsecs 3 + +# source: https://magic-8ball.com/magic-8-ball-answers/ +set 8ballanswers {"it is certain" "it is decidedly so" "without a doubt" "yes definitely" "you may rely on it" "as i see it, yes" "most likely" "outlook good" "yes" "signs point to yes" "reply hazy, try again" "ask again later" "better not tell you now" "cannot predict now" "concentrate and ask again" "don’t count on it" "my reply is no" "my sources say no" "outlook not so good" "very doubtful"} + +set 8ballantiflood [dict create] + +proc 8ball {nick uhost hand chan text} { + if {[channel get $chan 8ball]} { + global 8ballanswers 8ballantiflood 8ballantifloodsecs + set host [lindex [split $uhost @] 1] + set key "$host,$chan" + if {[dict exists $8ballantiflood $key] && ([clock seconds] - [dict get $8ballantiflood $key]) <= $8ballantifloodsecs} { + putlog "\[8ball\] ignored '!8ball $text' from $nick!$uhost in $chan - anti-flood" + return 1 + } else { + dict set 8ballantiflood $key [clock seconds] + putserv "PRIVMSG $chan :🎱: $nick, [lindex $8ballanswers [expr {int(rand()*[llength $8ballanswers])}]]" + } + } +} diff --git a/CONTENTS b/CONTENTS new file mode 100644 index 0000000..7e395fb --- /dev/null +++ b/CONTENTS @@ -0,0 +1,71 @@ +Directory Contents - scripts/ +Last revised: August 08, 2004 + _____________________________________________________________________ + + Directory Contents - scripts/ + + These are the example scripts that come with eggdrop. They're meant to be + useful AND to introduce Tcl to those who haven't dealt with it before. Even + people who program in Tcl may be confused by Eggdrop's implementation at + first, because so many commands were added to interface with the bot. + + action.fix.tcl + Gets rid of those ugly /me's people do instead of a .me. + + alltools.tcl + Several useful procs for use in scripts. + + autobotchk + Tcl script used to crontab your Eggdrop. Type 'scripts/autobotchk' from the + Eggdrop's root directory for help. + + botchk + A shell script which can be used for auto-starting the bot via 'cron'. + + cmd_resolve.tcl + Adds a dcc command called '.resolve' which can be used to resolve hostnames + or IP addresses via the partyline. + + compat.tcl + Maps old Tcl functions to new ones, for lazy people who can't be bothered + updating their scripts. + + dccwhois.tcl + Enhances Eggdrop's built-in dcc '.whois' command to allow all + users to '.whois' their own handle. + + getops.tcl + A way for bots to get ops from other bots on the botnet (if they're on the + same channel). + + klined.tcl + Removes servers from your server list that your bot has been k-lined on, to + prevent admins getting peeved with constant connects from your bot's host. + + notes2.tcl + Check your notes on every shared bot of the hub. + + ques5.tcl + Makes web pages of who's on each channel, updated periodically (requires + alltools.tcl). + + quotepong.tcl + Some EFnet servers require the user to type /quote pong : + when identd is broken or disabled. This will send pong : to + the server when connecting. + + sentinel.tcl (by slennox) + Flood protection script for Eggdrop with integrated BitchX CTCP simulation. + This script is designed to provide strong protection for your bot and + channels against large floodnets and proxy floods. + + userinfo.tcl + Cute user info settings things. + + weed + Weed out certain undesirables from an Eggdrop userlist. Type 'scripts/weed' + from the Eggdrop's root directory for help. + + _____________________________________________________________________ + + Copyright (C) 2001 - 2023 Eggheads Development Team diff --git a/accountscript.tcl b/accountscript.tcl new file mode 100644 index 0000000..4a7abdd --- /dev/null +++ b/accountscript.tcl @@ -0,0 +1,141 @@ +bind PUB * ,op acct_op + +proc acct_op {nick user hand chan text} { + set accthand [finduser -account [getaccount $nick]] + if [string match $accthand "*"] { + putserv "PRIVMSG $chan :$nick, you are not authenticated to NickServ and/or I don't know you!" + return 1 + } + if {[matchattr $accthand +o|+o $chan]} { + pushmode $chan +o $text + putserv "PRIVMSG $chan :ok" + } else { + putserv "PRIVMSG $chan :$nick, you do not have access to ,op" + } +} + + +bind PUB * ,masskick acct_masskick + +proc acct_masskick {nick user hand chan text} { + set accthand [finduser -account [getaccount $nick]] + if [string match $accthand "*"] { + putserv "PRIVMSG $chan :$nick, you are not authenticated to NickServ and/or I don't know you!" + return 1 + } + if {[matchattr $accthand +o $chan]} { + if {$text == ""} { + putserv "PRIVMSG $chan :\[masskick\] usage: ,masskick " + return 1 + } + putserv "PRIVMSG $chan :\[masskick\] starting..." + foreach chann [channels] { + if {([botisop $chann]) && ([onchan $text $chann])} { + putkick $chann $text "Your behaviour is not conducive to the desired environment." + puthelp "PRIVMSG $chan :\[masskick\] kicked $text from $chann" + } + } + puthelp "PRIVMSG $chan :\[masskick\] done" + } else { + putserv "PRIVMSG $chan :$nick, you do not have access to ,masskick" + } +} + +bind PUB * ,whoami acct_whoami + +proc acct_whoami {nick user hand chan text} { + set acct [getaccount $nick] + set accthand [finduser -account $acct] + if [string match $acct ""] { + putserv "PRIVMSG $chan :idk" + return 1 + } + putserv "PRIVMSG $chan :$nick: you're authenticated to NickServ as $acct" + if [string match $accthand ""] { + putserv "PRIVMSG $chan :$nick: '$acct' isn't a known user to me, though." + } else { + putserv "PRIVMSG $chan :$nick: hi! '$acct' is also a known user to me! (flags: [chattr $accthand * $chan])" + } +} + +bind PUB * ,whois acct_whois + +proc acct_whois {nick user hand chan text} { + set search [string trim $text] + if {$search == ""} { + putserv "PRIVMSG $chan :gimmie someone to whois lol" + return 1 + } + if {[isbotnick $search]} { + putserv "PRIVMSG $chan :hi! i'm eggdrop :3 (fireonlive thinks he owns me, but I actually own him)" + return 1 + } + set acct [getaccount $search] + set accthand [finduser -account $acct] + if [string match $acct "*"] { + putserv "PRIVMSG $chan :idk" + return 1 + } + putserv "PRIVMSG $chan :$search is authenticated to NickServ as $acct" + if [string match $accthand ""] { + putserv "PRIVMSG $chan :$acct isn't a known user to me, though." + } else { + putserv "PRIVMSG $chan :$acct is also a known user to me! (flags: [chattr $accthand * $chan])" + } +} + +bind PUB * ,join acct_join + +proc acct_join {nick user hand chan text} { + set accthand [finduser -account [getaccount $nick]] + if [string match $accthand "*"] { + putserv "PRIVMSG $chan :$nick, you are not authenticated to NickServ and/or I don't know you!" + return 1 + } + if {[matchattr $accthand +o]} { + channel add [string trim $text] + channel set [string trim $text] +lkarma +transferinliner +seen +8ball + putquick "PRIVMSG $chan :\[join\] joined [string trim $text] - set flags +lkarma +transferinliner +seen +8ball" + savechannels + } else { + putserv "PRIVMSG $chan :$nick, you do not have access to ,join" + } +} + +bind MSG * join acct_join_pm + +proc acct_join_pm {nick user hand text} { + set accthand [finduser -account [getaccount $nick]] + if [string match $accthand "*"] { + putserv "NOTICE $nick :you are not authenticated to NickServ and/or I don't know you!" + return 1 + } + if {[matchattr $accthand +o]} { + channel add [string trim $text] + channel set [string trim $text] +lkarma +transferinliner +seen +8ball +nitter + putquick "NOTICE $nick :\[join\] joined [string trim $text] - set flags +lkarma +transferinliner +seen +8ball +nitter" + putquick "PRIVMSG #fire-trail :\[join\] $nick ($accthand) requested join [string trim $text]. joined and set flags +lkarma +transferinliner +seen +8ball +nitter" + savechannels + } else { + putserv "NOTICE $nick :you do not have access to join" + } +} +bind PUB * ,chflags acct_chflags +bind PUB * ,chanset acct_chflags + +proc acct_chflags {nick user hand chan text} { + set accthand [finduser -account [getaccount $nick]] + if [string match $accthand "*"] { + putserv "PRIVMSG $chan :$nick, you are not authenticated to NickServ and/or I don't know you!" + return 1 + } + if {[matchattr $accthand +o]} { + set target [lindex [split $text] 0] + set flags [join [lrange [split $text] 1 end] " "] + channel set $target $flags + putquick "PRIVMSG $chan :\[chanset\] set flags \"$flags\" for $target" + savechannels + } else { + putserv "PRIVMSG $chan :$nick, you do not have access to ,chflags" + } +} diff --git a/action.fix.tcl b/action.fix.tcl new file mode 100644 index 0000000..13e13b4 --- /dev/null +++ b/action.fix.tcl @@ -0,0 +1,24 @@ +# action.fix.tcl +# +# Copyright (C) 2002 - 2023 Eggheads Development Team +# +# Tothwolf 25May1999: cleanup +# Tothwolf 04Oct1999: changed proc names slightly +# poptix 07Dec2001: handle irssi (and some others) "correct" messages for DCC CTCP + +# Fix for mIRC dcc chat /me's: +bind filt - "\001ACTION *\001" filt:dcc_action +bind filt - "CTCP_MESSAGE \001ACTION *\001" filt:dcc_action2 +proc filt:dcc_action {idx text} { + return ".me [string trim [join [lrange [split $text] 1 end]] \001]" +} + +proc filt:dcc_action2 {idx text} { + return ".me [string trim [join [lrange [split $text] 2 end]] \001]" +} + +# Fix for telnet session /me's: +bind filt - "/me *" filt:telnet_action +proc filt:telnet_action {idx text} { + return ".me [join [lrange [split $text] 1 end]]" +} diff --git a/alltools.tcl b/alltools.tcl new file mode 100644 index 0000000..78b901f --- /dev/null +++ b/alltools.tcl @@ -0,0 +1,439 @@ +# +# All-Tools TCL, includes toolbox.tcl, toolkit.tcl and moretools.tcl +# toolbox was originally authored by cmwagner +# toolkit was originally authored by Robey Pointer +# moretools was originally authored by David Sesno +# modified for 1.3.0 bots by TG +# +# Copyright (C) 1999, 2003 - 2010 Eggheads Development Team +# +# Tothwolf 02May1999: rewritten and updated +# guppy 02May1999: updated even more +# Tothwolf 02May1999: fixed what guppy broke and updated again +# Tothwolf 24/25May1999: more changes +# rtc 20Sep1999: added isnumber, changes +# dw 20Sep1999: use regexp for isnumber checking +# Tothwolf 06Oct1999: optimized completely +# krbb 09Jun2000: added missing return to randstring +# Tothwolf 18Jun2000: added ispermowner +# Sup 02Apr2001: added matchbotattr +# Tothwolf 13Jun2001: updated/modified several commands +# Hanno 28Sep2001: fixed testip +# guppy 03Mar2002: optimized +# Souperman 05Nov2002: added ordnumber +# Tothwolf 27Dec2003: added matchbotattrany, optimized ordnumber, +# more minor changes +# +######################################## +# +# Descriptions of available commands: +# +## +## (toolkit): +## +# +# putmsg +# send a privmsg to the given nick or channel +# +# putchan +# send a privmsg to the given nick or channel +# (for compat only, this is the same as 'putmsg' above) +# +# putnotc +# send a notice to the given nick or channel +# +# putact +# send an action to the given nick or channel +# +# +## +## (toolbox): +## +# +# strlwr +# string tolower +# +# strupr +# string toupper +# +# strcmp +# string compare +# +# stricmp +# string compare (case insensitive) +# +# strlen +# string length +# +# stridx +# string index +# +# iscommand +# if the given command exists, return 1 +# else return 0 +# +# timerexists +# if the given command is scheduled by a timer, return its timer id +# else return empty string +# +# utimerexists +# if the given command is scheduled by a utimer, return its utimer id +# else return empty string +# +# inchain +# if the given bot is connected to the botnet, return 1 +# else return 0 +# (for compat only, same as 'islinked') +# +# randstring +# returns a random string of the given length +# +# putdccall +# send the given text to all dcc users +# +# putdccbut +# send the given text to all dcc users except for the given idx +# +# killdccall +# kill all dcc user connections +# +# killdccbut +# kill all dcc user connections except for the given idx +# +# +## +## (moretools): +## +# +# iso +# if the given nick has +o access on the given channel, return 1 +# else return 0 +# +# realtime [format] +# 'time' returns the current time in 24 hour format '14:15' +# 'date' returns the current date in the format '21 Dec 1994' +# not specifying any format will return the current time in +# 12 hour format '1:15 am' +# +# testip +# if the given ip is valid, return 1 +# else return 0 +# +# number_to_number +# if the given number is between 1 and 15, return its text representation +# else return the number given +# +# +## +## (other commands): +## +# +# isnumber +# if the given string is a valid number, return 1 +# else return 0 +# +# ispermowner +# if the given handle is a permanent owner, return 1 +# else return 0 +# +# matchbotattr +# if the given bot has all the given flags, return 1 +# else return 0 +# +# matchbotattrany +# if the given bot has any the given flags, return 1 +# else return 0 +# +# ordnumber +# if the given string is a number, returns the +# "ordinal" version of that number, i.e. 1 -> "1st", +# 2 -> "2nd", 3 -> "3rd", 4 -> "4th", etc. +# else return +# +######################################## + +# So scripts can see if allt is loaded. +set alltools_loaded 1 +set allt_version 206 + +# For backward compatibility. +set toolbox_revision 1007 +set toolbox_loaded 1 +set toolkit_loaded 1 + +# +# toolbox: +# + +proc putmsg {dest text} { + puthelp "PRIVMSG $dest :$text" +} + +proc putchan {dest text} { + puthelp "PRIVMSG $dest :$text" +} + +proc putnotc {dest text} { + puthelp "NOTICE $dest :$text" +} + +proc putact {dest text} { + puthelp "PRIVMSG $dest :\001ACTION $text\001" +} + +# +# toolkit: +# + +proc strlwr {string} { + string tolower $string +} + +proc strupr {string} { + string toupper $string +} + +proc strcmp {string1 string2} { + string compare $string1 $string2 +} + +proc stricmp {string1 string2} { + string compare [string tolower $string1] [string tolower $string2] +} + +proc strlen {string} { + string length $string +} + +proc stridx {string index} { + string index $string $index +} + +proc iscommand {command} { + if {[string compare "" [info commands $command]]} then { + return 1 + } + return 0 +} + +proc timerexists {command} { + foreach i [timers] { + if {![string compare $command [lindex $i 1]]} then { + return [lindex $i 2] + } + } + return +} + +proc utimerexists {command} { + foreach i [utimers] { + if {![string compare $command [lindex $i 1]]} then { + return [lindex $i 2] + } + } + return +} + +proc inchain {bot} { + islinked $bot +} + +proc randstring {length {chars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789}} { + if {([string compare "" $length]) && \ + (![regexp \[^0-9\] $length])} then { + set count [string length $chars] + if {$count} then { + for {set index 0} {$index < $length} {incr index} { + append result [string index $chars [rand $count]] + } + } else { + error "empty character string" + } + } else { + error "invalid random string length" + } + return $result +} + +proc putdccall {text} { + foreach i [dcclist CHAT] { + putdcc [lindex $i 0] $text + } +} + +proc putdccbut {idx text} { + foreach i [dcclist CHAT] { + set j [lindex $i 0] + if {$j != $idx} then { + putdcc $j $text + } + } +} + +proc killdccall {} { + foreach i [dcclist CHAT] { + killdcc [lindex $i 0] + } +} + +proc killdccbut {idx} { + foreach i [dcclist CHAT] { + set j [lindex $i 0] + if {$j != $idx} then { + killdcc $j + } + } +} + +# +# moretools: +# + +proc iso {nick chan} { + matchattr [nick2hand $nick $chan] o|o $chan +} + +proc realtime {args} { + switch -exact -- [lindex $args 0] { + time { + return [strftime %H:%M] + } + date { + return [strftime "%d %b %Y"] + } + default { + return [strftime "%I:%M %P"] + } + } +} + +proc testip {ip} { + set tmp [split $ip .] + if {[llength $tmp] != 4} then { + return 0 + } + set index 0 + foreach i $tmp { + if {(([regexp \[^0-9\] $i]) || ([string length $i] > 3) || \ + (($index == 3) && (($i > 254) || ($i < 1))) || \ + (($index <= 2) && (($i > 255) || ($i < 0))))} then { + return 0 + } + incr index + } + return 1 +} + +proc number_to_number {number} { + switch -exact -- $number { + 0 { + return Zero + } + 1 { + return One + } + 2 { + return Two + } + 3 { + return Three + } + 4 { + return Four + } + 5 { + return Five + } + 6 { + return Six + } + 7 { + return Seven + } + 8 { + return Eight + } + 9 { + return Nine + } + 10 { + return Ten + } + 11 { + return Eleven + } + 12 { + return Twelve + } + 13 { + return Thirteen + } + 14 { + return Fourteen + } + 15 { + return Fifteen + } + default { + return $number + } + } +} + +# +# other commands: +# + +proc isnumber {string} { + if {([string compare "" $string]) && \ + (![regexp \[^0-9\] $string])} then { + return 1 + } + return 0 +} + +proc ispermowner {hand} { + global owner + + if {([matchattr $hand n]) && \ + ([lsearch -exact [split [string tolower $owner] ", "] \ + [string tolower $hand]] != -1)} then { + return 1 + } + return 0 +} + +proc matchbotattr {bot flags} { + foreach flag [split $flags ""] { + if {[lsearch -exact [split [botattr $bot] ""] $flag] == -1} then { + return 0 + } + } + return 1 +} + +proc matchbotattrany {bot flags} { + foreach flag [split $flags ""] { + if {[string first $flag [botattr $bot]] != -1} then { + return 1 + } + } + return 0 +} + +proc ordnumber {string} { + if {[isnumber $string]} then { + set last [string index $string end] + if {[string index $string [expr [string length $string] - 2]] != 1} then { + if {$last == 1} then { + return ${string}st + } elseif {$last == 2} then { + return ${string}nd + } elseif {$last == 3} then { + return ${string}rd + } + } + return ${string}th + } + return $string +} diff --git a/archivebot-chat.tcl b/archivebot-chat.tcl new file mode 100644 index 0000000..4affa8f --- /dev/null +++ b/archivebot-chat.tcl @@ -0,0 +1,68 @@ +bind pubm * "#archivebot *" abc-privmsg + +proc abc-privmsg {nick uhost hand chan text} { + if {([string index $text 0] == "!") && ([string index $text 1] != " ")} { + return 0 + } + if {([string match "*@archiveteam/Aramaki" $uhost]) || ([string match "*@hackint/user/h2ibot" $uhost])} { + #if {([string match "*@archiveteam/Aramaki" $uhost] && ([string first ": Job" $text] != -1) && ([string first ": Sorry, I don't know anything about" $text != -1)) || ([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 #archivebot-chat :<$nick> $text" +} + +bind ctcp * "ACTION" abc-action + +proc abc-action {nick uhost hand dest keyword text} { + if {$dest == "#archivebot"} { + if {[isop $nick $dest]} { + set nick "@$nick" + } elseif {[isvoice $nick $dest]} { + set nick "+$nick" + } + putserv "PRIVMSG #archivebot-chat :\001ACTION <$nick> $text\001" + } +} + +bind notc * "*" abc-notice + +proc abc-notice {nick uhost hand text {dest ""}} { + if {$dest == "#archivebot"} { + if {[isop $nick $dest]} { + set nick "@$nick" + } elseif {[isvoice $nick $dest]} { + set nick "+$nick" + } + putserv "NOTICE #archivebot-chat :<$nick> $text" + } +} + +bind out * "% sent" abc-out + +proc abc-out {queue text status} { + set botnick $::botnick + if {[botisop "#archivebot"]} { + set botnick "@$botnick" + } elseif {[botisvoice "#archivebot"]} { + set botnick "+$botnick" + } + if {[string match "PRIVMSG #archivebot *" $text]} { + if {[string match "*\\\[remind\\\]*" $text]} { + putserv "PRIVMSG #archivebot-chat :<$botnick> [join [lrange [split $text ":"] 1 end] ":"]" + } + } + if {[string match "NOTICE #archivebot *" $text]} { + if {[string match "*\\\[karma\\\]*" $text]} { + putserv "NOTICE #archivebot-chat :<$botnick> [join [lrange [split $text ":"] 1 end] ":"]" + } + } +} diff --git a/atme.tcl b/atme.tcl new file mode 100644 index 0000000..e63ed54 --- /dev/null +++ b/atme.tcl @@ -0,0 +1,37 @@ +setudef flag nohelp + +bind pubm * "% *" atme + +proc atme {nick uhost hand chan text} { + global botnick + set target [string trim [lindex [split $text] 0] ':,'] + if {$text == ",help"} { + set target $botnick + } + if {([isbotnick $target]) || ($target == "🥚") || ($target == "🥚💧")} { + set atcmd [lindex [split $text] 1] + if {$text == ",help"} { + set atcmd "help" + } + set args [join [lrange [split $text] 2 end] " "] + switch -- $atcmd { + "hi" { + putserv "PRIVMSG $chan :hi, $nick!" + } + "help" { + puthelp "NOTICE $nick :\[help\] !tell " + puthelp "NOTICE $nick :\[help\] !seen \[-exact/-glob/-regex\] " + puthelp "NOTICE $nick :\[help\] !remind \"