app tweaks
This commit is contained in:
@@ -33,6 +33,7 @@ local function display(meta)
|
||||
canvas.pitch = canvas.group.addText({ 4, 5 }, '') -- , 0x202020FF)
|
||||
canvas.pitch.setShadow(true)
|
||||
canvas.pitch.setScale(.75)
|
||||
canvas.group.addItem({ 5, 30 }, 'minecraft:elytra')
|
||||
canvas.group2 = canvas.addGroup({ 80, 10 })
|
||||
canvas.group2.addLines(
|
||||
{ 0, 0 },
|
||||
@@ -143,5 +144,9 @@ parallel.waitForAny(
|
||||
end
|
||||
print('Waiting for 5 seconds before restarting')
|
||||
os.sleep(5)
|
||||
modules = _G.peripheral.wrap('back')
|
||||
canvas = modules and modules.canvas and modules.canvas()
|
||||
end
|
||||
end)
|
||||
|
||||
clearDisplay()
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
run = "elytraFly.lua",
|
||||
requires = "neuralInterface",
|
||||
},
|
||||
[ "fisher" ] = {
|
||||
title = "Fisher",
|
||||
category = "Neural",
|
||||
run = "fisher.lua",
|
||||
requires = "neuralInterface",
|
||||
},
|
||||
[ "9101fc1744ab274aaa0b54ee22b14ca53ee6e236" ] = {
|
||||
title = "Sensor",
|
||||
category = "Neural",
|
||||
|
||||
@@ -10,31 +10,61 @@ local function Syntax(missing)
|
||||
end
|
||||
|
||||
local kinetic = device['plethora:kinetic'] or Syntax('kinetic augment')
|
||||
local sensor = device['plethora:sensor'] or Syntax('entity sensor')
|
||||
local sensor = device['plethora:sensor'] or Syntax('entity sensor')
|
||||
local canvas = device['plethora:glasses'] and device['plethora:glasses'].canvas()
|
||||
|
||||
if not sensor.getMetaOwner then Syntax('introspection module') end
|
||||
|
||||
local depth = -3
|
||||
local icon
|
||||
local scales = { .2, .4, .6, .8, 1, .8, .6, .4 }
|
||||
local scale = 0
|
||||
|
||||
while true do
|
||||
local meta = sensor.getMetaByName('unknown')
|
||||
if not meta then
|
||||
local owner = sensor.getMetaOwner()
|
||||
local held = owner.heldItem and owner.heldItem.getMetadata()
|
||||
if held and held.rawName == 'item.fishingRod' then
|
||||
kinetic.use(.2)
|
||||
print('casting')
|
||||
os.sleep(.5)
|
||||
meta = sensor.getMetaByName('unknown')
|
||||
depth = meta and meta.y - .5 or depth
|
||||
if canvas then
|
||||
local w, h = canvas.getSize()
|
||||
icon = canvas.addItem({ w - 20, h - 20 }, 'minecraft:fishing_rod' )
|
||||
end
|
||||
|
||||
local function fish()
|
||||
while true do
|
||||
local meta = sensor.getMetaByName('unknown')
|
||||
if not meta then
|
||||
local owner = sensor.getMetaOwner()
|
||||
local held = owner.heldItem and owner.heldItem.getMetadata()
|
||||
if held and held.rawName == 'item.fishingRod' then
|
||||
if icon then
|
||||
icon.setItem('minecraft:fish', 1)
|
||||
end
|
||||
kinetic.use(.2)
|
||||
print('casting')
|
||||
os.sleep(.5)
|
||||
meta = sensor.getMetaByName('unknown')
|
||||
depth = meta and meta.y - .5 or depth
|
||||
else
|
||||
if icon then
|
||||
icon.setItem('minecraft:fishing_rod')
|
||||
end
|
||||
print('waiting for fishing rod to be selected')
|
||||
end
|
||||
scale = 1
|
||||
icon.setScale(1)
|
||||
os.sleep(1)
|
||||
else
|
||||
print('waiting for fishing rod to be selected')
|
||||
if meta.y < depth then
|
||||
kinetic.use(.3)
|
||||
print('reeled in')
|
||||
end
|
||||
if icon then
|
||||
scale = scale + 1
|
||||
icon.setScale(scales[(scale % #scales) + 1])
|
||||
end
|
||||
os.sleep(.1)
|
||||
end
|
||||
os.sleep(1)
|
||||
else
|
||||
if meta.y < depth then
|
||||
kinetic.use(.3)
|
||||
print('reeled in')
|
||||
end
|
||||
os.sleep(.1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pcall(fish)
|
||||
|
||||
if icon then
|
||||
icon.remove()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user