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
Ranamart
Newbie


Joined: 27 Aug 2005
Posts: 2

PostPosted: Sat Aug 27, 2005 8:27 am   

Team info pack * * SOLVED * *
 
Hi!

At the first, i must ask your appologize: My english is very poor. Embarassed I'm from Hungary.

I have a big problem, I try to explain it.
When I'm playing in Team, on Team Channel when we fighting sometimes arrived the
team's information, like LifePoints, ManaPoints and Stamina points:
Ranamart <test info> Life 1000/1139, Stamina 831/834, Mana 1256/1410.
Doc <test info> Life 119/791, Stamina 42/710, Mana 0/0
Ranamart <test info> Life 871/1139, Stamina 826/834, Mana 1132/1410.
Doc <test info> Life 19/791, Stamina 21/710, Mana 0/0

I want this lines "pack" into new window, count of team member, like this:

Ranamart
871LP 826SP 1132MP
Doc
19LP 21SP 0MP

Trying to use this trigger:
Pattern:
Code:
%1 <%2 info> Life %3/%4, Stamina %5/%6, Mana %7/%8.

Value:
Code:
#VA I 0
#VA found %int( 0)
#VA teammember2 {%1%char( 9)%3%char( 9)%4%char( 9)%5%char( 9)%6%char( 9)%7%char( 9)%8}
#WHILE ((@I < %numitems( teamlist))) {
  #VA teammember %item( @teamlist, %int( @I + 1))
  #VA K %int( %pos( %char( 9), @teammember))
  #IF ((@K > 0) AND (%1 = %copy( @teammember, 1, @K - 1))) {#VA found %int( 1)}
  #ADD I 1
  }
#IF (@found = 1) {#VAR teamlist %replaceitem( @teammember2, %int( @I), @teamlist)} {#ADDITEM teamlist @teammember2}
#GAG
showinfo

That's trigger work correctly. I see in teamlist correct values of life, stamina and mana points.
But. The ShowInfo alias work incorrectly and strange :(

SHOWINFO alias:
Code:

#CLR teamwindow
#FORALL @teamlist {
  #VA teammemberdata {%i}

; /* Put the name into variable */
  #VA teammemberdata_name {%copy( @teammemberdata, 1, %pos( %char( 9), @teammemberdata) - 1)}
  #VA teammemberdata {%delete( @teammemberdata, 1, %pos( %char( 9), @teammemberdata))}

; /* Put the life points into variable */
  #VA teammemberdata_lp {%copy( @teammemberdata, 1, %pos( %char( 9), @teammemberdata) - 1)}
  #VA teammemberdata {%delete( @teammemberdata, 1, %pos( %char( 9), @teammemberdata))}

; /* Put the max life points into variable */
  #VA teammemberdata_maxlp {%copy( @teammemberdata, 1, %pos( %char( 9), @teammemberdata) - 1)}
  #VA teammemberdata {%delete( @teammemberdata, 1, %pos( %char( 9), @teammemberdata))}

; /* Put the stamina points into variable */
  #VA teammemberdata_sp {%copy( @teammemberdata, 1, %pos( %char( 9), @teammemberdata) - 1)}
  #VA teammemberdata {%delete( @teammemberdata, 1, %pos( %char( 9), @teammemberdata))}

; /* Put the max stamina points into variable */
  #VA teammemberdata_maxsp {%copy( @teammemberdata, 1, %pos( %char( 9), @teammemberdata) - 1)}
  #VA teammemberdata {%delete( @teammemberdata, 1, %pos( %char( 9), @teammemberdata))}


; /* Put the mana points into variable */
  #VA teammemberdata_mp {%copy( @teammemberdata, 1, %pos( %char( 9), @teammemberdata) - 1)}
  #VA teammemberdata {%delete( @teammemberdata, 1, %pos( %char( 9), @teammemberdata))}

; /* Put the max mana points into variable */
  #VA teammemberdata_maxmp {@teammemberdata}

; /* the teamwindow small, and i dont want to show max lifepoints and etc. */
; /* I try use the colors, when low, then red, when normal, then cyan, when on max then green */
  #IF (@teammemberdata_lp <= 100) {#VA lpcolor 1} {#IF (@teammemberdata_lp = @teammemberdata_maxlp) {#VA lpcolor 2} {#VA lpcolor 3}}
  #IF (@teammemberdata_sp <= 100) {#VA spcolor 1} {#IF (@teammemberdata_sp = @teammemberdata_maxsp) {#VA spcolor 2} {#VA spcolor 3}}
  #IF (@teammemberdata_mp <= 100) {#VA mpcolor 1} {#IF (@teammemberdata_mp = @teammemberdata_maxmp) {#VA mpcolor 2} {#VA mpcolor 3}}

  #WIN teamwindow {@teammemberdata_name}
  #WIN teamwindow {%case( @lpcolor, %ansi( high, red), %ansi( high, green), %ansi( high, cyan))<@teammemberdata_lp>lp
                   %case( @spcolor, %ansi( high, red), %ansi( high, green), %ansi( high, cyan))<@teammemberdata_sp>sp
                   %case( @mpcolor, %ansi( high, red), %ansi( high, green), %ansi( high, cyan))<@teammemberdata_mp>mp}
  }

And why it's strange. Theres a fight:

[>>>>> Khron kozepes erovel megvag a fegyverevel.
Life: 1000 Stamina: 831 Mana: 1256


In teamlist i have this: Ranamart 1000 1139 831 834 1256 1410

But on teamwindow i see this:

Ranamart
1139hp 832sp 1256mp


WHY? Shocked

Is i mistake something, or there exists easiest way, to solve my problem?
Thanks ahead of time for any help!

PS: I use Zmud 7.04. And I tryed also with database, but on database don't worked the trigger corectly Sad
Reply with quote
Ranamart
Newbie


Joined: 27 Aug 2005
Posts: 2

PostPosted: Sat Aug 27, 2005 2:27 pm   
 
I found the error, in the code which put information to the another window.
The problem is: <@teammemberdata_lp>lp I replace to: %trim(@teammemberdata_lp)lp. and working fine.
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