Last requests before feature freeze

Caled
Posts: 399
Joined: Thu Apr 09, 2009 4:45 am

Re: Last requests before feature freeze

Post by Caled » Mon Jun 01, 2009 2:36 pm

I had considered suggesting paths a while back, but I decided that it would be easy enough to write my own in lua. The rough plan I had for it was to capture the directions to a numbered list. The reason being how simple it would be to duplicate the reversing of the path, and also how easy to duplicate slow walking.

The use of #SLOW .pathname with 0 timeout on slow-walking is the key to botting tasks like harvesting areas or even clearing out the locusts from Antioch's sewers. For Heiko: In zmud terms, slowwalking is when the path sends each direction on at a time, confirmed and advanced in script with #OK (some other commands exist as well).

In other words, sending all the directions at once is only a small part of the pathing system (and since many muds limit the number of moves you can make per second) its often not even a useful feature. Placing directions into a numbered list makes it pretty easy for the average user to manipulate and use the paths however they want. IMO all that is needed is a "toolbox" package with some functions written in lua to prevent every user from reinventing the wheel. I suppose they could be added to the general library of functions, but I do suggest considering the use of numbers lists rather than storing the directions in a string. That way it is easy for people to use them in strange and different ways.

derekperrault
Posts: 14
Joined: Sun May 31, 2009 7:40 am

Re: Last requests before feature freeze

Post by derekperrault » Mon Jun 01, 2009 5:52 pm

Caled, good call. I completely forgot about path slow-walking as it related to the mapper.

I certainly wasn't suggesting paths be utilized by the system as strings... just instantiated using strings.

p = path.new('s2w3e') => Path object with attribute: {'s', 'w', 'w', 'e', 'e', 'e'}
Then you get all kinds of hotness...

p.reverse()
p.nth(3)
p.last
And Path should return an iterator, too. (not sure if this can be done with "interfaces" + the for loop or what)
I'm afraid I'm terribly new to Lua, so pardon me if I screw up syntax/idioms.

gurke111
Posts: 8
Joined: Fri May 01, 2009 1:29 pm

Re: Last requests before feature freeze

Post by gurke111 » Tue Jun 02, 2009 5:54 pm

Hello Heiko,

as we've already talked about earlier, I - and perhaps others - would like to get a well working Copy feature, when timestamps are enabled:
timestamps on, mark one line: "EricB idles: real life intrusion".. copy, paste --> "s: real life intrusion"
Thanks for your efforts!

derekperrault
Posts: 14
Joined: Sun May 31, 2009 7:40 am

Re: Last requests before feature freeze

Post by derekperrault » Thu Jun 04, 2009 12:31 am

Would it be possible to get PCRE as part of the global API?

Like mushclient? http://www.mushclient.com/scripts/doc.p ... al=lua_rex

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

Re: Last requests before feature freeze

Post by Heiko » Thu Jun 04, 2009 6:46 am

This is already available as well as a myriad of other Lua modules like SQL database support etc. that can be used by users who want this kind of functionality.
To load a Lua module, you simply have to load it via "require" in an init script (script item).

Regex libs:
# [lrexlib] (5.1) - a POSIX and Perl (PCRE) regular expression library for Lua.
# [LPeg] (5.1) - a New Pattern-Matching Library for Lua. See also LpegRecipes.

Here is a list of available modules: http://lua-users.org/wiki/LibrariesAndBindings

derekperrault
Posts: 14
Joined: Sun May 31, 2009 7:40 am

Re: Last requests before feature freeze

Post by derekperrault » Thu Jun 04, 2009 2:42 pm

Heiko, absolutely true. As a matter of fact, I built lrexlib yesterday. It was a bear, because there were some undocumented problems I encountered (maybe the way MacPorts installs luarocks borked something... I dunno). The whole time, I kept thinking, "Man, why isn't regexps packaged with Mudlet?" The reason I made the request is if I build a Lua "plugin" that requires regexps, I'd have to ask every interested party to build the dependency*. Some people don't have that experience.

(*Actually, I just remembered Windows has that nice Lua installer with tons of packages pre-built. OS X has nothing of the sort. Bah.)

I can see your point of view, definitely. Especially when most of your user-base is probably Windows with the packages already installed.

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

Re: Last requests before feature freeze

Post by Heiko » Thu Jun 04, 2009 10:39 pm

That is true. We should discuss what additional Lua packages we should include. PCRE or LPeg? Maybe even SQLLite. Lua Rocks didn't work for Mac OSX?

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

Re: Last requests before feature freeze

Post by Vadi » Thu Jun 04, 2009 10:46 pm

Yeah, I agree there are tons of Lua-extending modules available. We could ship some, but... Lua Rocks also provides functionality for installing them. Shipping Lua Rocks with Mudlet would be an even better solution.

Requires some discussions on this, though - It's a big thing.

derekperrault
Posts: 14
Joined: Sun May 31, 2009 7:40 am

Re: Last requests before feature freeze

Post by derekperrault » Fri Jun 05, 2009 3:14 am

Lua Rocks did (eventually) work, but it didn't "just work".
In order to install lrexlib, I had to do: luarocks install lrexlib-pcre PCRE_INCDIR=/opt/local/include PCRE_LIBDIR=/opt/local/lib

Prior to setting PCRE_INCDIR and PCRE_LIBDIR, the error I was getting was... Error: Could not find expected file pcre.h for PCRE -- you may have to install PCRE in your system and/or set the PCRE_DIR variable

I tried export PCRE_DIR=..., but that didn't work. Research eventually revealed it is a Luarocks variable, not an environment variable. So, as suggested in an older message on lua-users, I tried: luarocks install lrexlib-pcre PCRE_DIR=/opt/local/include

Still no dice. Finally, I thought to open up the lrexlib rockspec, saw the PCRE_INCDIR and PCRE_LIBDIR variables, tried them out, and lucky for me, my guess was on the money. All in all it was a pretty annoying process.

Oh, another thing. Distributing Mudlet with a set of modules will help keep people from having to modify the package.path and package.cpath variables. That would certainly encourage plug-in sharing, for sure.

derekperrault
Posts: 14
Joined: Sun May 31, 2009 7:40 am

Re: Last requests before feature freeze

Post by derekperrault » Fri Jun 05, 2009 3:23 am

Heiko wrote:That is true. We should discuss what additional Lua packages we should include. PCRE or LPeg? Maybe even SQLLite.
SQLite would definitely be nice. I also ran into stdlib, which provides a whole host of awesomeness.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests