forked from MoonManModding/EmergingTechnology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen-computers-example.lua
39 lines (31 loc) · 984 Bytes
/
open-computers-example.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
38
39
local component = require "component"
local event = require "event"
local term = require "term"
local computer = require "computer"
growbed = component.etech_grow_bed
computer.beep()
print("Connecting to grow bed...")
repeat
term.clear()
local water = growbed.getWaterLevel()
local medium = growbed.getMediumName()
local multiplier = growbed.getMediumGrowthMultiplier()
local light = growbed.getLightLevel()
local growth = growbed.getPlantGrowth()
local name = growbed.getPlantName()
print("- Hydroponic Grow Bed -")
print("Current crop: " .. name)
print("Crop growth: " .. growth)
print("Water: " .. water)
print("Medium: " .. medium)
print("Multiplier: " .. multiplier)
print("Light Level: " .. light)
if (growth == 7) then
computer.beep()
print("Crop is ready to be harvested!")
end
if (water < 100) then
computer.beep()
print("Warning - Low water!")
end
until event.pull(1) == "interrupted"