Help - Search - Members - Calendar
Full Version: Why Won't This Work?
Achaea's Forums > Off-Topic > Tech Support > Curing Systems and Scripts
Jonathin
I've tried:

#loopdb @countdown {#if (%val<%int( %eval( @timers.%key/2))) {#addk timercolour {%key=yellow}}}
#loopdb @countdown {#if (%val<%int( %eval( @timers.%key*(1/2)))) {#addk timercolour {%key=yellow}}}
#loopdb @countdown {#if (%val<%int( %eval( %db(@timers,%key)*(1/2)))) {#addk timercolour {%key=yellow}}}
#loopdb @countdown {#if (%val<%int( %eval( %db(@timers,%key)/2))) {#addk timercolour {%key=yellow}}}


None seem to work.

I'm obviously doing something wrong.

I just want it to change any value in the database to yellow if it's below half.
Sena
I don't think @timers.%key will work. Try %db(@timers,%key). I don't see anything else wrong.
Jonathin
I just looked at that, and holy cow I've come a long way from not knowing what %1 meant.

and this is what it is:

#loopdb @countdown {#if (%val<%int( %eval( %db( @timers, %key)*(1/2)))) {#addk timercolour {%key=yellow}}}


and it's just flat out not working.


I'm not sure what the difference between these is, but this is the one that worked.


#loopdb @countdown {#if (%val<%eval( %int( %db( @timers, %key)/2))) {#addk timercolour {%key=yellow}}



This is for 3 different colours:
CODE
#loopdb @countdown {#if (%val<%eval( %int( %db( @timers, %key)/4))) {#addk timercolour {%key=hi,red}} {#if (%val<%eval( %int( %db( @timers, %key)/2))) {#addk timercolour {%key=yellow}} {#if (%val>%eval( %int( %db( @timers, %key)/2))) {#addk timercolour {%key=green}}}}}
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.