Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Please read the forum rules before posting.



Check if you are posting in the correct category.



The Off Topic section is not meant for discussing Cookie Clicker.

on tick variable problem

firefliesfireflies Member Posts: 56 ✭✭
Hi everyone,

I am not sure if I am missing something obvious here but I have the following code in an upgrade, with the intention of setting a maximum limit on a resource (Energy) - the tick is triggering fine, the if lines are triggering fine, but the toast confirms that despite the if lines triggering, $nrg is "0". I have tried $nrg=0.01, I have tried 0.1, no change - I just get a value of 0 each time.

Any suggestions?

on tick:
$nrg=0
if (100 >= Energy) $nrg = 0.01
if (100 >= Energy) toast [$nrg] here
yield $nrg Energy
end

Comments

  • firefliesfireflies Member Posts: 56 ✭✭
    I have made a bit of progress - it seems that $nrg wasn't accepting a value of 0.01, so my plan is to feed into a hidden resource and when that fills, it will count up the intended resource and empty the hidden resource to reset the counter...

    However I now seem to be encountering a bug where no matter what I try - I cannot get the yield to work:

    on tick:
    $nrg=1
    if (Energy >= 100) $nrg = 0
    else
    toast [$nrg] nrg
    yield $nrg Energyticker

    I have tried every possible permutation - either having the above, or having:

    if ($nrg = 1) yield 1 Energyticker

    and I have confirmed this with a toast command to check I am in the right area:

    on tick:
    $nrg=1
    if (Energy >= 100) $nrg = 0
    else
    yield $nrg Energyticker
    if ($nrg >= 1)
    yield 1 Energyticker
    toast still no yield
    end

    which shows the popup "still no yield", and the Energyticker resource doesn't increment.

    Does anyone have any ideas for a working means to have a resource count up to 100 over 10,000 seconds whenever the resource is below 100?
Sign In or Register to comment.