PDA

View Full Version : Help on this script please



Caluss
12-14-2003, 08:22 AM
Due to my relatively weakness I wish to only attack when there is only one critter in the room. No matter how I have tried I still cannot get it to work. Can someone give me some guidance. I have included my attack script so you can show me what I have done wrong. I have also tried putting the same items in my checkroom, but nothing seems to work. Thanks in advance



filter1:
match start You can't go there.
match R%c Also here:
match R%c and a black forest ogre
match R%c and a massive black boar
match R%c and a black forest viper
match R%c and a black forest ogre,
match R%c and a massive black boar,
match R%c and a black forest viper,
match preatt1 Obvious paths:
match preatt1 Obvious exits:
matchwait

Kbundy
12-14-2003, 06:38 PM
Items are included in looks in a script, so it would only work if that creature is the last item/creature in the room. If it was first but there was a skin after it, it'd show up as 'a black forest ogre,' and not 'and a black forest ogre' or 'and a black forest ogre,'.

In fact, the only time a comma is used is when there is moer than one creature/item in the room, and that item/creature is in the room. Example:

[Town Square West]
Bank.
You also see some stuff, some more stuff, and the last item.

So, the lines

match R%c and a black forest ogre,
match R%c and a massive black boar,
match R%c and a black forest viper,

are useless, because they don't ever appear, and the lines before it..

match R%c and a black forest ogre
match R%c and a massive black boar
match R%c and a black forest viper

Are not the complete line, as there should be a period at the end of each line (if it's the last creature in the room).

I don't think there's any simple way to determine if there's one creature in the room without multiple (3+) looks in a single room. An untested possibility..

Check:
put look
match 1ogre a black forest ogre
match 1boar a massive black boar
match 1viper a black forest viper
match nothere Obvious paths/exits:
matchwait

1viper:
put look
waitfor A black forest viper
match retreat a black forest viper
match retreat a black forest ogre
match retreat a massive black boar
match attack obvious paths/exits:
matchwait

And the same thing for the ogres/boars.. the only problem is if there is a creature before the first match, in this case, is an ogre, is the only time it would work properly, I think.


When it would work:
[Hunting place]
Descript
You also see a black forest ogre, some stuff, a black forest viper and some stuff.

Wouldn't work:
[Hunting place]
Descript
You also see a black forest viper, some stuff and a black forest ogre.

The first match would probably match the ogre, and then waitfor the ogre on the second look, missing it since it's the second creature in the room.

Or not. I'm just giving you my opinion.