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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  trying to make atcp2 plugin to work
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

trying to make atcp2 plugin to work

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2 3  4  5  6  7  8  9  

Posted by Maxhrk   USA  (76 posts)  [Biography] bio
Date Reply #15 on Wed 30 Jun 2010 05:56 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 05:58 PM (UTC) by Maxhrk

Message
meh... that gmcp-doc from iron realm vanished or moved somewhere. I better looking for it(made me wish i should saved it somewhere on my computer!)

EDIT: nevermind, I got a cached version of gmcp-doc from google. Good thing(tm)
[Go to top] top

Posted by Maxhrk   USA  (76 posts)  [Biography] bio
Date Reply #16 on Wed 30 Jun 2010 09:55 PM (UTC)  quote  ]
Message
Okay, i have updated the GMCP plugin, here the link to download this files:


http://www.mediafire.com/file/e0mitudtzyh/gmcp.plugin.zip



Please remember as this plugin is currently in beta stage since i have few bugs to fix.. however, it is mostly good to go anyway! A example file can be found in "test_client.lua" file. That show the example how to listen to GMCP plugin(PPI required!).finally, a document regards about information on GMCP is under the document folder within zipfile.


Let me know if I am missing anything, post in this thread please. THANKS!
:)
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #17 on Wed 30 Jun 2010 10:40 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 10:56 PM (UTC) by Twisol

Message
I'm taking a peek at it right now. First thing I suggest, though, is changing GMCP_RGM.xml to plugin.xml. It's a bit more future-proof if every plugin has a plugin.xml, since you can have automated tools that go through any *.plugin/ folder to look for the plugin.xml. Otherwise you might (and do, I notice) have other *.xml files in the plugin, and it wouldn't be able to tell which one to use.


Minor nit for the test thingy: You can use require("tprint") instead of require("libraries.tprint"). It'll automatically look in the *.plugin/libraries/ folder first thanks to Plugger, and as a bonus it'll fall back to MUSHclient/lua/ if it doesn't find it there first. Since tprint comes pretty standard with MUSHclient, you could remove it from your libraries/ folder if you wanted.


EDIT: Hmm, interesting. Why did you copy libraries/plugger.xml into GMCP_RGM.xml? You can use an <include> tag to include Plugger, which would automatically call require("scripts.main") for you. (Which is another thing. Why is main.lua in the root plugin folder instead of scripts/main.lua? I mean, hey, if this is all working that's great. I'm just curious.)

EDIT 2: You can't use ReloadPlugin() to reload the calling plugin:

Documentation said:
However, a plugin cannot reload itself. That would mean the script was deleted out from under itself.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Maxhrk   USA  (76 posts)  [Biography] bio
Date Reply #18 on Wed 30 Jun 2010 11:12 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:18 PM (UTC) by Maxhrk

Message
Quote:

EDIT: Hmm, interesting. Why did you copy libraries/plugger.xml into GMCP_RGM.xml? You can use an <include> tag to include Plugger, which would automatically call require("scripts.main") for you. (Which is another thing. Why is main.lua in the root plugin folder instead of scripts/main.lua? I mean, hey, if this is all working that's great. I'm just curious.)


I have a problem with unused tag, '$PLUGINDIR', a given error by mushclient. so that why i am forced to temporarily included the code of it to GMCP_RGM.xml. only temporarily solution until i find out why that tag don't work for me on my client. I assumed it might have worked for you somehow.

<include name="$PLUGINDIR\libraries\plugger.xml" />


EDIT:
Quote:

Minor nit for the test thingy: You can use require("tprint") instead of require("libraries.tprint"). It'll automatically look in the *.plugin/libraries/ folder first thanks to Plugger, and as a bonus it'll fall back to MUSHclient/lua/ if it doesn't find it there first. Since tprint comes pretty standard with MUSHclient, you could remove it from your libraries/ folder if you wanted.


duly noted, however, tprint wont work when i tried to require tprint from mushclient folder. so, that why i moved it to my gmcp's library folder. Furthermore, my GMCP plugin directory is outside the realm of mushclient directory and that is probably reason why it wont work. (I think).

Quote:


I'm taking a peek at it right now. First thing I suggest, though, is changing GMCP_RGM.xml to plugin.xml. It's a bit more future-proof if every plugin has a plugin.xml, since you can have automated tools that go through any *.plugin/ folder to look for the plugin.xml. Otherwise you might (and do, I notice) have other *.xml files in the plugin, and it wouldn't be able to tell which one to use.

good point, i will rename it then. I will try to upload this GMCP plugin to Github. Eventually.
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #19 on Wed 30 Jun 2010 11:18 PM (UTC)  quote  ]
Message
Huh. What version of MUSHclient are you using, and what error does it give you? Also, do any of my plugins have that issue? They all use Plugger, too.

I just moved some stuff around and added the Plugger include tag back in, and it installed fine. (The plugin also works fine, so kudos there too! Haven't had a chance to muck with it more though.)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #20 on Wed 30 Jun 2010 11:20 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:22 PM (UTC) by Twisol

Message
Maxhrk said:
EDIT:
Quote:

Minor nit for the test thingy: You can use require("tprint") instead of require("libraries.tprint"). It'll automatically look in the *.plugin/libraries/ folder first thanks to Plugger, and as a bonus it'll fall back to MUSHclient/lua/ if it doesn't find it there first. Since tprint comes pretty standard with MUSHclient, you could remove it from your libraries/ folder if you wanted.


duly noted, however, tprint wont work when i tried to require tprint from mushclient folder. so, that why i moved it to my gmcp's library folder. Furthermore, my GMCP plugin directory is outside the realm of mushclient directory and that is probably reason why it wont work. (I think).

Hm. Probably not, I'm pretty sure MUSHclient sets the default require() paths to be relative to the MUSHclient executable. Interesting, though.

Maxhrk said:
Quote:


I'm taking a peek at it right now. First thing I suggest, though, is changing GMCP_RGM.xml to plugin.xml. It's a bit more future-proof if every plugin has a plugin.xml, since you can have automated tools that go through any *.plugin/ folder to look for the plugin.xml. Otherwise you might (and do, I notice) have other *.xml files in the plugin, and it wouldn't be able to tell which one to use.

good point, i will rename it then. I will try to upload this GMCP plugin to Github. Eventually.


Awesome! I was going to suggest that. :)


EDIT: Do you mind if I mess around with the plugin's internals a bit and send you what I change?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Maxhrk   USA  (76 posts)  [Biography] bio
Date Reply #21 on Wed 30 Jun 2010 11:24 PM (UTC)  quote  ]
Message
go ahead.
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #22 on Wed 30 Jun 2010 11:29 PM (UTC)  quote  ]
Message
Very minor nit, but I've seen it said in several places that Lua is generally indented with 2 spaces instead of tabs. Generally I have to agree, especially since Notepad expands the things to 8 spaces, which is like whooooooooa. *laughs*

I don't honestly expect you to change your habits on my whim, but I thought I'd point it out. :)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Maxhrk   USA  (76 posts)  [Biography] bio
Date Reply #23 on Wed 30 Jun 2010 11:38 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:42 PM (UTC) by Maxhrk

Message
heh. :) i am using Notepad++ at the moment, i will look into the config about that one.

okay, now that i have created repo of gmcp.plugin and it is now available at GITHUB:


http://github.com/druuimai/gmcp.plugin


cheer.

EDIT: for some reason the include tag now worked... weird anyhow. it could be my computer teasing me, mushclient teasing me, or a devilishly imp trying to mess with me. :p
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #24 on Wed 30 Jun 2010 11:41 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:43 PM (UTC) by Twisol

Message
I found a protocol issue. It apparently works, but strictly speaking it's breaking the spec. There are to be no spaces immediately after IAC SB GMCP, or immediately before IAC SE. You have spaces on both sides of the Core.Hello and Core.Supports.Set messages in OnPluginTelnetRequest.

Another issue is that you have MUSHclient's version hardcoded in the Core.Hello message. You can use Version() to get the current version.

Maxhrk said:
okay, now that i have created repo of gmcp.plugin and it is now available at GITHUB:

http://github.com/druuimai/gmcp.plugin


Awesome. :)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Maxhrk   USA  (76 posts)  [Biography] bio
Date Reply #25 on Wed 30 Jun 2010 11:43 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:51 PM (UTC) by Maxhrk

Message
Twisol said:

I found a protocol issue. It apparently works, but strictly speaking it's breaking the spec. There are to be no spaces immediately after IAC SB GMCP, or immediately before IAC SE. You have spaces on both sides of the Core.Hello and Core.Supports.Set messages in OnPluginTelnetRequest.

Another issue is that you have MUSHclient's version hardcoded in the Core.Hello message. You can use Version() to get the current version.

Maxhrk said:
okay, now that i have created repo of gmcp.plugin and it is now available at GITHUB:

http://github.com/druuimai/gmcp.plugin


Awesome. :)


fixing.

EDIT: can you elaborate on by your example. I may be confused a bit by your explanation. For instance, you say that there are to be no spaces immediately after IAC SB GMCP. I see no problem in the code unless you are implying that i am to add '\n' after that?

Quote:

I found a protocol issue. It apparently works, but strictly speaking it's breaking the spec. There are to be no spaces immediately after IAC SB GMCP, or immediately before IAC SE. You have spaces on both sides of the Core.Hello and Core.Supports.Set messages in OnPluginTelnetRequest.

[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #26 on Wed 30 Jun 2010 11:49 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:52 PM (UTC) by Twisol

Message
You've got a function UnListen, but the PPI.Expose call is referring to Unlisten (lowecase L). Personally, I prefer the lowercased name, but either way, it's not getting exposed.


Oh, and you can change all this:

PPI.Expose("Listen", function (info, callback) Listen(info, callback) end)
PPI.Expose("Unlisten", function(info) Unlisten(info) end)
PPI.Expose("UnListenAll", function(PluginIDx) UnListenAll(PluginIDx) end)


To this:

PPI.Expose("Listen", Listen)
PPI.Expose("Unlisten", Unlisten)
PPI.Expose("UnlistenAll", UnlistenAll)


No need for an intermediary function, since all you're doing is calling it yourself with the same arguments. Just pass the function itself. (I changed the lowercase things in that snippet, so careful with copying.)


EDIT: I'm not sure we need an ATTEMPTED variable either. If the server asks you, you should respond. Also, MUSHclient handles negotiation loops so we don't have to.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Maxhrk   USA  (76 posts)  [Biography] bio
Date Reply #27 on Wed 30 Jun 2010 11:53 PM (UTC)  quote  ]
Message
Twisol said:

You've got a function UnListen, but the PPI.Expose call is referring to Unlisten (lowecase L). Personally, I prefer the lowercased name, but either way, it's not getting exposed.


Oh, and you can change all this:

PPI.Expose("Listen", function (info, callback) Listen(info, callback) end)
PPI.Expose("Unlisten", function(info) Unlisten(info) end)
PPI.Expose("UnListenAll", function(PluginIDx) UnListenAll(PluginIDx) end)


To this:

PPI.Expose("Listen", Listen)
PPI.Expose("Unlisten", Unlisten)
PPI.Expose("UnlistenAll", UnlistenAll)


No need for an intermediary function, since all you're doing is calling it yourself with the same arguments. Just pass the function itself. (I changed the lowercase things in that snippet, so careful with copying.)


okay thanks for a tip.. By the way, I have edited my previous post if you havent seen it changed that i have raised a question regarding your protocol problem.
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #28 on Wed 30 Jun 2010 11:55 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:57 PM (UTC) by Twisol

Message
Maxhrk said:
EDIT: can you elaborate on by your example. I may be confused a bit by your explanation. For instance, you say that there are to be no spaces immediately after IAC SB GMCP. I see no problem in the code unless you are implying that i am to add '\n' after that?


Lets assume IAC = 1, SB = 2, GMCP = 3, and SE = 4. This is what you have:
123 Message.Name {Content} 14


This is what you're supposed to have:
123Message.Name {Content}14



EDIT: In the code, this:
[[ Core.Hello { "client" : "Mushclient", "version": "4.51"} ]]


Should be this:
[[Core.Hello { "client" : "Mushclient", "version": "4.51"}]]


Otherwise you're adding spaces before and after inside the long string.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #29 on Wed 30 Jun 2010 11:58 PM (UTC)  quote  ]

Amended on Wed 30 Jun 2010 11:59 PM (UTC) by Twisol

Message
Personally, though, I just added this function so it's handled in one single place.

function SendGMCP(message, content)
  SendPkt(codes.IAC_SB_GMCP .. json.encode(content) .. codes.IAC_SE)
end


(I took the codes table from my ATCP plugin and dropped it into this one, as you can see.)

I use it like:

SendGMCP("Core.Hello", {client="MUSHclient", version=Version()})



Still untested as of this post, but I'll be testing it shortly.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[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.


42,050 views.

This is page 2, subject is 9 pages long:  [Previous page]  1  2 3  4  5  6  7  8  9  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [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.

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]