Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Message
| You could try doing this:
Download the GMCP handler from Aardwolf:
http://www.aardwolf.com/wiki/index.php/Clients/MushclientGMCP
Copy two files as documented on that page:
- gmcphelper.lua to the "lua" directory in the MUSHclient installation
- GMCP_handler.xml to the "plugins" directory
Install the GMCP_handler into MUSHclient.
Close the world (if necessary) and reconnect.
You should see:
--- Connected on Tuesday, February 12, 2013, 10:45 AM ---
Enabling GMCP.
Rapture Runtime Environment v2.2.0 -- (c) 2012 -- Iron Realms Entertainment
Type:
Look around. You should see something like:
Char.Vitals { "hp": "340", "maxhp": "340", "mp": "334", "maxmp": "334", "ep": "600", "maxep": "600", "wp": "570", "maxwp": "570", "nl": "0", "bal": "1", "eq": "1", "string": "H:340/340 M:334/334 E:600/600 W:570/570 NL:0/100 " }
gmcpdata serialized: {
Char = {
Status = {
pk_level = "1 (0%)",
guild = "(None)",
bash_level = "1 (0%)",
towne = "(None)",
sect = "(None)",
name = "Haelanad",
city = "(None)",
prof = "(None)",
level = "1 (0.00%)",
quest_level = "1 (0%)",
fullname = "Haelanad",
},
Vitals = {
wp = "570",
eq = "1",
ep = "600",
maxhp = "340",
hp = "340",
nl = "0",
maxep = "600",
maxmp = "334",
mp = "334",
maxwp = "570",
bal = "1",
string = "H:340/340 M:334/334 E:600/600 W:570/570 NL:0/100 ",
},
StatusVars = {
pk_level = "PK level",
guild = "Guild",
bash_level = "Bashing level",
towne = "Towne",
sect = "Cult/Sect",
name = "Name",
city = "City",
prof = "Prof",
level = "Overall level",
quest_level = "Questing level",
fullname = "Full name",
},
},
Room = {
Info = {
map = "www.imperian.com/irex/maps/clientmap.php?map=1&building=0&level=0 6 13",
num = "8465",
name = "The empty western square",
environment = "Urban",
details = {
},
coords = "1,-1,0,0",
exits = {
ne = "8472",
s = "8453",
e = "8463",
d = "8558",
w = "8477",
["in"] = "28383",
se = "8453",
sw = "8571",
n = "8472",
},
area = "the ruins of Caanae",
},
WrongDir = {
[1] = "n",
},
},
}
-
Now to do something useful with that. You can turn the debugging off:
In the Immediate window, enter:
res, gmcparg = CallPlugin ("3e7dedbe37e44942dd46d264","gmcpval","Char")
-- convert to Lua table
luastmt = "gmcpdata = " .. gmcparg
assert (loadstring (luastmt or "")) ()
-- display Lua table
tprint (gmcpdata)
print ("My HP are:", gmcpdata.Vitals.hp)
That calls the plugin, asking for the latest "Char" stats. We see in the output window:
"Status":
"pk_level"="1 (0%)"
"guild"="(None)"
"bash_level"="1 (0%)"
"towne"="(None)"
"sect"="(None)"
"name"="Haelanad"
"quest_level"="1 (0%)"
"prof"="(None)"
"level"="1 (0.00%)"
"city"="(None)"
"fullname"="Haelanad"
"Vitals":
"wp"="570"
"eq"="1"
"ep"="600"
"maxhp"="340"
"hp"="340"
"nl"="0"
"maxep"="600"
"maxmp"="334"
"mp"="334"
"maxwp"="570"
"string"="H:340/340 M:334/334 E:600/600 W:570/570 NL:0/100 "
"bal"="1"
"StatusVars":
"pk_level"="PK level"
"guild"="Guild"
"bash_level"="Bashing level"
"towne"="Towne"
"sect"="Cult/Sect"
"name"="Name"
"quest_level"="Questing level"
"prof"="Prof"
"level"="Overall level"
"city"="City"
"fullname"="Full name"
My HP are: 340
The last line shows how we pulled out our current HP from the table.
To get the room details:
res, gmcparg = CallPlugin ("3e7dedbe37e44942dd46d264","gmcpval","Room")
-- convert to Lua table
luastmt = "gmcpdata = " .. gmcparg
assert (loadstring (luastmt or "")) ()
-- display Lua table
tprint (gmcpdata)
print ("The current room is:", gmcpdata.Info.name)
Example output:
"Info":
"map"="www.imperian.com/irex/maps/clientmap.php?map=1&building=0&level=0 6 13"
"num"="8465"
"name"="The empty western square"
"environment"="Urban"
"details":
"coords"="1,-1,0,0"
"exits":
"ne"="8472"
"s"="8453"
"e"="8463"
"d"="8558"
"w"="8477"
"in"="28383"
"se"="8453"
"sw"="8571"
"n"="8472"
"area"="the ruins of Caanae"
"WrongDir":
1="n"
The current room is: The empty western square
You should be able to build on that to use this information usefully. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|