I don't know much lua and I only had a working knowledge of how to script in Lua before I came here.
Here's my script:
alias name: target
pattern: ^tt(.+)$
big box::
target = matches[2]
echo("Target is set to ..target".")
but when I write target x I keep getting huh? and when i click on the green checked button, i get the echo but with the value of my variable unchanged.
It also means that my Key + 0 won't work on my target.
My macro is as follows:
Name: decay
command: ^k$ <-- though it perhaps should be set to decay
key binding: key + 0
Big box:send("decay"..target)
It's much easier for me to set my targeting alias in cmud.
I can write it this way: target = %1;#echo Target is set to
@target and it will echo the name of my target. I can't do that with my lua script for mudlet.
I also can assign my variable to say key +0 for decaying my target and assign . to fearing my target etc.
I would like to know what I can do to make my lua scripts work in mudlet...
Comments
→My Mudlet Scripts
Here's the new setup:
alias name: Targets
pattern: ^t (.+)$
bigbox:
target = matches[2]
echo("Target is set to "..target..".") <-- i tried setting it to t but that didn't work. Echo doesn't work with this alias.
I changed my macro like this:
name: decay
command: <-- i tried putting send(decay"..target") in there but that i didn't work. right now command is blank.
big box: send(decay "..target") key won't fire even though I have it activated. there's a green check on it.
In the macro, the send() still isn't quite right. Should be send("decay "..target). Not really sure what "Key + 0" means in the keybinding. Is "key" just a stand-in for something like alt/ctrl/whatever there?
I will give this a try. I forgot to add the scalar at the end of my pattern.. Thanks for pointing this out..I'll see about fixing my macro as well.