Re: HP line evaluation

Eugene <[email protected]> Tue, 06 Jul 2004 13:29:40 +0400
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <[email protected]>
On Mon, 5 Jul 2004 00:21:45 -0500
  Jim Sanders <[email protected]> wrote:
>Sorry if this is posted in the wrong place, and I'm sure 
>this is a
>stupid question, but what's the best way to do an 
>evaluation of an
>hpbar?  As a brief example:
>
>HP[100/100] SP[100/100]
>
>There are actually several more entries including some 
>that include
>dotted decimal notation with a % sign inside brackets
>[100.00/100.00%].  What I want to do is evaluate each 
>entry and as an
>example, if hp is less than maxhp (in this case, say HP 
>[90/100]),
>evaluate another entry on the line and if its more than 
>say 50.00%, do
>some command.  Then, if that other entry falls below 
>50.00%, do
>another command.
>
>I'm pretty new at lyntin and at python, so the only way I 
>can think of
>to do this is to do an action with like:
>
>HP[%1/%2] SP[%3/%4]
>
>However, this would drag it out to 10+ variables and just 
>make things
>ugly trying to put all the if statements and such on one 
>line.  Also,
>I'm guessing it might hurt performance as well.  I'm 

You are right. It slows things down a lot. For similar 
purpose, I have a custom python module with something what 
I call "pseudovariables" - some objects inside of the 
module that looks like variables so you might use them in 
your command-line triggers etc.

I'll put the module to the Wiki soon and post the link 
here.

Anyway, you can do it the simple way as you wrote and look 
whether the performance is sufficient for you.

--
Eugene
---
Professional hosting for everyone - http://www.host.ru


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com