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
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Wed Nov 19, 2003 6:42 pm   

Medievia Tradepost valuer for zmud
 
This is a trade valuer for medievia
To use it simply go to the tradepost you want to value
and type 'ztval' after the script finishes valuing you then
can display the data to SHOW or to CHAT
Note: you'll need my CaebColor Script(included here to chat colors
correctly to MM users)
ztshow displays to show and ztchat displays to chat, they have the
exact same functionality so i only describe ztshow here
ztshow - Lists every value
ztshow <number> - Lists every value greater then <number>
ztshow <post> - Lists every value from <post>
Note on ztshow <post> if your familar with zoneinfo on medievia
it works similar to that. for example if you wanted to list
values from g'dangus 'ztshow gda' (No puncuation or spaces)
ztshow ngu would work as well

I had to put a quick fix on the script for the new beta so if your not using it and are having any problems try replacing the trigger in the valuing class with this one
Code:
#TRIGGER {A covered wagon horse can carry %d %w of (%w). We'll pay you (%n) gold for that.} {#CLASS {ZTrader|Data|GoodsValue};%1 = %2;%1 = %replace(@%1,~,,"");#CLASS 0;ztvdovaluing}


Also the data for CPMs is from Carabas' script not sure if they changed since he wrote it, so until i make sure they may be off.

Code:
#CLASS {ZTrader}
#CLASS 0

#CLASS {ZTrader|Commands|User}
    #ALIAS ztval  {#IF (%1) {#SHOW ZTRADER SELECTIVE VALUING NOT YET IMPLEMENTED} {ztvalall}}
    #ALIAS ztshow {#IF (%1) {#IF (%isnumber(%1)) {ztdShowVal %1} {ztdShowPost %1}} {ztdShowAll}}
    #ALIAS ztchat {#IF (%1) {#IF (%isnumber(%1)) {ztdChatVal %1} {ztdChatPost %1}} {ztdChatAll}}
#CLASS 0

#CLASS {ZTrader|Commands|Display}

    #ALIAS ztdShowAll  {ztdCreateAll;#SHOW @ztdChatLine}
    #ALIAS ztdShowVal  {ztdCheckVal %1}
    #ALIAS ztdShowPost {ztdFindPost %1}
    #ALIAS ztdChatAll  {ztdCreateAll;#EMOTEALL @ztdChatLine}
    #ALIAS ztdChatVal  {ztdChatCheckVal %1}
    #ALIAS ztdChatPost {ztdChatFindPost %1}

    #ALIAS ztdCreateAll  {ztvposts      = @ztposts
                          ztdTitle      = @ztdAllTitle
                          ztdChatLine   = %concat(%char(10),@ztdTitle)
                          ztdChatLine   = %concat(@ztdChatLine,%char(10),@CaebColor(bold,blue),%repeat("-",%len(%stripansi(@ztdTitle))))
                          ztdChatLine   = %concat(@ztdChatLine,%char(10))
                          #FORALL @ztvposts {#FORALL @%i {ztdCreateLine %i %j}}}
   
    #ALIAS ztdCreatePost {ztdTitle      = @ztdPostTitle
                          ztdChatLine   = %concat(%char(10),@ztdTitle)
                          ztdChatLine   = %concat(@ztdChatLine,%char(10),@CaebColor(bold,blue),%repeat("-",%len(%stripansi(@ztdTitle))))
                          ztdChatLine   = %concat(@ztdChatLine,%char(10))
                          #FORALL @ztvposts {#FORALL @%i {ztdCreateLine %i %j}}}
   
    #ALIAS ztdCreateVal  {ztvposts     = @ztposts
                          ztdValDisplay = %format("&0.0n",%1)
                          ztdTitle      = @ztdValTitle
                          ztdChatLine   = %concat(%char(10),@ztdTitle)
                          ztdChatLine   = %concat(@ztdChatLine,%char(10),@CaebColor(bold,blue),%repeat("-",%len(%stripansi(@ztdTitle))))
                          ztdChatLine   = %concat(@ztdChatLine,%char(10))
                          #FORALL @ztvposts {#FORALL @%i {#IF (@%j>%1) {ztdCreateLine %i %j}}}}
                         
                         
    #VARIABLE ztdLine       {""} {""}
    #VARIABLE ztdChatLine   {""} {""}
    #VARIABLE ztdValDisplay {""} {""}
   
    #ALIAS ztdFindPost {ztvposts = %null;#FORALL @ztposts {#IF (%pos(%lower(%1),%i)) {ztvposts = %i}};#IF (@ztvposts) {ztdCreatePost;#SHOW @ztdChatLine} {ztdErrorPostFind %1}}
    #ALIAS ztdChatFindPost {ztvposts = %null;#FORALL @ztposts {#IF (%pos(%lower(%1),%i)) {ztvposts = %i}};#IF (@ztvposts) {ztdCreatePost;#EMOTEALL @ztdChatLine} {ztdErrorPostFind %1}}
    #ALIAS ztdCheckVal {#IF (%1 < 100000) {ztdErrorSmallVal} {ztdCreateVal %1;#SHOW @ztdChatLine}}
    #ALIAS ztdChatCheckVal {#IF (%1 < 100000) {ztdErrorSmallVal} {ztdCreateVal %1;#EMOTEALL @ztdChatLine}}
   
   
    #ALIAS ztdCreateLine {ztdLine = %concat(@CaebColor(bold,black),~()
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,cyan),@ztdCreateTp(%1))
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,magenta),@ztdCreateGood(%2))
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,white),@ztdCreateValue(%2))
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,red),@ztdCreateCpm(%2,%1))
                          ztdLine = %concat(@ztdLine,@CaebColor(green)cpms@CaebColor(bold,black)))
                          ztdChatLine = %concat(@ztdChatLine,@ztdLine,%char(10))}
   
    #FUNCTION ztdCreateGood  {@ztdCreateSpaces(%1,12,1)}
    #FUNCTION ztdCreateValue {@ztdCreateSpaces(%literal(%format("&0.0n",@%1)),11)}
    #FUNCTION ztdCreateCpm   {@ztdCreateSpaces(%eval(@%1/%item(@ztvcpmpost,%ismember(%2,@ztposts))),%eval(%len(%stripansi(@ztdTitle)) - 44))}
    #FUNCTION ztdCreateTp    {@ztdCreateSpaces(%item(@ztfancypost, %ismember(%1,@ztposts)),15,1)}
   
    #FUNCTION ztdCreateSpaces {%if(%3,%1%repeat(" ",%2-%len(%1)),%repeat(" ",%2-%len(%1))%1)}
   
    #VARIABLE ztdTitle     {""} {""}
    #FUNCTION ztdAllTitle  {@CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.0@CaebColor(bold,blue))@CaebColor(bold,cyan):@CaebColor(bold,green) Showing all valued items to @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvvalpost,@ztposts))}
    #FUNCTION ztdPostTitle {@CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.0@CaebColor(bold,blue))@CaebColor(bold,cyan):@CaebColor(bold,green) All values from @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvposts,@ztposts)) @CaebColor(bold,green)to @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvvalpost,@ztposts))}
    #FUNCTION ztdValTitle  {@CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.0@CaebColor(bold,blue))@CaebColor(bold,cyan):@CaebColor(bold,green) All values over @CaebColor(bold,white)@ztdValDisplay @CaebColor(bold,green)to @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvvalpost,@ztposts))}

    #ALIAS ztdErrorPostFind {#SHOW @CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.0@CaebColor(bold,blue))@CaebColor(bold,cyan): @CaebColor(bold,red)Error @CaebColor(bold,green)could not find any posts containing substring @CaebColor(bold,white)%1@CaebColor(bold,green).}
    #ALIAS ztdErrorSmallVal {#SHOW @CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.0@CaebColor(bold,blue))@CaebColor(bold,cyan): @CaebColor(bold,red)Error @CaebColor(bold,green)searching for values less then 100,000 is not supported.}
#CLASS 0

#CLASS {ZTrader|Commands|Valuing}
    #ALIAS ztvalall {ztvreset;ztvposts = @ztposts;ztvcurpost = 1;ztvcuritem = 0;ztvfindpost}
    #ALIAS ztvreset     {#FORALL @ztposts {#FORALL @%i {#CLASS {ZTrader|Data|GoodsValue};@%j = "DID NOT VALUE";#CLASS 0}}}
    #ALIAS ztvfindpost  {#T+ {ZTrader|Triggers|Valuing|Tradeposts};look}
    #ALIAS ztvpostfound {#T- {ZTrader|Triggers|Valuing|Tradeposts};ztvgettime}
    #ALIAS ztvgettime   {#T+ {ZTrader|Triggers|Valuing|Time};time}
    #ALIAS ztvtimefound {#T- {ZTrader|Triggers|Valuing|Time};#T+ {ZTrader|Triggers|Valuing|Value};ztvdovaluing}
    #ALIAS ztvdovaluing {ztvcuritem = %eval(@ztvcuritem + 1);#IF (@ztvcuritem > %numitems(%eval(@%item(@ztvposts,@ztvcurpost)))) {ztvnextpost} {value %item(%eval(@%item(@ztvposts, @ztvcurpost)),@ztvcuritem) covered}}
    #ALIAS ztvnextpost  {ztvcuritem = 0;ztvcurpost = %eval(@ztvcurpost + 1);#IF (@ztvcurpost > %numitems(@ztvposts)) {ztvvaldone} {ztvdovaluing}}
    #ALIAS ztvvaldone   {#SHOW Done Valuing;#T- {ZTrader|Triggers|Valuing|Value}}
    #VARIABLE ztvposts   {""}
    #VARIABLE ztvcurpost {""}
    #VARIABLE ztvcuritem {""}
    #VARIABLE ztvvalpost {""}
    #VARIABLE ztvtime    {""}
    #VARIABLE ztvcpmpost {""}
#CLASS 0

#CLASS {ZTrader|Triggers|Valuing|Value} {disable}
#TRIGGER {A covered wagon horse can carry %d %w of (%w). We'll pay you (%n) gold for that.} {#CLASS {ZTrader|Data|GoodsValue};%1 = %2;%1 = %replace(@%1,~,,"");#CLASS 0;ztvdovaluing}
#CLASS 0

#CLASS {ZTrader|Triggers|Valuing|Time} {disable}
    #TRIGGER {The current system time is %w %w %d (*) %d} {ztvtime = %1;ztvtimefound}
#CLASS 0

#CLASS {Ztrader|Triggers|Valuing|Tradeposts} {disable}
    #TRIGGER {Hidden City}                          {ztvcpmpost = @mvsena;ztvvalpost = "enatdae";ztvpostfound}
    #TRIGGER {A Minotaur Trading Outpost}           {ztvcpmpost = @mvsnae;ztvvalpost = "naeramae";ztvpostfound}
    #TRIGGER {A Quiet, Temple Shop}                 {ztvcpmpost = @mvselw;ztvvalpost = "elwyn";ztvpostfound}
    #TRIGGER {A Ranger's Cabin}                     {ztvcpmpost = @mvsran;ztvvalpost = "rangerscabin";ztvpostfound}
    #TRIGGER {An Elven Marketplace}                 {ztvcpmpost = @mvsath;ztvvalpost = "athelasea";ztvpostfound}
    #TRIGGER {DeRah Villadom's Small Trading Post}  {ztvcpmpost = @mvsder;ztvvalpost = "derahvilladom";ztvpostfound}
    #TRIGGER {Hidden Valley Traders, Inc.}          {ztvcpmpost = @mvsrue;ztvvalpost = "ruellia";ztvpostfound}
    #TRIGGER {Medievia Trading Shop}                {ztvcpmpost = @mvsmed;ztvvalpost = "medievia";ztvpostfound}
    #TRIGGER {New Ashton Trading Post}              {ztvcpmpost = @mvsash;ztvvalpost = "newashton";ztvpostfound}
    #TRIGGER {Riverton Trading Partners}            {ztvcpmpost = @mvsriv;ztvvalpost = "riverton";ztvpostfound}
    #TRIGGER {Sea's End Direct Merchants}           {ztvcpmpost = @mvssea;ztvvalpost = "seasend";ztvpostfound}
    #TRIGGER {Tanivsport Traders}                   {ztvcpmpost = @mvsmys;ztvvalpost = "mystara";ztvpostfound}
    #TRIGGER {The Lizard Boulangere}                {ztvcpmpost = @mvslyr;ztvvalpost = "lyryanoth";ztvpostfound}
    #TRIGGER {The Trading Post of G'dangus}         {ztvcpmpost = @mvsgda;ztvvalpost = "gdangus";ztvpostfound}
    #TRIGGER {Trading Post of the City of Karlisna} {ztvcpmpost = @mvsgda;ztvvalpost = "karlisna";ztvpostfound}
    #TRIGGER {Trading Post of the Dark Army}        {ztvcpmpost = @mvsgen;ztvvalpost = "newgenesia";ztvpostfound}
    #TRIGGER {Trading Shop of Trellor City}         {ztvcpmpost = @mvstre;ztvvalpost = "trellor";ztvpostfound}
    #TRIGGER {Ur-vile Feeding Hall}                 {ztvcpmpost = @mvsurv;ztvvalpost = "urvile";ztvpostfound}
    #TRIGGER {Vanlarra Imports and Exports}         {ztvcpmpost = @mvsvan;ztvvalpost = "vanlarra";ztvpostfound}
#CLASS 0

#CLASS {ZTrader|Data|UserOptions}
    #VARIABLE ztvalgag {0}
#CLASS 0

#CLASS {ZTrader|Data|TradePosts} {enable}
    #VARIABLE ztposts     {medievia|trellor|enatdae|naeramae|elwyn|rangerscabin|athelasea|derahvilladom|ruellia|newashton|riverton|seasend|mystara|lyryanoth|gdangus|karlisna|newgenesia|vanlarra|urvile}
    #VARIABLE ztfancypost {Medievia|Trellor|E'nat'dae|NaeraMae|Elwyn|Ranger's Cabin|Athelasea|DeRah Villadom|Ruellia|NewAshton|Riverton|Sea's End|Mystara|Lyryanoth|Gdangus|Karlisna|NewGenesia|Vanlarra|Ur-Vile}
#CLASS 0

#CLASS {ZTrader|Data|TpGoods} {enable}
    #VARIABLE urvile        {""}
    #VARIABLE derahvilladom {artifacts|candles|herbs|nuts|hemp}
    #VARIABLE gdangus       {bananas|seed|beans|rice|tobacco}
    #VARIABLE enatdae       {quilts|silk|fans|silkworms|illutian}
    #VARIABLE karlisna      {books|cloth|spices|beer|dates}
    #VARIABLE lyryanoth     {venom|eggs|hides|glowworms|mushrooms}
    #VARIABLE mystara       {pearls|teak|carpet|maps|fish}
    #VARIABLE newashton     {silver|jewels|silicate|nails|copper}
    #VARIABLE newgenesia    {tools|adamantite|coal|opium|iron}
    #VARIABLE riverton      {brandy|metals|honey|grapes|fertilizer}
    #VARIABLE ruellia       {emeralds|willowbark|cloaks|rope|waybread}
    #VARIABLE seasend       {opals|ambergris|shells|nets|kelp}
    #VARIABLE vanlarra      {silk|crystal|rum|figs|molasses}
    #VARIABLE athelasea     {flowers|arrows|bows|art|parchment}
    #VARIABLE naeramae      {armor|chains|mead|pelts|weapons}
    #VARIABLE elwyn         {aloe|quills|balm}
    #VARIABLE rangerscabin  {sap|furs|timber|rations|ivory}
    #VARIABLE medievia      {ale|tar|salt|sugar|raisins}
    #VARIABLE trellor       {perfume|wine|oils|incense|ink}
#CLASS 0                     
                             
#CLASS {ZTrader|Data|TpMoves}

#VARIABLE {mvsmed} {1|1269|308|NA|594|302|221|1072|998|781|572|1616|575|1179|1330|1246|657|786|NA}
#VARIABLE {mvsder} {1072|2264|862|NA|1295|1348|1225|1|1912|1785|1624|2662|1627|1880|2376|2292|1571|1838|NA}
#VARIABLE {mvselw} {594|1786|418|NA|1|870|747|1295|1434|1307|1146|2184|1149|655|1898|1814|1093|1336|NA}
#VARIABLE {mvsgda} {1330|1562|1612|NA|1898|1061|1262|2376|2308|1666|1197|672|1380|2483|1|863|1967|1423|NA}
#VARIABLE {mvslyr} {1179|2371|1003|NA|655|1455|1332|1880|2019|1892|1731|2768|1734|1|2183|2399|1678|1921|NA}
#VARIABLE {mvsnae} {NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA}                       
#VARIABLE {mvsmys} {575|1824|863|NA|1149|743|776|1627|1553|1336|307|1666|1|1734|1380|1256|1212|281|NA}
#VARIABLE {mvsash} {781|494|1021|NA|1307|1063|668|1785|1537|1|1333|1952|1336|1892|1666|752|1196|1547|NA}
#VARIABLE {mvsran} {302|1551|584|NA|870|1|503|1348|1280|1063|740|1347|743|1455|1061|976|939|958|NA}
#VARIABLE {mvsriv} {572|1821|860|NA|1146|740|773|1624|1550|1333|1|1483|307|1731|1197|1112|1209|518|NA}
#VARIABLE {mvsrue} {998|2169|1148|NA|1434|1280|1111|1912|1|1537|1550|2594|1553|2019|2308|2136|399|1764|NA}
#VARIABLE {mvsend} {1616|1774|1898|NA|2184|1347|1548|2662|2594|1952|1483|1|1666|2768|672|1149|2253|1709|NA}
#VARIABLE {mvsvan} {786|2035|1059|NA|1336|958|987|1838|1764|1547|518|1709|281|1921|1423|1338|1423|1|NA}
#VARIABLE {mvskar} {1246|1349|1528|NA|1814|976|1176|2292|2136|752|1112|1149|1256|2399|863|1|1795|1338|NA}
#VARIABLE {mvstre} {1269|1|1500|NA|1786|1551|1160|2264|2169|494|1821|1774|1824|2371|1562|1349|1500|2035|NA}
#VARIABLE {mvsath} {221|1160|461|NA|747|503|1|1225|1111|668|773|1548|776|1332|1262|1176|770|987|NA}
#VARIABLE {mvsena} {308|1500|1|NA|418|584|461|862|1148|1021|860|1898|863|1003|1612|1528|807|1059|NA}
#VARIABLE {mvsgen} {657|1500|807|NA|1093|939|770|1571|399|1196|1209|2253|1212|1678|1967|1795|1|1423|NA}
#VARIABLE {mvsurv} {NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA}
   
#CLASS 0

#CLASS {ZTrader|Data|GoodsValue}
#CLASS 0

;; ToDo
;; 1. Selective valuing - ztval med, gda ..just to value medievia gdangus and not everything.
;; 2. Fix Inflated Cpms for trading to the same post your at.
;; 3. Display by Cpms
;; 4. ADD Resume valuing, for asteroid valuing
;; 5. Check moves data
;; 6. ADD time passed since valuing
;; 7. ADD option to GAG valuing




And CaebColor
Code:
#CLASS {CaebColor}
   
   #FUNCTION CaebColor {%if((%2) || (%1 != "reset"),@CCBolds(%2), @CCResets(%1)}
   #FUNCTION CCBolds   {%item(@CCBoldEsc,%ismember(%1,@CCBoldList))}
   #FUNCTION CCResets  {%item(@CCResetEsc,%ismember(%1, @CCResetList))}
   
   #VARIABLE CCBoldList  {black|blue|green|cyan|red|magenta|yellow|white}
   #VARIABLE CCResetList {bold|reset|black|blue|green|cyan|red|magenta|yellow|white}
   
   #VARIABLE CCBoldEsc  {%e[1;30m|%e[1;34m|%e[1;32m|%e[1;36m|%e[1;31m|%e[1;35m|%e[1;33m|%e[1;37m}
   #VARIABLE CCResetEsc {%e[0m|%e[1m|%e[0;30m|%e[0;34m|%e[0;32m|%e[0;36m|%e[0;31m|%e[0;35m|%e[0;33m|%e[0;37m}
   
   #ALIAS cctest {#FORALL @CCBoldList {#SHOW @CaebColor(bold,%i) %i};#FORALL @CCResetList {#SHOW @CaebColor(%i)%i}}

#CLASS 0



Any problems let me know
Cheers, Caebryn of Medievia(35) KotBC
Reply with quote
Tlaca
Beginner


Joined: 11 May 2003
Posts: 23
Location: Canada

PostPosted: Sun Nov 23, 2003 4:43 pm   
 
Holy mack dude, that's an awesome script.[8D]

I've been searching for ages for a good set of scripts, and this is frist Very Happy great one I've found. Carabas's are old and I think the changes in game have rendered his obsolete.[:p]

I do want to be able to separate each post in the full list, and I want to be able to report vals over clan/town. But those should both be pretty easy to do on my own.Smile

Thanks so much man, and if you have more scripts, please, post 'em. I'm really interested in a bs reporter.
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Mon Nov 24, 2003 12:53 am   
 
Thanks :)

I do have a few more scripts I can post, as for the backstab reporter I made one based on the maverick script for MM, it has 2 little bugs in it that i have to work out once its done ill post it.

Cheers, Caebryn
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Mon Nov 24, 2003 1:11 am   
 
Friend found a bug, script won't value at elwyn
need to change its trigger

It should be this
Code:

#TRIGGER {A Quiet Temple Shop} {ztvcpmpost = @mvselw;ztvvalpost = "elwyn";ztvpostfound}


Caebryn
Reply with quote
Tlaca
Beginner


Joined: 11 May 2003
Posts: 23
Location: Canada

PostPosted: Mon Nov 24, 2003 1:40 am   
 
Awesome, looks like it is working

Tlaca
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Wed Nov 26, 2003 11:36 am   
 
Good job [^]

Credit for "CPM" goes to Ichelo. It was his idea and hard
work that made it happen.
Reply with quote
Tlaca
Beginner


Joined: 11 May 2003
Posts: 23
Location: Canada

PostPosted: Wed Nov 26, 2003 8:50 pm   
 
2 things

I valued at Mystara the other day, and had a val from van at 16,000 cpm [:p]

The script has Vanalarra selling silk, which it used to. This should be wands instead.

Also, valueing at sea's end doesn't give cpm. It could just be that my comp is having a bad day on this one, but, thought I should mention it.
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Thu Nov 27, 2003 2:47 am   
 
Ok I think you already solved the inflated value from vanlarra problem, it was probably silk , some reason it still lets you value silk even though its not sold. So if you just replace silk with wands in vanlarra's list of goods it should take care of that. The reason your not getting CPMs at Sea's End is a misnamed variable

Code:

#VARIABLE {mvsend} {1616|1774|1898|NA|2184|1347|1548|2662|2594|1952|1483|1|1666|2768|672|1149|2253|1709|NA}


the name of that variable should be mvssea

Thanks for help, Caebryn
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Thu Nov 27, 2003 3:15 am   
 
CaebColor had a big bug in it too[}:)]
But it didnt effect either script heres
fixed version
Code:

#CLASS {CaebColor}
   
   #FUNCTION CaebColor {%if(("%2" != "") & ("%1" != "reset"),@CCBolds(%2),%if(("%2" != ""),@CCResets(%2),@CCResets(%1)))}
   #FUNCTION CCBolds   {%item(@CCBoldEsc,%ismember(%1,@CCBoldList))}
   #FUNCTION CCResets  {%item(@CCResetEsc,%ismember(%1, @CCResetList))}
   
   #VARIABLE CCBoldList  {black|blue|green|cyan|red|magenta|yellow|white}
   #VARIABLE CCResetList {bold|reset|black|blue|green|cyan|red|magenta|yellow|white}
   
   #VARIABLE CCBoldEsc  {%e[1;30m|%e[1;34m|%e[1;32m|%e[1;36m|%e[1;31m|%e[1;35m|%e[1;33m|%e[1;37m}
   #VARIABLE CCResetEsc {%e[0m|%e[1m|%e[0;30m|%e[0;34m|%e[0;32m|%e[0;36m|%e[0;31m|%e[0;35m|%e[0;33m|%e[0;37m}
   
   #ALIAS cctest {#FORALL @CCBoldList {#SHOW @CaebColor(bold,%i) %i};#FORALL @CCResetList {#SHOW @CaebColor(%i)%i}}

#CLASS 0



Reply with quote
stick
Newbie


Joined: 11 Nov 2003
Posts: 7
Location: USA

PostPosted: Thu Nov 27, 2003 7:41 pm   
 
The reason you're still able to value silk is because silk is one of the new items at E'nat'dae.
Reply with quote
Bradach
Beginner


Joined: 21 Mar 2003
Posts: 19
Location: USA

PostPosted: Sun Dec 07, 2003 4:52 am   
 
So, does anyone have a complete, debugged version of the script?
Reply with quote
Tlaca
Beginner


Joined: 11 May 2003
Posts: 23
Location: Canada

PostPosted: Sun Dec 07, 2003 11:00 pm   
 
OK, I had a major computer crash here a week ago, am running on a new computer now. So I've had to re download and re install all my scripts and such. I can't get the trade script to work at all now. It executes look, time, and stops.

The best I can figure is that my script parser settings in zmud preferences must not be set right. However, i can't figure what is the right way set them.

Also, if I go into triggers and such, it keeps saying there are syntax errors. All I did was copy the script into notepad, save, and load it with script(ascii). It worked before the computer crash...

HELP [:p]
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Mon Dec 08, 2003 3:15 pm   
 
Its not triggering on time correctly, noticed this myself
the other day, put a quick fix on it since i wasnt using the
time yet. This script includes all the fixes from above. Im almost
finished with a newer version that will fix the cpms by subtracting
the initial cost from the value and it will also add the amount
a covered holds to the display. Ill post it sometime tomorrow

Code:

#CLASS {ZTrader}
#CLASS 0

#CLASS {ZTrader|Commands|User}
    #ALIAS ztval  {#IF (%1) {#SHOW ZTRADER SELECTIVE VALUING NOT YET IMPLEMENTED} {ztvalall}}
    #ALIAS ztshow {#IF (%1) {#IF (%isnumber(%1)) {ztdShowVal %1} {ztdShowPost %1}} {ztdShowAll}}
    #ALIAS ztchat {#IF (%1) {#IF (%isnumber(%1)) {ztdChatVal %1} {ztdChatPost %1}} {ztdChatAll}}
#CLASS 0

#CLASS {ZTrader|Commands|Display}

    #ALIAS ztdShowAll  {ztdCreateAll;#SHOW @ztdChatLine}
    #ALIAS ztdShowVal  {ztdCheckVal %1}
    #ALIAS ztdShowPost {ztdFindPost %1}
    #ALIAS ztdChatAll  {ztdCreateAll;#EMOTEALL @ztdChatLine}
    #ALIAS ztdChatVal  {ztdChatCheckVal %1}
    #ALIAS ztdChatPost {ztdChatFindPost %1}

    #ALIAS ztdCreateAll  {ztvposts      = @ztposts
                          ztdTitle      = @ztdAllTitle
                          ztdChatLine   = %concat(%char(10),@ztdTitle)
                          ztdChatLine   = %concat(@ztdChatLine,%char(10),@CaebColor(bold,blue),%repeat("-",%len(%stripansi(@ztdTitle))))
                          ztdChatLine   = %concat(@ztdChatLine,%char(10))
                          #FORALL @ztvposts {#FORALL @%i {ztdCreateLine %i %j}}}
   
    #ALIAS ztdCreatePost {ztdTitle      = @ztdPostTitle
                          ztdChatLine   = %concat(%char(10),@ztdTitle)
                          ztdChatLine   = %concat(@ztdChatLine,%char(10),@CaebColor(bold,blue),%repeat("-",%len(%stripansi(@ztdTitle))))
                          ztdChatLine   = %concat(@ztdChatLine,%char(10))
                          #FORALL @ztvposts {#FORALL @%i {ztdCreateLine %i %j}}}
   
    #ALIAS ztdCreateVal  {ztvposts     = @ztposts
                          ztdValDisplay = %format("&0.0n",%1)
                          ztdTitle      = @ztdValTitle
                          ztdChatLine   = %concat(%char(10),@ztdTitle)
                          ztdChatLine   = %concat(@ztdChatLine,%char(10),@CaebColor(bold,blue),%repeat("-",%len(%stripansi(@ztdTitle))))
                          ztdChatLine   = %concat(@ztdChatLine,%char(10))
                          #FORALL @ztvposts {#FORALL @%i {#IF (@%j>%1) {ztdCreateLine %i %j}}}}
                         
                         
    #VARIABLE ztdLine       {""} {""}
    #VARIABLE ztdChatLine   {""} {""}
    #VARIABLE ztdValDisplay {""} {""}
   
    #ALIAS ztdFindPost {ztvposts = %null;#FORALL @ztposts {#IF (%pos(%lower(%1),%i)) {ztvposts = %i}};#IF (@ztvposts) {ztdCreatePost;#SHOW @ztdChatLine} {ztdErrorPostFind %1}}
    #ALIAS ztdChatFindPost {ztvposts = %null;#FORALL @ztposts {#IF (%pos(%lower(%1),%i)) {ztvposts = %i}};#IF (@ztvposts) {ztdCreatePost;#EMOTEALL @ztdChatLine} {ztdErrorPostFind %1}}
    #ALIAS ztdCheckVal {#IF (%1 < 100000) {ztdErrorSmallVal} {ztdCreateVal %1;#SHOW @ztdChatLine}}
    #ALIAS ztdChatCheckVal {#IF (%1 < 100000) {ztdErrorSmallVal} {ztdCreateVal %1;#EMOTEALL @ztdChatLine}}
   
   
    #ALIAS ztdCreateLine {ztdLine = %concat(@CaebColor(bold,black),~()
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,cyan),@ztdCreateTp(%1))
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,magenta),@ztdCreateGood(%2))
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,white),@ztdCreateValue(%2))
                          ztdLine = %concat(@ztdLine,@CaebColor(bold,red),@ztdCreateCpm(%2,%1))
                          ztdLine = %concat(@ztdLine,@CaebColor(green)cpms@CaebColor(bold,black)))
                          ztdChatLine = %concat(@ztdChatLine,@ztdLine,%char(10))}
   
    #FUNCTION ztdCreateGood  {@ztdCreateSpaces(%1,12,1)}
    #FUNCTION ztdCreateValue {@ztdCreateSpaces(%literal(%format("&0.0n",@%1)),11)}
    #FUNCTION ztdCreateCpm   {@ztdCreateSpaces(%eval(@%1/%item(@ztvcpmpost,%ismember(%2,@ztposts))),%eval(%len(%stripansi(@ztdTitle)) - 44))}
    #FUNCTION ztdCreateTp    {@ztdCreateSpaces(%item(@ztfancypost, %ismember(%1,@ztposts)),15,1)}
   
    #FUNCTION ztdCreateSpaces {%if(%3,%1%repeat(" ",%2-%len(%1)),%repeat(" ",%2-%len(%1))%1)}
   
    #VARIABLE ztdTitle     {""} {""}
    #FUNCTION ztdAllTitle  {@CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.1@CaebColor(bold,blue))@CaebColor(bold,cyan):@CaebColor(bold,green) Showing all valued items to @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvvalpost,@ztposts))}
    #FUNCTION ztdPostTitle {@CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.1@CaebColor(bold,blue))@CaebColor(bold,cyan):@CaebColor(bold,green) All values from @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvposts,@ztposts)) @CaebColor(bold,green)to @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvvalpost,@ztposts))}
    #FUNCTION ztdValTitle  {@CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.1@CaebColor(bold,blue))@CaebColor(bold,cyan):@CaebColor(bold,green) All values over @CaebColor(bold,white)@ztdValDisplay @CaebColor(bold,green)to @CaebColor(bold,white)%item(@ztfancypost, %ismember(@ztvvalpost,@ztposts))}

    #ALIAS ztdErrorPostFind {#SHOW @CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.1@CaebColor(bold,blue))@CaebColor(bold,cyan): @CaebColor(bold,red)Error @CaebColor(bold,green)could not find any posts containing substring @CaebColor(bold,white)%1@CaebColor(bold,green).}
    #ALIAS ztdErrorSmallVal {#SHOW @CaebColor(bold,blue)(@CaebColor(bold,white)ZTrader V2.1@CaebColor(bold,blue))@CaebColor(bold,cyan): @CaebColor(bold,red)Error @CaebColor(bold,green)searching for values less then 100,000 is not supported.}
#CLASS 0

#CLASS {ZTrader|Commands|Valuing}
    #ALIAS ztvalall {ztvreset;ztvposts = @ztposts;ztvcurpost = 1;ztvcuritem = 0;ztvfindpost}
    #ALIAS ztvreset     {#FORALL @ztposts {#FORALL @%i {#CLASS {ZTrader|Data|GoodsValue};@%j = "DID NOT VALUE";#CLASS 0}}}
    #ALIAS ztvfindpost  {#T+ {ZTrader|Triggers|Valuing|Tradeposts};look}
    #ALIAS ztvpostfound {#T- {ZTrader|Triggers|Valuing|Tradeposts};ztvgettime}
    #ALIAS ztvgettime   {#T+ {ZTrader|Triggers|Valuing|Time};ztvtimefound}
    #ALIAS ztvtimefound {#T- {ZTrader|Triggers|Valuing|Time};#T+ {ZTrader|Triggers|Valuing|Value};ztvdovaluing}
    #ALIAS ztvdovaluing {ztvcuritem = %eval(@ztvcuritem + 1);#IF (@ztvcuritem > %numitems(%eval(@%item(@ztvposts,@ztvcurpost)))) {ztvnextpost} {value %item(%eval(@%item(@ztvposts, @ztvcurpost)),@ztvcuritem) covered}}
    #ALIAS ztvnextpost  {ztvcuritem = 0;ztvcurpost = %eval(@ztvcurpost + 1);#IF (@ztvcurpost > %numitems(@ztvposts)) {ztvvaldone} {ztvdovaluing}}
    #ALIAS ztvvaldone   {#SHOW Done Valuing;#T- {ZTrader|Triggers|Valuing|Value}}
    #VARIABLE ztvposts   {""}
    #VARIABLE ztvcurpost {""}
    #VARIABLE ztvcuritem {""}
    #VARIABLE ztvvalpost {""}
    #VARIABLE ztvtime    {""}
    #VARIABLE ztvcpmpost {""}
#CLASS 0

#CLASS {ZTrader|Triggers|Valuing|Value} {disable}
#TRIGGER {A covered wagon horse can carry %d %w of (%w). We'll pay you (%n) gold for that.} {#CLASS {ZTrader|Data|GoodsValue};%1 = %2;%1 = %replace(@%1,~,,"");#CLASS 0;ztvdovaluing}
#CLASS 0

#CLASS {ZTrader|Triggers|Valuing|Time} {disable}
    #TRIGGER {The current system time is %w %w %d (*) %d} {ztvtime = %1;ztvtimefound}
#CLASS 0

#CLASS {Ztrader|Triggers|Valuing|Tradeposts} {disable}
    #TRIGGER {Hidden City}                          {ztvcpmpost = @mvsena;ztvvalpost = "enatdae";ztvpostfound}
    #TRIGGER {A Minotaur Trading Outpost}           {ztvcpmpost = @mvsnae;ztvvalpost = "naeramae";ztvpostfound}
    #TRIGGER {A Quiet Temple Shop}                  {ztvcpmpost = @mvselw;ztvvalpost = "elwyn";ztvpostfound}
    #TRIGGER {A Ranger's Cabin}                     {ztvcpmpost = @mvsran;ztvvalpost = "rangerscabin";ztvpostfound}
    #TRIGGER {An Elven Marketplace}                 {ztvcpmpost = @mvsath;ztvvalpost = "athelasea";ztvpostfound}
    #TRIGGER {DeRah Villadom's Small Trading Post}  {ztvcpmpost = @mvsder;ztvvalpost = "derahvilladom";ztvpostfound}
    #TRIGGER {Hidden Valley Traders, Inc.}          {ztvcpmpost = @mvsrue;ztvvalpost = "ruellia";ztvpostfound}
    #TRIGGER {Medievia Trading Shop}                {ztvcpmpost = @mvsmed;ztvvalpost = "medievia";ztvpostfound}
    #TRIGGER {New Ashton Trading Post}              {ztvcpmpost = @mvsash;ztvvalpost = "newashton";ztvpostfound}
    #TRIGGER {Riverton Trading Partners}            {ztvcpmpost = @mvsriv;ztvvalpost = "riverton";ztvpostfound}
    #TRIGGER {Sea's End Direct Merchants}           {ztvcpmpost = @mvssea;ztvvalpost = "seasend";ztvpostfound}
    #TRIGGER {Tanivsport Traders}                   {ztvcpmpost = @mvsmys;ztvvalpost = "mystara";ztvpostfound}
    #TRIGGER {The Lizard Boulangere}                {ztvcpmpost = @mvslyr;ztvvalpost = "lyryanoth";ztvpostfound}
    #TRIGGER {The Trading Post of G'dangus}         {ztvcpmpost = @mvsgda;ztvvalpost = "gdangus";ztvpostfound}
    #TRIGGER {Trading Post of the City of Karlisna} {ztvcpmpost = @mvsgda;ztvvalpost = "karlisna";ztvpostfound}
    #TRIGGER {Trading Post of the Dark Army}        {ztvcpmpost = @mvsgen;ztvvalpost = "newgenesia";ztvpostfound}
    #TRIGGER {Trading Shop of Trellor City}         {ztvcpmpost = @mvstre;ztvvalpost = "trellor";ztvpostfound}
    #TRIGGER {Ur-vile Feeding Hall}                 {ztvcpmpost = @mvsurv;ztvvalpost = "urvile";ztvpostfound}
    #TRIGGER {Vanlarra Imports and Exports}         {ztvcpmpost = @mvsvan;ztvvalpost = "vanlarra";ztvpostfound}
#CLASS 0

#CLASS {ZTrader|Data|UserOptions}
    #VARIABLE ztvalgag {0}
#CLASS 0

#CLASS {ZTrader|Data|TradePosts} {enable}
    #VARIABLE ztposts     {medievia|trellor|enatdae|naeramae|elwyn|rangerscabin|athelasea|derahvilladom|ruellia|newashton|riverton|seasend|mystara|lyryanoth|gdangus|karlisna|newgenesia|vanlarra|urvile}
    #VARIABLE ztfancypost {Medievia|Trellor|E'nat'dae|NaeraMae|Elwyn|Ranger's Cabin|Athelasea|DeRah Villadom|Ruellia|NewAshton|Riverton|Sea's End|Mystara|Lyryanoth|Gdangus|Karlisna|NewGenesia|Vanlarra|Ur-Vile}
#CLASS 0

#CLASS {ZTrader|Data|TpGoods} {enable}
    #VARIABLE urvile        {""}
    #VARIABLE derahvilladom {artifacts|candles|herbs|nuts|hemp}
    #VARIABLE gdangus       {bananas|seed|beans|rice|tobacco}
    #VARIABLE enatdae       {quilts|silk|fans|silkworms|illutian}
    #VARIABLE karlisna      {books|cloth|spices|beer|dates}
    #VARIABLE lyryanoth     {venom|eggs|hides|glowworms|mushrooms}
    #VARIABLE mystara       {pearls|teak|carpet|maps|fish}
    #VARIABLE newashton     {silver|jewels|silicate|nails|copper}
    #VARIABLE newgenesia    {tools|adamantite|coal|opium|iron}
    #VARIABLE riverton      {brandy|metals|honey|grapes|fertilizer}
    #VARIABLE ruellia       {emeralds|willowbark|cloaks|rope|waybread}
    #VARIABLE seasend       {opals|ambergris|shells|nets|kelp}
    #VARIABLE vanlarra      {wands|crystal|rum|figs|molasses}
    #VARIABLE athelasea     {flowers|arrows|bows|art|parchment}
    #VARIABLE naeramae      {armor|chains|mead|pelts|weapons}
    #VARIABLE elwyn         {aloe|quills|balm}
    #VARIABLE rangerscabin  {sap|furs|timber|rations|ivory}
    #VARIABLE medievia      {ale|tar|salt|sugar|raisins}
    #VARIABLE trellor       {perfume|wine|oils|incense|ink}
#CLASS 0         

#CLASS {ZTrader|Data|GoodsValue}
#CLASS 0           
                             
#CLASS {ZTrader|Data|TpMoves}

#VARIABLE {mvsmed} {1|1269|308|NA|594|302|221|1072|998|781|572|1616|575|1179|1330|1246|657|786|NA}
#VARIABLE {mvsder} {1072|2264|862|NA|1295|1348|1225|1|1912|1785|1624|2662|1627|1880|2376|2292|1571|1838|NA}
#VARIABLE {mvselw} {594|1786|418|NA|1|870|747|1295|1434|1307|1146|2184|1149|655|1898|1814|1093|1336|NA}
#VARIABLE {mvsgda} {1330|1562|1612|NA|1898|1061|1262|2376|2308|1666|1197|672|1380|2483|1|863|1967|1423|NA}
#VARIABLE {mvslyr} {1179|2371|1003|NA|655|1455|1332|1880|2019|1892|1731|2768|1734|1|2183|2399|1678|1921|NA}
#VARIABLE {mvsnae} {NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA}                       
#VARIABLE {mvsmys} {575|1824|863|NA|1149|743|776|1627|1553|1336|307|1666|1|1734|1380|1256|1212|281|NA}
#VARIABLE {mvsash} {781|494|1021|NA|1307|1063|668|1785|1537|1|1333|1952|1336|1892|1666|752|1196|1547|NA}
#VARIABLE {mvsran} {302|1551|584|NA|870|1|503|1348|1280|1063|740|1347|743|1455|1061|976|939|958|NA}
#VARIABLE {mvsriv} {572|1821|860|NA|1146|740|773|1624|1550|1333|1|1483|307|1731|1197|1112|1209|518|NA}
#VARIABLE {mvsrue} {998|2169|1148|NA|1434|1280|1111|1912|1|1537|1550|2594|1553|2019|2308|2136|399|1764|NA}
#VARIABLE {mvssea} {1616|1774|1898|NA|2184|1347|1548|2662|2594|1952|1483|1|1666|2768|672|1149|2253|1709|NA}
#VARIABLE {mvsvan} {786|2035|1059|NA|1336|958|987|1838|1764|1547|518|1709|281|1921|1423|1338|1423|1|NA}
#VARIABLE {mvskar} {1246|1349|1528|NA|1814|976|1176|2292|2136|752|1112|1149|1256|2399|863|1|1795|1338|NA}
#VARIABLE {mvstre} {1269|1|1500|NA|1786|1551|1160|2264|2169|494|1821|1774|1824|2371|1562|1349|1500|2035|NA}
#VARIABLE {mvsath} {221|1160|461|NA|747|503|1|1225|1111|668|773|1548|776|1332|1262|1176|770|987|NA}
#VARIABLE {mvsena} {308|1500|1|NA|418|584|461|862|1148|1021|860|1898|863|1003|1612|1528|807|1059|NA}
#VARIABLE {mvsgen} {657|1500|807|NA|1093|939|770|1571|399|1196|1209|2253|1212|1678|1967|1795|1|1423|NA}
#VARIABLE {mvsurv} {NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA|NA}
   
#CLASS 0

#CLASS {ZTrader|Data|GoodsValue}
#CLASS 0

;; ToDo
;; 1. Selective valuing - ztval med, gda ..just to value medievia gdangus and not everything.
;; 2. Fix Inflated Cpms for trading to the same post your at.
;; 3. Display by Cpms
;; 4. ADD Resume valuing, for asteroid valuing
;; 5. Check moves data
;; 6. ADD time passed since valuing
;; 7. ADD option to GAG valuing


Jesse
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