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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion Goto page 1, 2  Next
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Sun Feb 02, 2003 6:43 pm   

Capturing Data
 
I have an idea for a script but I don't know how I would go about it, maybe someone out there can take a look at my idea and make a script.

I was wanting a script that would capture information from the screen and enter it into a database from a specific format, and then display information back as the information is updated.

--Planet Data: -------------------------------
Planet: Coruscant
Starsystem: Coruscant
Governed By: The Empire
Planet Funds: 1851781887

Ammunition ( Price per unit: 7.62 )
Ardanium ( Price per unit: 6.32 )
Chemicals ( Price per unit: 5.02 )
Common metals ( Price per unit: 7.84 )
Construction parts ( Price per unit: 3.78 )
Electronics ( Price per unit: 2.00 )
Food ( Price per unit: 8.07 )
Fuel ( Price per unit: 7.85 )
Goods ( Price per unit: 2.40 )
Lomite ( Price per unit: 7.76 )
Lumber ( Price per unit: 8.67 )
Medical supplies ( Price per unit: 6.55 )
Precious metals ( Price per unit: 4.43 )
Quantum ( Price per unit: 6.04 )
Spice ( Price per unit: 9.48 )
Textiles ( Price per unit: 3.40 )
Uranium ( Price per unit: 8.76 )
Water ( Price per unit: 9.96 )
Weapons ( Price per unit: 4.27 )

I think that these are all of the catagories, but it could change, so the script would need to be easily expandable.

How would I go about capturing the information, and then give me statistical information in return, like best profit return, worst profit return on which planet, and the amount of profit per unit?

Thanks in advance.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 02, 2003 7:18 pm   
 
The first step is to go ahead and define the database.

After you've finished defining your database, you can write a bunch of triggers to automatically put the Planet Data into a record-variable. The record-variable can then be used to create a new record with the #NEW command. It could also be used to add/change data in an existing record with the #DBPUT command. If you choose to use a subclass, there should be a trigger or alias outside the class which provides the #T+ command to enable the class and your final trigger should include the #T- command to disable it.

#TR {^--Planet Data: --} {#VAR PlanetData %null;#T+ PlanetData}
#CLASS PlanetData disable
#TR {Planet: (%w)} {#ADDKEY PlanetData Planet {%1}}
#TR {Starsystem: (%w)} {#ADDKEY PlanetData Starsystem {%1}}
#TR {Ammunition ~( Price per unit: (%x) } {#ADDKEY PlanetData AmmoPrice {%remove( ".", %1)};#T- PlanetData}
etc.
#CLASS 0

LightBulb
Advanced Member
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Mon Feb 03, 2003 4:37 am   
 
so, I have an alias that looks like this

Alias: sales
Showplanet Byss resources
Showplanet Coruscant resources
Showplanet Yavin resources
Showplanet Corellia resources
Showplanet Ryloth resources
Showplanet Gamorr resources
Showplanet Tatooine resources
Showplanet Kashyyyk resources
Showplanet Wroona resources
Showplanet Roche resources
Showplanet 'Nal hutta' resources
showplanet 'Nim Drovis' resources
Showplanet 'Ord Mantell' resources

and it returns...

You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Byss
Starsystem: Byss
Governed By: The Empire
Planet Funds: 579703

Common metals ( Price per unit: 4.00 )
Construction parts ( Price per unit: 8.27 )
Durelium ( Price per unit: 6.17 )
Electronics ( Price per unit: 4.06 )
Explosives ( Price per unit: 7.39 )
Food ( Price per unit: 7.78 )
Fuel ( Price per unit: 9.27 )
Goods ( Price per unit: 5.27 )
Lomite ( Price per unit: 9.66 )
Lumber ( Price per unit: 10.08)
Precious metals ( Price per unit: 6.85 )
Quantum ( Price per unit: 9.96 )
Spice ( Price per unit: 7.92 )
Textiles ( Price per unit: 6.87 )
Uranium ( Price per unit: 8.33 )
Weapons ( Price per unit: 2.76 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Coruscant
Starsystem: Coruscant
Governed By: The Empire
Planet Funds: 1851111201

Ammunition ( Price per unit: 5.45 )
Ardanium ( Price per unit: 9.84 )
Chemicals ( Price per unit: 4.64 )
Common metals ( Price per unit: 9.88 )
Construction parts ( Price per unit: 3.87 )
Electronics ( Price per unit: 4.92 )
Food ( Price per unit: 7.94 )
Fuel ( Price per unit: 7.81 )
Goods ( Price per unit: 3.47 )
Lomite ( Price per unit: 6.39 )
Lumber ( Price per unit: 10.16)
Medical supplies ( Price per unit: 9.14 )
Precious metals ( Price per unit: 4.37 )
Quantum ( Price per unit: 6.45 )
Spice ( Price per unit: 9.51 )
Textiles ( Price per unit: 3.10 )
Uranium ( Price per unit: 9.80 )
Water ( Price per unit: 8.80 )
Weapons ( Price per unit: 2.75 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Yavin
Starsystem: Yavin
Governed By: Neutral
Planet Funds: 1020124

Food ( Price per unit: 5.53 )
Goods ( Price per unit: 9.86 )
Livestock ( Price per unit: 6.74 )
Lumber ( Price per unit: 5.87 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Corellia
Starsystem: Corellian
Governed By: The Empire
Planet Funds: 1109137

Ammunition ( Price per unit: 3.46 )
Ardanium ( Price per unit: 9.56 )
Chemicals ( Price per unit: 6.56 )
Common metals ( Price per unit: 8.11 )
Construction parts ( Price per unit: 3.83 )
Electronics ( Price per unit: 6.95 )
Explosives ( Price per unit: 2.22 )
Food ( Price per unit: 7.11 )
Fuel ( Price per unit: 8.44 )
Goods ( Price per unit: 6.24 )
Lomite ( Price per unit: 5.21 )
Lumber ( Price per unit: 11.78)
Medical supplies ( Price per unit: 9.09 )
Precious metals ( Price per unit: 6.46 )
Spice ( Price per unit: 10.52)
Textiles ( Price per unit: 5.92 )
Weapons ( Price per unit: 5.87 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Ryloth
Starsystem: Ryloth
Governed By: The Empire
Planet Funds: 983014

Food ( Price per unit: 4.52 )
Fuel ( Price per unit: 6.69 )
Goods ( Price per unit: 4.63 )
Precious metals ( Price per unit: 3.60 )
Spice ( Price per unit: 5.54 )
Weapons ( Price per unit: 9.21 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Gamorr
Starsystem: Gamorr
Governed By: The Empire
Planet Funds: 772638

Chemicals ( Price per unit: 2.47 )
Food ( Price per unit: 4.29 )
Livestock ( Price per unit: 6.34 )
Lumber ( Price per unit: 5.57 )
Textiles ( Price per unit: 6.76 )
Weapons ( Price per unit: 5.76 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Tatooine
Starsystem: Tatoo
Governed By: The Empire
Planet Funds: 822608

Ammunition ( Price per unit: 9.31 )
Common metals ( Price per unit: 5.56 )
Electronics ( Price per unit: 8.95 )
Explosives ( Price per unit: 5.37 )
Food ( Price per unit: 9.29 )
Fuel ( Price per unit: 9.19 )
Goods ( Price per unit: 7.04 )
Livestock ( Price per unit: 11.58)
Lomite ( Price per unit: 5.08 )
Medical supplies ( Price per unit: 7.12 )
Quantum ( Price per unit: 6.96 )
Spice ( Price per unit: 4.61 )
Water ( Price per unit: 9.46 )
Weapons ( Price per unit: 7.12 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Kashyyyk
Starsystem: Kashyyyk
Governed By: The New Republic
Planet Funds: 833969

Ammunition ( Price per unit: 7.29 )
Common metals ( Price per unit: 2.40 )
Livestock ( Price per unit: 10.84)
Lumber ( Price per unit: 7.46 )
Precious metals ( Price per unit: 4.62 )
Weapons ( Price per unit: 7.29 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Wroona
Starsystem: Wroona
Governed By: The New Republic
Planet Funds: 1003443

Food ( Price per unit: 3.20 )
Fuel ( Price per unit: 3.47 )
Goods ( Price per unit: 6.24 )
Livestock ( Price per unit: 11.79)
Lumber ( Price per unit: 7.74 )
Medical supplies ( Price per unit: 5.88 )
Textiles ( Price per unit: 4.77 )
Water ( Price per unit: 3.31 )
Weapons ( Price per unit: 7.12 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Roche
Starsystem: Roche Sector
Governed By: The New Republic
Planet Funds: 1118897

Ammunition ( Price per unit: 1.55 )
Chemicals ( Price per unit: 2.42 )
Common metals ( Price per unit: 4.14 )
Durelium ( Price per unit: 3.66 )
Explosives ( Price per unit: 7.51 )
Food ( Price per unit: 4.81 )
Fuel ( Price per unit: 5.48 )
Lomite ( Price per unit: 2.36 )
Precious metals ( Price per unit: 4.84 )
Quantum ( Price per unit: 3.99 )
Uranium ( Price per unit: 4.60 )
Water ( Price per unit: 5.54 )
Weapons ( Price per unit: 7.16 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Nal Hutta
Starsystem: Hutt Space
Governed By: Neutral
Planet Funds: 1078639

Common metals ( Price per unit: 5.88 )
Construction parts ( Price per unit: 8.01 )
Explosives ( Price per unit: 8.54 )
Food ( Price per unit: 4.97 )
Goods ( Price per unit: 4.63 )
Spice ( Price per unit: 4.30 )
Weapons ( Price per unit: 3.45 )

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Nim Drovis
Starsystem: Drovian
Governed By: The Empire
Planet Funds: 1234567

(No resources avaliable on this planet)

HP:500/500 MV:1660/1660 GP:161696>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Ord Mantell
Starsystem: Bright Jewel
Governed By: The Empire
Planet Funds: 0

(No resources avaliable on this planet)

The prices change every minute or so, do you think that the sripting will still work in such a situation?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Feb 04, 2003 12:47 am   
 
No, if the prices change every minute or so it's probably a waste of time to put them in a database.

I'm not familiar with any MUDs of this sort, perhaps someone who is will have a better idea of what might be useful for you.

LightBulb
Advanced Member
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Feb 04, 2003 2:25 am   
 
quote:

The prices change every minute or so, do you think that the sripting will still work in such a situation?


like Lightbulb said, lots of work if the numbers are going to keep on changing... but i can see why you'd want to! thats alot of reading if your just looking for 1 or two things.
maybe if you had more clearly defined goals, like finding the lowest price, or highest price, or planet with most variety, then you would have better luck

--------

moon.icebound.net:9000
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Tue Feb 04, 2003 3:17 am   
 
As I was stating in the first post...
How would I go about capturing the information, and then give me statistical information in return, like best profit return, worst profit return on which planet, and the amount of profit per unit?
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Feb 04, 2003 4:13 am   
 
#TRIGGER {--Planet Data} {#T+ getprices}
#CLASS getprices
#TRIGGER {Planet: (*)} {planet = {%1}}
#TRIGGER {^(%w)*~( Price per unit: (%x) ~)} {
temp = %float( %2)
#IF (%ismember( @goods, %1)) {
#IF (@temp > @%1.price) {
#VARIABLE %1 ""
#ADDKEY %1 price @temp
#ADDKEY %1 planet @planet
}
} {
#VARIABLE %1 ""
#ADDKEY %1 price @temp
#ADDKEY %1 planet @planet
#ADDITEM goods %1
}
}
#class 0
#alias bestprices {
#forall @goods {
#show highest price for %i: @%i.planet @%i.price
}}

what i'm trying to do here is create a string list, where each entry is the name of a possible good, and the name of a database variable storing the highest priced planet for that good, and the cost. i haven't tested this, so you might run into problems on statements like this one:
@%1.price
where one part of the expression might be evaluated out of order, but i don't think so.

run your alias that loops through everything, then run the bestprices alias to see what we've found out.
quote:

How would I go about capturing the information, and then give me statistical information in return, like best profit return, worst profit return on which planet, and the amount of profit per unit?



the worst profit (lowest price) you can get by duplicating everything i've done above, but changing the ">" to "<". Of course this will overwrite your data on best prices. And the amount of profit is totally dependant on how much you paid.

--------

moon.icebound.net:9000
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Tue Feb 04, 2003 12:51 pm   
 
Basically this is what I Have been doing in my head every couple of minutes, I remember what planet I am on. I run my sales alias. Read the information. Stop at the planet I am on, look for the goods with the loweest price. Then I read it from the top and look at all of the like goods on other planets, and then once I find the highest number. I'm done.

So, to use this, I just put it into the commandline and press enter or what?

Thanks for trying to tackle this monster for me. No way I would have been able to do it.

By the way, this is for a Star Wars Reality mud, called Legend of the Jedi.
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Feb 04, 2003 5:23 pm   
 
right, you can just copy and paste start at the first '#' and end the selection at the last '}' put it all in the command line and press enter. Then activate your sales alias, and after its done printing out activate the bestprices alias. Then come back here and tell me how it broke, hehe

--------

moon.icebound.net:9000
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Tue Feb 04, 2003 6:00 pm   
 
highest price for price5.15999984741211planetNal Hutta: @Nal Hutta @5.15999984741211
highest price for Goods: @ @
highest price for Spice: @ @
highest price for Weapons: @ @

was the reply I got, I think that what you were going for was the name of the goods, and then the planet, and the current price...

but it isn't something I can really decypher easily.
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Tue Feb 04, 2003 6:07 pm   
 
another interesting thing, it only comes up with Nal Hutta, never anywhere else.
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Feb 04, 2003 10:32 pm   
 
ok, i redid it a bit, and tested some this time this one should work alot better:

#TRIGGER {Planet: (*)} {planet = {%1}} "getprices"
#TRIGGER {(%w)*~( Price per unit: (%x) ~)} {temp = %float( %2);#IF (%ismember( %1, @profitlist)) {#IF (@temp > %db( @%1, price)) {#VARIABLE %1 "";#ADDKEY %1 {price=@temp|planet=@planet}}} {#ADDITEM profitlist "%1";#VARIABLE %1 "";#ADDKEY %1 {price=@temp|planet=@planet}}} "getprices"
#ALIAS bestprices {#FORALL @profitlist {showgood %i}}
#ALIAS showgood {#SHOW Best price for %1: %expanddb( @{%1}, " on the ", ": ")}
#TRIGGER {--Planet Data} {#T+ getprices}


same instructions as before: run sales, wait for it to finish, then run bestprices
--edit--
to correct an error in original post
4:42PM 02/4/03
--------

moon.icebound.net:9000
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Wed Feb 05, 2003 6:49 am   
 
Best price for Common: price: 7.6399998664856 on the planet: Corellia
Best price for Construction: price: 7.86999988555908 on the planet: Nal Hutta
Best price for Durelium: price: 8.10000038146973 on the planet: Byss
Best price for Electronics: price: 7.90000009536743 on the planet: Tatooine
Best price for Explosives: price: 9.23999977111816 on the planet: Nal Hutta
Best price for Food: price: 9.84000015258789 on the planet: Tatooine
Best price for Fuel: price: 8.93000030517578 on the planet: Tatooine
Best price for Goods: price: 9.82999992370605 on the planet: Tatooine
Best price for Lomite: price: 8.60000038146973 on the planet: Coruscant
Best price for Lumber: price: 9.78999996185303 on the planet: Corellia
Best price for Precious: price: 8.39000034332275 on the planet: Byss
Best price for Quantum: price: 9.36999988555908 on the planet: Byss
Best price for Spice: price: 9.94999980926514 on the planet: Corellia
Best price for Textiles: price: 6.53000020980835 on the planet: Gamorr
Best price for Uranium: price: 8.92000007629395 on the planet: Coruscant
Best price for Weapons: price: 8.52000045776367 on the planet: Roche
Best price for Ammunition: price: 6.8600001335144 on the planet: Kashyyyk
Best price for Ardanium: price: 9.81999969482422 on the planet: Corellia
Best price for Chemicals: price: 6.65999984741211 on the planet: Corellia
Best price for Medical: price: 9.85999965667725 on the planet: Tatooine
Best price for Water: price: 9.89000034332275 on the planet: Tatooine
Best price for Livestock: price: 9.68000030517578 on the planet: Tatooine

was the reply I recieved.

now, I am assuming that what this is doing is getting the highest prices, and reporting them?

What would be most helpfull is if I could get the lowest price for an item and the find out the highest price paid.

or tell it the item I have and have it find the highest price paid, on which planet.

Not that I am trying to sound ungrateful. Because I am very grateful! You've done only what I could dream about doing. Thank you sooo much for your efforts.
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Wed Feb 05, 2003 5:30 pm   
 
So, I found another spot where it broke, it doesn't update. It's been reporting the same information EVERY time.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Feb 05, 2003 6:41 pm   
 
To solve the problem of it not updating, you need to clear the variables. Adding this as the first line of your sales alias should do it, I think.
#FORALL @profitlist {#VAR %i %null}

Emit is just checking each price to see if it's higher than the highest previous one for that product, if it is he uses it as the new high price. You can get lowest prices the same way.

LightBulb
Advanced Member
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Wed Feb 05, 2003 7:03 pm   
 
Works now, thanks guys!!

How would I make an alias using the same information, to give me the lowest prices?

Being capitalist, we all know, you want to buy low, sell high!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Feb 05, 2003 8:38 pm   
 
I already told you.

"Emit is just checking each price to see if it's higher than the highest previous one for that product, if it is he uses it as the new high price. You can get lowest prices the same way."

In other words, just check each price to see if it's LOWER than the LOWEST previous one for that product, if it is use it as the new LOW price.

#TRIGGER {Planet: (*)} {planetlow = {%1}} "getlowprices"
#TRIGGER {(%w)*~( Price per unit: (%x) ~)} {templow = %float( %2);#IF (%ismember( %1, @lowlist)) {#IF (@templow < %db( @%1low, price)) {#VARIABLE %1low "";#ADDKEY %1low {price=@templow|planet=@planetlow}}} {#ADDITEM lowlist "%1";#VARIABLE %1low "";#ADDKEY %1low {price=@templow|planet=@planetlow}}} "getlowprices"
#ALIAS lowprices {#FORALL @lowlist {showlow %i}}
#ALIAS showlow {#SHOW lowest price for %1: %expanddb( @{%1low}, " on the ", ": ")}
#TRIGGER {--Planet Data-} {#T+ getlowprices}

And of course, add another line to sales to clear all the low prices
#FORALL @lowlist {#VAR %ilow %null}

LightBulb
Advanced Member
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Wed Feb 05, 2003 11:35 pm   
 
Sorry, I must not have understood it. Thanks again!!
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Thu Feb 06, 2003 7:38 am   
 
So I did as you said I should...

and this is the result...

lowest price for Common: @%ilow
lowest price for Construction: @%ilow
lowest price for Durelium: @%ilow
lowest price for Electronics: @%ilow
lowest price for Explosives: @%ilow
lowest price for Food: @%ilow
lowest price for Fuel: @%ilow
lowest price for Goods: @%ilow
lowest price for Lomite: @%ilow
lowest price for Precious: @%ilow
lowest price for Quantum: @%ilow
lowest price for Spice: @%ilow
lowest price for Textiles: @%ilow
lowest price for Uranium: @%ilow
lowest price for Weapons: @%ilow
lowest price for Ammunition: @%ilow
lowest price for Ardanium: @%ilow
lowest price for Chemicals: @%ilow
lowest price for Medical: @%ilow
lowest price for Water: @%ilow
lowest price for Livestock: @%ilow
lowest price for Lumber: @%ilow


I even tried making two seperate "Sales" Aliases, thinking that the commands might be conflicting.

What should I do?
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Thu Feb 06, 2003 7:49 am   
 
So I also just noticed something, even with the extra coding put into the SALES alias...

I don't think that it is working...Look at this information and you'll see why.

You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Byss
Starsystem: Byss
Governed By: The Empire
Planet Funds: 851888

Common metals ( Price per unit: 4.03 )
Construction parts ( Price per unit: 9.45 )
Durelium ( Price per unit: 6.27 )
Electronics ( Price per unit: 4.59 )
Explosives ( Price per unit: 7.23 )
Food ( Price per unit: 7.93 )
Fuel ( Price per unit: 7.59 )
Goods ( Price per unit: 5.54 )
Lomite ( Price per unit: 9.34 )
Lumber ( Price per unit: 9.86 )
Precious metals ( Price per unit: 6.24 )
Quantum ( Price per unit: 8.23 )
Spice ( Price per unit: 9.31 )
Textiles ( Price per unit: 5.44 )
Uranium ( Price per unit: 8.42 )
Weapons ( Price per unit: 3.26 )
Speed: 85 Fuel Level: 96% Coords: 2817 -10485 5601

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Coruscant
Starsystem: Coruscant
Governed By: The Empire
Planet Funds: 1848513078

Ammunition ( Price per unit: 7.89 )
Ardanium ( Price per unit: 8.58 )
Chemicals ( Price per unit: 4.63 )
Common metals ( Price per unit: 9.75 )
Construction parts ( Price per unit: 3.79 )
Electronics ( Price per unit: 4.83 )
Food ( Price per unit: 9.33 )
Fuel ( Price per unit: 9.70 )
Goods ( Price per unit: 4.27 )
Lomite ( Price per unit: 7.56 )
Lumber ( Price per unit: 11.50)
Medical supplies ( Price per unit: 8.89 )
Precious metals ( Price per unit: 5.44 )
Quantum ( Price per unit: 6.50 )
Spice ( Price per unit: 11.45)
Textiles ( Price per unit: 5.38 )
Uranium ( Price per unit: 9.26 )
Water ( Price per unit: 9.17 )
Weapons ( Price per unit: 2.44 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Yavin
Starsystem: Yavin
Governed By: Neutral
Planet Funds: 1001358

Food ( Price per unit: 2.72 )
Goods ( Price per unit: 8.91 )
Livestock ( Price per unit: 5.49 )
Lumber ( Price per unit: 5.96 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Corellia
Starsystem: Corellian
Governed By: The Empire
Planet Funds: 826610

Ammunition ( Price per unit: 2.83 )
Ardanium ( Price per unit: 9.15 )
Chemicals ( Price per unit: 4.33 )
Common metals ( Price per unit: 8.54 )
Construction parts ( Price per unit: 3.55 )
Electronics ( Price per unit: 6.06 )
Explosives ( Price per unit: 4.53 )
Food ( Price per unit: 9.38 )
Fuel ( Price per unit: 7.85 )
Goods ( Price per unit: 5.96 )
Lomite ( Price per unit: 4.59 )
Lumber ( Price per unit: 8.97 )
Medical supplies ( Price per unit: 7.75 )
Precious metals ( Price per unit: 8.57 )
Spice ( Price per unit: 11.53)
Textiles ( Price per unit: 4.56 )
Weapons ( Price per unit: 7.92 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Ryloth
Starsystem: Ryloth
Governed By: The Empire
Planet Funds: 980981

Food ( Price per unit: 5.19 )
Fuel ( Price per unit: 5.60 )
Goods ( Price per unit: 2.33 )
Precious metals ( Price per unit: 2.89 )
Spice ( Price per unit: 4.53 )
Weapons ( Price per unit: 6.94 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Gamorr
Starsystem: Gamorr
Governed By: The Empire
Planet Funds: 742452

Chemicals ( Price per unit: 4.37 )
Food ( Price per unit: 4.42 )
Livestock ( Price per unit: 4.30 )
Lumber ( Price per unit: 5.69 )
Textiles ( Price per unit: 7.99 )
Weapons ( Price per unit: 5.52 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Tatooine
Starsystem: Tatoo
Governed By: The Empire
Planet Funds: 671057

Ammunition ( Price per unit: 6.46 )
Common metals ( Price per unit: 6.70 )
Electronics ( Price per unit: 7.00 )
Explosives ( Price per unit: 6.51 )
Food ( Price per unit: 8.08 )
Fuel ( Price per unit: 7.05 )
Goods ( Price per unit: 7.79 )
Livestock ( Price per unit: 11.40)
Lomite ( Price per unit: 4.46 )
Medical supplies ( Price per unit: 8.08 )
Quantum ( Price per unit: 5.24 )
Spice ( Price per unit: 4.82 )
Water ( Price per unit: 8.64 )
Weapons ( Price per unit: 4.24 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Kashyyyk
Starsystem: Kashyyyk
Governed By: The New Republic
Planet Funds: 632470

Ammunition ( Price per unit: 8.17 )
Common metals ( Price per unit: 3.41 )
Livestock ( Price per unit: 10.79)
Lumber ( Price per unit: 4.34 )
Precious metals ( Price per unit: 5.81 )
Weapons ( Price per unit: 6.45 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Wroona
Starsystem: Wroona
Governed By: The Empire
Planet Funds: 1008171

Food ( Price per unit: 3.48 )
Fuel ( Price per unit: 3.76 )
Goods ( Price per unit: 6.57 )
Livestock ( Price per unit: 11.97)
Lumber ( Price per unit: 5.29 )
Medical supplies ( Price per unit: 5.72 )
Textiles ( Price per unit: 5.91 )
Water ( Price per unit: 3.51 )
Weapons ( Price per unit: 5.27 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Roche
Starsystem: Roche Sector
Governed By: The New Republic
Planet Funds: 1063403

Ammunition ( Price per unit: 2.47 )
Chemicals ( Price per unit: 2.03 )
Common metals ( Price per unit: 3.89 )
Durelium ( Price per unit: 5.53 )
Explosives ( Price per unit: 8.44 )
Food ( Price per unit: 6.79 )
Fuel ( Price per unit: 4.11 )
Lomite ( Price per unit: 3.75 )
Precious metals ( Price per unit: 4.20 )
Quantum ( Price per unit: 2.20 )
Uranium ( Price per unit: 5.74 )
Water ( Price per unit: 6.01 )
Weapons ( Price per unit: 8.01 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Nal Hutta
Starsystem: Hutt Space
Governed By: Neutral
Planet Funds: 149666

Common metals ( Price per unit: 6.19 )
Construction parts ( Price per unit: 9.06 )
Explosives ( Price per unit: 9.14 )
Food ( Price per unit: 4.07 )
Goods ( Price per unit: 4.22 )
Spice ( Price per unit: 5.54 )
Weapons ( Price per unit: 4.80 )

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Nim Drovis
Starsystem: Drovian
Governed By: The Empire
Planet Funds: 1234567

(No resources avaliable on this planet)

HP:500/500 MV:1990/1990 GP:451409>
You use the datapad to lookup the information.
--Planet Data: -------------------------------
Planet: Ord Mantell
Starsystem: Bright Jewel
Governed By: The Empire
Planet Funds: 0

(No resources avaliable on this planet)

HP:500/500 MV:1990/1990 GP:451409>besprices
Huh?

HP:500/500 MV:1990/1990 GP:451409>
Speed: 85 Fuel Level: 96% Coords: 2915 -10583 5503

HP:500/500 MV:1990/1990 GP:451409>Best price for Common: price: 9.75 on the planet: Coruscant
Best price for Construction: price: 9.44999980926514 on the planet: Byss
Best price for Durelium: price: 6.26999998092651 on the planet: Byss
Best price for Electronics: price: 7.0 on the planet: Tatooine
Best price for Explosives: price: 9.14000034332275 on the planet: Nal Hutta
Best price for Food: price: 9.38000011444092 on the planet: Corellia
Best price for Fuel: price: 9.69999980926514 on the planet: Coruscant
Best price for Goods: price: 8.90999984741211 on the planet: Yavin
Best price for Lomite: price: 9.34000015258789 on the planet: Byss
Best price for Lumber: price: 9.85999965667725 on the planet: Byss
Best price for Precious: price: 8.56999969482422 on the planet: Corellia
Best price for Quantum: price: 8.22999954223633 on the planet: Byss
Best price for Spice: price: 9.3100004196167 on the planet: Byss
Best price for Textiles: price: 7.98999977111816 on the planet: Gamorr
Best price for Uranium: price: 9.26000022888184 on the planet: Coruscant
Best price for Weapons: price: 8.01000022888184 on the planet: Roche
Best price for Ammunition: price: 8.17000007629395 on the planet: Kashyyyk
Best price for Ardanium: price: 9.14999961853027 on the planet: Corellia
Best price for Chemicals: price: 4.63000011444092 on the planet: Coruscant
Best price for Medical: price: 8.89000034332275 on the planet: Coruscant
Best price for Water: price: 9.17000007629395 on the planet: Coruscant
Best price for Livestock: price: 5.48999977111816 on the planet: Yavin

Notice how it says that Yavin has the best price for livestock, and in reality, Wroona and Kashyyyk both have better prices?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Feb 06, 2003 3:41 pm   
 
Feel free to write your own scripts at any time.

Lowest price for Common: @%ilow
Obviously, %i isn't being expanded in the lowprices alias, since that's where %i is being used.
Solution: Force expansion (curly braces worked)

zMUD interprets decimal numbers (%float) as strings, and 5 is greater than 1, therefore 5.48 is indeed greater than either 10 or 11.
Solutions:
Use the integer portion of the number only
Multiply the number by 100 so it doesn't need a decimal point

#TRIGGER {Planet: (*)} {planetlow = {%1}} "getlowprices"
#TRIGGER {(%w)*~( Price per unit: (%d).(%d) ~)} {#MATH templow ((%2 * 100) + %3);#IF (%ismember( %1, @lowlist)) {#IF (@templow < %db( @%1low, price)) {#VARIABLE %1low "";#ADDKEY %1low {price=@templow|planet=@planetlow}}} {#ADDITEM lowlist "%1";#VARIABLE %1low "";#ADDKEY %1low {price=@templow|planet=@planetlow}}} "getlowprices"
#ALIAS lowprices {#FORALL @lowlist {showlow %{i}}}
#ALIAS showlow {#SHOW lowest price for %1: %expanddb( @{%1low}, " on the ", ": ")}
#TRIGGER {--Planet Data-} {#T+ getlowprices}

I assume you'll be able to figure out the changes for the "high" portion yourself. I'm working on the statement to clear the "low" variables.

LightBulb
Advanced Member
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Thu Feb 06, 2003 3:45 pm   
 
Thanks, I have writen my own scripts, just never anything this complicated before. I'd be willing to share what I have created over the past couple of years, but I am not sure if your into Star Wars Reality MUDs. And I am rally thankful that everyone has been so helpful on this matter.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Feb 06, 2003 4:01 pm   
 
Alias: sales
#FORALL @profitlist {#VAR %i %null}
#FORALL @lowlist {#VAR temp1 %{i}low;#VAR @temp1 %null}
Showplanet Byss resources
Showplanet Coruscant resources
Showplanet Yavin resources
Showplanet Corellia resources
Showplanet Ryloth resources
Showplanet Gamorr resources
Showplanet Tatooine resources
Showplanet Kashyyyk resources
Showplanet Wroona resources
Showplanet Roche resources
Showplanet 'Nal hutta' resources
showplanet 'Nim Drovis' resources
Showplanet 'Ord Mantell' resources

LightBulb
Advanced Member
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Thu Feb 06, 2003 4:06 pm   
 
So, if I am not mistake, this would be the flipside of the new code?

just the changes made...

#MATH temp = ((%2 * 100) + %3
#IF (%ismember( %1, @profitlist)) {#IF (@temp > %db( @%1, price)) {
#VARIABLE %1 ""
#ADDKEY %1 {price=@temp|planet=@planet}
}} {
#ADDITEM profitlist "%1"
#VARIABLE %1 ""
#ADDKEY %1 {price=@temp|planet=@planet}
}
Reply with quote
Sylvanoes
Beginner


Joined: 30 Jan 2003
Posts: 22
Location: USA

PostPosted: Thu Feb 06, 2003 4:12 pm   
 
I know I botched the second part of that revision, I fixed it with the help of zMUD, I needed to remove a = and add a )

but it still doesn't explain what happend when I ran it, is it possible that I don't need those additions in the SALES alias? Here is what happend.

Best price for Common:
Best price for Construction:
Best price for Durelium:
Best price for Electronics:
Best price for Explosives:
Best price for Food:
Best price for Fuel:
Best price for Goods:
Best price for Lomite:
Best price for Lumber:
Best price for Precious:
Best price for Quantum:
Best price for Spice:
Best price for Textiles:
Best price for Uranium:
Best price for Weapons:
Best price for Ammunition:
Best price for Ardanium:
Best price for Chemicals:
Best price for Medical:
Best price for Water:
Best price for Livestock:
lowest price for Common:
lowest price for Construction:
lowest price for Durelium:
lowest price for Electronics:
lowest price for Explosives:
lowest price for Food:
lowest price for Fuel:
lowest price for Goods:
lowest price for Lomite:
lowest price for Precious:
lowest price for Quantum:
lowest price for Spice:
lowest price for Textiles:
lowest price for Uranium:
lowest price for Weapons:
lowest price for Ammunition:
lowest price for Ardanium:
lowest price for Chemicals:
lowest price for Medical:
lowest price for Water:
lowest price for Livestock:
lowest price for Lumber:
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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