Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
 Entire forum ➜ MUSHclient ➜ Plugins ➜ GMCP Group module for aardwolf

GMCP Group module for aardwolf

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


Posted by Khannon   (32 posts)  Bio
Date Tue 11 Feb 2020 04:01 PM (UTC)
Message
I'm trying to draw members from the group to be used in wildcards in other functions, but I'm not sure how to achieve that.


function OnPluginBroadcast (msg, id, name, text)
    if id == "3e7dedbe37e44942dd46d264" then 

        if (text == "group") then
            res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","group")
		
        end
    end
end

function mobCount2 (name, line, wildcards)
	
	if wildcards[2] == "members" then
        mobCounter = mobCounter + 1
    end
end
Top

Posted by Khannon   (32 posts)  Bio
Date Reply #1 on Tue 11 Feb 2020 04:11 PM (UTC)
Message
Good lord, I thought saving message doesn't actually 'post' message I'm sorry for duplicates if you could remove duplicates... that would be great. Clearly I'm not succeeding at anything today.
Top

Posted by Teclab85   (16 posts)  Bio
Date Reply #2 on Tue 11 Feb 2020 04:59 PM (UTC)
Message

group_data = 0
function OnPluginBroadcast (msg, id, name, text)
    if id == "3e7dedbe37e44942dd46d264" then 

        if (text == "group") then
            res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","group")
		luastmt = "data = " .. gmcparg --- Convert the serialized string back into a lua table.
        assert (loadstring (luastmt or "")) ()
        
        group_data = data -- This is the 'Global' that you need to fill
        end
    end
end

function mobCount2 (name, line, wildcards)
	local group_data = group_data
        -- Hand waving to get a concise list of names from the group_data table
        -- need to do some iteration, something like the following
        for _,name in ipairs(modified_group_data) do
          --compare them
          if wildcards[2] == name then
            print("Matched")
            mobCounter = mobCounter + 1
          else
            print("No Match")
          end
        end
--	if wildcards[2] == "members" then
--        mobCounter = mobCounter + 1
    end
end


This should help you out with the syntax. Mind you this was written hasitly and might have its own flaws. The important parts that you were missing were getting the data out of the gmcpval call. Now that you know how to put the data into a table, via the loadstring statement, you should be able to continue developing. I would suggest that you read the following.

http://www.aardwolf.com/wiki/index.php/Clients/MushclientGMCP

http://www.aardwolf.com/wiki/index.php/Clients/GMCP


As I have told you on Aardwolf. Please read and understand these.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #3 on Tue 11 Feb 2020 11:35 PM (UTC)

Amended on Tue 11 Feb 2020 11:37 PM (UTC) by Fiendish

Message
Quote:
I would suggest that you read the following.

http://www.aardwolf.com/wiki/index.php/Clients/MushclientGMCP

If you're using the Aardwolf MUSHclient Package, then you really need to be reading https://github.com/fiendish/aardwolfclientpackage/wiki/Using-GMCP and *not* the Aardwolf wiki page, just like it says right at the top of the Aardwolf wiki page.

https://github.com/fiendish/aardwolfclientpackage
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.


12,067 views.

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

Go to topic:           Search the forum


[Go to top] top

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