Posted 27 December 2014 - 12:17 AM
Hi again… this is related to the problem with startup code not executing on chunk load. I am trying to come up with a
work-around for my non-OP users.
my non-op users can not click on a turtle in the world spawn chunk, so I placed a turtle outside the chunk, and programmed it to travel to the one inside the chunk and execute the turnOn method. It doesn't work.
I perform a shutdown on the target turtle inside the world spawn chunk, and go to the turtle outside the world spawn chunk
and run the following code
code:
–[
missing code just moves the turtle to the desired location inside the world spawn chunk
(approximately 20 blocks)
–]
if peripheral.isPresent("top") then
print("peripheral found on top")
T = peripheral.wrap("top")
sleep(1)
T.turnOn() – try this method and it fails,
peripheral.call("top","turnOn") – so I try this method, and it also fails
id = T.getID() – this is just to see if it can get any info from the target
print(id) – the ID should be 13
end
–[
missing code returns turtle to origin outside WSC.
–]
end of code:
output:
peripheral found on top
113
problem is, the target turtle is not turned on, and its ID is 13, not the reported 113.
LastID file shows 112 (the ID of the moving turtle), so it appears the getID method is returning the next ID, because
(assuming) it can't get the ID from the target.
I try it with the target already turned on (manually) and still the getID method returns 113.
I can physically see the turtle come up under the target, and pause for a second, then it leaves.
The startup code on the target turtle functions properly when I click on it (tells a command block to send a message to all users),
but not when I use the turnOn method from another turtle.
I'm thinking that the WSC is protected from non-OPed players, and recognizes the turtle as such.
work-around for my non-OP users.
my non-op users can not click on a turtle in the world spawn chunk, so I placed a turtle outside the chunk, and programmed it to travel to the one inside the chunk and execute the turnOn method. It doesn't work.
I perform a shutdown on the target turtle inside the world spawn chunk, and go to the turtle outside the world spawn chunk
and run the following code
code:
–[
missing code just moves the turtle to the desired location inside the world spawn chunk
(approximately 20 blocks)
–]
if peripheral.isPresent("top") then
print("peripheral found on top")
T = peripheral.wrap("top")
sleep(1)
T.turnOn() – try this method and it fails,
peripheral.call("top","turnOn") – so I try this method, and it also fails
id = T.getID() – this is just to see if it can get any info from the target
print(id) – the ID should be 13
end
–[
missing code returns turtle to origin outside WSC.
–]
end of code:
output:
peripheral found on top
113
problem is, the target turtle is not turned on, and its ID is 13, not the reported 113.
LastID file shows 112 (the ID of the moving turtle), so it appears the getID method is returning the next ID, because
(assuming) it can't get the ID from the target.
I try it with the target already turned on (manually) and still the getID method returns 113.
I can physically see the turtle come up under the target, and pause for a second, then it leaves.
The startup code on the target turtle functions properly when I click on it (tells a command block to send a message to all users),
but not when I use the turnOn method from another turtle.
I'm thinking that the WSC is protected from non-OPed players, and recognizes the turtle as such.