![]() To get the size of tables that use user defined keys instead of automatic indices (pairs() type) you need to use the function table.size() referenced above. ipairs() type of tables with numerical indices. This is the standard Lua way of getting the size of index tables i.e. typing gg to have get gold from ground put gold in bag be sent to the game. These include, but are not limited to: Aliases User-defined text input, which is converted into a different, usually longer input before being sent to the game. Parametersįor index based tables you can get the size with the # operator: Mudlet offers a vast array of standard features to automate or otherwise improve your gaming experience. See for more info table.size table.size (t) Returns the size of a key-value table (this function has to iterate through all of the table to count all elements). ![]() The sort algorithm is not stable that is, elements considered equal by the given order may have their relative positions changed by the sort. If comp is not given, then the standard Lua operator < is used instead. If comp is given, then it must be a function that receives two table elements, and returns true when the first is less than the second (so that not comp(a,a) will be true after the sort). "/a", mytable ) table.sort table.sort(Table ) Sorts table elements in a given order, in-place, from Table to Table, where n is the length of the table. Saves the table mytable to the lua file mytable in your Mudlet Home Directory table. table.keys table.keys(table) return a table that is the collection of the keys in use by the table passed in Parameters Mudlet is a platform for gaming and enhancing game-play primarily with MUDs. index_of ( words, "greetings" )) end table.is_empty table.is_empty(table) Check if a table is devoid of any values. contains ( words, "greetings" ) then table.remove ( words, table. The function to use for determining what order to iterate the items in the table. Spairs spairs(tbl, sortFunction) Returns an iterator similar to pairs(tbl) but sorts the keys before iterating through them. Through them you can add to tables, remove values, check if a value is present in the table, check the size of a table, and more. ![]() These functions are used to manipulate tables. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |