Posted 01 December 2015 - 08:42 AM
I have a pesky problem which I cannot find the cause of, and right now I am inclined to call this a bug in CC. But please prove me wrong!
I see the problem in a Crafty Turtle with a particular program (see below). While the turtle works as intended initially, the bug will most often occur when I log back into the server after a while and start this particular program again. The error I am seeing is "attempt to call nil". I understand that this error most often occurs when you are trying to call a function which does not exist or which you have mistyped. But in this case, the function missing is turtle.craft(). Also, when I hop into the Lua interpreter and run turtle.craft() I see the same error! It even fails to tab-complete that command, as if has simply disappeared from the Turtle API.
The only way to fix this problem is to destroy the computer and place it again. If I have labels on it, this is a quick procedure. But it really annoys the h*ll out of me. I want to know what's going on! :P/>
This is on a Linux-based multiplayer server running 1.7.10 latest via Forge. No other mods are installed on the server or client. The server is running Creative. I have confirmed the bug with multiple minor versions of Forge, and with CC 1.74. I have also seen it with multiple clients across 2 different OS.
I should say that I have attempted to replicate this in singleplayer without success.
Here is a screenshot which demonstrates the bug:
And here is the program. It's mainly a straight copy of this thing from Rainbow Hyphen.
It simply combines his Fireworks launcher with two required input signals: one from HTTP and another from Redstone.
When this bug occurs, it is in the while loop at the end, at turtle.craft(1).
I hope someone has an idea about whats happening here.
I see the problem in a Crafty Turtle with a particular program (see below). While the turtle works as intended initially, the bug will most often occur when I log back into the server after a while and start this particular program again. The error I am seeing is "attempt to call nil". I understand that this error most often occurs when you are trying to call a function which does not exist or which you have mistyped. But in this case, the function missing is turtle.craft(). Also, when I hop into the Lua interpreter and run turtle.craft() I see the same error! It even fails to tab-complete that command, as if has simply disappeared from the Turtle API.
The only way to fix this problem is to destroy the computer and place it again. If I have labels on it, this is a quick procedure. But it really annoys the h*ll out of me. I want to know what's going on! :P/>
This is on a Linux-based multiplayer server running 1.7.10 latest via Forge. No other mods are installed on the server or client. The server is running Creative. I have confirmed the bug with multiple minor versions of Forge, and with CC 1.74. I have also seen it with multiple clients across 2 different OS.
I should say that I have attempted to replicate this in singleplayer without success.
Here is a screenshot which demonstrates the bug:
And here is the program. It's mainly a straight copy of this thing from Rainbow Hyphen.
It simply combines his Fireworks launcher with two required input signals: one from HTTP and another from Redstone.
When this bug occurs, it is in the while loop at the end, at turtle.craft(1).
-- fw_maker
-- Put this in the Crafty Turtle that makes the fireworks.
-- Start this one first, then start fw_parts!
side = 'back'
delay = 0.2
queueid = 20
function repack()
-- if something is in cell 4, move it to cell 11.
turtle.select(4)
turtle.transferTo(11)
-- if something is in cell 8, move it to cell 10.
turtle.select(8)
turtle.transferTo(10)
-- select cell 1
turtle.select(1)
end
function sync()
rs.setOutput(side, true)
sleep(delay)
rs.setOutput(side, false)
sleep(delay)
while not rs.getInput(side) do
sleep(delay)
end
sleep(delay * 3)
repack()
end
function getQueue()
local handle = http.get("http://example.com/json/"..queueid)
code = handle.getResponseCode()
if (code == 200) then
return true
else
return false
end
end
function getMasterRS()
return rs.getInput('front')
end
function goForLaunch()
rsm = getMasterRS()
qstatus = false
if (rsm == true) then
qstatus = getQueue()
end
return qstatus
end
-- START PROCEDURE
-- select cell 1
turtle.select(1)
while (true) do
sync() -- firework star
turtle.craft(1)
sleep(delay)
sync() -- firework!
turtle.craft(1)
while not (goForLaunch()) do
sleep(delay*5)
end
turtle.place()
end
I hope someone has an idea about whats happening here.