|
Setepth Novice
Joined: 17 Dec 2001 Posts: 34 Location: USA
|
Posted: Thu May 15, 2003 12:12 am
Difficult Coding, Need Help |
Hello,
I would like to gain some assistance in writing this script. In my mud, you may own industries to make things for the city but they require coinage per real life day to run. However, I have a significantly large list of industries and have broken them down into groups as following:
mines
quarries
refineries
mints
plots
butchers
greengrocers
fishmongers
sawmills
Within each category they have the list of id's and their cost. The command to pay for lets say mine id #10079 would be pay maintenance 10079 54; 10079 of course being the id and 54 being 54 coins which is the cost to run a mine. The response to the command would look something like:
You pay maintenance costs for the mine.
What I would like to be able to do is be able to type pay mines (x) days where x is the amount of days Real Life and thus will pay a maintenance of (54 times X) and run down the list going to the next id on the list after the response.
If you can show me how to work that I should be able to insert the rest of the ids and data myself and do the same with the other industries. thanks!
examples would be
1. pay maintenance 10079 (54 times X)
2. pay maintenance 30482 (72 times X)
3. pay maintenance 51418 (54 times X)
Hey meet my character:
Nurmek Leptin, Shaman of the Orcs.
At
telnet: elysium-rpg.com port:7777 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu May 15, 2003 2:27 am |
First make a record-variable with all the ID's and their cost.
#ADDK Mines 10079 54
#ADDK Mines 30482 72
#ADDK Mines 51418 54
Now, you can make a simple alias to pay each value once.
#AL PayMines {#LOOPDB Mines {pay maintenance %key %val}
You can then just use #XX to run the alias several times.
#5 PayMines
LightBulb
Advanced Member |
|
|
|
Setepth Novice
Joined: 17 Dec 2001 Posts: 34 Location: USA
|
Posted: Thu May 15, 2003 3:02 am |
Thanks. That works most of the way, except cause of the mud, it doesnt accept the continuous string of commands, you have to wait till the first response comes before you can send the next and i tried inserting wait but it messes up on certain ones because of world emotes and stuff. Any tips on how to fix that?
Hey meet my character:
Nurmek Leptin, Shaman of the Orcs.
At
telnet: elysium-rpg.com port:7777 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu May 15, 2003 3:57 am |
Yes. You'll either need a trigger based on whatever the message is that allows you to send the next command, or an alarm with a period that's longer than it takes to get that message.
Search this forum and the Finished Scripts forum for "command queue" or the like, I think someone did one for Gemstones or DragonRealms around Jan/Feb. You could probably adapt it if you can't find one for Elysium. You might also check both forums for posts regarding Achaea/Aetolia and "balance" or "equilibrium". They use a method which sounds similar to yours.
LightBulb
Advanced Member |
|
|
|
|
|