blob: 56700a211d1e68f9b8e5dd5737401947762958c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
local p = peripheral.wrap"back"
assert(p.hasModule"plethora:kinetic", "need kinetic!")
assert(p.hasModule"plethora:glasses", "need glasses!")
local strength = 0.2
local delta = 0.01
local canvas = p.canvas()
local text = canvas.addText({x=5,y=5}, "..")
text.setScale(3)
parallel.waitForAny(
function() while true do
p.launch(0,-90,strength)
end end,
function() while true do
text.setText(tostring(strength))
local _,key = os.pullEvent"key"
if key == 265 then strength=strength+delta
elseif key == 264 then strength=strength-delta end
strength = math.min(strength, 4)
strength = math.max(strength, 0)
end end
)
|