Calculating heading returns heading message on success.
Status request now displays previously hidden heading information.
This commit is contained in:
parent
4241ed4d03
commit
d95cae9caf
@ -101,8 +101,8 @@ local function handleMessage(sender, type, data)
|
||||
if type == LOG then
|
||||
print("[" .. sender .. "]: " .. data["log"] .. ": " .. (data["content"]["n"] >= 1 and tostring(data["content"][1]) or ""))
|
||||
if data["log"] == STATUS then
|
||||
print("Relative position: " .. textutils.serializeJSON(data["content"][1]["relative_position"]["coordinates"]))
|
||||
print("Position: " .. (data["content"][1]["position"]["coordinates"] and textutils.serialiseJSON(data["content"][1]["position"]["coordinates"]) or "not positioned."))
|
||||
print("Relative position: " .. textutils.serializeJSON(data["content"][1]["relative_position"]))
|
||||
print("Position: " .. (data["content"][1]["position"]["coordinates"] and textutils.serialiseJSON(data["content"][1]["position"]) or "not positioned."))
|
||||
print("fuel: " .. tostring(data["content"][1]["fuel"]))
|
||||
print("current task: " .. data["content"][1]["task"])
|
||||
end
|
||||
|
@ -274,6 +274,7 @@ local function determineHeading()
|
||||
end
|
||||
heading = fDelta
|
||||
rightAxis = position - oldPos
|
||||
sendLog(HEADING, "Heading obtained. \nForward: " .. heading .. "\nRight direction: " .. rightAxis)
|
||||
end
|
||||
|
||||
local function moveBy(delta, forward, right)
|
||||
|
Loading…
Reference in New Issue
Block a user