It seems that decrementing an application variable will never cause it to drop below 1. I have no idea why this is. You can make application variables less than 1. This code, for example, runs the variable at -2 and increments it from there, which works fine:
app:test += 1 from -2;
Description just doesn't work like that ...
I would suggest just setting the score to 1 so that you pretend that 1 means 0. In this case, your application might look like this:
rule morePies { select when web pageview ".*" if (app:pies > 1) then { notify("You get a pie", "Yay!"); } fired { app:pies -= 1 from 11; } } rules piesAreGone { select when web pageview ".*" if (app:pies <= 1) then { notify("No pies left", "Sorry."); } }
source share