Coding Pack!
This is designed for people who are coding in mudlet. It provides a lua code alias with multiple returns, a trigger feeder, and a new 'function finder'.
This also includes a function that I consider crucial:
math.round() -- We all want to be able to easily round numbers off to a specific decimal point.
To update, remove the script you have in your system from the package manager, then install this one.
UPDATED:
Sunday, January 24, 2013
2.2
RunCode alias now will output any number of arguments - not just limited to three.
Sunday, December 30th, 2012
2.1
display() has been removed from this one - as of Mudlet 2.0 Test 7, an undocumented function that was being used by this display has been removed from Mudlet, and the display() built into mudlet no longer has the issues that this one fixed.
---------------------------------------------------------------------------------------------------------------------
Lua Code Alias Syntax:
lua <stuff>
This alias is a bit more verbose than most Lua Code aliases. It will run the 'stuff' as lua code, and give you back whatever the code returns.
In the case where the code has multiple returns, such as getMainWindowSize(), it will show all of them. If there is an error, it prints to the Error log properly.
Example:
lua yajl
(1) {
parser = "function: 0x23005410",
to_value = "function: 0x230053d0",
generator = "function: 0x23005450",
to_string = "function: 0x23005390",
null = null
}
lua getMainWindowSize()
(1) 1281
(2) 632
lua 2*3+(34/3^3), 1+1, 3^2
(1) 7.2592592592593
(2) 2
(3) 9
Trigger Feeder Syntax:
`echo <stuff>
This will feed <stuff> to your triggers, so you can test if a trigger is firing. Seperate lines with a $
Example: `echo This is on line 1$This is on line 2
Prints:
This is on line 1
This is on line 2
Function Finder Syntax:
findfunc <stuff>
This will return a list of the various _G things that match your parameters. For example, 'findfunc echo' returns (and I bet you didn't know half these):
Example: findfunc echo
echo Type: function
echoUserWindow Type: function
decho Type: function
echoPopup Type: function
xEcho Type: function
echoLink Type: function
checho Type: function
cecho Type: function
hecho Type: function
Echos Type: table
cechoLink Type: function
dechoLink Type: function
hechoLink Type: function
Round Number Function:
math.round(num[, idp])
This will round 'num' to 'idp' decimal spots. If 'idp' is left out, then it will round it off to 0 decimal spots.
Note: This is not a TRUNCATE, this is a ROUND: 0 - 4 rounds down, 5-9 rounds up.
- Login to post comments

Comments
Sweet!
Sweet!
Definitely a useful utility
Definitely a useful utility for all scripters.
Ohhh, this sounds very useful
Ohhh, this sounds very useful !
agreed
agreed
Cool stuff.
Cool stuff.
^
^
nice
nice
looks good.
looks good.
I'd definitely recommend this
I'd definitely recommend this to new Mudlet users. i can't stress enough how useful it is having several diagnostic tools to find problems with your scripts!
I really should get up to
I really should get up to snuff in coding in Mudlet...
Well then.
Gotta start somewhere I guess.
Thank you
:)
Thanks!
This has been incredibly helpful with my learning and testing.
Good deal!
Anything that helps is awesome!
Bitchin'
I'm on it, thanks!
this is beyond me
Mainly because I don't speak moonspeak
Wrong language. This is
Wrong language. This is obviously done in smalltalk :P
Nice
Nice! Definatly a must have.
Nice.
Thanks.
I totally dig this.
I totally dig this.
Oh, interesting, thanks!
Oh, interesting, thanks!
Woho
Yay!
coding... ugh...
coding... ugh...
i hope more people continue
i hope more people continue to share their scripts... this is great for the mudding community.
indeed.
indeed.
gotta love this script
gotta love this script
It definitely looks useful.
Looks very useful.
Nice
Thank you!
very useful
love the round
tough stuff
Coding...
i'm gonna try this out...
i'm gonna try this out...
Nice!
Nice!
Sweet
sweet
Great update, thanks!
Great update, thanks!
thanks
thanks
thanks!
thanks!
erm dont know if this is
erm dont know if this is useful/helpful or not..
would probably use this if I
would probably use this if I knew what I would want to do with this, heh.
yep
yep
+1
+1
hmm
hmm
the original
vlua
I've been thinking of
I've been thinking of learning how to code in mudlet
Sounds interesting. Not sure
Sounds interesting. Not sure what to use it for.
no idea how to use this
no idea how to use this
nice
nice
Superdiddlydooper! Thank you!
Superdiddlydooper! Thank you!
I plan to learn more about
I plan to learn more about coding in mudlet and this seems the right tool for that...
thanks
thanks
helpful
helpful