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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Sat Dec 05, 2020 5:45 pm   

Guild Power Timer monitor to auto-renew when below a set value
 
part of my HUD per round, is the following...

Vr: 75 Bo: 557 Vv: 828 AA: 119 Vg: 828 Bf: 830 Cg: 831

which I use this trig to store the duration to a variableDB.

Code:
<trigger priority="6360" case="true" id="636">
  <pattern>~[~[ (*) ~]~]</pattern>
  <value>#CALL %match(%1, "Vr: (%d)", @powers.Vr)
#CALL %match(%1, "Bo: (%d)", @powers.Bo)
#CALL %match(%1, "Vv: (%d)", @powers.Vv)
#CALL %match(%1, "AA: (%d)", @powers.AA)
#CALL %match(%1, "Vg: (%d)", @powers.Vg)
#CALL %match(%1, "Cp: (%d)", @powers.Cp)
#CALL %match(%1, "Bc: (%d)", @powers.Bc)
#CALL %match(%1, "Bf: (%d)", @powers.Bf)
#CALL %match(%1, "Cg: (%d)", @powers.Cg)</value>
</trigger>


I want to monitor the value to refresh the power when it drops to 30 or lower. I tried a couple methods and they didn't pan out.
#LOOPDB, #IF (@{powers.%1} <= 30) ...
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sat Dec 05, 2020 6:40 pm   
 
Are you sure the values are storing?
If they are something like this should work:

#FORALL "Vr|Bo|Vv|AA|Vg|Cp|Bc|Bf|Cg" {#IF (%db(@powers, %i) <=30) {refresh %i}}
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Sat Dec 05, 2020 7:18 pm   
 
using #LOOPDB @powers {#SHOW {%key : %val}} yields
Vv : 135
Vr : 508
Vg : 135
Cg : 138
Bo : 495
Bf : 137
AA : 324

so ... yea (not trying to sound like a smart ass) just verifying :)

due to omitted info edited your bit to reflect the required changes
Code:
#CALL %match(%1, "Vr: (%d)", @powers.Vr)
#CALL %match(%1, "Bo: (%d)", @powers.Bo)
#CALL %match(%1, "Vv: (%d)", @powers.Vv)
#CALL %match(%1, "AA: (%d)", @powers.AA)
#CALL %match(%1, "Vg: (%d)", @powers.Vg)
#CALL %match(%1, "Cp: (%d)", @powers.Cp)
#CALL %match(%1, "Bc: (%d)", @powers.Bc)
#CALL %match(%1, "Bf: (%d)", @powers.Bf)
#CALL %match(%1, "Cg: (%d)", @powers.Cg)

$activePowers="Vr|Bo|Vv|AA|Vg|Bf|Cg"
#FORALL $activePowers {#IF (%db(@powers, %i) <=30) {
  #SW (%i)
    (Vr) {#ADDITEM actionSeq valor}
    (Vv) {#ADDITEM actionSeq verve}
    (Vg) {#ADDITEM actionSeq vigor}
    (Bo) {#ADDITEM actionSeq bolt}
    (Bf) {#ADDITEM actionSeq biofeedback}
    (Cg) {#ADDITEM actionSeq {conductive grasp}}
    (AA) {#ADDITEM actionSeq {aa eagle}}
    {}
  }
}


Can only activate one guild power per HB, so I use a #IF (@actionSeq!=0) {%pop(actionSeq)
Your thing works great ! thank you
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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