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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  advice on creating plugin with MSDP from scratch?

advice on creating plugin with MSDP from scratch?

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


Posted by George   (9 posts)  [Biography] bio
Date Thu 25 Aug 2011 02:54 PM (UTC)
Message
hi, I'm wondering what pointers and tips people have for people writing plugins using MSDP.

Currently I've based things off of KaVir's GW2 plugin, so the stripped down plugin looks like this:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, July 14, 2011, 10:33 PM -->
<!-- MuClient version 4.64 -->

<!-- Plugin "conquest" generated by Plugin Wizard -->

<muclient>
<plugin
   name="conquest"
   author="george"
   id="94bb7c5857d64917248618c6"
   language="lua"
   save_state="y"
   date_written="2011-07-14 22:32:18"
   requires="4.64"
   version="1.0"
   >

</plugin>


<!--  Get our standard constants -->

<include name="constants.lua"/>

<script>
<![CDATA[
--latest
local using_msdp = false
local msdp = {}
]]>

-- MSDP negotiation
local MSDP = 69

function OnPluginTelnetRequest (type, data)
  if type == MSDP and data == "WILL" then
    using_msdp = true
    return true
  else -- another protocol
    return false
  end -- if
end -- function OnPluginTelnetRequest

function OnPluginTelnetSubnegotiation (type, data)
  if type == MSDP then
    endpos=string.len(data)
    for i=endpos,1,-1 do
      if string.byte(data,i) == 1 then
        variable = string.sub(data,i+1,endpos)
        StoreVariable(variable, value)
        endpos = i-1
      elseif string.byte(data,i) == 2 then
        value = string.sub(data,i+1,endpos)
        endpos = i-1
      end -- if
    end -- for   
  end -- if
end -- function OnPluginTelnetSubnegotiation

</script>

</muclient>


The first thing I'd like to figure out is how people generally debug the MSDP packets sent by the mud; I watch the packet stream by selecting debug packets, but is there some other intermediate stream you can inspect or a way to create one so you can see the English translation of the MSDP negotiation and variables sent by the mud (hope that makes sense).
[Go to top] top

Posted by Chyort   USA  (58 posts)  [Biography] bio
Date Reply #1 on Fri 26 Aug 2011 06:47 AM (UTC)

Amended on Fri 26 Aug 2011 06:48 AM (UTC) by Chyort

Message
George said:

The first thing I'd like to figure out is how people generally debug the MSDP packets sent by the mud; I watch the packet stream by selecting debug packets, but is there some other intermediate stream you can inspect or a way to create one so you can see the English translation of the MSDP negotiation and variables sent by the mud (hope that makes sense).


Assuming i understand you right, I think this might help you.

http://clanscw.brinkster.net/godwars/topic.asp?TOPIC_ID=2522

KaVir has a simple plugin that notes the MSDP info.

Quote:

Note that all this does is display the data that's being sent back and forth - there are no energy bars etc. However it's really easy to add this to existing plugins to replace the trigger they usually use to capture text from the screen.


I recently started looking at MSDP, and what KaVir's plugin can do... But it all is Way beyond me at this point :P

I hope this helps.
[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.


11,500 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 HostDash]