From 06110165336db03b8e013d4df5a2a5ea37127aa3 Mon Sep 17 00:00:00 2001 From: LemADEC Date: Thu, 28 Jan 2016 03:39:18 +0100 Subject: [PATCH] Fixed CC/OC scripts for mining laser (2nd parameter was inverted vs the help screen) --- .../warpdriveMiningLaser/mine | 22 +++++------------ .../warpdriveMiningLaser/mine.lua | 24 ++++++------------- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMiningLaser/mine b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMiningLaser/mine index 50c484e4..610bddd7 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMiningLaser/mine +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMiningLaser/mine @@ -15,12 +15,12 @@ end noExit = true layerOffset = 1 -mineAll = true +onlyOres = false silktouch = false args = {...} if #args > 0 then if args[1] == "help" or args[1] == "?" then - print("Usage: mine ") + print("Usage: mine ") print() print("Miner always mine below it, down to bedrock.") print("Set layerOffset to define starting level.") @@ -35,8 +35,8 @@ if #args > 0 then end if #args > 1 then - if args[2] == "false" or args[2] == "0" then - mineAll = false + if args[2] == "true" or args[2] == "1" then + onlyOres = true end end @@ -59,18 +59,8 @@ if noExit then statusString, isActive = mininglaser.state() if not isActive then mininglaser.offset(layerOffset) - - if mineAll then - mininglaser.onlyOres(false) - else - mininglaser.onlyOres(true) - end - - if silktouch then - mininglaser.silktouch(silktouch) - else - mininglaser.silktouch(false) - end + mininglaser.onlyOres(onlyOres) + mininglaser.silktouch(silktouch) mininglaser.start() end diff --git a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveMiningLaser/mine.lua b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveMiningLaser/mine.lua index 3faa8518..98e79c92 100644 --- a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveMiningLaser/mine.lua +++ b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveMiningLaser/mine.lua @@ -28,12 +28,12 @@ end noExit = true layerOffset = 1 -mineAll = true +onlyOres = true silktouch = false args = {...} if #args > 0 then if args[1] == "help" or args[1] == "?" then - print("Usage: mine ") + print("Usage: mine ") print() print("Miner always mine below it, down to bedrock.") print("Set layerOffset to define starting level.") @@ -48,8 +48,8 @@ if #args > 0 then end if #args > 1 then - if args[2] == "false" or args[2] == "0" then - mineAll = false + if args[2] == "true" or args[2] == "1" then + onlyOres = true end end @@ -70,19 +70,9 @@ if noExit then statusString, isActive = mininglaser.state() if not isActive then mininglaser.offset(layerOffset) - - if mineAll then - mininglaser.onlyOres(false) - else - mininglaser.onlyOres(true) - end - - if silktouch then - mininglaser.silktouch(silktouch) - else - mininglaser.silktouch(false) - end - + mininglaser.onlyOres(onlyOres) + mininglaser.silktouch(silktouch) + mininglaser.start() end end