[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Using COM to pull map data from CMUD.
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Using COM to pull map data from CMUD.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Falgor   (21 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 09 Oct 2015 05:50 AM (UTC)
Message
See: http://www.gammon.com.au/forum/?id=6022

Also: http://www.gammon.com.au/forum/?id=12628

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Falgor   (21 posts)  [Biography] 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!
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by Falgor   (21 posts)  [Biography] 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.
[Go to top] top

Posted by Falgor   (21 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by Falgor   (21 posts)  [Biography] 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.
[Go to top] top

Posted by Falgor   (21 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] 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.


4,098 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]