Space Engineers

Space Engineers

Not enough ratings
Counter script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
547.000 B
15 Jan, 2015 @ 7:30am
1 Change Note ( view )

Subscribe to download
Counter script

Description
Simple to use script that counts how many times it has been used.

Features:
Can start counting uppwards from any given number, can be altered to count down as well.
Single function easy to add in any script and can be used several of in same script or different scripts.

How to use:
Give any nameable block a custom name of your choice.
Set that name in the function call of the script.
And run the script.

Example custom name: (Default)
counter("counter");

Example custom name: (custom)
counter("custom what ever i want");

If no number is given in the block name it will set it to 0.
It follows what ever number is given after the custom name.

Simply run the script and each time it adds +1 to the number currently in the block name following the custom name used in the script.

Limitation:
Only works perfect when the custom name given is unique, however having numbers in the custom name works perfectly fine.

Possible usages:
With a sensor running the script it can be used to count rocks/parts,.visitors,.enemys and so on.
Counting how many times a specific script is run, or how many times a script uses the function in the script.
Your imagination is the limit.
2 Comments
Potato127 26 Feb, 2020 @ 7:03pm 
how do i make activate something and reset its counts after 5 detects
Allessia 27 Sep, 2019 @ 7:03am 
Hi first of all i hope this is what i am surching for and if so, i will surely love it.
I would like to use your scrip, but i got a couple questions.

Is there a way to trigger an event after it conts X-times?

In my case i build this infinite drillingthing. I got 8 timers for it. So far so god, but i realy would like to stop it after lets say 25 times one of the timers start counting.

Is the scrip stil working? I
U can't get it to run without errormesaages, If i do nothing, there are a few error messages and if i type in the Name of my Timer the error messages are only two left over that they can't do anything with the Name.

How can i get the output of the counting on a screen?

As i am no programer i can't make any sense of it :-)