More random astrology bits.

by Laysus

Back to Mechanic's Corner.

Laysus2006-03-05 20:51:56
This tracks what blessings an astrologer has, how strong they are, and how long they have left. (note, only works for astrologers tongue.gif)

three parts. First, reflexes!
CODE

#TRIGGER {A Sphere of the (*) ~((%d)~%~) influences you positively ~((%d) minutes~).} {#additem astrobuffs {%1};#addkey abtimes {%1} %3;#addkey abstr {%1} %2;} "astrology_scripts"
#TRIGGER {You no longer have the Sphere of (*) surrounding you.} {#delitem astrobuffs {%1}} "astrology_scripts"
#TRIGGER {scintillating globe of energy, which manifests into the Sphere of the (*).} {#additem astrobuffs {%1};#addkey abtimes {%1} 75;#addkey abstr {%1} "?"} "astrology_scripts"
#TRIGGER {A Sphere of the (*) ~((%d)~%~) influences you negatively ~((%d) minutes~).} {#additem astrobuffs {%1};#addkey abtimes {%1} %3;#addkey abstr {%1} -%2} "astrology_scripts"
#TRIGGER {scintillating globe of energy, which manifests into the Sphere of the Burning} {#additem astrobuffs {Burning Censer};#addkey abtimes {Burning Censer} 75;#addkey abstr {Burning Censer} "?"} "astrology_scripts"
#TRIGGER {scintillating globe of energy, which manifests into the Sphere of the Twin} {#additem astrobuffs {Twin Crystals};#addkey abtimes {Twin Crystals} 75;#addkey abstr {Twin Crystals} "?"} "astrology_scripts"
#ALARM "abtimer" {*60} {#if (%ismember("Volcano",@astrobuffs)) {#add abtimes.Volcano -1;#if (@abtimes.volcano<0) {#delitem astrobuffs Volcano}};#if (%ismember("Antlers",@astrobuffs)) {#add abtimes.Antlers -1;#if (@abtimes.Antlers<0) {#delitem astrobuffs Antlers}};#if (%ismember("Twin Crystals",@astrobuffs)) {#addkey abtimes {Twin Crystals} %eval(%db(@abtimes,"Twin Crystals")-1);#if (%db(@abtimes,"Twin Crystals")<0) {#delitem astrobuffs {Twin Crystals}}};#if (%ismember("Dolphin",@astrobuffs)) {#add abtimes.Dolphin -1;#if (@abtimes.Dolphin<0) {#delitem astrobuffs Dolphin}};#if (%ismember("Lion",@astrobuffs)) {#add abtimes.Lion -1;#if (@abtimes.Lion<0) {#delitem astrobuffs Lion}};#if (%ismember("Crocodile",@astrobuffs)) {#add abtimes.Crocodile -1;#if (@abtimes.Crocodile<0) {#delitem astrobuffs Crocodile}};#if (%ismember("Burning Censer",@astrobuffs)) {#addkey abtimes {Burning Censer} %eval(%db(@abtimes,"Burning Censer")-1);#if (%db(@abtimes,"Burning Censer")<0) {#delitem astrobuffs "Burning Censer"}};#if (%ismember("Spider",@astrobuffs)) {#add abtimes.Spider -1;#if (@abtimes.Spider<0) {#delitem astrobuffs Spider}};#if (%ismember("Dragon",@astrobuffs)) {#add abtimes.Dragon -1;#if (@abtimes.Dragon")<0) {#delitem astrobuffs Dragon}};#if (%ismember("Skull",@astrobuffs)) {#add abtimes.Skull -1;#if (@abtimes.Skull<0) {#delitem astrobuffs Skull}};#if (%ismember("Bumblebee",@astrobuffs)) {#add abtimes.Bumblebee -1);#if (@abtimes.Bumblebee<0) {#delitem astrobuffs Bumblebee}};#if (%ismember("Glacier",@astrobuffs)) {#add abtimes.Glacier -1;#if (@abtimes.Glacier<0) {#delitem astrobuffs Glacier}}} "astrology_scripts"


Slightly fudged Nativity to reset relevant vars when you check these things.
CODE

#ALIAS nativity {#if (%match(%1,laysus)) {#var astrobuffs ""};#send {nativity %1}}


And little bit added to my prompt reflex, to display the data to the relevant window.
And yeah, the window's whatever the hell you want it to be.

CODE

#var i 1
#window afflictions BUFFS:
#while (@i <= %numitems(@astrobuffs)) {#window afflictions %item(@astrobuffs,@i)~(%db(@abstr,%item(@astrobuffs,@i))~%~): %db(@abtimes,%item(@astrobuffs,@i)) Mins;#add i 1}


Note: I finished this 20 minutes ago, if you find bugs, tell me.
Asarnil2006-03-05 20:53:20
First bug - in the nativity code. #if or %if at the beginning of the line not a plain if.
Laysus2006-03-05 20:56:09
That's a bug in copying rather than anything else, methinks. I'll fix it.

Edit: fixed, and yeah, was a mistake made when posting, not in my code.
Laysus2006-03-08 16:09:13
Fixed a very major problem (had my ismembers the wrong way around) and streamlined the alarm to countdown, so if anyone's using it, the code there now's a lot better >.>