From a3294c3c1aa7437f8338c64a20be6c99bee6cec8 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Thu, 22 Dec 2022 12:45:46 +0100 Subject: [PATCH] Added copy-to-clipboard, and fixed bug in refuel. --- docs/package-lock.json | 14 ++++++++++++++ docs/package.json | 3 +++ docs/src/.vuepress/config.js | 6 ++++++ docs/src/config/README.md | 15 --------------- src/movescript.lua | 2 +- 5 files changed, 24 insertions(+), 16 deletions(-) delete mode 100755 docs/src/config/README.md diff --git a/docs/package-lock.json b/docs/package-lock.json index 27f0f1f..1b238b7 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,6 +8,9 @@ "name": "movescript-docs", "version": "0.0.1", "license": "MIT", + "dependencies": { + "vuepress-plugin-code-copy": "^1.0.6" + }, "devDependencies": { "vuepress": "^1.5.3" } @@ -14222,6 +14225,12 @@ "object.getownpropertydescriptors": "^2.0.3" } }, + "node_modules/vuepress-plugin-code-copy": { + "version": "1.0.6", + "resolved": "http://192.168.88.248:8081/repository/npm-public/vuepress-plugin-code-copy/-/vuepress-plugin-code-copy-1.0.6.tgz", + "integrity": "sha512-FiqwMtlb4rEsOI56O6sSkekcd3SlESxbkR2IaTIQxsMOMoalKfW5R9WlR1Pjm10v6jmU661Ex8MR11k9IzrNUg==", + "license": "GPL-3.0-or-later" + }, "node_modules/vuepress-plugin-container": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/vuepress-plugin-container/-/vuepress-plugin-container-2.1.5.tgz", @@ -26370,6 +26379,11 @@ } } }, + "vuepress-plugin-code-copy": { + "version": "1.0.6", + "resolved": "http://192.168.88.248:8081/repository/npm-public/vuepress-plugin-code-copy/-/vuepress-plugin-code-copy-1.0.6.tgz", + "integrity": "sha512-FiqwMtlb4rEsOI56O6sSkekcd3SlESxbkR2IaTIQxsMOMoalKfW5R9WlR1Pjm10v6jmU661Ex8MR11k9IzrNUg==" + }, "vuepress-plugin-container": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/vuepress-plugin-container/-/vuepress-plugin-container-2.1.5.tgz", diff --git a/docs/package.json b/docs/package.json index 1560e9a..e3172cd 100755 --- a/docs/package.json +++ b/docs/package.json @@ -15,5 +15,8 @@ "license": "MIT", "devDependencies": { "vuepress": "^1.5.3" + }, + "dependencies": { + "vuepress-plugin-code-copy": "^1.0.6" } } diff --git a/docs/src/.vuepress/config.js b/docs/src/.vuepress/config.js index dae83da..8316bec 100755 --- a/docs/src/.vuepress/config.js +++ b/docs/src/.vuepress/config.js @@ -81,5 +81,11 @@ module.exports = { plugins: [ '@vuepress/plugin-back-to-top', '@vuepress/plugin-medium-zoom', + ['vuepress-plugin-code-copy', { + backgroundTransition: false, + staticIcon: false, + color: '#de9502', + successText: 'Copied to clipboard.' + }] ] } diff --git a/docs/src/config/README.md b/docs/src/config/README.md deleted file mode 100755 index 63a04b9..0000000 --- a/docs/src/config/README.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -sidebar: auto ---- - -# Config - -## foo - -- Type: `string` -- Default: `/` - -## bar - -- Type: `string` -- Default: `/` diff --git a/src/movescript.lua b/src/movescript.lua index dd44e50..1e32f57 100644 --- a/src/movescript.lua +++ b/src/movescript.lua @@ -131,7 +131,7 @@ end -- Blocks until the turtle's fuel level is at least at the required level. local function refuelToAtLeast(requiredLevel, settings) refuelAll(settings) - while t.getFuelLevel < requiredLevel do + while t.getFuelLevel() < requiredLevel do print( "[MS] Fuel level is too low. Level: " .. t.getFuelLevel() .. ". Required: " .. requiredLevel .. ". Please add some of the following fuels:"