Lua module PCRE not found

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Lua module PCRE not found

Post by Rakon »

Greetings everyone.

I'm attempting to switch from MUSHclient, to Mudlet for a native client on Linux.

I really don't know Lua, so it's going to be a hassle for me to even being converting my other system. When I start Mudlet I get the following notifications:

Code: Select all

[INFO] local manual: /home/chris/.config/mudlet
[INFO] old LuaGlobal.lua removed successfully
[INFO] LuaGlobal.lua restored successfully
Lua error:[string "require "rex_pcre""]:1: module 'rex_pcre' not found:
	no field package.preload['rex_pcre']
	no file './rex_pcre.lua'
	no file '/usr/local/share/lua/5.1/rex_pcre.lua'
	no file '/usr/local/share/lua/5.1/rex_pcre/init.lua'
	no file '/usr/local/lib/lua/5.1/rex_pcre.lua'
	no file '/usr/local/lib/lua/5.1/rex_pcre/init.lua'
	no file '/usr/share/lua/5.1/rex_pcre.lua'
	no file '/usr/share/lua/5.1/rex_pcre/init.lua'
	no file './rex_pcre.so'
	no file '/usr/local/lib/lua/5.1/rex_pcre.so'
	no file '/usr/lib/lua/5.1/rex_pcre.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
[INFO] LuaGlobal.lua loaded successfully.
[INFO] looking up the IP address of server:www.achaea.com:23 ...
[INFO] The IP address of www.achaea.com has been found. It is: 64.127.116.163
[INFO] trying to connect to 64.127.116.163:23 ...
[INFO] A connection has been established successfully.
I'm running Ubuntu 9.10 X86_64 with kernel 2.6.31-19-generic.

I have lua5.1 installed and also librexlib1.

I've tried completely removing both packages, as well as Mudlet then reinstalling all. Still the error persist.
How would I actually install the necessary libs in order to begin working with PCRE in Mudlet?

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Lua module PCRE not found

Post by Rakon »

Another issue running into:

Apparently, using \n within an echo returns as a bell character, and not actual a newline.

Using echo ('\n'), which prints a bell looking character to the output window instead of the newline.

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

Re: Lua module PCRE not found

Post by Vadi »

This warning can be ignored, because this is only necessary if you want to use PCRE matching in your Lua scripts (Lua has it's own matching which is simpler and smaller in featureset, but it should be enough for all your needs). So it really doesn't do anything to the functionality.

However, this can be solved by either using the generic linux installer: http://forums.mudlet.org/viewtopic.php?f=5&t=1185 or waiting a bit on me to figure out what's wrong with the package I made for lrexlib. The thing isn't packaged in debian or ubuntu :|

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Lua module PCRE not found

Post by Rakon »

I went ahead, and kept trying to make the script anyway.

MY frustrations continue with the following:
As I said, when I change/edit/redo a trigger or alias, it is not immediate. I have to click activate(to DEactivate the trigger), click it again (to activate) and click save item, before the changes I made to the script are actually processed.

IE, make a trigger that matches on prompt. Make it echo('prompt'). Save item, activate. Go to output window, see a few prompts with 'prompt' appended. Hurray! Go to prompt trigger, change it to echo(matches[2]) (WTF! why 2? who knows) click save item. Prompt still echos 'prompt' and not the matches. I have to go back to the triggers, click activate (to deactivate the trigger) click it again, and then it'll process the changes.

Also, attempting to use a newline in an echo, does not actually echo the newline, instead echoing some symbol.

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

Re: Lua module PCRE not found

Post by Vadi »

Just hit 'save' to have the changes be processed. Re-activating it isn't necessary!

matches[2] because the 0th wildcard in regex means the part of the pattern that matched, and because Lua by convention starts indexing from 1, \0 beame 1 and \1 became 2.

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

Re: Lua module PCRE not found

Post by Heiko »

If you are not able to compile Mudlet yourself correctly, use the binary installer that has been posted for testing on this forum. None of the things you described in your posting happen if Mudlet is compiled and configured correctly using proper libraries.

PS: Triggers, alias etc. are autosaved when you switch items or single click the item itself, to activate/deactivate -> double click

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Lua module PCRE not found

Post by Rakon »

I am Using the PPA setup by Vadi for Mudlet.

You're saying I need to compile Mudlet, instead of using the PPA, to get proper functionality?

I should not have to switch from Triggers to alias/scripts/whatever in order to get the changes applied. Would it be possible, to do the reload/autosave when the save button is clicked the first time?

Also... how would I get the echo to properly echo a newline, instead of symbols??

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Lua module PCRE not found

Post by Rakon »

Heiko wrote:If you are not able to compile Mudlet yourself correctly, use the binary installer that has been posted for testing on this forum. None of the things you described in your posting happen if Mudlet is compiled and configured correctly using proper libraries.

PS: Triggers, alias etc. are autosaved when you switch items or single click the item itself, to activate/deactivate -> double click

Greetings, again.

I've now attempted to use, and create various simple triggers and scripts with both 1.0.5 (Vadi's ubuntu ppa), and the generic 1.0.6. In each of these, there have been a number of bugs or limitations that've made so much as setting up a simple highlighting trigger, or echo unbearably difficult.

1.0.5 :
echo ending in or containing '\n' displays bell character, not newline
Error of lua module PCRE not found
Was told to 'use the 1.0.6 generic installer to fix the issues'

1.0.6 :
Highlight trigger ending in a . is ignored, IE not highlighted
highlighting a regex trigger only colors a matched group, not the entire line
Various nuances regarding variables not being registered , IE 'nil'
Was told 'you're using an unreleased version, use 1.0.5 it works'

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

Re: Lua module PCRE not found

Post by Vadi »

"Highlight trigger ending in a . is ignored, IE not highlighted" - fixed since the installer was made, new one isn't available yet though
"highlighting a regex trigger only colors a matched group, not the entire line" - that's a feature. If you'd like to highlight entire line in regex, do: selectString(line, 1); bg("color"); resetFormat();
"Various nuances regarding variables not being registered , IE 'nil'" No what does this mean, sorry. This is a pure Lua environment, variables don't need to be 'registered' but are created when necessary.

Thanks for the feedback!

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Lua module PCRE not found

Post by Rakon »

Vadi wrote:"Highlight trigger ending in a . is ignored, IE not highlighted" - fixed since the installer was made, new one isn't available yet though
"highlighting a regex trigger only colors a matched group, not the entire line" - that's a feature. If you'd like to highlight entire line in regex, do: selectString(line, 1); bg("color"); resetFormat();
"Various nuances regarding variables not being registered , IE 'nil'" No what does this mean, sorry. This is a pure Lua environment, variables don't need to be 'registered' but are created when necessary.

Thanks for the feedback!

'Fixed since the installer was made, but it's not available yet'

Great, any ETA on when a proper one will be?

The issue with highlighting a line ONLY highlighting the matched group, and not the entire line is a feature? Why?
If the basic function of a highlighted trigger, is to highlight a LINE, shouldn't the highlight only the matched group be an option, not forced?? The only other way to create a full line trigger highlight is to use three lines of code per highlight trigger? I'd have likely a lot of highlights, and echos, just as that's what I use a lot.

Variables not being registered. Trigger, regex :

Code: Select all

^Health:       (\d+)\/ (\d+)     Mana:         (\d+) / (\d+)$
---
chp = matches[2]
mmp = matches[3]
While using the 'cecho' function found on the forums here, in 1.0.6
Prompt trigger, regex:

Code: Select all

^(\d+)h\, (\d+)m\, (\d+)e\, (\d+)w ([cexkdb]+)(.*?)\-(.*?)$
------------

if tonumber(chp) > (tonumber(mmp) / 1.4) then
 hcolor = 'green'

echo(string.format('<%s>%sh', hcolor,chp ))
Type score, in lua output on prompt being recieved:
(I didn't save the exact text, was pretty frustrated at this point and just stopped working with Mudlet)
Lua ERROR: attempting to compare value to mhp, nil value.

Hope this helps.

Post Reply