Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
Foam
Novice


Joined: 08 Nov 2000
Posts: 44
Location: Australia

PostPosted: Tue Apr 22, 2003 9:11 am   

Potion Accountant
 
Hiya's

Heres a little script to help organisations manage their brewed potions, this script could be
added to an already existing donations watching bot. It keeps records of potion used, gold
donations and calculates how much to donate to cover potions used so its easy for individuals
to keep track of their usage.

Flask cost is set at 11,000 at the moment, just change the value in the variable flaskcost if your
organisations flask buying chars buys them at a different average rate.

Change the values in the variable authorised to who ever buys flasks for your organisation, the
bot will only give donated gold to characters listed in this variable.

Change "an ancient stone bier" to whatever your organisations potion container is called in the
four times it is listed in triggers patterns.

Have your prompt set as %g gold for example: 455566 gold

Thats about it, hope its of some use. I wrote this for Realms of Despair, if you do use it, i'd
appreciate any feedback :) (im Foamfoller on RoD)






*Below are instructions for your organisations members, whack it in the bots desc or bio prehaps*


(*) say report please to find out how many potions you have used
or how many potions have be already covered by donations
.
(*) say donate value to find out how much of a donation would cover
the flask cost of potions u have used
.
(*) say gold please If you are a authorised flask buying person to
be given the donated gold so you can buy flasks
.
(*) say stats please to be told total potions counted and gold held
.
You can reduce your outstanding potions by giving this bot a donation, which
will be used to purchase more flasks.







*Cut and paste the following code into your command line*


#CLASS {potion}
#VAR flaskcost {11000}
#VAR positive {}
#VAR positive2 {}

#VAR donation {}
#VAR prepaid2 {}
#VAR prepaid {}
#VAR gold {}
#VAR authorised {Leader|First|Second}

#VAR counted {}
#VAR paid {}
#VAR paidpots {}
#VAR goldwithdrawn {}

#TRIGGER {^(%w) gets a * potion from an ancient stone bier.$} {#if (%1=%null) {#var %1 %1} {#ad %1 1};#ad counted 1;save}
#TRIGGER {^(%w) says 'report please'$} {#var positive @%1;#math positive2 -@positive;#if (@%1 >0) {say %1 has taken a total of @%1 potions};#if (@%1 <0) {say %1 you have donated in advance to cover @positive2 potions};#if (@%1 =0) {say %1 has currently taken no potions}}
#TRIGGER {^(%w) gets a * potion ~((%d)~) from an ancient stone bier.$} {#if (%1=%null) {#var %1 %1} {#ad %1 %2};#ad counted %2;save}
#TRIGGER {^(%w) says 'donate value'$} {#math donation (@%1 * @flaskcost);#var prepaid2 @%1;#math prepaid -@prepaid2;#if (@donation <1) {say You currently have @prepaid prepaid potions} {say A donation of @donation will replenish the potions you have used}}

#TRIGGER {^(%w) gives you (%n) coins.$} {#var paid %2;#math paidpots (@paid / @flaskcost);#math %1 (@%1 - @paidpots);#var prepaid2 @%1;#math prepaid -@prepaid2;#if (@%1>1) {say Your donation covered @paidpots potions, You have @%1 unpaid potions left on your account} {say Your donation covered @paidpots potions, You now have @prepaid prepaid potions on your account};save}
#TRIGGER {^(%w) gets an * * potion ~((%d)~) from an ancient stone bier.$} {#if (%1=%null) {#var %1 %1} {#ad %1 %2};#ad counted %2;save}

#TRIGGER {^(%w) gets an (%w) (%w) potion from an ancient stone bier.$} {#if (%1=%null) {#var %1 %1} {#ad %1 1};#ad counted 1;save}
#TRIGGER {^(%w) says 'gold please'$} {#IF (%ismember( "%1", @authorised)) {give @gold coins %1;#ad goldwithdrawn %1}}
#TRIGGER {(%n) gold} {#var gold %1} "" {prompt}
#TRIGGER {^(%w) says 'stats please'$} {say Hiya %1, I am currently holding @gold donated coins, and have counted a total of @counted potions}
#CLASS 0
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net