Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component");
- local gpu = component.gpu;
- local event = require("event");
- local x = 1;
- local y = 1;
- local c_white = 0xffffff;
- os.execute("sleep 1");
- --event.listen("key_down");
- function setBackgroundSpace(color)
- gpu.setBackground(color);
- width, height = gpu.getResolution();
- gpu.fill(1, 1, width, height, " ");
- return true;
- end
- function drawTextLn(...)
- local tempText;
- local arg = {...};
- for i, v in ipairs(arg) do
- if i % 2 == 1 then
- tempText = v;
- else
- gpu.setForeground(v);
- gpu.set(x, y, tempText);
- x = x + string.len(tempText);
- end
- end
- y = y + 1;
- x = 1;
- end
- function resetScreen()
- x = 1;
- y = 1;
- setBackgroundSpace(0x0d0d0d);
- end
- --Code starts here
- gpu.setResolution(36, 36/2);
- while true do
- setBackgroundSpace(0x0d0d0d);
- drawTextLn("Reactor Status: ", 0xffffff)
- drawTextLn("Energy Produced Per Second: ", c_white, "1 gazillion", 0x00ff44)
- check = event.pull(.1, "key_down");
- if check ~= nil then break; end
- resetScreen();
- end
- os.execute("clear");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement