Created
November 17, 2022 17:46
-
-
Save chosig/599966621c50a20ade4bdd68eacbeab3 to your computer and use it in GitHub Desktop.
This is the script I use in Mudlet to activate MSDP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Enable MSDP protocol | |
function enableMSDP() | |
-- Wait a second then try to enable MSDP | |
tempTimer(1, function() sendMSDP("LIST", "COMMANDS", "LISTS", "REPORTABLE_VARIABLES") end) | |
-- Wait 2 seconds then try to populate MSDP variables. | |
tempTimer(2, function() enableMSDPvariables() end) | |
cecho("<orange>MSDP ENABLED!<reset>") | |
end | |
function enableMSDPvariables() | |
-- If MSDP is ready, get variables reported, | |
-- else wait 1 second and try again. | |
if type(msdp.REPORTABLE_VARIABLES) == "table" then | |
for _,v in pairs(msdp.REPORTABLE_VARIABLES) do | |
sendMSDP("REPORT", v) | |
end | |
cecho("<orange> -- MSDP reporting enabled!") | |
else | |
tempTimer(1, function() enableMSDPvariables() end) | |
end | |
end | |
if event_enableMSDP then killAnonymousEventHandler(event_enableMSDP) end | |
event_enableMSDP = registerAnonymousEventHandler("sysConnectionEvent", enableMSDP) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And this is the event to populate HMS stuff from MSDP