I know how to do both of these, and could write up a mini primer for each, but that takes a long time and a lot of patience. If you're interested in databases, you'll want to take a look at LuaSQL lite. Ensure the generic mapper package is installed in Mudlet2. If you're interested in doing GUI stuff, you'll want to learn CSS before Mudlet's Geyser. Short video describing how to use the generic mapper for Mudlet. Table.insert(tableName, location, value ) It has an optional parameter that tells it where in the table the value should be added. Returns the number of items within a table.Īgain, like our function example, index_of works nearly the same way, except that it returns a value or nil.Īdds a value to a table. Like our function example, contains works nearly the same way, except it returns no value, only true or false. I don't often use table functions aside from getn, insert and remove, but these will provide you with extra mobility when dealing with your coding. but there are two similar functions to this for tables that exist. Could be very useful if you're trying to determine if you should add something to a table or not!. The above looks through a table and if the item you're looking for is in the table, will return the index (or key) for it. I cannibalized the following example from another IRE game's forums, though I can't recall which or who wrote it. However, you can pass variables into the function and do things with them, and then have the function return a value as well.įunction someOtherFunctionName (var1, var2, var3 ) Functions are best if you plan to repeat certain steps over and over. Reverse the order of characters in a string:įunctions make life a lot easier, and I've opted to avoid them until this point because I was hoping you'd get a hang of everything up until this point, first. It sounds like you want to want to attach some of the windows to your main display, like how its setup in the tutorial GIF For that, the window needs to be in Adjustable mode (the default that all the windows appear when you install zgui), versus User Window mode (where the window is popped out and you can drag it anywhere, even beyond the. If you want to learn more about patterns for gsub, take a swing over to this page. SomeStr = someStr:gsub("He%-Who%-Must%-Not%-Be%-Named", "Voldemort") He-Who-Must-Not-Be-Named needs his reign ended, now!" SomeStr = "He-Who-Must-Not-Be-Named is an evil man.
0 Comments
Leave a Reply. |