vortirr.blogg.se

Mudlet temptimer
Mudlet temptimer










mudlet temptimer

Now that we got the ifs covered, lets go over the Mudlet equivalents of other Nexus functions. following lines are all _one_ single if statement. blocks in its constituent clauses may have multiple lines.

mudlet temptimer

This shows how ifs continue (on 'logical' lines) even though the #echo These commands are all on separate lines too! Note: If you just have a pattern with a ' is Match the end of a line (not the actual newline character) Match one or more of anything EXCEPT 'a', 'b', or 'c' Match one or more of either 'a', 'b' or 'c'. Match one or more numeric digits (a number) Match one or more non-whitespace characters (a 'word')

mudlet temptimer

Make sure to set the pattern type in Mudlet to be perl regex, because the default substring works differently. For translating Nexus patterns into Mudlet, use the following table below. The same goes for IF statements/functions etc.Lets start with triggers. If you wish a variable to be LOCAL to the script or loop you create it in, then you must create the variable this way:īe aware that if you create it inside a for loop, it will not exist outside the loop.

Mudlet temptimer how to#

The value will not persist between sessions though - if you want to learn how to save values between sessions, ask that question separately (and check out the remember() function. If you create a variable as I did above, then it is available globally to any script. I apologise if I explained what you already knew. NOW that I am sure you're on the right page, I'll answer your question. This is pretty neat - it lets you contain/compartmentalise scripts, making them easy to share and resistant to being interfered with by other scripts given to you by other people. Now you can see that you can have a single table with multiple TYPES inside - in this case, simple strings (text data), a true/false, and a function. You'll get the same result - because by default, we can reference individual keys in the global table without having to specify the _G (however, sometimes it can be really useful to do so, which is why I mentioned it). You are just adding another entry into the global table, which is called _G The value can be a string, integer, function, boolean, another table, or probably one of a few other types that have slipped my mind, or I just don't know about.Įven when you create a "simple" variable, that is to say: When you create a function, for example, the function name is the KEY in some table, and the function itself is the value. A table is a key = value structure (in cmud, a database variable, or record variable). Hope this gives you something of a start!Įverything in lua is a table. Create a function to return a gsubbed string, and then do send("say ". You could develop it from there, that's by no means the most efficient way or the most pared-down script you can do.įor the opposite, in turning out the language, you could do the same thing, only in reverse. I'm sure there are other ways you can do that bit, but that's the quick-and-dirty, no-research-done, no-questions-asked kind of thing I'd do. Local translation = translate_d(matches)Ĭecho("(yellow) - replace () with html brackets here - ". Here, you would need to create a check that runs a string.findpattern on matches, and if it doesn't detect a word of your language, to stop running the trigger.

mudlet temptimer

Then what you do is trigger say to something like: Local translation = arg:gsub("vir", "hello"):gsub("wer", "world") One is a gsub for accepting the language as a trigger, that would look like this: What I would do if I were to take a first cut at this is create two different subroutines. There are a couple of ways you can do this.












Mudlet temptimer