Mudlet Manual, Lua & Regex Tutorials and References

Post Reply
User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Mudlet Manual, Lua & Regex Tutorials and References

Post by Heiko »

Mudlet manual: http://mudlet.git.sourceforge.net/git/g ... ml;hb=HEAD

Geyser (Mudlet's layout manager) Howto: http://wiki.mudlet.org/w/Manual:Geyser

(best) Programming in Lua: http://www.lua.org/pil/index.html

Lua tutorial directory: http://lua-users.org/wiki/TutorialDirectory



PCRE regular expression tutorial & reference: http://www.regular-expressions.info/reference.html
PCRE manual: http://www.pcre.org/pcre.txt


list of additional Lua special purpose modules: http://lua-users.org/wiki/LibrariesAndBindings

help on compiling Mudlet from source code: here

User avatar
Vadi
Posts: 4852
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet Manual, Lua & Regex Tutorials and References

Post by Vadi »

Pattern for capturing negative numbers with regex: (-?\d+)

uti
Posts: 10
Joined: Thu Feb 03, 2011 6:16 pm

Re: Mudlet Manual, Lua & Regex Tutorials and References

Post by uti »

Seems to me like the following sections are missing, and their links in the ToC are dead:
4. Advanced Learning From Selected Example Scripts
a. inlineMapExample
b. Auto Miner Bot Example - How to write a little Bot with Mudlet?

5. Custom GUI Elements
a. User Terminal Windows
b. Custom Mini Text Displays - Scripting Labels
c. Scripting Buttons
d. User Custom Graphics Windows

User avatar
Vadi
Posts: 4852
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet Manual, Lua & Regex Tutorials and References

Post by Vadi »

Will be cleaned soon, thanks.

edit: done now.

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Mudlet Manual, Lua & Regex Tutorials and References

Post by Yetzederixx »

Example, from another thread (which I can't find), of accounting for optional info/arguments/parameters in an alias. This same method works anywhere in a regex, but I find I use it only for alias' myself.

^qwerty(?: (\w+))?$

I do this for quite a few spell alias' which don't need targets if you are already in combat. Code is like:
Code: [show] | [select all] lua
if matches[2] then send("do_something to " .. matches[2]) else send("do_something") end

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Mudlet Manual, Lua & Regex Tutorials and References

Post by Yetzederixx »

While trying to help someone else I found this other online regex tester: www.regextester.com/. This one will tell you what is in the matches table from your pattern.
Attachments
screenshot of this website in action
screenshot of this website in action

Post Reply