Add holy hand of RMS. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit f64d96cf8740794a0e3810ec53ec245461c37dca | |
parent aeaf0f986a02abe4369f5f21604a100eb1a515c2 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Wed, 30 Aug 2023 12:51:21 +0200 | |
Add holy hand of RMS. | |
Diffstat: | |
M modules/idlerpg/idlerpg-channel-se… | 19 +++++++++++++++++++ | |
1 file changed, 19 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/modules/idlerpg/idlerpg-channel-service.py b/modules/idlerpg/idler… | |
@@ -132,6 +132,18 @@ def main(args): | |
hacker.append(0) | |
return hacker | |
+ def hand_of_rms(hackers, hacker): | |
+ win = random.randint(0, 5) | |
+ rmstime = random.randint(1, 10) * 100 | |
+ if win: | |
+ hackers[hacker][0] += rmstime | |
+ say(chaninpath, "The holy hand of RMS moved %s %d seconds" \ | |
+ " forward in idle time." % (hacker, rmstime)) | |
+ else: | |
+ hackers[hacker][0] -= rmstime | |
+ say(chaninpath, "RMS had a bad day and moved %s %d seconds" \ | |
+ " back in idle time." % (hacker, rmstime)) | |
+ | |
def go_on_quest(hackers, questhackers): | |
quest = random.choice(list(quests.keys())) | |
success = random.randint(1, 16) | |
@@ -229,6 +241,8 @@ def main(args): | |
elif random.randint(1, 65535) < 30 and len(hackers) > 1: | |
questhackers = random.sample(list(hackers.keys()), random.rand… | |
go_on_quest(hackers, questhackers) | |
+ elif random.randint(1, 65535) < 5 and len(hackers) > 1: | |
+ hand_of_rms(random.choice(list(hackers.keys()))) | |
writeout_dictfile("%s/hackers.txt" % (basepath), hackers) | |
continue | |
@@ -278,6 +292,11 @@ def main(args): | |
else: | |
questhackers = random.sample(list(hackers.keys()),… | |
go_on_quest(hackers, questhackers) | |
+ elif cmd == "!hor": | |
+ if len(cmdargs) > 0 and cmdargs[0] in hackers: | |
+ hand_of_rms(hackers, cmdargs[0]) | |
+ else: | |
+ hand_of_rms(hackers, random.choice(list(hackers.ke… | |
elif user == "-!-": | |
(hacker, text) = remain.split(" ", 1) |