Property/Counter Updating using trigger + block code

So…if a number of points must be given to a property(saying that you do something that will grant you points and the points are tracked on a property, "Points") and we decide to use a counter for this, we have a limitation, we can only increment by 1 each time so how can we increment it by 5? Idea: increment using a trigger that uses recursion to repeat its attempts 5 times, in other words we can view it like this:

trigger → +1 to counter

trigger, re-run → +1 to counter

and this will continue until we reach our fifth attempt and say in other words:

trigger → +5 to counter

Even though we can only do 1 we did 5 because we repeated the same task. The problem:
In order to achieve this we need to tell the trigger what the limit is or what to look for before it does it, in other words:

As long as the points/counter doesn’t equal what it used to equal + 6(if it equaled 5 beforehand, it should repeat the task as long as it isn’t more than 10, which would be 5+6 which = 11) then repeat.

I’m not entirely sure if that can be done because if it is doing recursion then this is what will be done:

set newpoints to [get property "points" + 6]

if [get property "points" < newpoints] then
    broadcast on channel "trigger trigger"

The above sets newpoints to 11, but if it were to be repeated then the newpoints would become 12 as it is constantly updating the property value and the variable value.

I could terribly be wrong about this(if I am please tell me…), or I could be terribly right, but either way I do need help.

Thank you.
-VALUEX

PS:
I’m not sure if I am supposed to add tags to this help request…or what tags…

5 Likes

you can do set points [get property points + 5]

Screenshot 2024-09-24 11.36.39 AM

Do need help @VALUEX ?

I know that, but I wanted to see if there was some kind of work-around.

not really

I do.

either way I do need help.

1 Like

You could try to just have a counter that tracks how many times the trigger triggers, use a trigger to increment the counter and the points property and have a system that stops after 5 increments, so the points are incremented exactly 5 times, even though each individual increment is by 1(?)

1 Like

That could work, I’ll try it, thanks!

1 Like

bad Random update thingy. mostlikely is not helpful at all


Property settings:

Code for trigger:

Counter settings:

2 Likes

Have you tested anything yet?

I might just be trying to say what ShadowDragon44 said above so kudos to him and anyone who is replying to this topic (for a potential solution). But, i don’t think you need block code.
You just need 1 triggers, 2 counters, 1 wire repeater, and 1 property. lol
So basically, you have a trigger that gets triggered after an event happens [1]. Then when the trigger gets triggered, it increments both the score counter(a) and the incrementation counter(b). Counter(a) tracks the property [2]. The property is a number type property with whatever scope you want and it broadcasts on the same channel that the event that triggered it did [3]. Now, for counter(b). Set it to a target value of 5 and when target value is reached, broadcast on a channel (I used “scoreIncrementOver”) and also have the counter(b) reset when receiving on this channel (“scoreIncrementOver”). The trigger should deactivate when receiving on this channel (“scoreIncrementOver”) as well. Finally, the wire repeater [4]. Wire the counter to the wire repeater [target value reached → repeat wire pulse] and wire the wire repeater to the trigger [wire pulse repeated → activate trigger. Make the wire repeater have a delay of 1 or less seconds. And I think that should be all!
Sorry for all the side-note thingies! Good day/night/your time to you as well! If you need pics, I can get some.


  1. in this example, I’ll say, someone scores a goal in blastball ↩︎

  2. which can be called score I guess ↩︎

  3. unless you use wires for this, then you can broadcast on a new channel. Also, if the blastball is scored, then I would broadcast on channel “triggerRecursion” and that would also be the channel the property broadcasts on. ↩︎

  4. I believe this is the most memory efficient ↩︎

6 Likes

This goes in Devices because it’s a theory and not a request.
Good idea tho.

2 Likes

eh it’s a bit of both. but the theory isn’t really a theory anymore but a reality. i think. [1]


  1. i have absolutely 0, actually no i have negative self-confidence lol ↩︎

2 Likes

It was more of a request on my end as I was confused and needed help.

2 Likes

Oh, okay then. You can change it back if you want, it just seemed like an idea to me.

3 Likes

Update: You actually want the trigger to have a 0.5 second delay lol
I forgot about the update speed hehe

3 Likes

A possibly easier way is to have the trigger broadcast on the following, where the counter increments on channel increment:

increment,increment,increment,increment,increment

This works because the commas act as a separator, meaning increment is broadcasted on five times.

3 Likes

That’s what I did in the block code.

2 Likes

wow. ._.
how did I never know about this.

1 Like