Parse ATCP
Posted: Fri Jan 18, 2013 5:14 am
The mud I'm currently using sends information to the user via atcp.
This is similar to how achaea sends information via gmcp.
After you set up the exchange, the information is live and you can set up event handlers for each variable.
A few examples are:
MSDPCHARACTER_NAME is your character's name
MSDPOPPONENT_HEALTH is your opponent's health
MSDPSTR for your strength stat
These variables can also be pulled from the atcp table via atcp.MSDPCHARACTER_NAME
My problem is that some of these variables are giant strings that need to be parsed.
An example being MSDPAFFECTS (Affects in this mud are kinda like afflictions in IRE games )
MSDPAFFECTS doesn't hold a single value, but multiple. And none of it is parsed!
I need to parse the information in this variable so that I can use it in an event handler like the rest.
Here's what a few of the variables look like:
As you can see, variables like the room name and damage roll are simple. But the MSDPAFFECTS variable needs to be broken up.
I was given the following code taken from a Godwars user that parses the information succesfully and then utilizes it in a UI. I can't figure out how to adapt this to my own scripting:
This is similar to how achaea sends information via gmcp.
After you set up the exchange, the information is live and you can set up event handlers for each variable.
A few examples are:
MSDPCHARACTER_NAME is your character's name
MSDPOPPONENT_HEALTH is your opponent's health
MSDPSTR for your strength stat
These variables can also be pulled from the atcp table via atcp.MSDPCHARACTER_NAME
My problem is that some of these variables are giant strings that need to be parsed.
An example being MSDPAFFECTS (Affects in this mud are kinda like afflictions in IRE games )
MSDPAFFECTS doesn't hold a single value, but multiple. And none of it is parsed!
I need to parse the information in this variable so that I can use it in an event handler like the rest.
Here's what a few of the variables look like:
As you can see, variables like the room name and damage roll are simple. But the MSDPAFFECTS variable needs to be broken up.
I was given the following code taken from a Godwars user that parses the information succesfully and then utilizes it in a UI. I can't figure out how to adapt this to my own scripting:
Help?