style: consistent casing
This commit is contained in:
@@ -218,14 +218,14 @@ function handleMessages(side, channel, replyChannel, message, dist)
|
||||
end
|
||||
|
||||
if not commands[message.name] then
|
||||
log.error("unhandled command (%s)", message.name)
|
||||
log.error("Unhandled command (%s)", message.name)
|
||||
return
|
||||
end
|
||||
|
||||
local cmd = commands[message.name]
|
||||
for i, v in pairs(cmd.keys) do
|
||||
if type(message.data[i]) ~= v and v ~= "optional" then
|
||||
log.error("command %s requires key %s of type %s (was %s)", message.name, i, v, type(message[i]))
|
||||
log.error("Command %s requires key %s of type %s (was %s)", message.name, i, v, type(message[i]))
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -233,10 +233,10 @@ function handleMessages(side, channel, replyChannel, message, dist)
|
||||
-- cmd execution
|
||||
local success, err = pcall(cmd.handler, message.data, message.id)
|
||||
if not success then
|
||||
log.error("error occurred while executing command %s: %s", message.name, err)
|
||||
log.error("Error occurred while executing command %s: %s", message.name, err)
|
||||
end
|
||||
|
||||
log.info("processed command (%s)", message.name)
|
||||
log.info("Processed command (%s)", message.name)
|
||||
end
|
||||
|
||||
registerEventListener("modem_message", handleMessages)
|
||||
@@ -334,7 +334,7 @@ end
|
||||
registerConsoleCommand("exit", exitCommand, "Exits the program")
|
||||
|
||||
function scanCommand(args)
|
||||
log.info("broadcasting SCAN")
|
||||
log.info("Broadcasting SCAN")
|
||||
sendToAll("SCAN", { ["hostChannel"] = HOST_CHANNEL })
|
||||
end
|
||||
|
||||
@@ -348,14 +348,14 @@ registerConsoleCommand("clear", clearCommand, "Clears the console")
|
||||
|
||||
function turtlesCommand(args)
|
||||
if #turtles == 0 then
|
||||
log.info("no turtles registered")
|
||||
log.info("No turtles registered")
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, #turtles, 1 do
|
||||
local turt = turtles[i]
|
||||
|
||||
local turtleMessage = ("coords: %d, %d, %d - fuel: %d - channel: %d - id: %d - status: %s"):format(
|
||||
local turtleMessage = ("Coords: %d, %d, %d - fuel: %d - channel: %d - id: %d - status: %s"):format(
|
||||
turt.position[1],
|
||||
turt.position[2], turt.position[3], turt.fuel, turt.channel, turt.id, turt.status)
|
||||
|
||||
@@ -468,7 +468,7 @@ function drawStatusBar(y)
|
||||
scr.setTextColor(colors.white)
|
||||
scr.clearLine()
|
||||
|
||||
local str = ("turtles: %d"):format(#turtles)
|
||||
local str = ("Turtles: %d"):format(#turtles)
|
||||
scr.write(str)
|
||||
end
|
||||
|
||||
@@ -537,7 +537,7 @@ end
|
||||
--[[
|
||||
main
|
||||
]]
|
||||
log.general("init")
|
||||
log.general("Init")
|
||||
|
||||
while shouldRun do
|
||||
updateScreen()
|
||||
|
||||
Reference in New Issue
Block a user