Targetting help

User avatar
Omni
Posts: 131
Joined: Fri Feb 12, 2010 10:26 am

Re: Targetting help

Post 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.

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

Re: Targetting help

Post 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)

User avatar
Jules
Posts: 118
Joined: Sun Oct 11, 2009 5:41 pm
Location: Plymouth State University - Sophomore

Re: Targetting help

Post 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)

User avatar
Omni
Posts: 131
Joined: Fri Feb 12, 2010 10:26 am

Re: Targetting help

Post 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.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Targetting help

Post by demonnic »

if you add \n to the end of the echo, that'll force a newline.

User avatar
Omni
Posts: 131
Joined: Fri Feb 12, 2010 10:26 am

Re: Targetting help

Post by Omni »

ok thank you.

mudlet
Posts: 3
Joined: Sat Apr 03, 2010 8:06 pm

Re: Targetting help

Post 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

Metho
Posts: 14
Joined: Wed Sep 16, 2009 10:20 pm

Re: Targetting help

Post by Metho »

send "(garrote ..^tar$)"

Should be:

send("garrote " .. tar)

mudlet
Posts: 3
Joined: Sat Apr 03, 2010 8:06 pm

Re: Targetting help

Post 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

mudlet
Posts: 3
Joined: Sat Apr 03, 2010 8:06 pm

Re: Targetting help

Post by mudlet »

sorry nevermind I just got it to work somehow thanks!

Post Reply