-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
41 lines (32 loc) · 858 Bytes
/
main.lua
File metadata and controls
41 lines (32 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
-- main.lua
local autoUpdate = require("lib/autoupdate")
local version = require("version")
autoUpdate(
version,
"MarkinoTeck/GTNH-HTTP-ROBOT-CONTROLLER",
"RobotCode"
)
local ok, robot_api = pcall(require, "robot")
---@diagnostic disable-next-line: cast-local-type
if not ok then robot_api = nil end
local Config = require("lib/config")
local Sender = require("lib/sender")
local Setup = require("src/setup")
local DEFAULTS = {
id = false,
ip = "http://test.lookitsmark.com",
configured = false,
owner = false,
}
local conf = Config.new("/etc/robot_config.cfg", DEFAULTS)
Sender.init(conf, robot_api)
Setup.run(conf, robot_api)
if robot_api then
local Commands = require("src/commands")
local Loop = require("src/loop")
Commands.init(conf)
Loop.init(conf)
while true do
Loop.tick()
end
end