Targeting alias
Re: Targeting alias
Have you tried deleting the alias and creating it again? When I create an alias with the identical pattern "^z (.*)$", it works perfectly for me.
Re: Targeting alias
His xml has this though:Heiko wrote:^z (.*)$" *would* work nicely, *IF* he used that, but uses "^z (.*)$\s" which will never match in Mudlet.
That's why I told him to use the debug console in the future
Maybe \n got in there by accident and wasn't rendered?<Alias isActive="yes" isFolder="no">
<name>Target Get</name>
<script>burger = matches[2]</script>
<command></command>
<regex>^z (.*)$
</regex>
</Alias>
Re: Targeting alias
Well it worked of course, so thanks, both.
Oh yeah, the variable was only changed to "burger" so I could check "target" wasn't some reserved keyword. Looks a bit weird.
Oh yeah, the variable was only changed to "burger" so I could check "target" wasn't some reserved keyword. Looks a bit weird.
Re: Targeting alias
Ergh. It's back. I don't understand the Lua errors, but it feels like bugs to me.
Code: Select all
rget Get(^z (.*)) matched.
Alias: capture group #1 = <z blah>
Alias: capture group #2 = <blah>
LUA: ERROR running script Target Get (Alias1) ERROR:Lua error:[string "function Alias1()..."]:2:
attempt to index global 'match' (a nil value)
Alias name=Bash(^x$) matched.
Alias: capture group #1 = <x>
LUA: ERROR running script Bash (Alias2) ERROR:Lua error:[string "function Alias2()..."]:2: attempt to concatenate global 'target' (a nil value)
Re: Targeting alias
Feels like typos to me. "match" as it says doesn't exist. Maybe you want matches?
Re: Targeting alias
So you understand it in the future:
That's all one alias matching. get Get(^z (.*)) matched. means alias named Get with the pattern ^z (.*) matched.
Just information to help you - it means matches[1] contains z blah and matches[2] contains blah.
That means Lua was upset about your script running.
Is the actual Lua error. "attempt to index" basically means "get". a nil value, well nil in Lua means it does not exist. So match having a nil value = Lua couldn't find such a variable!
Code: Select all
get Get(^z (.*)) matched.
Alias: capture group #1 = <z blah>
Alias: capture group #2 = <blah>
LUA: ERROR running script Target Get (Alias1) ERROR:Lua error:[string "function Alias1()..."]:2:
attempt to index global 'match' (a nil value)
Alias name=Bash(^x$) matched.
Alias: capture group #1 = <x>
LUA: ERROR running script Bash (Alias2) ERROR:Lua error:[string "function Alias2()..."]:2: attempt to concatenate global 'target' (a nil value)
Code: Select all
get Get(^z (.*)) matched.
Alias: capture group #1 = <z blah>
Alias: capture group #2 = <blah>
LUA: ERROR running script Target Get (Alias1) ERROR:Lua error:[string "function Alias1()..."]:2:
attempt to index global 'match' (a nil value)
Code: Select all
Alias: capture group #1 = <z blah>
Alias: capture group #2 = <blah>
Code: Select all
LUA: ERROR running script Target Get (Alias1) ERROR:Lua error:[string "function Alias1()..."]:2:
attempt to index global 'match' (a nil value
Code: Select all
attempt to index global 'match' (a nil value