Cleanup.
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
userNick="$1"
|
||||
shift
|
||||
chan="$1"
|
||||
shift
|
||||
snack="${@#botsnack}"
|
||||
snack="${snack:-$(shuf -n1 -e\
|
||||
"BBQ microchips" \
|
||||
"BBQ sunflower seeds" \
|
||||
"BBQ corn nuts" \
|
||||
"deep fried goat placenta" \
|
||||
"steak")} "
|
||||
thanks="$(shuf -n1 -e "Thank you" "You're so awesome" "You shouldn't have" "You rock")"
|
||||
favorite="$(shuf -n1 -e "my favorite" "yum yum" "this is bot heaven" "DELICIOUS")"
|
||||
|
||||
msg "$chan" "$thanks $userNick: $snack! $favorite!"
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
# Add phrases in quotes to the array.
|
||||
phrases=(
|
||||
"cuss words, just let 'em roll, mother fucking shit god damn ass hole!"
|
||||
"cuss words, just don't quit, mother fuck you damn shit head bitch!"
|
||||
"damn!"
|
||||
"fuck the fucking fuckers!"
|
||||
"fuck the fuck off!"
|
||||
"fuck!"
|
||||
"fuck. fuck. fuck. Mother mother fuck. Mother mother fuck fuck. Mother fuck mother fuck. Noise noise noise."
|
||||
"god damn it!"
|
||||
"motherfucker"
|
||||
"shit, piss, fuck, cunt, cocksucker, motherfucker, and tits."
|
||||
"shit!"
|
||||
"son of a bitch!"
|
||||
)
|
||||
msg "$2" "${phrases[$(($RANDOM % ${#phrases[@]}))]}"
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
douchebag=(
|
||||
"Don't ask to ask, just ask!"
|
||||
"STOP! READ THIS BEFORE YOU SPEAK! http://www.rockbox.org/wiki/IrcGuidelines"
|
||||
"The human requesting this service can't be bothered to help you in person, so they requested a bot tell you that we don't discuss blah here, only blah+ which is totally different."
|
||||
'Use a pastebin website, bun only the one approved by the users of this channel, else someone may flood your screen with whining and bitching!')
|
||||
msg "$2" "$1: $(shuf -n1 -e "${douchebag[@]}")"
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
# Dependencies required by this module
|
||||
dependencies=("curl")
|
||||
|
||||
# Check dependencies before running
|
||||
if ! check_dependencies "${dependencies[@]}"; then
|
||||
msg "$2" "$1: This module requires: ${dependencies[*]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
type="$(shuf -n1 -e "off" "you" "donut" "shakespeare" "linus" "king" "chainsaw" "madison")"
|
||||
response="$(curl -s --connect-timeout 5 --max-time 10 -H "Accept: text/plain" "https://foaas.com/${type}/$3/$nick")"
|
||||
if [[ -z "$response" || ${#response} -lt 5 ]]; then
|
||||
msg "$2" "$1: Sorry, the FOAAS service is unavailable right now."
|
||||
else
|
||||
msg "$2" "$response"
|
||||
fi
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
shift
|
||||
chan="$1"
|
||||
shift
|
||||
|
||||
pimp() {
|
||||
echo -n "$*" | sed \
|
||||
-r -e "s/(^| )ask( |\?|\.|!)/\1aks\2/gI" \
|
||||
-e "s/(^| )A /\1Uh $(shuf -e -n1 "god damn" "motha fuckin'") /gI" \
|
||||
-e "s/(^| )I /\1Ah /gI" \
|
||||
-e "s/(^| )is /\1be /gI" \
|
||||
-e "s/(^| )are /\1is /gI" \
|
||||
-e "s/(^| )(boy|dude|friend|guy|man)( |\?|\.|!)/\1$(shuf -n1 -e "bruh" "bruh-man" "brutha")\3/gI" \
|
||||
-e "s/(^| )for( |\?|\.|!)/\1fuh\2/gI" \
|
||||
-e "s/(^| )(appartment|house)( |\?|\.|!)/\1crib\3/gI" \
|
||||
-e "s/(\w)ing( |\?|\.|!)/\1in'\2/gI" \
|
||||
-e "s/(^| )my /\1mah /gI" \
|
||||
-e "s/(^| )people /\1people /gI" \
|
||||
-e "s/(^| )that( |\?|\.|!)/\1dat\2/gI" \
|
||||
-e "s/(^| )this( |\?|\.|!)/\1dis\2/gI"
|
||||
|
||||
echo " $(shuf -n1 -e \
|
||||
"Brace yourself foo'!" \
|
||||
"What 'chew thinking Gee!" \
|
||||
"and shit!" \
|
||||
"sho 'nuff! ya'eard!?" \
|
||||
"nd git Sheniquah's ass back ova' heeah!" \
|
||||
)"
|
||||
}
|
||||
|
||||
msg "$chan" "$(pimp "$*")"
|
||||
@@ -1,11 +0,0 @@
|
||||
# The site on which this module relied is now down.
|
||||
# This module is here in the hopes that it will one day come back.
|
||||
# Thanks to joel.net for years of laughs.
|
||||
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
shift
|
||||
chan="$1"
|
||||
shift
|
||||
pimpText="${*#pimp }"
|
||||
echo "$chan" "$(curl -L -s --data-urlencode English="$pimpText" --data-urlencode submit="Submit send" http://joel.net/EBONICS/Translator | grep ' <textarea id="Ebonics" name="Ebonics" class="materialize-textarea validate" required>' | sed -e 's/^ <textarea id="Ebonics" name="Ebonics" class="materialize-textarea validate" required>//' -e "s/'/'/g" -e 's#</textarea>##' -e 's/^$//g' -e 's/"/\\"/g')"
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
shift
|
||||
chan="$1"
|
||||
shift
|
||||
|
||||
redneck() {
|
||||
echo -n "$*" | sed \
|
||||
-r -e "s/ass/ice/gI" \
|
||||
-e "s/(^| )finger( |,|\?|\.|!|$)/\1fanger\2/gI" \
|
||||
-e "s/(^| )thing( |,|\?|\.|!|$)/\1thang\2/gI" \
|
||||
-e "s/(.\w+)ink(.*)/\1ank\2/gI" \
|
||||
-e "s/(^| )A /\1uh /gI" \
|
||||
-e "s/(.*)i([^a|^e|^u|^ble|^ck|^ft|^ll|^ndo|^on|^ps|^s|^v].*)/\1ah\2/gI" \
|
||||
-e "s/(^| )I( |,|\?|\.|!|$)/\1Ah\2/g" \
|
||||
-e "s/(^| )(boy|dude|fellow|guy|man)([?s])( |,|\?|\.|!|$)/\1feller\3\4/gI" \
|
||||
-e "s/(^| )for( |,|\?|\.|!|$)/\1fer\2/gI" \
|
||||
-e "s/(^| )(hello|hey|hi|how's it going|hows it going)( |,|\?|\.|!|$)/\1howdy\3/gI" \
|
||||
-e "s/(^| )men( |,|\?|\.|!|$)/\1fellers\2/gI" \
|
||||
-e "s/(^| )get( |,|\?|\.|!|$)/\1git\2/gI" \
|
||||
-e "s/(^| )(appartment|cottage|house)( |,|\?|\.|!|$)/\1shack\3/gI" \
|
||||
-e "s/(^| )(god damn|goddam)( |,|\?|\.|!|$)/\1gol-durn\3/gI" \
|
||||
-e "s/(^| )damn( |,|\?|\.|!|$)/\1durn\2/gI" \
|
||||
-e "s/(^| )(am not|is not|isn't|are not|aren't|will not)( |,|\?|\.|!|$)/\1ain't\3/gI" \
|
||||
-e "s/(.*)backward(.*)/\1backerd\2/gI" \
|
||||
-e "s/(^| )bear( |,|\?|\.|!|$)/\1bar\2/gI" \
|
||||
-e "s/(^| )(cannot|can't)( |,|\?|\.|!|$)/\1cain't\3/gI" \
|
||||
-e "s/(^| )careful( |,|\?|\.|!|$)/\1kerful\2/gI" \
|
||||
-e "s/(^| )terrible( |,|\?|\.|!|$)/\1ter'ble\2/gI" \
|
||||
-e "s/(\w)ing( |,|\?|\.|!|$)/\1in'\2/gI" \
|
||||
-e "s/(\w)(i|ah)ght( |,|\?|\.|!|$)/\1aht'\3/gI" \
|
||||
-e "s/(^| )my /\1mah /gI" \
|
||||
-e "s/(^| )people( |,|\?|\.|!|$)/\1folks\2/gI" \
|
||||
-e "s/(^| )pretty( |,|\?|\.|!|$)/\1purdy\2/gI" \
|
||||
-e "s/(^| )sure( |,|\?|\.|!|$)/\1shore\2/gI" \
|
||||
-e "s/(^| )there( |,|\?|\.|!|$)/\1thar'\2/gI" \
|
||||
-e "s/(.*)window(.*)/\1windder\2/gI" \
|
||||
-e "s/(.*)where|we're(.*)/\1wer\2/gI" \
|
||||
-e "s/(^| )that( |,|\?|\.|!|$)/\1'at thar'\2/gI" \
|
||||
-e "s/(^| )this( |,|\?|\.|!|$)/\1'is here\2/gI" \
|
||||
-e "s/(^| )wash( |,|\?|\.|!|$)/\1wahrsh\2/gI" \
|
||||
-e "s/(^| )([bg])ah([g|t])( |,|\?|\.|!|'|$)/\1\2i\3\4/gI" \
|
||||
-e "s/(^| )aht( |,|\?|\.|!|'|$)/\1it\2/gI" \
|
||||
-e "s/(^| )(ahf|if)( |,|\?|\.|!|$)/\1iffen\3/gI" \
|
||||
-e "s/^[Yy]ou( |,|\.|\?\!|$)/Y'all\1/g"
|
||||
|
||||
echo " $(shuf -n1 -e \
|
||||
"Hold Mah beer." \
|
||||
"You're darn tootn" \
|
||||
"Y'all come back now, ye'hear?" \
|
||||
"Yyyyyyeeeeeeeeehaaaaaaaaawwwwww!" \
|
||||
)"
|
||||
}
|
||||
|
||||
msg "$chan" "$(redneck "$*")"
|
||||
@@ -335,7 +335,7 @@ case "$subcommand" in
|
||||
# Set user's location
|
||||
shift
|
||||
if [[ $# -eq 0 ]]; then
|
||||
msg "$channelName" "$name: Usage: weather set <location>"
|
||||
msg "$channelName" "$name: Usage: weather -set <location>"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
101
modules/wordtrack-leaders/wordtrack-leaders.sh
Executable file
101
modules/wordtrack-leaders/wordtrack-leaders.sh
Executable file
@@ -0,0 +1,101 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Word tracking leaderboard module - shows top users in a category
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
# shellcheck disable=SC1091
|
||||
[ -f triggers/wordtrack/categories.sh ] && source triggers/wordtrack/categories.sh
|
||||
|
||||
name="$1"
|
||||
channelName="$2"
|
||||
shift 2
|
||||
|
||||
category="$1"
|
||||
|
||||
# If no category specified, list available categories
|
||||
# shellcheck disable=SC2154
|
||||
if [[ -z "$category" ]]; then
|
||||
msg "$channelName" "$name: Available categories: ${categories[*]}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Validate category exists
|
||||
categoryValid=0
|
||||
# shellcheck disable=SC2154
|
||||
for cat in "${categories[@]}"; do
|
||||
if [[ "$cat" == "$category" ]]; then
|
||||
categoryValid=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if ((categoryValid == 0)); then
|
||||
msg "$channelName" "$name: Invalid category. Available: ${categories[*]}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Data directory for this channel
|
||||
dataDir="triggers/wordtrack/data/${channelName}"
|
||||
|
||||
if [[ ! -d "$dataDir" ]]; then
|
||||
msg "$channelName" "$name: No tracking data available yet."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Collect all users' counts for this category
|
||||
declare -A leaderboard
|
||||
|
||||
for userFile in "$dataDir"/*.dat; do
|
||||
[[ -f "$userFile" ]] || continue
|
||||
|
||||
userName=$(basename "$userFile" .dat)
|
||||
|
||||
while IFS='=' read -r cat count; do
|
||||
if [[ "$cat" == "$category" ]]; then
|
||||
leaderboard["$userName"]="$count"
|
||||
fi
|
||||
done < "$userFile"
|
||||
done
|
||||
|
||||
# Check if anyone has been tracked
|
||||
if [[ ${#leaderboard[@]} -eq 0 ]]; then
|
||||
msg "$channelName" "$name: No one has been tracked in the ${category} category yet."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Sort users by count (descending)
|
||||
sortedUsers=()
|
||||
while IFS= read -r line; do
|
||||
sortedUsers+=("$line")
|
||||
done < <(for user in "${!leaderboard[@]}"; do
|
||||
echo "${leaderboard[$user]} $user"
|
||||
done | sort -rn | head -5)
|
||||
|
||||
# Get level names for this category
|
||||
levelsArrayName="${category}Levels"
|
||||
declare -n levelsRef="$levelsArrayName"
|
||||
|
||||
# Build leaderboard message
|
||||
leaderParts=()
|
||||
position=1
|
||||
|
||||
for entry in "${sortedUsers[@]}"; do
|
||||
count="${entry%% *}"
|
||||
userName="${entry#* }"
|
||||
|
||||
# Find level for this count
|
||||
level="Unranked"
|
||||
for threshold in $(printf '%s\n' "${!levelsRef[@]}" | sort -n); do
|
||||
if ((count >= threshold)); then
|
||||
level="${levelsRef[$threshold]}"
|
||||
fi
|
||||
done
|
||||
|
||||
leaderParts+=("${position}. ${userName}: ${level} (${count} words)")
|
||||
((position++))
|
||||
done
|
||||
|
||||
unset -n levelsRef
|
||||
|
||||
msg "$channelName" "$name: Top ${category} users: $(IFS=' | '; echo "${leaderParts[*]}")"
|
||||
74
modules/wordtrack-stats/wordtrack-stats.sh
Executable file
74
modules/wordtrack-stats/wordtrack-stats.sh
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Word tracking stats module - shows user's current stats
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
# shellcheck disable=SC1091
|
||||
[ -f triggers/wordtrack/categories.sh ] && source triggers/wordtrack/categories.sh
|
||||
|
||||
name="$1"
|
||||
channelName="$2"
|
||||
shift 2
|
||||
|
||||
# Optional: check another user's stats
|
||||
targetUser="${1:-$name}"
|
||||
|
||||
# User data file
|
||||
dataDir="triggers/wordtrack/data/${channelName}"
|
||||
userDataFile="${dataDir}/${targetUser}.dat"
|
||||
|
||||
# Check if user has any data
|
||||
if [[ ! -f "$userDataFile" ]]; then
|
||||
msg "$channelName" "$name: ${targetUser} has not been tracked yet."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Load user data
|
||||
declare -A userCounts
|
||||
while IFS='=' read -r category count; do
|
||||
userCounts["$category"]="$count"
|
||||
done < "$userDataFile"
|
||||
|
||||
# Build stats message
|
||||
statsMessage="${targetUser}'s word tracking stats: "
|
||||
statsParts=()
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
for category in "${categories[@]}"; do
|
||||
count="${userCounts[$category]:-0}"
|
||||
|
||||
if ((count > 0)); then
|
||||
# Get current level for this category
|
||||
levelsArrayName="${category}Levels"
|
||||
declare -n levelsRef="$levelsArrayName"
|
||||
|
||||
currentLevel="Unranked"
|
||||
nextThreshold=""
|
||||
|
||||
# Find current level and next threshold
|
||||
for threshold in $(printf '%s\n' "${!levelsRef[@]}" | sort -n); do
|
||||
if ((count >= threshold)); then
|
||||
currentLevel="${levelsRef[$threshold]}"
|
||||
elif [[ -z "$nextThreshold" ]]; then
|
||||
nextThreshold="$threshold"
|
||||
fi
|
||||
done
|
||||
unset -n levelsRef
|
||||
|
||||
# Build stat string
|
||||
if [[ -n "$nextThreshold" ]]; then
|
||||
remaining=$((nextThreshold - count))
|
||||
statsParts+=("${category}: ${currentLevel} (${count}/${nextThreshold}, ${remaining} to next)")
|
||||
else
|
||||
statsParts+=("${category}: ${currentLevel} (MAX LEVEL - ${count} words)")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#statsParts[@]} -eq 0 ]]; then
|
||||
msg "$channelName" "$name: ${targetUser} has not earned any levels yet."
|
||||
else
|
||||
statsMessage+=$(IFS=' | '; echo "${statsParts[*]}")
|
||||
msg "$channelName" "$statsMessage"
|
||||
fi
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
# Dependencies required by this module
|
||||
dependencies=("curl" "sed")
|
||||
|
||||
# Check dependencies before running
|
||||
if ! check_dependencies "${dependencies[@]}"; then
|
||||
msg "$2" "$1: This module requires: ${dependencies[*]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
joke="$(curl -s --connect-timeout 5 --max-time 10 https://api.yomomma.info | sed -e 's/{"joke":"//' -e 's/"}$//')"
|
||||
if [[ -z "$joke" || ${#joke} -lt 5 ]]; then
|
||||
msg "$2" "$1: Sorry, couldn't fetch a yo momma joke right now."
|
||||
else
|
||||
joke="${joke//[[:space:]]/ }"
|
||||
msg "$2" "$joke"
|
||||
fi
|
||||
Reference in New Issue
Block a user