Page 1 of 1

Using target name

Posted: 25 May 2017 11:15
by Drazson
I want to auto-appraise my enemies when the fight starts. Can I have a trigger that considers who my target is?
For example, something like "k *" = "do kill *, appraise *" or without the do command by using the client extra aliases.

Re: Using target name

Posted: 25 May 2017 12:10
by Tarax the Terrible
In any client enemy is a target built in to the game. (When you are fighting something)

So things like these work

Code: Select all

compare stats with enemy
look at enemy
glance at enemy
health enemy
slap enemy
say to enemy Now you die!
So all you need is

Code: Select all

trigger 
Pattern. you attack
Command. appraise enemy
compare stats with enemy
Whatever else u want
In terms of killing things <it> is kinda of useful but breaks down a lot. <kill it> but after u kill one it might be the corpse etc.

To get more fancy u use the invisible gmcp data the game will send ur client if it supports it
Mine doesn't but there are aliases and scripts talking about it on the forum. Stuff like
gmcp.player.last enemy killed
gmcp.room.what mobs are present



it is more useful for equipment

Code: Select all

get item from rack
appraise it

get sword from rack
appraise it
Useful to make sure u use non saving equipment first. I just have a trigger firing <appraise it> every time I see "from the rack"

Re: Using target name

Posted: 25 May 2017 12:19
by Drazson
I didn't know about the "enemy" being a thing. Thanks about that one, it helps! May I ask another one?
How about wanting to discern when I meet people of certain races? Whatever their description.
For example how do I write this:

Trigger: (?:A|An) (whatever 1st characteristic) (whatever 2nd characteristic) (minotaur|ogre).
Commands: say Oi there tall guy.

Re: Using target name

Posted: 25 May 2017 14:02
by Tarax the Terrible
Off the top of my head I'd only know a zmud example.

The general topic about what you want to do there regardless of client is called "pattern matching"
So to use pattern matching in the game client you would set up the trigger as "regexp"
Which stands for regular expression.
https://en.wikipedia.org/wiki/Regular_expression

So you can set up a trigger with key phrases and wild cards

Not able to tell you off hand how you pass those wild cards as variables into commands. But there are example scripts in the client section. Think it relies on the trigger setting client variables then the script using them.

Look at Britanica's example for tap screen.
Had code in it where if you find a certain herb type u do a certain action.

gl