|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sun Aug 04, 2019 9:18 am
Counting MOBS |
Quote: |
<<100%hp 100%m 95%mv>> east
Room Name
Descrption is
Basically always
Multilple lines
[Exits: east west]
Elf Mob 1 stands here.
Human Mob 2 rests here.
Dog Mob 3 sits here.
<<100%hp 100%m 93%mv>> |
Hey guys, what I'm wanting to do is make a script for mobs in each room, to do something based on how many there are.. for example I might simply want to look at them all... Is there a way to count how many there are so I can simply trigger to do:
Code: |
look 1.
look 2.
look 3. |
|
|
|
|
chris123zugg Apprentice
Joined: 23 Aug 2013 Posts: 175
|
Posted: Sun Aug 04, 2019 10:42 am |
#TR {Elf mob (%d) stands here.} {#loo %1 {look at elf %i} will iterate through how many elf mobs are listed
|
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sun Aug 04, 2019 11:42 pm |
Sorry, those were just made up examples, none of the mobs are that simple in actual practice...
What I was even hoping for was more like a way to count the lines between:
[Exits: *]
and the next seen
~<~<*~%hp *~>~> |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Aug 05, 2019 7:49 pm |
you can do that, yes
Code: |
#TR {Exits:} {NPC_Count=0}
#COND {*} {
#IF (!%match(%line, "(%d)%hp")) {
#STATE 1
NPC_Count=(@NPC_Count+1)
} {#LOOP @NPC_Count {look %i}}
} {within|param=1} |
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
rmorock8869@yahoo.com Beginner
Joined: 15 May 2018 Posts: 17
|
Posted: Mon Dec 27, 2021 4:59 pm |
How would you count CORPSE and then set it to @NUM
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Dec 27, 2021 9:09 pm |
That depends entirely on how your game displays corpses.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
rmorock8869@yahoo.com Beginner
Joined: 15 May 2018 Posts: 17
|
Posted: Tue Dec 28, 2021 2:09 am |
The corpse of a dire corby alpha is here.
|
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Tue Dec 28, 2021 1:36 pm |
#TRIG {The corpse of * is here.} {num=@num+1}
Obviously you initialise your corpse counter at the point when you want to start counting.
Eg., for each session maybe an ONCONNECT event, and for each room an ONROOMENTER event. |
|
|
|
|
|