From 58af53bc8341b0691a1685503fdd1cfd1381b1c5 Mon Sep 17 00:00:00 2001 From: "aiden@zuchtbude.de" Date: Sun, 8 May 2022 16:41:56 +0200 Subject: [PATCH] euh, same as previous commit, stupid vs code smh my head --- random_stuff/gui_testing.lua | 16 ++++++++++++++++ reactorControl/gui_control.lua | 8 ++++---- reactorControl/reactorControl.lua | 21 +++++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 random_stuff/gui_testing.lua create mode 100644 reactorControl/reactorControl.lua diff --git a/random_stuff/gui_testing.lua b/random_stuff/gui_testing.lua new file mode 100644 index 0000000..daead71 --- /dev/null +++ b/random_stuff/gui_testing.lua @@ -0,0 +1,16 @@ + +component = require("component") +event = require("event") +colors = require("colors") +gpu = component.gpu + +while true do + local _,_,x,y = event.pull("touch") + if(x <= 50 and x >= 40 and y <= 20 and y >= 10) then + gpu.setBackground(0x00ff00) + gpu.fill(x,y,1,1," ") + else + gpu.setBackground(0x0000ff) + gpu.fill(x,y,1,1," ") + end +end \ No newline at end of file diff --git a/reactorControl/gui_control.lua b/reactorControl/gui_control.lua index 29669ca..8760cce 100644 --- a/reactorControl/gui_control.lua +++ b/reactorControl/gui_control.lua @@ -109,7 +109,7 @@ t3 = thread.create(cleanup) -local test = {"a","b","c"} -for i=0,table.getn(test) do - print(test[i]) -end \ No newline at end of file +-- local test = {"a","b","c"} +-- for i=0,table.getn(test) do +-- print(test[i]) +-- end \ No newline at end of file diff --git a/reactorControl/reactorControl.lua b/reactorControl/reactorControl.lua new file mode 100644 index 0000000..f045cdf --- /dev/null +++ b/reactorControl/reactorControl.lua @@ -0,0 +1,21 @@ +component = require("component") +event = require("event") +redstone = component.redstone +reactor = component.reactor_chamber + + + +while true do + heat = reactor.getHeat() + heatp = heat / reactor.getMaxHeat() * 100 + print(heat .. " : " .. heatp) + + if heatp > 60 then + redstone.setOutput(0,0) + end + if heatp < 1 then + redstone.setOutput(0,1) + end + + os.sleep(1) +end \ No newline at end of file