Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
--Min is 3 for H-- lengthMax = 50 widthMax = 3 heightMax = 3 orientation = 4 --N=4, E=3, S=2, W=1-- orientations = {"north", "east", "south", "west"} startDirection = orientation xCurrent = 0 zCurrent = 0 yCurrent = 0 xHome = 0 zHome = 0 yHome = 0 xBlackcurrant = 0 zBlackcurrant = 0 yBlackcurrant = 0 orientationLast = orientation zDiff = {-1, 0, 1, 0} xDiff = {0, 1, 0 ,-1} turn = 1 turnLast = turn lengthCurrent = lengthMax placeTorch = 10 width = widthMax finishWalk = widthMax heightCheck = heightMax heightMax = heightMax - 3 height = heightMax ending = false kill = false said = false fuelSaid = false selectedSlot = 16 answer = "F" facingAnswer = 0 torchesGoCheck = "Pickles" startUpComplete = false saidYes = "Rainbows" fuelYes = "Cabbages" hasTorch = false lengthSet = 0 widthSet = 0 heightSet = 0 fuelLevel = turtle.getFuelLevel() function fillFacing() print("Fill in which way I'm facing: ") print("North=4, East=3, South=2, West=1") facingAnswer = tonumber(read()) while not(facingAnswer == 1 or facingAnswer == 2 or facingAnswer == 3 or facingAnswer == 4) do print("ERROR! Please try again!") print("Fill in which way I'm facing: ") print("North=4, East=3, South=2, West=1") facingAnswer = tonumber(read()) end orientation = facingAnswer startDirection = orientation orientationLast = orientation shell.run("clear") end function answerWrong() print("ERROR! Please try again!") print("Do you want to fill in the dimensions? Type: 'Y' or 'N'") print("If 'N' then I will use the Default") print("Default: (L: " .. lengthMax .. ", W: " .. widthMax .. ", H: " .. heightCheck .. ")") answer = read() shell.run("clear") end function runStartup() if startUpComplete == false then shell.run("clear") print("I'm going to build you a room, Master.") print(" ") print("Do you want to fill in the dimensions? Type: 'Y' or 'N'") print("If 'N' then I will use the Default") print("Default: (L: " .. lengthMax .. ", W: " .. widthMax .. ", H: " .. heightCheck .. ")") answer = read() while not(answer == "Y" or answer == "N") do print("ERROR! Please try again!") print("Do you want to fill in the dimensions? Type: 'Y' or 'N'") print("If 'N' then I will use the Default") print("Default: (L: " .. lengthMax .. ", W: " .. widthMax .. ", H: " .. heightCheck .. ")") answer = read() shell.run("clear") end if answer == "N" then fillFacing() heightMax = heightMax + 3 heightCheck = heightMax heightMax = heightMax - 3 height = heightMax startUpComplete = true elseif answer == "Y" then shell.run("clear") print("Please Fill the Dimensions!") print(" ") print("Fill in the Length:") lengthSet = tonumber(read()) lengthMax = lengthSet lengthCurrent = lengthMax while lengthSet == nil do print("ERROR! Please try again!") print("Fill in the Length:") lengthSet = tonumber(read()) lengthMax = lengthSet lengthCurrent = lengthMax shell.run("clear") end shell.run("clear") print("Please Fill the Dimensions!") print(" ") print("Fill in the Width:") widthSet = tonumber(read()) widthMax = widthSet width = widthMax while widthSet == nil do print("ERROR! Please try again!") print("Fill in the Width:") widthSet = tonumber(read()) widthMax = widthSet width = widthMax shell.run("clear") end shell.run("clear") print("Please Fill the Dimensions!") print(" ") print("Fill in the Height:") heightSet = tonumber(read()) heightMax = heightSet heightCheck = heightMax heightMax = heightMax - 3 height = heightMax while heightSet == nil or heightSet < 3 do print("ERROR! Please try again!") print("Fill in the Height:") heightSet = tonumber(read()) heightMax = heightSet heightCheck = heightMax heightMax = heightMax - 3 height = heightMax shell.run("clear") end shell.run("clear") fillFacing() shell.run("clear") print("I will now start, Master.") print(" ") startUpComplete = true end end end function torchGo() while not(torchesGoCheck == "Go") do print("ERROR! Please try Again") print("Once I have Torches Type: 'Go'") torchesGoCheck = read() shell.run("clear") end end function torchAdded() while not(saidYes == "Y") do shell.run("clear") print("ERROR! Please try Again") print("Once I have Torches, Type: 'Y'") saidYes = read() end end function saidCheck() shell.run("clear") print("I need Torches in Slot.1, Master.") print("Once I have Torches Type: 'Y'") saidYes = read() torchAdded() end function torchCheck() while not(turtle.getItemDetail("minecraft:torch")) do if said == false then saidCheck() hasTorch = true end end if hasTorch == true then shell.run("clear") print("I'm Ready, Master. Type: 'Go' to Start") torchesGoCheck = read() torchGo() end shell.run("clear") hasTorch = false said = false end function fuelCheck() fuelLevel = turtle.getFuelLevel() while not(fuelLevel > 0) do if fuelSaid == false then fuelSaidCheck() hasFuel = true end shell.run("refuel all") fuelLevel = turtle.getFuelLevel() end if hasFuel == true then shell.run("clear") print("I'm Ready, Master. Type: 'Go' to Start") fuelGoCheck = read() fuelGo() end shell.run("clear") hasFuel = false fuelSaid = false end function fuelGo() while not(fuelGoCheck == "Go") do print("ERROR! Please try Again") print("Once I have Fuel Type: 'Go'") fuelGoCheck = read() shell.run("clear") end end function fuelAdded() while not(fuelYes == "Y") do shell.run("clear") print("ERROR! Please try Again") print("Once I have Fuel, Type: 'Y'") fuelYes = read() end end function fuelSaidCheck() shell.run("clear") print("I need Fuel, Master.") print("Once I have Fuel Type: 'Y'") fuelYes = read() fuelAdded() end function left() orientation = orientation - 1 orientation = (orientation - 1) % 4 orientation = orientation + 1 turtle.turnLeft() end function right() orientation = orientation - 1 orientation = (orientation + 1) % 4 orientation = orientation + 1 turtle.turnRight() end function look(direction) while direction ~= orientations[orientation] do right() end end function moveForward() while turtle.detect() do turtle.dig() end moved = false while not(moved) do moved = turtle.forward() end xCurrent = xCurrent + xDiff[orientation] zCurrent = zCurrent + zDiff[orientation] end function digForward() while turtle.detect() do turtle.dig() end end function digBelow() while turtle.detectDown() do turtle.digDown() end end function digAbove() while turtle.detectUp() do turtle.digUp() end end function moveUp() turtle.digUp() moved = false while not(moved) do digAbove() moved = turtle.up() end yCurrent = yCurrent + 1 end function moveDown() turtle.digDown() moved = false while not(moved) do moved = turtle.down() end yCurrent = yCurrent - 1 end function goDown() moved = false while not(moved) do turtle.digDown() moved = turtle.down() end yCurrent = yCurrent - 1 end function goUp() moved = false while not(moved) do digAbove() moved = turtle.up() end yCurrent = yCurrent + 1 end function upBreak() digAbove() goUp() digAbove() end function leftDig() left() moveForward() digAbove() digBelow() while height > 0 do upBreak() height = height - 1 end height = heightMax while height > 0 do moveDown() height = height - 1 end height = heightMax left() end function rightDig() right() moveForward() digAbove() digBelow() while height > 0 do upBreak() height = height - 1 end height = heightMax while height > 0 do moveDown() height = height - 1 end height = heightMax right() end function leftWalk() left() moveForward() digAbove() digBelow() while height > 0 do upBreak() height = height - 1 end height = heightMax while height > 0 do moveDown() height = height - 1 end height = heightMax end function rightWalk() right() moveForward() digAbove() digBelow() while height > 0 do upBreak() height = height - 1 end height = heightMax while height > 0 do moveDown() height = height - 1 end height = heightMax end function goto(xHome, zHome, yHome) while yHome < yCurrent do moveDown() end while yHome > yCurrent do moveUp() end if xHome < xCurrent then look("west") while xHome < xCurrent do moveForward() end end if xHome > xCurrent then look("east") while xHome > xCurrent do moveForward() end end if zHome < zCurrent then look("north") while zHome < zCurrent do moveForward() end end if zHome > zCurrent then look("south") while zHome > zCurrent do moveForward() end end while not(orientation == startDirection) do right() end end function dropItems() turtle.select(16) selectedSlot = 16 while not(selectedSlot == 1) do turtle.drop() selectedSlot = selectedSlot - 1 turtle.select(selectedSlot) end end function lookLast() while not(orientation == orientationLast) do right() end end function dropOff() xBlackcurrant = xCurrent zBlackcurrant = zCurrent yBlackcurrant = yCurrent orientationLast = orientation turtle.select(16) if turtle.getItemCount() > 0 then print("Going to Drop Off") goto(xHome, zHome, yHome) dropItems() goto(xBlackcurrant, zBlackcurrant, yBlackcurrant) lookLast() elseif turtle.getItemCount() == 0 then turtle.select(1) end end while true do if lengthCurrent > 0 and ending == false then runStartup() dropOff() torchCheck() fuelCheck() moveForward() digAbove() digBelow() while height > 0 do upBreak() height = height - 1 end height = heightMax while height > 0 do moveDown() height = height - 1 end height = heightMax placeTorch = placeTorch - 1 lengthCurrent = lengthCurrent - 1 if placeTorch <= 0 then placeTorch = 10 turtle.placeDown() end end if lengthCurrent <= 0 and turn == 1 and width > 0 then width = width - 1 if width > 0 then rightDig() lengthCurrent = lengthMax turn = 2 print("Turned Right") end end if lengthCurrent <= 0 and turn == 2 and width > 0 then width = width - 1 if width > 0 then leftDig() lengthCurrent = lengthMax turn = 1 print("Turned Left") end end if width <= 0 then turnLast = turn turn = 3 ending = true end if width <= 0 and turn == 3 and ending == true then print("Final Walk Home") goto(xHome, zHome, yHome) kill = true turn = 4 end if kill == true then print("Killing the Program") error() end end
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
OoT rando seed 6/13
6 min ago | 202.05 KB
w
17 hours ago | 0.09 KB
[email protected]
- idiot sending fr...
19 hours ago | 1.35 KB
Untitled
22 hours ago | 0.03 KB
Checking in availability
1 day ago | 0.66 KB
TRMP TOKEN
1 day ago | 1.56 KB
Untitled
1 day ago | 0.16 KB
my-push Script
1 day ago | 0.19 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!