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 Goto page 1, 2  Next
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Tue Nov 28, 2017 10:23 am   

Need help if possible...
 
Trying to convert a tintin++ script to use in cmud and one command is causing some issues, as I can not find/figure out a comparable command/function

http://tintin.sourceforge.net/manual/format.php

What I'm trying to convert... http://necro.wikidot.com/tintin-crafting
so far only #FORMAT is red text.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Tue Nov 28, 2017 6:24 pm   
 
I have never been good at direct conversion, mainly cause I can't always tell what other scripts are doing.
Rest assured that whatever it is can be done, but perhaps you could explain it a bit better than that page, which seems to be referring to other scripts I don't have access to.

Some of the MUD output would help as well.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 2:42 am   
 
I do apologize for the obvious lack of info, lack of sleep does that to people lol...
If I understand the concept of the tintin script it is creating a trigger to capture and format the output to store each item, and quantity of it's various tiers
"Total | Legendary " Superior | Good | Average | Poor | Crude | Worthless" then doing some condensing/disposal of excess beyond a pre-set limit.

Sample of the mud output below. (as you can see i'm almost capped)

Code:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Component Name            |   T |  L |  S |  G |  A |  P |  C |  W |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Alexandrite               |   2 |  0 |  0 |  0 |  0 |  2 |  0 |  0 |
Alexandrite Dust          |  14 |  0 |  1 |  4 |  7 |  1 |  1 |  0 |
Aquamarine                |  10 |  0 |  3 |  4 |  0 |  1 |  2 |  0 |
Aquamarine Dust           |  13 |  1 |  4 |  5 |  1 |  1 |  1 |  0 |
Bronze Shards             |  40 |  0 |  3 |  5 | 22 |  6 |  4 |  0 |
Cat's Eye                 |  19 |  0 |  3 |  2 |  9 |  4 |  1 |  0 |
Cat's Eye Dust            |  27 |  0 |  2 |  6 | 14 |  2 |  3 |  0 |
Copper Shards             |  86 |  5 | 12 | 14 | 45 |  8 |  2 |  0 |
Essence Of Might          |  17 |  0 |  0 |  1 | 14 |  2 |  0 |  0 |
Essence Of Soul           |  12 |  0 |  1 |  1 | 10 |  0 |  0 |  0 |
Essence Of The Unseen     |  10 |  0 |  5 |  5 |  0 |  0 |  0 |  0 |
Essence Of Water          |   1 |  0 |  0 |  0 |  1 |  0 |  0 |  0 |
Essence Of Willy          |   1 |  1 |  0 |  0 |  0 |  0 |  0 |  0 |
Eye Of Flame              |  16 |  0 |  1 |  3 |  7 |  3 |  2 |  0 |
Eye Of Frost              |  14 |  0 |  2 |  2 |  5 |  4 |  1 |  0 |
Fragment Of Ascension     |  30 |  1 |  1 |  1 | 14 | 13 |  0 |  0 |
Fragment Of Blasting      |  21 |  1 |  2 |  7 | 10 |  0 |  1 |  0 |
Fragment Of Compassion    |  19 |  0 |  1 |  6 | 10 |  1 |  1 |  0 |
Fragment Of Damnation     |   8 |  0 |  1 |  1 |  0 |  6 |  0 |  0 |
Fragment Of Destruction   |  19 |  0 |  2 |  1 | 11 |  0 |  5 |  0 |
Fragment Of Knowledge     |  47 |  0 |  1 |  3 |  6 | 36 |  1 |  0 |
Fragment Of Light         |  64 |  1 |  4 | 20 |  6 | 26 |  7 |  0 |
Fragment Of Might         |  10 |  1 |  0 |  2 |  1 |  6 |  0 |  0 |
Fragment Of Rage          |  58 |  0 |  5 |  9 | 25 | 14 |  5 |  0 |
Fragment Of Rejuvenation  |  60 |  1 |  1 |  4 | 50 |  3 |  1 |  0 |
Fragment Of Shadow        |  66 |  2 |  1 | 12 | 42 |  8 |  1 |  0 |
Fragment Of Soul          |  13 |  1 |  3 |  4 |  1 |  3 |  1 |  0 |
Fragment Of The Unseen    |  42 |  0 |  4 |  7 | 21 |  3 |  7 |  0 |
Fragment Of Water         |  62 |  5 |  1 | 12 | 31 |  8 |  5 |  0 |
Fragment Of Willy         |  52 |  0 |  5 |  4 | 41 |  2 |  0 |  0 |
Garnet                    |  19 |  0 |  3 |  4 |  8 |  2 |  2 |  0 |
Garnet Dust               |  30 |  0 |  6 |  4 | 13 |  4 |  3 |  0 |
Iron Shards               |  32 |  0 |  3 |  4 | 14 |  3 |  8 |  0 |
Morganite                 |   7 |  1 |  1 |  2 |  0 |  2 |  1 |  0 |
Morganite Dust            |  15 |  0 |  5 |  6 |  0 |  1 |  3 |  0 |
Steel Shards              |  17 |  0 |  1 |  1 | 11 |  2 |  2 |  0 |
Tiger's Eye               |   6 |  1 |  2 |  1 |  1 |  0 |  1 |  0 |
Tiger's Eye Dust          |  19 |  1 |  2 |  8 |  4 |  1 |  3 |  0 |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
You have 998/999 items in your satchel.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 5:45 am   
 
Hmm... sounds like you would want to store it in a database variable.

Code:

<trigger priority="92020" id="9202">
  <pattern><![CDATA[(*) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) |]]></pattern>
  <value>$item=%trim(%1)
$this=%db(@satchelList, $item)
#ADDKEY $this total %trim(%2)
#ADDKEY $this Legendary %trim(%3)
#ADDKEY $this Superior %trim(%4)
#ADDKEY $this Good %trim(%5)
#ADDKEY $this Average %trim(%6)
#ADDKEY $this Poor %trim(%7)
#ADDKEY $this Crude %trim(%8)
#ADDKEY $this Worthless %trim(%9)
#ADDKEY satchelList $item $this</value>
</trigger>


Something like that should populate it, and you can work on a formatting display alias from there.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 6:37 am   
 
hrm that is throwing ERROR: Syntax error in Alias: sl : invalid local variable: this

my "sl" alias (as per the script from above)
Code:

#TRIGGER {<![CDATA[(*) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) |]]>}
    {$item=%trim(%1)
      $this=%db(@satchelList, $item)
      #ADDKEY $this total %trim(%2)
      #ADDKEY $this Legendary %trim(%3)
      #ADDKEY $this Superior %trim(%4)
      #ADDKEY $this Good %trim(%5)
      #ADDKEY $this Average %trim(%6)
      #ADDKEY $this Poor %trim(%7)
      #ADDKEY $this Crude %trim(%8)
      #ADDKEY $this Worthless %trim(%9)
      #ADDKEY satchelList $item $this
    };

    #TRIGGER {You have %%d/%%d items in your satchel.}
    {
        #UNTRIGGER {<![CDATA[(*) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) | ([%s%d]) |]]>};
        #UNTRIGGER {You have %%d/%%d items in your satchel.};
    };

    #SEND {!stashlist %0}
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 7:17 am   
 
That is the XML for the trigger, you need to paste it over what is on the XML tab of a new trigger

and there is no reason to #UNTRIGGER this, the pattern is so specific, little else is likely to fire it
#UNTRIGGER in general should not be used.
there is #TEMP for one shot triggers, and #T+ / #T- for toggling them, if you give them an ID
_________________
Discord: Shalimarwildcat

Last edited by shalimar on Wed Nov 29, 2017 7:21 am; edited 1 time in total
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 7:21 am   
 
honestly starting to think this isn't really possible without seeing it in action via tinitn

I only "Think" i understand what this script does... but 98% of the command syntax of cmud/tintin overlap there are still some commands that just don't appear to translate over... or are just obscure enough to be difficult to convert.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 7:23 am   
 
Well, how do you want the end display to look?
I can help there as well, but I don't have enough info to go on.
What commands are used to get rid of surplus and the like?
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 7:30 am   
 
well as I see it IF i see this as it supposed to function... http://necro.wikidot.com/tintin-crafting

creates 3 variables

1st alias "sl" which creates 2 triggers. 1 scans the above list I provided in 3rd post, and formats the stored variables (this is where i'm not sure) then runs 2nd alias. 2nd trig watches for the final line of the above list to then delete the 2 newly created trigs.
and finally sending the command to the mud !stashlist %0

2nd alias ".CleanIngredients" performs various logics foreach, math and so forth. to eval how many of each tier of each fragment/essence and then condenses them up the tiers to final tier, but only allowing a limit of X (default appears to be 30) for each one.

the final segment of that script looks to be only if i want to adjust the default 'keep X' amounts and save these settings across tintin open/close of program.


as in the first post. #FORMAT is the tintin command that has me stumped

Format

Syntax: #format {variablename} {format} {argument1} {argument2} {etc}

This command allows you to format text very much like the sprintf function in C. The result will be stored in the variable given. The format part can contain text and argument variables. You can give up to 20 arguments in the arguments part. Also see the linux man file on sprintf.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 7:51 am   
 
.... a screenshot of the desired output from the client it was intended for might help.
complete with the commands it is actually sending to the game as it physically interacts with the excess.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 7:59 am   
 
'stash' crafting components
'unstash' them when you are ready to use them.
You can see what's inside your crafting satchel using the command 'stashlist'.

actual mud output not sure if this is the 'desired' though due to the #FORMAT command in the alias :(
https://1drv.ms/i/s!AhMgRb1DtUImiGYtNhazrdx6pcGQ
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 8:50 am   
 
looks like it is just coloring the number based on it being in a range of values
outside of visually helping you to spot which ones you have too much/little of, that does help you in actually managing the the contents.

If that is not what you want.... then what do you want?
and what do you do with them after you unstash them, is there a way of combining them into the next tier up?
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 8:53 am   
 
the coloring is a default of the mud not the triggers/script

based on the contents of the tintin i have linked a few times...

Quote:
This script will automatically assemble fragments and essences if it finds 5 of the same type and quality, and also maintain the crafting ingredients within your satchel at a set limit, removing the worst quality ingredients automatically. You can set both a default limit and specific limits for certain rare or less wanted ingredients (fragments and essences will never be discarded).

The script runs whenever you type "sl" or "sl ingredient_name" (it works exactly the same way as stashlist).
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 9:12 am   
 
I have asked for this information several times as well... and that is still rather vague.
I would presume the command is 'assemble' then?
do you have to specify the item name?
how to you specify quality when unstashing?

Code:
#ALIAS assemblyLine {
  #FORALL %dbkeys(@satchelList) {
    $this=%db(@satchelList, %i)
    #FORALL {Worthless|Crude|Poor|Average|Good|Superior} {
      #IF (%db($this, %j) > 5) {
        #LOOP 5 {unstash %j %i}
        assemble %i
        stash %i
        }
      }
    }
  }


Something like that might work.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 9:21 am   
 
In that regard I apologize for my misunderstanding. Was starting to feel like the link was being ignored. :)

ok so after examining an 'essence'
Code:
Average essence of water

[ AVERAGE ESSENCE OF WATER ]

It's still hard to understand how this odd little blue ball (that
certainly LOOKS like water) is not even remotely damp!  You can assemble
5 of these essences into a single heart, or shatter the essence into 5
fragments.

This item can be stashed in a crafting satchel.

Type: Essence Of Water
Minimum Skill: 36
Trivial Skill: 46


so to up-tier yes <assemble fragment of blah> 5 to form 1... or reverse with <shatter essence of blah> 1 to get 5 fragments.

as for unstash there are a couple methods for its use.
"unstash <all|quality> essence of rejuvenation" (all will unstash as much as i can carry, while quality will unstash a single item)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 9:29 am   
 
Then you just need to recreate the original trigger, as I outlined a few posts above, and update your values between iterations.
I expect it will be quite spammy, so don't do it in public.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 9:31 am   
 
yea, something like this i would run in my personal home on the mud.

just import it via xml ?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 9:42 am   
 
No.
Click the 'Trigger' button at the top of the CMUD screen to open the settings editor to triggers.
Then click on the 'New' button at the top center of the Settings Editor window.
(Side note, this button has a dropdown arrow where you can choose any type of setting, but by default it will be the setting type you opening up the editor with.)
Back to the new trigger. Click on the 'XML' tab on the bottom of the Trigger setting in the Settings Editor window.
Select all, and replace with the original trigger code i supplied at the top of this post.
Then press the Escape key to save and exit the Settings editor window.

You should now be able to update your @satchelList database by entereing the command to check the satchel
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 9:55 am   
 
the assemblyLine alias above when i created a new alias and xml pasted it in...

File. . line: 1 Col: 1 Error: Expected String: '<'

nm i'ma derp
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 9:58 am   
 
Yea... the assemblyline was not done in XML, it can be entered directly from the command line as if you were typing into the game.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Nov 29, 2017 10:00 am   
 
yea i figured that out after re-reading it. *facepalm*

any way to refine the trigger to only capture the lines that start with [Heart|Essence|Fragment] those are really the only things that 'shatter/assemble'
RESOLVED... changed trigger pattern to a regex of
Code:
^(\w[?:Essence|Fragment|Heart][^>]+) \| ([\s\d]+) \| ([\s\d]+) \| ([\s\d]+) \| ([\s\d]+) \| ([\s\d]+) \| ([\s\d]+) \| ([\s\d]+) \| ([\s\d]+) \|$


also had to %lower(%j) %lower(%i) as the mud does not accept the proper/capital version...
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 29, 2017 7:22 pm   
 
Glad you got it working.
_________________
Discord: Shalimarwildcat
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Fri Dec 15, 2017 3:01 am   
 
I used this chaossdragon

trigger portion

^Essence Of (%w?%w)%s|%s%d%s|%s(%d)%s|%s(%d)%s|%s(%d)%s|%s(%d)%s|%s(%d)%s|%s(%d)%s|%s(%d)%s|

script portion

#IF (%2 > 4) {#5 unstash legendary essence of %lower(%1);assemble essence of %lower(%1);stash essence of %lower(%1)}
#IF (%3 > 4) {#5 unstash superior essence of %lower(%1);assemble essence of %lower(%1);stash essence of %lower(%1)}
#IF (%4 > 4) {#5 unstash good essence of %lower(%1);assemble essence of %lower(%1);stash essence of %lower(%1)}
#IF (%5 > 4) {#5 unstash average essence of %lower(%1);assemble essence of %lower(%1);stash essence of %lower(%1)}
#IF (%6 > 4) {#5 unstash poor essence of %lower(%1);assemble essence of %lower(%1);stash essence of %lower(%1)}
#IF (%7 > 4) {#5 unstash crude essence of %lower(%1);assemble essence of %lower(%1);stash essence of %lower(%1)}
#IF (%8 > 4) {#5 unstash worthless essence of %lower(%1);assemble essence of %lower(%1);stash essence of %lower(%1)}
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Fri Dec 15, 2017 3:37 am   
 
hrm for some reason it's not doing anything for me.
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Fri Dec 15, 2017 3:47 am   
 
use #show, and remove all but first %w and see if that captures then add back each section of capture till they all work.
it deffinetly works, just not elegant, and doesnt store info at all. it just snatches out ANY essence stack above 4, so if you had 15 of any kind of essence it would take spamming the script to work.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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