-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel.lua
37 lines (35 loc) · 1.27 KB
/
kernel.lua
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
-- Initialize the peripherals before booting
function initPeripherals()
deviceAmount = 0
if peripheral.isPresent("top") == true then
topdeviceType = peripheral.getType("top")
print("Found device:", topdeviceType, "on top")
deviceAmount = deviceAmount + 1
end
if peripheral.isPresent("left") == true then
leftdeviceType = peripheral.getType("left")
print("Found device:", leftdeviceType, "on the left side")
deviceAmount = deviceAmount + 1
end
if peripheral.isPresent("right") == true then
rightdeviceType = peripheral.getType("right")
print("Found device:", rightdeviceType, "on the right side")
deviceAmount = deviceAmount + 1
end
if peripheral.isPresent("bottom") == true then
bottomdeviceType = peripheral.getType("bottom")
print("Found device:", bottomdeviceType, "on the bottom")
deviceAmount = deviceAmount + 1
end
print("Device discovery finished. Found", deviceAmount , "device(s)")
end
initPeripherals()
print("Checking init files...")
-- Read and launch init files.
function readInit()
if fs.exists("/init/init.cfg") == true then
print("Init file found. Proceeding.")
else print("Init file not found. Halting.")
end
end
readInit()