blob: b39ecfd53ca2d5991f151a23a9c8d312b96e4aad (
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
25
|
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()
canvas.clear()
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
)
|