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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Xarsas
Beginner


Joined: 05 Mar 2008
Posts: 16

PostPosted: Mon Apr 20, 2009 4:15 pm   

Some help gathering data from MUD
 
Hi

I would like to collect the data in my cache on aetolia store them in variables and then have the variables displayed in a seperate window as gauges(I want it this way so I can use my status window solely for afflictions in combat). I have set it up as follows

Code:
<trigger priority="29560" id="2975">
  <pattern>Glancing into the cache, you see:</pattern>
  <trigger type="Duration" param="50" repeat="true">
    <pattern>  ~[(&amp;4)~] (%w)%s</pattern>
    <value>#if (%2=ginseng) {#VAR ginsengcache %1 _nodef HerbControl}
#if (%2=bellwort) {#VAR bellwortcache %1 _nodef HerbControl}
#if (%2=elm) {#VAR elmcache %1 _nodef HerbControl}
#if (%2=lobelia) {#VAR lobeliacache %1 _nodef HerbControl}
#if (%2=ginger) {#VAR gingercache %1 _nodef HerbControl}
#if (%2=echinacea) {#VAR echinaceacache %1 _nodef HerbControl}
#if (%2=myrrh) {#VAR myrrhcache %1 _nodef HerbControl}
#if (%2=cohosh) {#VAR cohoshcache %1 _nodef HerbControl}
#if (%2=ash) {#VAR ashcache %1 _nodef HerbControl}
#if (%2=slipper) {#VAR slippercache %1 _nodef HerbControl}
#if (%2=goldenseal) {#VAR goldensealcache %1 _nodef HerbControl}
#if (%2=bayberry) {#VAR bayberrycache %1 _nodef HerbControl}
#if (%2=hawthorn) {#VAR hawthorncache %1 _nodef HerbControl}
#if (%2=valerian) {#VAR valeriancache %1 _nodef HerbControl}
#if (%2=skullcap) {#VAR skullcapcache %1 _nodef HerbControl}
#if (%2=kuzu) {#VAR kuzucache %1 _nodef HerbControl}
#if (%2=kola) {#VAR kolacache %1 _nodef HerbControl}
#if (%2=moss) {#VAR mosscache %1 _nodef HerbControl}
#if (%2=bloodroot) {#VAR bloodrootcache %1 _nodef HerbControl}
#if (%2=kelp) {#VAR kelpcache %1 _nodef HerbControl}
#if (%2=sileris) {#VAR sileriscache %1 _nodef HerbControl}
#if (%2=coal) {#VAR coalcache %1 _nodef HerbControl}
#if (%2=dust) {#VAR dustcache %1 _nodef HerbControl}
#if (%2=feather) {#VAR feathercache %1 _nodef HerbControl}
#if (%2=gold) {#VAR goldcache %1 _nodef HerbControl}
#if (%2=ice) {#VAR icecache %1 _nodef HerbControl}
#if (%2=iron) {#VAR ironcache %1 _nodef HerbControl}
#if (%2=leather) {#VAR leathercache %1 _nodef HerbControl}
#if (%2=obsidian) {#VAR obsidiancache %1 _nodef HerbControl}
#if (%2=pear) {#VAR pearcache %1 _nodef HerbControl}
#if (%2=sac) {#VAR saccache %1 _nodef HerbControl}
#if (%2=silver) {#VAR silvercache %1 _nodef HerbControl}
#if (%2=skin) {#VAR skincache %1 _nodef HerbControl}
#if (%2=weed) {#VAR weedcache %1 _nodef HerbControl}
#if (%2=wood) {#VAR woodcache %1 _nodef HerbControl}</value>
  </trigger>
</trigger>


This seems to collect the data all right, but CMUD simply freezes after about the fourth line from the MUD. The cache looks like this
Code:
Glancing into the cache, you see:
  [ 577] ash                [ 503] bayberry           [ 196] bellwort
  [ 592] bloodroot          [ 172] blue ink           [   3] coal
  [ 425] cohosh             [ 198] crystal cube       [  98] cylinder crystal
  [ 201] diamond crystal    [ 100] disc crystal       [  86] dust
  [ 466] echinacea          [ 114] egg crystal        [ 450] elm
  [ 284] feather            [1730] ginger             [ 553] ginseng
  [ 824] gold               [1411] goldenseal         [  69] gold ink
  [ 677] green ink          [ 440] hawthorn           [ 173] ice
  [1000] iron               [ 484] kelp               [ 202] kola
  [1692] kuzu               [  10] leather            [ 746] lobelia
  [ 178] moss               [1503] myrrh              [ 859] obsidian
  [ 943] pear               [ 100] pentagon crystal   [ 630] piece of stag's
  [  97] polyhedron cryst   [ 429] purple ink         [ 182] pyramid crystal
  [ 291] red ink            [ 169] sac                [ 749] sileris
  [ 650] silver             [ 162] skin               [  50] skullcap
  [1957] slipper            [  72] sphere crystal     [ 104] spiral crystal
  [ 107] torus crystal      [ 238] valerian           [   1] weed
  [ 955] wood               [ 569] yellow ink


I had to set up multiple triggers due to some numbers having spaces in (under 1000 units) and others not(over 1000 units), and then some extra ones due to the amount of spaces in some of the names. I have however disabled all others except this one to try and bring the amount of processing that has to be done down. I treid using #switch instead of #if as well, with no luck.

I'm guessing there must be a less resource intensive way to do this, or I am using to many wildcards, however with my limited knowledge of scripting I do not know how to do it any better Embarassed . Any help would be appreciated.

Thanks.

-edit The buttons and all are set up with no problems, its just getting the data from my cache to the variables I am not managing with. The window i use for the buttons is "HerbControl" and those variables are also all stored there.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Mon Apr 20, 2009 6:05 pm   
 
Try to look here first:
http://forums.zuggsoft.com/forums/viewtopic.php?t=32707
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Xarsas
Beginner


Joined: 05 Mar 2008
Posts: 16

PostPosted: Mon Apr 20, 2009 7:51 pm   
 
okay, i haves used that regex trigger to capture my cache, copy it to the herbcontrol window and gag the main window. then created a copy of the trigger on the herbcontrol window and it works brilliantly, however in the database i now have items like blue ink etc. words with sapces in. using "@rift.blue ink" (without quotes) gives my variable the value of "ink" how do i either let it accept multiple words or make the strings one word?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Apr 20, 2009 7:54 pm   
 
I mentioned this in the thread. %db(@rift,"blue ink") is the way to access these.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Xarsas
Beginner


Joined: 05 Mar 2008
Posts: 16

PostPosted: Mon Apr 20, 2009 7:58 pm   
 
ah, my apologies. i didn't notice the edit part. Thanks.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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