
The below functions (table.save, table.load) can be used to save individual Lua tables to disc and load It saves the contents of _saveTable into a file for persistence. This function should primarily be used by Mudlet. Local l_SettingsFile = getMudletHomeDir(). If string.char( getMudletHomeDir(): byte()) = "/ " then and unpacks them into the global namespace. It loads saved settings in from the Mudlet home directory This function should be primarily used by Mudlet. They are saved to "a" when the profile is closed or saved. Variables are automatically unpacked into the global namespace when the profile is loaded. This function flags a variable to be saved by Mudlet's variable persistence system. If (a and ( not b)) or (b and ( not a)) then Implementation of boolean exclusive or. if io.exists("/home/user/Desktop/file.txt") then if io.exists("/home/user/Desktop") then If it exists, it'll return the Lua true boolean value, otherwise false. Checks to see if a given file or folder exists. Return setScript(name, getScript(name, pos).
#Mudlet use lua socket code
"!) ")Īssert( type(luaCode) = "string ", "appendScript: bad argument #2 type (lua code as string expected, got ". Return group_creation_functions(name, parent)įunction appendScript( name, luaCode, pos)Īssert( type(name) = "string ", "appendScript: bad argument #1 type (script name as string expected, got ". permGroup("Defensive aliases", "alias")įunction permGroup( name, itemtype, parent)Īssert( type(name) = "string ", "permGroup: need a name for the new thing ")Īssert(group_creation_functions, "permGroup: ". if exists("Defensive aliases", "alias") = 0 then create a new alias group only if one doesn't exist already permGroup("Combat triggers", "trigger") parent optional name of existing item which the new item itemtype type of the item - can be trigger, alias, or timer Creates a group of a given type that will persist through sessions. Return not ( permScript(name, parent, " ", " ") = - 1) Return not ( permKey(name, parent, - 1, " ") = - 1) Return not ( permAlias(name, parent, " ", " ") = - 1) Return not ( permSubstringTrigger(name, parent,, " ") = - 1) Return not ( permTimer(name, parent, 0, " ") = - 1) Table of functions used by permGroup to create the appropriate group, based on itemtype. sendAll("stand", "wield shield", "say ha!", false) Use sendAll and do not echo sent command on the main window. sendAll("stand", "wield shield", "say ha!") Use sendAll instead of multiple send commands. echoTheValue optional boolean flag (default value is true) which determine if value should to use multiple send() commands one after another. You can use this to send some things at once instead of having for using event handlers and parsing its messages into Lua datastructures. A ATCP demo package is also available on the forums
#Mudlet use lua socket free
Feel free to experiment with this to achieve the desired results. register RoomExits as the event handler, make the script name be process_exits, and use this in the script: For example, if you'd like to listen to the RoomExits event and have it call the process_exits() function. name in the script you'd like to be called. You do that by setting the Script name: to the function should it call for you when your handler receives a message. Next, because scripts in Mudlet can have multiple functions, you need to tell Mudlet which function the event name you'd like your script to listen to into the Add User Defined Event Handler: field and press the + button While the concept of handlers for events is to be explained elsewhere in the manual, the quick rundown is this - place

The ATCP handler names follow the same format as the atcp table - RoomNum, RoomExits, CharVitals and so on. If you'd like to trigger on ATCP messages, then you need to create scripts to attach handlers to the ATCP messages. removed - so it becomes CharVitals and RoomExits. Note that while the typical message comes in the format of Module.Submodule, ie Char.Vitals or Room.Exits, in Mudlet the dot is

To find out the available messages available in the atcp table and the event names, raised for each ATCP message that arrives. Whenever new data arrives, the previous is overwritten. The latest ATCP data is stored in the atcp table. such that any it should work on others. This is primarily available on IRE-based MUDs, but Mudlet's implementation is generic enough Extending default libraries makes Babelfish happy. tripped up on number representation differences (.

enforce uniform locale so scripts don't get
