Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Trade Class to help with Tracking Net Change

KeldoranKeldoran Member Posts: 7
edited February 2013 in Scripting
I thought I'd share my system for Zmud to help with tracking trade sales and changes in commodities.  I haven't been able to spend the amount of time I wanted on this and it's vastly unfinished, however I wanted to share it.

#CLASS {trade}
#ALIAS checkcomms {#t+ trade|Capture;city mat summary;city comms;funds trade;previousmaterialvalues = @totalmaterialsvalue;totalmaterialsvalue = %null;previouscommoditiesvalue = @totalcommoditiesvalue;totalcommoditiesvalue = %null}
#ALIAS tradesummary {#math tradefundsdifference @[email protected];#echo %ansi( yellow)Current Funds: @tradefunds Net Change: @tradefundsdifference @grosstradevalue Gross Value. Change in Gross Value: @grosstradechange;#echo %ansi( yellow)@totalcommoditiesvalue Total Commodities Value, @totalcommoditieschange Change in Value of Commodities;#echo %ansi( yellow)@totalmaterialsvalue Total Material Value, @totalmaterialschange Change in Value of Materials;#echo Steel: @steel Stock, @steeltotal Total Stock. Buying @steelbuyprice, Selling @steelsellprice. @steeltotalchange Net Change;#echo Wood: @wood Stock, @woodtotal Total Stock. Buying @woodbuyprice, Selling @woodsellprice. @woodtotalchange Net Change;#echo Iron: @Iron Stock, @Irontotal Total Stock. Buying @Ironbuyprice, Selling @Ironsellprice. @Irontotalchange Net Change;#echo Leather: @Leather Stock, @Leathertotal Total Stock. Buying @Leatherbuyprice, Selling @Leathersellprice. @Leathertotalchange Net Change;#echo Coal: @Coal Stock, @Coaltotal Total Stock. Buying @Coalbuyprice, Selling @Coalsellprice. @Coaltotalchange Net Change;#echo Obsidian: @Obsidian Stock, @Obsidiantotal Total Stock. Buying @Obsidianbuyprice, Selling @Obsidiansellprice. @Obsidiantotalchange Net Change;#echo Cloth: @Cloth Stock, @Clothtotal Total Stock. Buying @Clothbuyprice, Selling @Clothsellprice. @Clothtotalchange Net Change;#echo Gold: @Gold Stock, @Goldtotal Total Stock. Buying @Goldbuyprice, Selling @Goldsellprice. @Goldtotalchange Net Change;#echo Rope: @Rope Stock, @Ropetotal Total Stock. Buying @Ropebuyprice, Selling @Ropesellprice. @Ropetotalchange Net Change;#echo Ice: @Ice Stock, @Icetotal Total Stock. Buying @Icebuyprice, Selling @Icesellprice. @Icetotalchange Net Change;#echo Silver: @Silver Stock, @Silvertotal Total Stock. Buying @Silverbuyprice, Selling @Silversellprice. @Silvertotalchange Net Change;#echo Platinum: @Platinum Stock, @Platinumtotal Total Stock. Buying @Platinumbuyprice, Selling @Platinumsellprice. @Platinumtotalchange Net Change;#echo Ruby: @Ruby Stock, @Rubytotal Total Stock. Buying @Rubybuyprice, Selling @Rubysellprice. @Rubytotalchange Net Change;#echo Diamond: @Diamond Stock, @Diamondtotal Total Stock. Buying @Diamondbuyprice, Selling @Diamondsellprice. @Diamondtotalchange Net Change;#echo Emerald: @Emerald Stock, @Emeraldtotal Total Stock. Buying @Emeraldbuyprice, Selling @Emeraldsellprice. @Emeraldtotalchange Net Change;#echo Sapphire: @Sapphire Stock, @Sapphiretotal Total Stock. Buying @Sapphirebuyprice, Selling @Sapphiresellprice. @Sapphiretotalchange Net Change;#echo Stone: @Stone Stock, @Stonetotal Total Stock. Buying @Stonebuyprice, Selling @Stonesellprice. @Stonetotalchange Net Change;#echo Fruit: @Fruit Stock, @Fruittotal Total Stock. Buying @Fruitbuyprice, Selling @Fruitsellprice. @Fruittotalchange Net Change;#echo Vegetable: @Vegetable Stock, @Vegetabletotal Total Stock. Buying @Vegetablebuyprice, Selling @Vegetablesellprice. @Vegetabletotalchange Net Change;#echo Grain: @Grain Stock, @Graintotal Total Stock. Buying @Grainbuyprice, Selling @Grainsellprice. @Graintotalchange Net Change;#echo Meat: @Meat Stock, @Meattotal Total Stock. Buying @Meatbuyprice, Selling @Meatsellprice. @Meattotalchange Net Change;#echo Dairy: @Dairy Stock, @Dairytotal Total Stock. Buying @Dairybuyprice, Selling @Dairysellprice. @Dairytotalchange Net Change;#echo Gemstone: @Gemstone Stock, @Gemstonetotal Total Stock. Buying @Gemstonebuyprice, Selling @Gemstonesellprice. @Gemstonetotalchange Net Change;#echo Sinn: @Sinn Stock, @Sinntotal Total Stock. Buying @Sinnbuyprice, Selling @Sinnsellprice. @Sinntotalchange Net Change;#echo Cuhpfehr: @Cuhpfehr Stock, @Cuhpfehrtotal Total Stock. Buying @Cuhpfehrbuyprice, Selling @Cuhpfehrsellprice. @Cuhpfehrtotalchange Net Change;#echo Rahnse: @Rahnse Stock, @Rahnsetotal Total Stock. Buying @Rahnsebuyprice, Selling @Rahnsesellprice. @Rahnsetotalchange Net Change;#echo Isan: @Isan Stock, @Isantotal Total Stock. Buying @Isanbuyprice, Selling @Isansellprice. @Isantotalchange Net Change;#echo Stehl: @Stehl Stock, @Stehltotal Total Stock. Buying @Stehlbuyprice, Selling @Stehlsellprice. @Stehltotalchange Net Change;#echo Orichalcum: @Orichalcum Stock, @Orichalcumtotal Total Stock. Buying @Orichalcumbuyprice, Selling @Orichalcumsellprice. @Orichalcumtotalchange Net Change;#echo Veritum: @Veritum Stock, @Veritumtotal Total Stock. Buying @Veritumbuyprice, Selling @Veritumsellprice. @Veritumtotalchange Net Change;#echo Bone: @Bone Stock, @Bonetotal Total Stock. Buying @Bonebuyprice, Selling @Bonesellprice. @Bonetotalchange Net Change;#echo Glass: @Glass Stock, @Glasstotal Total Stock. Buying @Glassbuyprice, Selling @Glasssellprice. @Glasstotalchange Net Change;#echo Blackpowder: @Blackpowder Stock, @Blackpowdertotal Total Stock. Buying @Blackpowderbuyprice, Selling @Blackpowdersellprice. @Blackpowdertotalchange Net Change;#echo Crystehl: @Crystehl Stock, @Crystehltotal Total Stock. Buying @Crystehlbuyprice, Selling @Crystehlsellprice. @Crystehltotalchange Net Change;#echo Materials:;#echo Crop: @Crop, Change @Cropstockchange, Price @Cropprice. Value of Materials @Cropvalue;#echo Livestock: @Livestock, Change @Livestockstockchange, Price @Livestockprice. Value of Materials @Livestockvalue;#echo Ore: @Ore, Change @Orestockchange, Price @Oreprice. Value of Materials @Orevalue;#echo Rock: @Rock, Change @Rockstockchange, Price @Rockprice. Value of Materials @Rockvalue;#echo Water: @Water, Change @Waterstockchange, Price @Waterprice. Value of Materials @Watervalue;#echo Fish: @Fish, Change @Fishstockchange, Price @Fishprice. Value of Materials @Fishvalue;#echo Lumber: @Lumber, Change @Lumberstockchange, Price @Lumberprice. Value of Materials @Lumbervalue}
#CLASS 0

#CLASS {trade|Capture}
#TRIGGER {(%w)%s(%d)%s(%d)} {%1previousstock = %2;#math %1stockchange %2-@%1previousstock;%1 = %2;%1price = %3;#math totalmaterialsvalue @%1*@%1value+@totalmaterialsvalues}
#TRIGGER {(%w)~:%s(%d)%s~+%s(%d)%s~=%s(%d)%s(%d)%s(%d)%s(%d)} {%1previousstock = @%1;%1previousreserves = @%1reserve;%1previoustotal = @%1total;#math %1stockchange @%1-@%1previousstock;#math %1reservechange @%1reserve-@%1previousreserves;#math %1totalchange @%1total-@%1previoustotal;%1 = %2;%1reserve = %3;%1total = %4;%1buyprice = %6;%1sellprice = %7;#math totalcommoditiesvalue @%1total*@%1sellprice+@totalcommoditiesvalue}
#TRIGGER {The trade budget currently has (%d) gold.} {previousfunds = @tradefunds;tradefunds = %1;previousgrosstradevalue = @grosstradevalue;#math totalcommoditieschange @[email protected];#math totalmaterialschange @[email protected];#math grosstradevalue @[email protected][email protected];#math grosstradechange @[email protected];#t- trade|Capture;#math cropvalue @[email protected][email protected]/[email protected]/[email protected];#math orevalue @[email protected][email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/60;#math rockvalue @[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/8;#math livestockvalue @[email protected][email protected][email protected]/5;#math lumbervalue @woodsellprice;#math fishvalue @[email protected]/3;watervalue = @icesellprice;#math Steeltotalchange @[email protected];#math Woodtotalchange @[email protected];#math Irontotalchange @[email protected];#math Leathertotalchange @[email protected];#math Coaltotalchange @[email protected];#math Obsidiantotalchange @[email protected];#math Clothtotalchange @[email protected];#math Goldtotalchange @[email protected];#math Ropetotalchange @[email protected];#math Icetotalchange @[email protected];#math Silvertotalchange @[email protected];#math Platinumtotalchange @[email protected];#math Rubytotalchange @[email protected];#math Diamondtotalchange @[email protected];#math Emeraldtotalchange @[email protected];#math Sapphiretotalchange @[email protected];#math Stonetotalchange @[email protected];#math Fruittotalchange @[email protected];#math Vegetabletotalchange @[email protected];#math Graintotalchange @[email protected];#math Meattotalchange @[email protected];#math Dairytotalchange @[email protected];#math Gemstonetotalchange @[email protected];#math Sinntotalchange @[email protected];#math Cuhpfehrtotalchange @[email protected];#math Rahnsetotalchange @[email protected];#math Isantotalchange @[email protected];#math Stehltotalchange @[email protected];#math Orichalcumtotalchange @[email protected];#math Veritumtotalchange @[email protected];#math Bonetotalchange @[email protected];#math Glasstotalchange @[email protected];#math Blackpowdertotalchange @[email protected];#math Crystehltotalchange @[email protected];tradesummary}
#CLASS 0
Aulani
Sign In or Register to comment.