Broken targeter

edited April 2013 in Mechanic's Corner
Hello :)

I am not a coder but some time ago people helped me make a targeter and a staff cast alias.
The targeter went with x <something> and it also highlighted the target, while ff was my staffcast.

Unfortunately, I couldn't recover the proper lines (since they had to be edited many times in the process), rather found a copy of them before being fully polished.

And I am afraid my targeter doesn't even work anymore :/

So I will be more than grateful if someone can help me out ^.^

Thanks in advance.

P.S. I am using Mudlet.

-------
pattern: ^x (.+)$

Target = matches[2]

sysEcho("info", " target set:" .. string.title(target))

if id then killTrigger(id) end

id = tempTrigger(target, [[selectString("]] .. target .. [[", 1) fg("gold") resetFormat()]])

-----

pattern: ^ff( \w+)?$

if matches[2] then

send("point staff " .. matches[2])

else

send("point staff " .. target)

end

Comments

  • How doesn't it work? Does it print the info line when you set a target? Can you staffcast with a specified target, but not with the set target?

    With a quick lookthrough, it might be that it says "Target = matches[2]". Not sure if Mudlet is sensitive to capitalisation; if so, it should probably say "target" instead of "Target".
    image
  • edited April 2013
    When I x something:
    1) It doesn't hightlight it
    2) It doesn't target it at all

    I can staffcast manualy so I guess the problem is within the targeter itself.

    So I did what you suggested - removed the capital "T" - now it targets. Though it still doesn't highlight =)
  • I'm guessing the highlighting comes from this line:

    id = tempTrigger(target, [[selectString("]] .. target .. [[", 1) fg("gold") resetFormat()]])

    That being said... I've no clue what's wrong with it.
    image
  • Depending on what you're targetting, it may not be highlighting due to trying to compare something like "ssaliss" to "Ssaliss", which doesn't actually match due to case differences.

    Easiest way is probably to look into making a permanent Mudlet trigger off a variable, and making sure that trigger isn't case sensitive.
  • Try adding

    target = target:title()

    above the "if id then ..." line. It should then highlight capitalised versions of your target.

  • Nope. There's simply no highlight at all, regardless of the target :/
  • You have 'Target = matches[2]' capitalized, but then you use 'target' uncapitalized later on. Make it consistent. Capitalization matters!
  • Shedrin said:
    You have 'Target = matches[2]' capitalized, but then you use 'target' uncapitalized later on. Make it consistent. Capitalization matters!
    That part was already fixed though, unless I misunderstood something.
    image
  • It was :)
  • Oops, ok.
  • I think Mudlet targetting was case sensitive last time I checked. Make two temp triggers, one for 'ssaliss' and one for 'Ssaliss'. Alternatively check if your stuff throws an error when executed.
Sign In or Register to comment.