Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ Using COM to pull map data from CMUD.
Using COM to pull map data from CMUD.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Falgor
(36 posts) Bio
|
Date
| Thu 08 Oct 2015 10:35 PM (UTC) |
Message
| Hi,
MUSHclient was my first client, the only reason I left it was because of zmUDs/CMUDs map, I want to test out pulling map data from CMUD's map to use in MUSH.
I'm trying to get my head around Lua Com Objects, I know both MUSH and CMUD support com.
How would I go about communicating from MUSH to CMUD? I can work on the rest from there.
Where do I put the lua script? I've tried messing around with holding it in an alias, but to no avial so far.
Thanks in advance. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 09 Oct 2015 05:50 AM (UTC) |
Message
| |
Posted by
| Falgor
(36 posts) Bio
|
Date
| Reply #2 on Fri 09 Oct 2015 12:44 PM (UTC) |
Message
| I can communicate from MUSH to CMUD okay, but I can't find any of the documentation for MUSHclients com functions. I basically want to be able to send a string from CMUD to MUSHclient.
I've tried:
require "luacom"
cmud = luacom.CreateObject("MUSHclient.Application")
But I'm failing at even that first hurdle! | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #3 on Sat 10 Oct 2015 02:29 AM (UTC) |
Message
| You are not intended to create an instance of MUSHclient from within it. The link I have shows creating instances of other objects. Can you find how CMud stores the map? Or export it somehow? That might be easier.
And it also might be quicker just to re-map with the MUSHclient mapper. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Falgor
(36 posts) Bio
|
Date
| Reply #4 on Sun 11 Oct 2015 06:50 PM (UTC) |
Message
| I did try with the MUSHclient mapper (I play T2T, which your post is based on). But there are so many weird room exits and structures that I think it'll be a pretty impossible task. | Top |
|
Posted by
| Falgor
(36 posts) Bio
|
Date
| Reply #5 on Sun 11 Oct 2015 06:55 PM (UTC) |
Message
| This is what I'm trying to do, order CMUD to work out directions from A to B, which saves that data in a variable. Then grab the data from that variable for use in MUSH, once I can do this the rest is a easy peasy.
require("luacom")
require("luacom5")
cmud = luacom.CreateObject("cMUD.Application")
cmud.CurrentSession:ProcessCommand("getdirections")
var = cmud.CurrentSession:GetVar("test")
print(var)
What is currently happening when I print is I just get:
table: 046C0178
table: 046C0420
table: 046C06C8
table: 046C0970
table: 046C10A0
table: 046C0FB0
table: 046C1618
table: 046C18C0
Table is random each time. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #6 on Sun 11 Oct 2015 07:41 PM (UTC) |
Message
| Looks like you might be close. Try printing that table:
require "tprint"
tprint (var)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Falgor
(36 posts) Bio
|
Date
| Reply #7 on Sun 11 Oct 2015 08:10 PM (UTC) |
Message
| Same again, just a different format for randomness :)
I'm trying to get your mapper up and running again. I've tweaked the roomdesc/exits wildcards and have them triggering fine and grabbing the right data on a normal trigger, when I add it all into the mapper.xml it isn't working though. | Top |
|
Posted by
| Falgor
(36 posts) Bio
|
Date
| Reply #8 on Sun 11 Oct 2015 08:13 PM (UTC) |
Message
| The brief mode on T2T is a lot simpler for movement:
The Adornas Road(e, n, w and s)
Merchant is riding a brown horse
A brown horse
HP:140 EP:140 >
So I've tweaked the trigger too:
<triggers>
<trigger
enabled="y"
match="^(?P<roomdesc>.*)\((?P<exits>.*)\)$"
multi_line="n"
regexp="y"
script="process_room_description"
sequence="100"
>
</trigger>
</triggers>
The match as a normal trigger works fine (I've sent the wildcards to output to test what it captures). But not working when I modified the plugin, I guess the later stages aren't ready to receive wildcards in that format. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #9 on Mon 12 Oct 2015 08:12 PM (UTC) |
Message
| I'm not sure what you mean by that. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
27,387 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top