1
0
mirror of https://github.com/kepler155c/opus synced 2025-07-05 11:32:51 +00:00
This commit is contained in:
kepler155c@gmail.com 2017-09-18 14:46:46 -04:00
parent 36fd5ca073
commit 00fe2c9989
5 changed files with 26 additions and 8 deletions

View File

@ -196,8 +196,8 @@ local function pathTo(dest, options)
dest = selectDestination(dests, box, map, dim) dest = selectDestination(dests, box, map, dim)
if not dest then if not dest then
error('failed to reach destination') -- error('failed to reach destination')
-- return false, 'failed to reach destination' return false, 'failed to reach destination'
end end
if turtle.point.x == dest.x and turtle.point.z == dest.z and turtle.point.y == dest.y then if turtle.point.x == dest.x and turtle.point.z == dest.z and turtle.point.y == dest.y then
break break

View File

@ -343,6 +343,11 @@ function Manager:click(button, x, y)
if button == 1 then if button == 1 then
local c = os.clock() local c = os.clock()
if self.doubleClickTimer then
debug(c - self.doubleClickTimer)
end
if self.doubleClickTimer and (c - self.doubleClickTimer < 1.9) and if self.doubleClickTimer and (c - self.doubleClickTimer < 1.9) and
self.doubleClickX == x and self.doubleClickY == y and self.doubleClickX == x and self.doubleClickY == y and
self.doubleClickElement == clickEvent.element then self.doubleClickElement == clickEvent.element then

View File

@ -226,20 +226,17 @@
requires = "turtle", requires = "turtle",
}, },
[ "53a5d150062b1e03206b9e15854b81060e3c7552" ] = { [ "53a5d150062b1e03206b9e15854b81060e3c7552" ] = {
apptype = "url",
title = "Minesweeper", title = "Minesweeper",
category = "Games", category = "Games",
run = "http://pastebin.com/raw/nsKrHTbN", run = "http://pastebin.com/raw/nsKrHTbN",
}, },
[ "8d59207c8a84153b3e9f035cc3b6ec7a23671323" ] = { [ "8d59207c8a84153b3e9f035cc3b6ec7a23671323" ] = {
apptype = "url",
title = "Micropaint", title = "Micropaint",
category = "Apps", category = "Apps",
run = "http://pastebin.com/raw/tMRzJXx2", run = "http://pastebin.com/raw/tMRzJXx2",
requires = "advancedComputer", requires = "advancedComputer",
}, },
[ "d78f28759f255a0db76604ee560b87c4715a0da5" ] = { [ "d78f28759f255a0db76604ee560b87c4715a0da5" ] = {
apptype = "url",
title = "Sketch", title = "Sketch",
category = "Apps", category = "Apps",
run = "http://pastebin.com/raw/Mm5hd97E", run = "http://pastebin.com/raw/Mm5hd97E",

View File

@ -34,9 +34,25 @@ function turtle.setGPSHome()
local config = { } local config = { }
Config.load('gps', config) Config.load('gps', config)
if turtle.enableGPS() then if turtle.point.gps then
config.home = turtle.point config.home = turtle.point
Config.update('gps', config) Config.update('gps', config)
turtle.gotoPoint(turtle.point) else
local pt = GPS.getPoint()
if pt then
local originalHeading = turtle.point.heading
local heading = GPS.getHeading()
if heading then
local turns = (turtle.point.heading - originalHeading) % 4
pt.heading = (heading - turns) % 4
config.home = pt
Config.update('gps', config)
pt = GPS.getPoint()
pt.heading = heading
turtle.setPoint(pt, true)
turtle.gotoPoint(config.home)
end
end
end end
end end

View File

@ -222,7 +222,7 @@ function turtle.placeDown(slot) return _place(actions.down, slot) end
local function _drop(action, qtyOrName, qty) local function _drop(action, qtyOrName, qty)
if not qtyOrName or type(qtyOrName) == 'number' then if not qtyOrName or type(qtyOrName) == 'number' then
return action.drop(qtyOrName) return action.drop(qtyOrName or 64)
end end
return inventoryAction(action.drop, qtyOrName, qty) return inventoryAction(action.drop, qtyOrName, qty)
end end