[DeveloperScript] IGER's Particle And Object Detector 0.4
#21
line 135 invalid escape sequence.
Reply
#22
(05-16-2013, 04:11 PM)Arivo Wrote: line 135 invalid escape sequence.

The lua escape character is %, not a backslash.

So, this pattern is not strictly valid: match("^[a-zA-Z0-9\.\_]+$")

Here's the fix, works with both lua dlls:

match("^[%w_.]+$")

LuaJIT is more strict about invalid escape sequences. Also, you don't need to escape those characters anyway.
Reply
#23
<3 dude Smile
Reply
#24
A lot of wierd stuff was going on with that regexpart when I wrote it. I can't remember exactly why. But I wasn't able to use w or W. well maybe because I used the \ instead of the %... :p
Reply
#25
Line 135 in v0.4.1 should be:

Code:
if ((object.name ~= nil and string.len(object.name) > 0 and object.name:match("^[a-zA-Z0-9._]+$") ) or (object.charName ~= nil and string.len(object.charName) > 0 and object.charName:match("^[a-zA-Z0-9._]+$"))) and not alreadyInList then table.insert(list,object) end

To fix the invalid escape sequences. I finally tested it.

EDIT: As discussed, %w works too, but I just quickly removed the \ while in game.
Reply
#26
Fixed script and updated first post.

Gruß

Valdorian
---
---
[Image: 8j6g4vms.jpg]
Reply
#27
Since taylorswift just mention,
I will post the fixed line 135, was using it for a while
http://hastebin.com/qelufebuze.tex
[Image: nKxM6O4.png]
Reply




Users browsing this thread: 1 Guest(s)