There are a few instances that cause a script to be reset while it is not running.
1 - when cross a sim border
2 - When stored into inventory and rezzed again. This also includes a worn attachment that is detached an worn again.
3 - A simple sim reset.
a simple script to test
==================================
integer count = 0;
default
{
touch_start(integer total_number)
{
llSay(0, (string)count++);
}
}
=================================
Test A - inventory store
1. put script in a box
2. touch the box see that is counts up everytime you touch it.
3. set the script to not running.
4. take it back into inventory
5. rez the box again.
6. set script to running
7. touch it and notice it starts counting at zero again.
Test B - sim crossing
1. take the same scripted box and go somewhere very close to sim border
2. touch it a few times to verify is it working
3. set the script to not running
4. edit the box and move it in the other sim
5. set the script to running.
6. touch it and notice it starts counting at zero again.
Test C - sim reset
1. take the same scripted box and place it in a sim you can reset.
2. touch it a few times to verify is it working
3. set the script to not running
4. rest the sim.
5. after the reset go back to the box and set the script to running.
6. touch it and notice it starts counting at zero again.