Page 2 of 3

Re: Targetting help

Posted: Sun Feb 14, 2010 4:50 am
by Omni
nope, none of my scripts, triggers or aliases have x as a variable. I've even tried changing the letter and still it doesn't work.

Re: Targetting help

Posted: Sun Feb 14, 2010 10:38 am
by Heiko
Please you the debug console (script editor->lady bug button) to sort out this kind of trivial bugs yourself in the future.
It'll show you what alias/trigger matched etc. and has lots of information especially if your scripts failed due to runtime errors.

Also, this sub forum is *NOT* a place to ask questions, but a forum to post FAQs and Tips & Tricks.

I guess that your alias pattern isn't really what you think it is e.g. it has some trailing spaces etc.. Check it.
Your script definitely works *IF* your variable target is defined to be a string value. This script definitely works:

Code: Select all

heiko_target = matches[2]
echo("target has been set to " .. heiko_target)
send("point staff " .. heiko_target)

Re: Targetting help

Posted: Sun Feb 14, 2010 4:34 pm
by Jules
I've had issues before when using the term "target" as a variable. I'm not sure what it is, or if Mudlet uses it elsewhere, but change the variable "target" to "tar", or something similar. Your code is fine, and your pattern is fine too. It's actually something similar to what I use for mine, except my targetting alias is slightly different, but that's okay!

Code: Select all

--pattern: ^x (\w+)$
tar = matches[2]
echo("Target set to " ..tar.. ". Prepare to destroy!")
send("point staff " ..tar)

Re: Targetting help

Posted: Sun Feb 14, 2010 6:01 pm
by Omni
Thank you. I'll check them out and see if they work. sorry for posting this under here. I wasn't paying attention when I did and by the time I realized my mistake it was too late to fix it.

Add: I didn't try heikos suggestion, but the second one works, but when it sends the command and the echo they end up on the same line. I even tried putting so my input wouldn't show up, but that just moved the part of the first line of the attack next to the echo.

Re: Targetting help

Posted: Mon Feb 15, 2010 3:41 am
by demonnic
if you add \n to the end of the echo, that'll force a newline.

Re: Targetting help

Posted: Mon Feb 15, 2010 3:46 am
by Omni
ok thank you.

Re: Targetting help

Posted: Sat Apr 03, 2010 8:20 pm
by mudlet
I am also having targetting issues and have tried the aforementioned codes and something is still going wrong
so far in my alias I have
Alias name: target
Alias pattern: ^t (\w+)$
substitution: blank
script: tar = matches[2]
echo("Target set to " ..tar.. ". Prepare to destroy!")

for the keybinding I have
name: garrote
comand: blank
keybinding: control+d
script: send "(garrote ..^tar$)"

I am trying to switch from nexus and any help is appreciated I am not a very good at scripting and have got most of this information from the forums and the mudlet manual

Re: Targetting help

Posted: Sat Apr 03, 2010 8:26 pm
by Metho
send "(garrote ..^tar$)"

Should be:

send("garrote " .. tar)

Re: Targetting help

Posted: Mon Apr 05, 2010 3:22 am
by mudlet
Ok I tried that and when I set my target and use my keybinding it still acts like it does not recognize the target I have set ie: you can not see that being here
thanks for any help

Re: Targetting help

Posted: Mon Apr 05, 2010 3:24 am
by mudlet
sorry nevermind I just got it to work somehow thanks!