Mudlet Newbie needs help with hunting script

by Unknown

Back to Mechanic's Corner.

Unknown2012-03-03 00:08:36
Hi
I am making my passage from Nexus to Mudlet and I am a little lost with my alias and such.

What I need is to improve the hunting alias I used in Nexus. Let me tell you what I did there.

First I set my target ---- st mt rat ---- for example
Then I made an alias to the command, for example point staff $mt
Then I linked it to a key (ctrl K, for example)


After a lot of trial and error I managed to mimic this in Mudlet (it works fine but I get a syntax error message). This is the command for the alias:
send("point staff" mt)

I think this can be improved, to avoid me to set the target everytime and to avoid the "alias to keybinding" step, besides avoiding the error message.

Can anybody help me? Thanks
Near2012-03-03 00:58:54
send("point staff " .. mt)
Unknown2012-03-03 03:38:50
There is no need to first make an alias then a keybinding, though you may do that. I would do the following:

Make an alias to set Target:
Alias Name: Target
Pattern: ^t (\\w+)$
Code: target = matches

Make a keybinding to attack:
Key Name: Attack
Key Binding: no modifiers + F1
Code: send("point staff " .. target)

Set your target and every time you press F1 it will staff cast that target, if your on balance of course! Let me know if you are interested in something more. You can make it so that the alias itself both sets the target and attacks, you can also make it so you will keep staff casting on balance till your target is dead with only one button press. I recommend reading the Mudlet Wiki some. Hope this helps!
Unknown2012-03-03 14:39:15
Thanks. I'll try both answers.
Unknown2012-03-03 14:43:26
SheiaSilverwing:

There is no need to first make an alias then a keybinding, though you may do that. I would do the following:

Make an alias to set Target:
Alias Name: Target
Pattern: ^t (\\w+)$
Code: target = matches

Make a keybinding to attack:
Key Name: Attack
Key Binding: no modifiers + F1
Code: send("point staff " .. target)

Set your target and every time you press F1 it will staff cast that target, if your on balance of course! Let me know if you are interested in something more. You can make it so that the alias itself both sets the target and attacks, you can also make it so you will keep staff casting on balance till your target is dead with only one button press. I recommend reading the Mudlet Wiki some. Hope this helps!


I let you know that I am interested in something more. The examples you give is what I was going to aim when I mastered a little bit more the coding (I am reading the Mudlet Wiki and other manuals, but it takes time and I wanted to play "as before" until I understand how to make things right).
So if you want to help me, please do.
Unknown2012-03-03 15:22:42
Neither of the codes work! They do nothing!
Is there something I am missing? Something so dumb that everybody takes for granted and I don't do?
Thanks
Is there something I am missing? Something so dumb that everybody takes for granted and I don't do?
Thanks

Addendum Finally I managed to make Sheia code work. I didn't understand that I should type t rat to set rat as a target.
This is what I meant when I said I don't see even the dumber things.
Consider that English is not my main language and coding not my greater strenght, although I am fluent in one and a-little-bit-more-capable-than-average-person in the other. So when I read the Mudlet manuals and the wiki I miss many things since they aim to a more skilled reader than me (I wish there was some Mudlet for dummies).
I'll keep trying. I am very stubborn and I won't quit till I understand.
Thanks again
Unknown2012-03-03 19:23:22
Ah! I should have mentioned that "t " is how you set a target, sorry about that. Well I'll give you a very easy sample bashing code.

You'll need all of the following:

Make an alias to set Target:
Alias Name: Target Pattern: ^t (\\w+)$
Code:
matches = target
Make a keybinding to attack:
Key Name: Attack Key Binding: no modifiers + F1
Code:
send("point staff " .. target)
enableTrigger("AutoBash")
enableTrigger("Slain")

Make a trigger to for your balance:
Trigger Name: AutoBash Type: exact match Pattern: You have recovered equilibrium.
Code:
send("point staff " .. target)
Make a trigger to detect when your target is dead:
Trigger Name: Slain Type: begin of line substring Pattern: You have slain
Code:
disableTrigger("AutoBash")
disableTrigger("Slain")

Set your target using t then press F1 and you will staff cast your target every time you regain equilibrium until it is slain. Please note this is extremely bare bones and if you are made prone, you black out, or are hindered in any way, it will probably stop working. I'm just giving this as a starting point.
Saurio:

I'll keep trying. I am very stubborn and I won't quit till I understand.

The above is a good attitude to have about it! I had zero programming knowledge only 6 months ago, and I know how to do just about whatever I like in Mudlet now. So I'm sure you can do it with some time.
Unknown2012-03-05 11:30:45
Thanks Sheia, that was cool. And useful, because I developed another codes for other actions from yours.
Thanks again
Haqikah2012-03-07 02:24:03
I have targeting but I don't have keybinding or the other things you mentioned. Since I'll be using these codes I wanted to say thank you as well!
Unknown2012-03-07 10:17:01
Glad I could help!