Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Curtis
Novice


Joined: 25 Nov 2002
Posts: 39
Location: USA

PostPosted: Wed Oct 29, 2003 12:25 pm   

Stringlist or Database Question
 
I have the ability in my mud to touch players to check thier health status. Im trying to use this ability in a team fight to determine which of my enemies would have the lowest health and than target that player. Im looking for some guidance on the best way to do this. I know how to use stringlists but am not familiar with databases. Is this possible to do in a stringlist or do I need to sort this into a database.

This would be my command to touch.

#FORALL @enemylist {touch %i}

This will be the mud output I receive if they are in the room.

Doctor Evil has a health of 560 / 1000.

I need the EVIL and the 560 added to a database or stringlist and than sorted so the enemy with the lowest health is set as my target.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Wed Oct 29, 2003 3:13 pm   
 
string list is fine,there are a number of ways to do it.

(%w) has a health of (%d) / 1000.
Doctor Evil has a health of 560 / 1000.
enemyhealth=%1~*%2
enemyhealth=560*evil
then use if statments to check against it
bug bot has a health of 230/3000.
if 230<560 change the enemyhealth if not stay with the one you got
go through your enemy list like this and your all set
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net