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
glister
Beginner


Joined: 06 Mar 2014
Posts: 12

PostPosted: Sat Dec 28, 2019 7:15 am   

Trigger on raw Telenet
 
So in the debugger I have this beautifully formatted text:
Code:
1.1958 | <IAC><SB><69><1>MOVEMENT<2>929<IAC><SE>

And it seems like I could use Regex to easily capture what I want from this string. This string is not making to the main window however. and if I user a telent trigger to grab it I get:
Code:
MOVEMENT929

Worse when its a longer string it doesn't even have the  it just strings them together without any separator . (See example below)

My question then becomes is there a way I can just trigger on the raw text? I see that it is being sent to the debug window beautifully why can't we just trigger off of that text?

I tried searching for this sorry if I'm just doing something dumb.

I also already realize that I can use a telnet trigger to grab this. However I'm still getting back MSDPVARS that are like:
Code:
NAMEDarthalomusLEVEL12IS_LEADER1HEALTH145HEALTH_MAX145MOVEMENT940MOVEMENT_MAX940
and when piped to the main window come back as:
Code:
NAMEDarthalomusLEVEL12IS_LEADER1HEALTH145HEALTH_MAX145MOVEMENT930MOVEMENT_MAX940

I suppose I could break down and manually code out for every MSDPVAR name but I would really like to just recursively pull these out.

Any help would be greatly appreciated.
Reply with quote
glister
Beginner


Joined: 06 Mar 2014
Posts: 12

PostPosted: Sat Dec 28, 2019 8:31 pm   
 
So I noticed in the debugger that the text that I want to trigger on is being sent from the mud but has the i not the a. Is this indicating that CMUD is seeing this as input? And is that why I can't trigger on it?


Code:
0.9164 | i  Luminari <<IAC><SB><69><1>AFFECTS<2><3><1>AFFECTED_BY<2><5><2><3><1>NAME<2>Mode-PowerAttack<1>DESC<2>You sacrifice accuracy to inflict more damage in battle.<4><6><1>SPELL_LIKE_AFFECTS<2><5><6><4><IAC><SE><IAC><SB><69><1>ACTIONS<2><3><1>STANDARD_ACTION<2>1<1>MOVE_ACTION<2>1<1>SWIFT_ACTION<2>1<4><IAC><SE><IAC><SB><69><1>CHARACTER_NAME<2>Darthalomus<IAC><SE><IAC><SB><69><1>SERVER_ID<2><IAC><SE><IAC><SB><69><1>SERVER_TIME<2>0<IAC><SE><IAC><SB><69><1>SNIPPET_VERSION<2>8<IAC><SE><IAC><SB><69><1>INVENTORY<2><5><2><3><1>LOCATION<2>Used as light<1>NAME<2>a magical torch (illuminating)<4><2><3><1>LOCATION<2>Worn on right finger<1>NAME<2>Smurfette's bracelet<4><2><3><1>LOCATION<2>Worn on left finger<1>NAME<2>a silver ring<4><2><3><1>LOCATION<2>First worn around Neck<1>NAME<2>a wooden orthodox Elcardorian cross<4><2><3><1>LOCATION<2>Second worn around Neck<1>NAME<2>a fancy cape<4><2><3><1>LOCATION<2>Worn on body<1>NAME<2>a full plate armor (masterwork)<4><2><3><1>LOCATION<2>Worn on head<1>NAME<2>a full plate helm (masterwork)<4><2><3><1>LOCATION<2>Worn on legs<1>NAME<2>a full plate leggings (masterwork)<4><2><3><1>LOCATION<2>Worn on feet<1>NAME<2>a pair of oaken boots<4><2><3><1>LOCATION<2>Worn on hands<1>NAME<2>a pair of iron gauntlets<4><2><3><1>LOCATION<2>Worn on arms<1>NAME<2>a full plate sleeves (masterwork)<4><2><3><1>LOCATION<2>Worn as shield<1>NAME<2>a tower shield (masterwork)<4><2><3><1>LOCATION<2>Worn about body<1>NAME<2>a leather backpack<4><2><3><1>LOCATION<2>Worn around waist<1>NAME<2>a belt of the ancients<4><2><3><1>LOCATION<2>Worn around right wrist<1>NAME<2>a minotaur's nosering<4><2><3><1>LOCATION<2>Wielded<1>NAME<2>Erenar, the Sword of Flames<4><2><3><1>LOCATION<2>Worn as ammo pouch<1>NAME<2>a small leather quiver<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>the mosswood gate key<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a rolled up letter<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a small rusty key<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a map of Ashenport<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a dwarven axe<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a silver scabbard<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>the axe of severance<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a purse<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a key to the training chambers<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a pair of steel full plate leggings<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>an orcish potion of remove poison<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>an orcish potion of remove curse<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a pair of elaborate cyan boots<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a suit of white wool robe<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a finely-made wood dart with a barbed tip<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a map of the dwarven mines<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a scroll of 'greater invisibility'<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>a small raft<4><2><3><1>LOCATION<2>Inventory<1>NAME<2>the teleporter<4><6><IAC><SE><IAC><SB><69><1>ALIGNMENT<2>32<IAC><SE><IAC><SB><69><1>EXPERIENCE<2>1227888<IAC><SE><IAC><SB><69><1>EXPERIENCE_MAX<2>326500<IAC><SE><IAC><SB><69><1>EXPERIENCE_TNL<2>248112<IAC><SE><IAC><SB><69><1>HEALTH<2>145<IAC><SE><IAC><SB><69><1>HEALTH_MAX<2>145<IAC><SE><IAC><SB><69><1>LEVEL<2>12<IAC><SE><IAC><SB><69><1>RACE<2>Dwarf<IAC><SE><IAC><SB><69><1>CLASS<2>warrior<IAC><SE><IAC><SB><69><1>PSP<2>0<IAC><SE><IAC><SB><69><1>PSP_MAX<2>0<IAC><SE><IAC><SB><69><1>WIMPY<2>30<IAC><SE><IAC><SB><69><1>PRACTICE<2>0<IAC><SE><IAC><SB><69><1>MONEY<2>14479<IAC><SE><IAC><SB><69><1>MOVEMENT<2>940<IAC><SE><IAC><SB><69><1>MOVEMENT_MAX<2>940<IAC><SE><IAC><SB><69><1>ATTACK_BONUS<2>20<IAC><SE><IAC><SB><69><1>DAMAGE_BONUS<2>0<IAC><SE><IAC><SB><69><1>AC<2>30<IAC><SE><IAC><SB><69><1>STR<2>20<IAC><SE><IAC><SB><69><1>INT<2>17<IAC><SE><IAC><SB><69><1>WIS<2>11<IAC><SE><IAC><SB><69><1>DEX<2>15<IAC><SE><IAC><SB><69><1>CON<2>14<IAC><SE><IAC><SB><69><1>CHA<2>8<IAC><SE><IAC><SB><69><1>STR_PERM<2>0<IAC><SE><IAC><SB><69><1>INT_PERM<2>0<IAC><SE><IAC><SB><69><1>WIS_PERM<2>0<IAC><SE><IAC><SB><69><1>DEX_PERM<2>0<IAC><SE><IAC><SB><69><1>CON_PERM<2>0<IAC><SE><IAC><SB><69><1>CHA_PERM<2>0<IAC><SE><IAC><SB><69><1>STANDARD_ACTION<2>1<IAC><SE><IAC><SB><69><1>MOVE_ACTION<2>1<IAC><SE><IAC><SB><69><1>SWIFT_ACTION<2>1<IAC><SE><IAC><SB><69><1>GROUP<2><5><2><3><1>NAME<2>Darthalomus<1>LEVEL<2>12<1>IS_LEADER<2>1<1>HEALTH<2>145<1>HEALTH_MAX<2>145<1>MOVEMENT<2>940<1>MOVEMENT_MAX<2>940<4><6><IAC><SE><IAC><SB><69><1>OPPONENT_HEALTH<2>0<IAC><SE><IAC><SB><69><1>OPPONENT_HEALTH_MAX<2>0<IAC><SE><IAC><SB><69><1>OPPONENT_LEVEL<2>0<IAC><SE><IAC><SB><69><1>OPPONENT_NAME<2><IAC><SE><IAC><SB><69><1>TANK_NAME<2><IAC><SE><IAC><SB><69><1>TANK_HEALTH<2>0<IAC><SE><IAC><SB><69><1>TANK_HEALTH_MAX<2>0<IAC><SE><IAC><SB><69><1>ROOM<2><3><1>VNUM<2>145308<1>NAME<2>Stanfeld's Armor and Shields<1>AREA<2>Mosswood<1>ENVIRONMENT<2>Room<1>COORDS<2><3><1>X<2>0<1>Y<2>0<1>Z<2>0<4><1>TERRAIN<2>Inside<1>EXITS<2><3><1>west<2>145201<4><4><IAC><SE><IAC><SB><69><1>AREA_NAME<2>Mosswood<IAC><SE><IAC><SB><69><1>ROOM_EXITS<2><3><1>west<2>145201<4><IAC><SE><IAC><SB><69><1>ROOM_NAME<2><ESC>[38;5;051mStanfeld's Armor and Shields<ESC>[0;00m<IAC><SE><IAC><SB><69><1>ROOM_VNUM<2>145308<IAC><SE><IAC><SB><69><1>WORLD_TIME<2>0<IAC><SE><IAC><SB><69><1>SECTORS<2><3><1>west<2>145201<1>Inside<2>0<1>City<2>1<1>Field<2>2<1>Forest<2>3<1>Hills<2>4<1>Low Mountains<2>5<1>Water (Swim)<2>6<1>Water (No Swim)<2>7<1>In Flight<2>8<1>Underwater<2>9<1>Zone Entrance<2>10<1>Road North-South<2>11<1>Road East-West<2>12<1>Road Intersection<2>13<1>Desert<2>14<1>Ocean<2>15<1>Marshland<2>16<1>High Mountains<2>17<1>Outer Planes<2>18<1>Underdark - Wild<2>19<1>Underdark - City<2>20<1>Underdark - Inside<2>21<1>Underdark - Water (Swim)<2>22<1>Underdark - Water (No Swim)<2>23<1>Underdark - In Flight<2>24<1>Lava<2>25<1>Dirt Road North-South<2>26<1>Dirt Road East-West<2>27<1>Dirt Road Intersection<2>28<1>Cave<2>29<1>Jungle<2>30<1>Tundra<2>31<1>Taiga<2>32<1>Beach<2>33<4><IAC><SE><IAC><SB><69><1>MINIMAP<2><IAC><SE><IAC><SB><69><1>CLIENT_ID<2>CMUD<IAC><SE><IAC><SB><69><1>CLIENT_VERSION<2>3.34<IAC><SE><IAC><SB><69><1>PLUGIN_ID<2>Unknown<IAC><SE><IAC><SB><69><1>ANSI_COLORS<2>1<IAC><SE><IAC><SB><69><1>XTERM_256_COLORS<2>1<IAC><SE><IAC><SB><69><1>UTF_8<2>0<IAC><SE><IAC><SB><69><1>SOUND<2>0<IAC><SE><IAC><SB><69><1>MXP<2>1<IAC><SE>
Reply with quote
shalimar
GURU


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

PostPosted: Sun Dec 29, 2019 12:03 am   
 
So long as you have a trigger that fires, that is fine.
Even if it is super general and just firing off one of the square boxes, you can theoreticaaly parse it all out from %line
Make liberal use of %replace to get rid of common phrases/characters that don't matter, or to insert colons and pipes to make for easily understood #LOCAL $vars.
Then use %match to set the variables you will actually be using.

As to the 'i vs a' thing, I am not sure. It could just as easily mean invisible
_________________
Discord: Shalimarwildcat
Reply with quote
glister
Beginner


Joined: 06 Mar 2014
Posts: 12

PostPosted: Mon Dec 30, 2019 8:09 am   Telnet 69 MSDP lessons learned
 
Okay, I thought I would follow up on this in case anyone else runs int a similar issue.

What I discovered is that in the debugger for the telnet 69 entries there is a one to one correlation of the MSDP tags and the mating hexadecimal values.
In other word <1> can be matched using x01 and <2> is x02 and 3 is x03 and so on.

So this means you can match on the pattern using hex pattern recognition. I created a telnet 69 trigger and used regex for the pattern matching.

The main trigger is below. I used this as the main one as the majority 54/65 MSDP tags on the game I was playing use the followin format <1>VarName<2>VarValue
^[\x01]([a-z,_]+)[\x02]([a-z,0-9,\s]+)

With the following script text
Code:
#VAR %1 ""
#ADDKEY %1 %2 %3


For any MSPD Vars that are more complex lists list the above pattern wont match them correctly. as they tend to have a pattern like <1>ListName<2><5><2><3><1>VarName<2>Value and often times the VarName in this list is the same and will require extra finesse to get them out.

Just to provide and example of a quick on I pulled for groups.
Text from mud on the telnet 69 entry: <1>GROUP<2><5><2><3><1>NAME<2>Darthalomus<1>LEVEL<2>12<1>IS_LEADER<2>1<1>HEALTH<2>145<1>HEALTH_MAX<2>145<1>MOVEMENT<2>940<1>MOVEMENT_MAX<2>940<4><6><IAC><SE>

Pattern and trigger info: This is a telnet 69 trigger type with regex and the repeat within line option enabled
NAME[\x02]([a-z," "]+)[\x01]LEVEL[\x02](\d+)[\x01]IS_LEADER[\x02](\d)[\x01]health[\x02](\d+)[\x01]Health_Max[\x02](\d+)[\x01]movement[\x02](\d+)[\x01]movement_max[\x02](\d+)

Code:
#WIN Group %1 HP: %4/%5   MV: %6



Hopefully this helps. Feel free to hit me up I would love to figure out some other ways to parse the sub lists. I'm also happy to help to the degree that I can.
Reply with quote
glister
Beginner


Joined: 06 Mar 2014
Posts: 12

PostPosted: Tue Dec 31, 2019 8:08 pm   MSDP Intialization
 
So I put this together this will initialize MSDP on any mud and setup reporting for every available msdpvar
Code:
<class name="Initialize" id="209">
  <trigger type="Telnet" param="69" priority="10" regex="true" id="208">
    <pattern>[\x01]REPORTABLE_VARIABLES[\x02][\x05][\x02]</pattern>
    <value>#T+ BeginInit

</value>
  </trigger>
  <trigger name="BeginInit" type="Telnet" param="69" priority="11" repeat="true" regex="true" enabled="false" id="210">
    <pattern>[\x02]([a-z,_,\s]+)</pattern>
    <value>#SENDSB 69 %CHAR(1)REPORT%CHAR(2)%1
#T- BeginInit</value>
  </trigger>
  <alias name="LoadMSDP" id="211">
    <value>#sendsb 69 %CHAR(1)LIST%CHAR(2)REPORTABLE_VARIABLES
</value>
  </alias>
</class>


This one has two sets of triggers. The main ones parses through all of the msdp vars and maps them to variables. The second one puts all of the values of a sublist called group into a CMUD varaible database record. This can be used to capture content out of any custom lists that may be setup on your mud. Keep in mind you will need to modify this to work with the specific sublist.
Code:
<class name="Prod" id="189">
  <trigger name="Main" type="Telnet" param="69" priority="19" regex="true" newline="false" prompt="true" id="113">
    <pattern>^[\x01]([a-z,_]+)[\x02]([a-z,0-9,\s]+)</pattern>
    <value>#clr Combat</value>
  </trigger>
  <trigger name="Main2" type="Telnet" param="69" priority="20" regex="true" newline="false" prompt="true" id="195">
    <pattern>^[\x01]([a-z,_]+)[\x02]([a-z,0-9,\s]+)</pattern>
    <value>#VAR %1 %2

#Win Combat Tank: @Tank_Name
#Win Combat Enemy: @OPPONENT_NAME HP: @OPPONENT_HEALTH/@OPPONENT_Health_MAX</value>
  </trigger>
  <trigger type="Telnet" param="69" priority="1990" regex="true" id="199">
    <pattern>[\x01](GROUP)[\x02][\x05][\x02][\x03]</pattern>
    <value>CurMSDPTable = %1
#T+ GroupOpen
MSDPCounter = 1

</value>
  </trigger>
  <trigger name="GroupOpen" type="Telnet" param="69" priority="1991" repeat="true" regex="true" enabled="false" id="201">
    <pattern>[\x01]([a-z,_]+)[\x02]([a-z,0-9,\s]+)</pattern>
    <value>#ADDKEY @curMSDPTable @MSDPCounter {%1|%2}
MSDPCounter = @MSDPCounter + 1

#clr group
GroupSize = @MSDPCounter
#T+ GroupClose
</value>
  </trigger>
  <trigger name="GroupClose" type="Telnet" param="69" priority="1992" regex="true" enabled="false" id="202">
    <pattern>[\x01](GROUP)[\x02][\x05][\x02][\x03].*[\x04][\x06]</pattern>
    <value>//#say g2 activeated

//               NAME         

A = 1
#WHILE (@A < @GroupSize) {
#win Group @GROUP.@A.2 LvL:@GROUP.%eval(@A+1).2
#win Group HP:@GROUP.%eval(@A+3).2/@GROUP.%eval(@A+4).2 MV:@GROUP.%eval(@A+5).2;#ADD A 7}

//#win Group @GROUP.1.2 LvL:@GROUP.2.2 HP:@GROUP.4.2/@GROUP.5.2 MV:@GROUP.6.2

#T- GroupOpen
#T- GroupClose</value>
  </trigger>
</class>

Please note: The group triggers also have the syntax for pulling information out of the database variable. I'm pushing information to a windows named group. All of that isn't necessary however I left it here to have a great example of how it works.
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