Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script is is working progress but if finally out of beta form.
- -- This script has a left, right and centre function just in case you want you door to be in the middle
- --but if you do centre with an even number you will need to manually do the other half of the door.
- --This script now detects for mobs/gravel/sand.
- --he also has an enderches function. not meant for normal chests
- -- This is my first ever script. I did this as my learning script. I started this when I started learning the day I started scripting turtles and finished about a week later.
- -- This script is for clearing out rooms mainly for under ground bases.
- -- Not wise to use it for mining.
- -- There is no copy right but if you make some good changes that work please let me know.
- -- email: subtox1cgaming@gmail.com
- -- ADDED: normal chest function, enderchest function and press ENTER to start function
- function textOutput(output_message, x_screen_pos, z_screen_pos, clear_area)
- term.setCursorPos(x_screen_pos,z_screen_pos)
- if clear_area == 0 then
- clear_area = string.len(output_message)
- end
- write(output_message..string.rep(" ", (clear_area - string.len(output_message))))
- end
- function uwd()
- while not turtle.up() do
- sleep(0.2)
- turtle.digUp()
- turtle.attackUp()
- end
- end
- function fwd()
- while not turtle.forward() do
- sleep(0,2)
- turtle.dig()
- turtle.attack()
- end
- end
- function dwd()
- while not turtle.down() do
- sleep(0.2)
- turtle.digDown()
- turtle.attackDown()
- end
- end
- function echest()
- if v == "e" then
- if turtle.getItemCount(16) > 0 then
- print "unloading"
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- for i = 3,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.digDown()
- turtle.select(2)
- turtle.placeDown()
- turtle.select(3)
- end
- else
- if v == "n" then
- if turtle.getItemCount(16) > 0 then
- print "unloading"
- turtle.turnLeft()
- turtle.dig()
- turtle.select(1)
- turtle.place()
- for i = 3,16 do
- turtle.select(i)
- turtle.drop()
- turtle.select(3)
- end
- turtle.turnRight()
- end
- end
- end
- end
- function echest1()
- if v == "e" then
- if turtle.getItemCount(16) > 0 then
- print "unloading"
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- for i = 3,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.digDown()
- turtle.select(2)
- turtle.place()
- turtle.select(3)
- end
- else
- if v == "n" then
- if turtle.getItemCount(16) > 0 then
- print "unloading"
- turtle.turnRight()
- turtle.dig()
- turtle.select(1)
- turtle.place()
- for i = 3,16 do
- turtle.select(i)
- turtle.drop()
- turtle.select(3)
- end
- turtle.turnLeft()
- end
- end
- end
- end
- function echest2()
- if v == "e" then
- print "unloading"
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- for i = 3,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.digDown()
- turtle.select(2)
- turtle.placeDown()
- turtle.select(3)
- else
- if v == "n" then
- print "unloading"
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- for i = 3,16 do
- turtle.select(i)
- turtle.dropDown()
- turtle.select(3)
- end
- end
- end
- end
- function hight()
- for i = 1,h do
- turtle.digUp()
- echest()
- uwd()
- end
- for i = 1,h do
- dwd()
- end
- end
- function length()
- for j = 1,l do
- hight()
- turtle.dig()
- echest()
- fwd()
- end
- hight()
- turtle.turnRight()
- turtle.turnRight()
- for j = 1,l do
- fwd()
- end
- end
- function typing()
- term.clear()
- term.setCursorPos(1,1)
- print "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
- term.setCursorPos(10,2)
- print "Clearance Time v3.0"
- term.setCursorPos(13,3)
- print "by SubTox1c"
- term.setCursorPos(3,11)
- print "With Help From:"
- term.setCursorPos(25,11)
- print "The_penguin101"
- term.setCursorPos(1,12)
- print "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
- end
- function hwd()
- for m = 1,w*0.5 do
- turtle.dig()
- echest()
- fwd()
- end
- end
- function width()
- if d == "r" then
- for k = 1,w do
- length()
- turtle.turnLeft()
- turtle.dig()
- echest()
- fwd()
- turtle.turnLeft()
- end
- else
- if d == "l" then
- for k = 1,w do
- length()
- turtle.turnRight()
- turtle.dig()
- echest1()
- fwd()
- turtle.turnRight()
- end
- else
- if d == "c" then
- if w > 0 then
- turtle.turnLeft()
- hwd()
- turtle.turnRight()
- end
- for p = 1,w do
- length()
- turtle.turnLeft()
- turtle.dig()
- echest()
- fwd()
- turtle.turnLeft()
- end
- end
- end
- end
- length()
- end
- function door()
- for k = 1,a do
- turtle.dig()
- turtle.digUp()
- echest()
- fwd()
- end
- end
- typing()
- term.setCursorPos(4,5)
- print "How High Would You Like Me To Go?"
- term.setCursorPos(18,8)
- h=read()
- h=h-1
- typing()
- term.setCursorPos(6,5)
- print "How Long Would You Like It?"
- term.setCursorPos(18,8)
- l=read()
- l=l-1
- typing()
- term.setCursorPos(6,5)
- print "How Wide Would You Like It?"
- term.setCursorPos(18,8)
- w=read()
- w=w-1
- typing()
- term.setCursorPos(6,5)
- print "Would You Like Me To Go...."
- print " Left [l]"
- print " Right [r]"
- print " Centre [c]"
- term.setCursorPos(18,9)
- d=read()
- typing()
- term.setCursorPos(9,5)
- print"How Thick For The Door?"
- term.setCursorPos(4,6)
- print "(i.e. blocks between each room)"
- term.setCursorPos(18,9)
- a=read()
- a=a+1
- typing()
- term.setCursorPos(11,5)
- print "Ender Chest [e]"
- term.setCursorPos(17,6)
- print "Or"
- term.setCursorPos(11,7)
- print "Normal Chests [n]"
- term.setCursorPos(18,9)
- v=read()
- typing()
- term.setCursorPos(1,5)
- print "Put Ender Chest/ Normal Chests In Slot 1 and cobble in slot 2"
- textOutput("Press enter to start", 1, 9, 0)
- while true do
- press, key = os.pullEvent()
- if press == "key" and key == 28 then
- break
- end
- end
- typing()
- term.setCursorPos(6,6)
- print "Clearing Your Space Master!"
- door()
- width()
- echest2()
- typing()
- term.setCursorPos(11,10)
- print "All Finished Sir."
- term.setCursorPos(1,6)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement