Autoattack Trigger....

Posted by Tatewaki2365 on Sun 16 May 2004 02:21 AM — 22 posts, 83,413 views.

#0
Well, I was hunting someone, and I kept on passing them - I just couldn't bloody catch him. But he kept going RIGHT by me everytime I switched directions (I.e. Spam "e", he spams "w", I spam "w", he spams "e"). I was wondering if there is a known trigger so that you can target someone, and then when that name is seen, the trigger would automaticly input 'kill/murder [person]'.


Also... I was wondering how one goes about creating a health/mana/movement bar (If that's possible).
Thanks.
Amended on Sun 16 May 2004 02:33 AM by Tatewaki2365
Australia Forum Administrator #1
I don't know about a "known" trigger, but that one sounds simple enough to write.

As for the health bar, check out the plugins page for MUSHclient, and search this forum, there are quite a few posts about it.
#2
You could have a trigger that kills your target when he comes in from the (east|west|north|south)
#3
Except... I don't really know how to write triggers, so I'm kind of useless on this subject.
Australia Forum Administrator #4
You match what you see and tell it to respond in some way. Try experimenting. It is hard for us to help more as you haven't pasted what you see, so we would be guessing.
#5
Well, if it helps (provided I have the right idea of what your asking for), it would look something like this:

[person] rides in.
--Or
[person] walks in.

And, for them just sitting there, it would be:

[person] is * here.

*Can be sitting/resting as well as nothing at all (which would be standing)

The only thing I really need is something that would input a command when the name is seen;
Such as:

[person] is here.
-command inputted would be 'kill [person]'
USA #6
Basically, triggers, you have two major fields.

Match Text: (this is what the mud displays to "fire" the trigger).

Send: This is what you send once the trigger fires.

Triggers can include variables, denoted with an asteriks (*). You then can use these variables in the send field, by %# where # is the number of the variable:

* walks in wearing *.
would match:
Bill walks in wearing a hat.
and %1 would contain 'Bill'
%2 would contain 'a hat'

Thats basically the basics of triggers. Otherstuff is fairly self explainatory. Punctuation/spacing and other things are important. You really need to become a stickler for details while writing triggers.
More info can be found in the help file (either the online one, or the one included with mushclient).
Amended on Mon 17 May 2004 01:45 AM by Flannel
Greece #7
Try this:


<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="([A-Za-z]+) (is( sitting| resting|) here|rides in|walks in)\.$"
   regexp="y"
   sequence="100"
  >
  <send>kill %1</send>
  </trigger>
</triggers>


Copy the entire thing and click "Paste" in MC's triggers window.
Amended on Mon 17 May 2004 09:14 AM by Poromenos
#8
Many thanks. I would wish to know though, how does one edit from there who the target is?
Greece #9
The target's name is [A-Za-z]+, this means match any word. If you want someone specific, you can set that to the name, e.g. Poromenos. You can also make a variable, for example @target, and this way it will match on whatever is in the variable. You could set an alias so you would type "target <person>" and it would only kill the person you specified.
#10
Ok, so I tried it out, and replaced "[A-Za-z]+" with "A cow" (Heck... I have very little idea what's going on here, so I figured, instead of bugging you, I would give a stab at it, and try to figure it out myself... It didn't work.), this of course produced little, as there is no doubt in my mind that this was not the correct thing to do. This is the test that I used:

Fields of grain
You stand amid colossal fields of grain. Around you, long
stalks of wheatgrass rise well above your head. The yellow
grains tend to sway slowly back and forth like waves as
the mountain winds sigh through them. You have to hack and
chop your way through here to make a path, but you can see
hundreds of large scarecrows set up here.

[Exits: north south]
A cow is here, chewing her cud.

Is there something special I would have to do for this one? As I see, the trigger has "sitting" and "resting" in it, so I would sort of assume that something along the lines of "chewing her cud" might have to be thrown in there... In anycase, I just need to find out how to work this trigger, because I've heard of MANY people dying from their own triggers.

Thanks for the patience.
Greece #11
Yes, that's right, this trigger won't match on "chewing her cud". You would have to change the trigger to:

([A-Za-z]+) (is( sitting| resting|) here|is here\, chewing her cud|rides in|walks in)\.

Regular expressions can be a bit overwhelming if you're new. There are also the normal triggers which just match something like:
* walks in.
You could use those, or you could read the document about regular expressions which comes with MC. It is very helpful, and it's in the \docs catalog in the MC directory.
Amended on Tue 18 May 2004 09:24 AM by Poromenos
USA #12
Actually.. It won't match on "A cow" anyway, since that is two words and you make no allowances for multiple words, only letters.
#13
Try (.*?) is here etc...

Do you want just to kill * (whoever), i have a trigger
which automatically saves another mudder's character name
in a variable. Then an alias to attack.

#14
Is it possible to be able to grab two pieces of
information from a trigger, and store them in
seperate variables?

*>Demonica sprays you with Venom

I need to put Demonica in one variable
and Venom in another

USA #15
Demonica sprays you with Venom
non regexp:
* sprays you with *
(you need to add punctuation, etc)
Regexp:
^(.*) sprays you with (.*)$
(again, add punctuation, and anything else)

Send to: Script
Send:
setvariable "var1", %1
setvariable "var2", %2
#16
Cheers Flannel

I was trying all sorts
#17
Flannel that aint working, its capturing the trigger
(cos ive coloured it green), but not sending anything
to my variables
Greece #18
Quote:

Actually.. It won't match on "A cow" anyway, since that is two words and you make no allowances for multiple words, only letters.

He had changed [A-Za-z]+ to A cow, so it would match. A bit late now for me though :p
USA #19
Assassin, Do you have scripting enabled? And what language are you using? I guess most of us default to VBscript.

You can get more information about the other languages usage of setvariable here:
http://www.gammon.com.au/scripts/function.php?name=SetVariable
#20
Scripting enabled yes, and VBscript
Australia Forum Administrator #21
Quote:

setvariable "var1", %1
setvariable "var2", %2


Say you received:


Demonica sprays you with Venom


This would evaluate to:


setvariable "var1", Demonica
setvariable "var2", Venom


However Demonica and Venom won't exist (as variables) so the variables var1 and var2 will be empty.

You want this:


setvariable "var1", "%1"
setvariable "var2", "%2"