Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Local Varables
- --rednet.open("right")
- local intro = "INTRODUCTION INDEX: " -- 22
- local t = 0.1
- local red = 0
- local a = 0.25 -- Animate Speed
- local n = 1
- local bRunning = true
- local sid = 0 -- 0 = loop 1 = not loop
- --local success, data = turtle.inspect()
- local testitem = 0
- local tdetectOut = false
- local readt = 0.75
- ptrue = "true"
- pfalse = "false"
- -- Crafter Varables
- local loc = 1
- local sid = 1
- local sidD = 1
- local bRunning = true
- local curX = 2
- local curY = 11
- local clrX = 3
- local clrY = 11
- local t = 0.3
- local i = 1
- local x = 1
- local a = 64
- --sel
- local b2 = 1 -- a1 for
- local n2 = 5 -- a2 for
- local m2 = 9 -- a3 for
- local b = 1 -- 1 for
- local n = 5 -- 2 for
- local m = 9 -- 3 for
- local work = colors.blue
- local work2 = colors.cyan
- local draw = {"1","2","3","4","5","6","7","8","9"}
- local targs = command
- -- Lower Tier Functions
- function waitT(ptime)
- os.sleep(ptime)
- end
- function stime(sleeptime)
- sleep(sleeptime)
- end
- function setCur(x1, y1)
- term.setCursorPos(x1, y1)
- end
- function clr()
- term.clear()
- setCur(1, 1)
- end
- function clrl(xclr, yclr)
- setCur(xclr, yclr)
- term.clearLine(xclr, yclr)
- end
- function text(textU,textT)
- textutils.slowPrint(textU)
- sleep(textT)
- end
- function LockOut()
- os.pullEvent = os.pullEventRaw
- end
- -- Slighty Adv functions
- -- Other Functions Below This one
- function setColor(txtColor,bgColor)
- if term.isColor then
- if term.isColor() then
- if txtColor then
- term.setTextColor(txtColor)
- end
- if bgColor then
- term.setBackgroundColor(bgColor)
- end
- end
- end
- end
- function setTC(textPrint,txtColor,bgColor)
- if term.isColor then
- if term.isColor() then
- if txtColor then
- term.setTextColor(txtColor)
- print(textPrint)
- end
- if bgColor then
- term.setBackgroundColor(bgColor)
- end
- end
- end
- end
- --
- function invP(pass,sym,xPo,yPo) -- Inside LIB
- LockOut()
- if pass == nil then
- setColor(colors.cyan)
- print("Needs a Password!")
- elseif sym == nil then
- setColor(colors.cyan)
- print("Needs a Symbol!")
- elseif xPo == nil then
- setColor(colors.cyan)
- print("Needs a X set!")
- elseif yPo == nil then
- setColor(colors.cyan)
- print("Needs a Y set!")
- else
- code = ""
- setColor(colors.black)
- setCur(xPo,yPo)
- code = read(sym)
- if code == pass then
- setColor(colors.lime)
- setCur(1,5)
- print("|====UNLOCKED!====|")
- sleep(0.10)
- setCur(xPo,yPo)
- else
- setColor(colors.red)
- setCur(xPo,yPo)
- print ','
- sleep(0.10)
- LockScreen()
- end
- end
- end
- function checkrun(xpo,ypo)
- if xpo == nil then
- setColor(colors.lime)
- print("Function setup!")
- setColor(colors.green)
- print("Function Error Please Read...")
- error("checkrun Needs a Xpos Set.")
- elseif xpo == 0 then
- xpo = 1
- elseif ypo == nil then
- setColor(colors.green)
- print("Function Error Please Read...")
- error("checkrun Needs Set To 1")
- elseif xpo == 0 then
- xpo = 1
- else
- if turtle then
- term.clear()
- term.setCursorPos(xpo,ypo)
- setColor(colors.lime)
- print("Local Tech: "..tostring("Turtle"))
- else
- term.clear()
- term.setCursorPos(xpo,ypo)
- setColor(colors.lime)
- print("Local Tech: "..tostring("Computer"))
- end
- end
- end
- function keydraw()
- print("------------")
- setCur(1, 2)
- print("| KEY READ |")
- setCur(1,3)
- print("------------")
- end
- function keyread()
- clr()
- keydraw()
- while true do
- event, key = os.pullEvent("key")
- clr()
- keydraw()
- print("Your Key: "..key)
- if event == "key" then
- if key == keys.backspace then
- sleep(0.50)
- clr()
- return false
- end
- end
- end
- end
- function Init(inNum)
- setTC("["..intro.."] ".." ["..inNum.."]",colors.lime)
- end
- function setnext(txtX,txtY)
- setCur(txtX,txtY)
- setTC("[PRESS ANY KEY TO NEXT!]",colors.green)
- end
- function setend(txtX,txtY)
- setCur(txtX,txtY)
- setTC("[PRESS ANY KEY TO END!]",colors.lime)
- end
- function LockScreen(pass,sym,xPo,yPo)
- clr()
- setTC("|-----------------|",colors.green)
- setTC("|% LOCKED SCREEN %|",colors.lime)
- setTC("|% CONTACT ADMIN %|",colors.lime)
- setTC(" ",colors.green)
- setTC("|====< ADMIN >====|",colors.lime)
- invP("4321","*",3,4)
- end
- function showProgram(colorT) -- NextPrg/ExitPrg = 12,19
- clr()
- Init(1)
- setTC("[ WELCOME THIS IS ]",colorT)
- setTC("[ USELESS SCREEN ]",colorT)
- setTC("[ FOR NOW..... ]",colorT)
- setTC("[ --------------- ]",colorT)
- setnext(12,19)
- os.pullEvent("key")
- clr()
- Init(2)
- setTC("[Welcome To The ShowProgram]",colorT)
- setTC("[There Are 63+ Functions! ]",colors.colorT)
- setTC("[--------------------------]",colorT)
- setTC("[]",colorT)
- setnext(12,19)
- os.pullEvent("key")
- clr()
- Init(3)
- setTC("[Hello This Is The Exit Page!]")
- setTC("[----------------------------]")
- setTC("[]")
- setTC("[]")
- setTC("[]")
- setTC("[]")
- setend(12,19)
- os.pullEvent("key")
- clr()
- print("Do you Want To reboot?")
- if InA == "yes" then
- os.reboot()
- elseif InA == "no" then
- clr()
- print(": ")
- return
- end
- end
- -- Lock Functions
- function lock(pass,sym,colSet,ySet,statlock,xpo,ypo) -- statlock is if you want clr for LIB "on" or "off"
- if pass == nil then
- setColor(colors.lime)
- print("SETUP FOR PASSWORD API!")
- setColor(colors.green)
- print("Function Error Please Read...")
- error("Needs a ".."('".."password".."')")
- elseif sym == nil then
- setColor(colors.green)
- print("Function Error Please Read...")
- error("Needs a Symbol, In Function: lock")
- elseif colSet == nil then
- setColor(colors.green)
- print("Function Error Please Read...")
- error("Needs a Color, In Function: lock")
- elseif ySet == nil then
- setColor(colors.green)
- print("Function Error Please Read...")
- error("Ypos Needs Set To 2 In Function: lock ")
- elseif statlock == nil then
- setColor(colors.green)
- print("Function Error Please Read...")
- error("Section 5 Need To Be Set: 0 = Clr On 1 = Clr Off")
- else
- if statlock == 1 then
- clr()
- elseif statlock ~= 1 then
- setColor(colSet)
- checkrun(xpo,ypo)
- print("[Enter Code]: ")
- setColor(colors.lime)
- setCur(14,ySet)
- code = read(sym)
- if code == pass then
- setColor(colors.lime)
- print 'Password Accepted!'
- else
- setColor(colors.red)
- print 'Password Denied!'
- sleep(0.25)
- LockScreen()
- end
- end
- end
- end
- -- Run Lib Shit Here
- -- clr()
- -- lock("1234","*",colors.yellow,2,0,1,1)
- -- Other Locks That I Dont Really Use.
- function masterLock()
- clr()
- setColor(colors.yellow)
- print("-----------------")
- setColor(colors.cyan)
- textutils.slowPrint("% Computer Lock %")
- setColor(colors.yellow)
- print("-----------------")
- setColor(colors.green)
- print("")
- if fs.exists("/.password") then
- setColor(colors.green)
- write("Password: ")
- file = fs.open("/.password","r")
- correctpassword = file.readAll()
- file.close()
- setColor(colors.lime)
- password = read("*")
- if password == correctpassword then
- clr()
- setColor(colors.green)
- print("Password Accumalated Correctly!...")
- sleep(0.25)
- clr()
- -- .test
- else
- print("")
- setColor(colors.red)
- write("Password Accumalated Incorrectly!...")
- sleep(0.25)
- clr()
- masterLock()
- end
- else
- clr()
- setColor(colors.yellow)
- textutils.slowPrint("No Password Has Been Generated")
- sleep(0.25)
- textutils.slowPrint("How About You Genarated One Now -->")
- sleep(0.25)
- setColor(colors.green)
- write("New Password: ")
- setColor(colors.lime)
- newPassword = read("*")
- file = fs.open("/.password","w")
- file.write(newPassword)
- file.close()
- clr()
- setColor(colors.green)
- textutils.slowPrint("New Password Has Been Genarated Sucessfuly!...")
- sleep(0.25)
- clr()
- setColor(colors.cyan)
- print("Resetting...")
- sleep(0.15)
- return
- end
- end
- function getPass(checkPass)
- pass = ""
- clr()
- setColor(colors.yellow)
- term.write("Plase Enter Password: ")
- pass = read("*")
- if pass ~= checkPass then
- setColor(colors.red)
- print("Password Incorrect!!")
- sleep(0.25)
- getPass(checkPass)
- else
- clr()
- setColor(colors.green)
- print("Password Correct!!")
- sleep(0.25)
- clr()
- setColor(colors.yellow)
- print(">")
- setCur(2, 1)
- end
- end
- -- End Of locks
- function Pgui()
- clr()
- print("Welcome to pulser")
- print("Please type in direction")
- print("-----------------------------")
- print("back")
- print("left")
- print("right")
- print("front")
- print("bottom")
- print("top")
- print("-----------------------------")
- end
- function pulse()
- Pgui()
- direct = "top"
- interval = 0
- count = 0
- direction = read()
- if direction == "back" or direction == "left" or direction == "right" or direction == "front" or direction == "bottom" or direction == "top" then
- direct = direction
- term.clear()
- term.setCursorPos(1,1)
- print("-----------------------------")
- print("Please choose the interval (seconds)")
- print("-----------------------------")
- inter = read()
- if tonumber(inter) > 0 then
- interval = tonumber(inter)
- term.clear()
- term.setCursorPos(1,1)
- print("-----------------------------")
- print("How many pulses")
- print("-----------------------------")
- coun = read()
- count = coun
- term.clear()
- term.setCursorPos(1,1)
- for i = 0, count-1, 1 do
- redstone.setOutput(direction, true)
- sleep(interval)
- redstone.setOutput(direction, false)
- sleep(interval)
- i = i + 1
- term.clear()
- term.setCursorPos(1,1)
- j = (count) - i
- print("Pulses Done: " .. i)
- print("Pulses Remaining: " ..j)
- end
- if i == count then
- os.shutdown()
- end
- else
- os.shutdown()
- end
- end
- end
- -- function Menu(...)-- Put the menu text in. User chooses one. The function returns the selection he choose.
- -- --You now need to type in the number the menu starts, and the number it ends
- -- local Parameters = {...}
- -- local MenuStuff = nil
- -- local first = Parameters[1]
- -- local second = Parameters[2]
- -- if type(Parameters[3]) == string or type(Parameters[3]) == "string" then
- -- local temptable = Parameters
- -- table.remove(temptable, 1)
- -- table.remove(temptable, 1)
- -- MenuStuff = temptable
- -- else
- -- MenuStuff = Parameters[3]
- -- end
- -- local Mouse = first
- -- local function rewrite()
- -- local i = 0
- -- for n=first, second do
- -- i = i+1
- -- if MenuStuff[i+DownDown] then
- -- term.setCursorPos(4, n)
- -- term.write(string.rep(" ", string.len(MenuStuff[i+DownDown])))
- -- end
- -- end
- -- end
- -- local function Draw()
- -- local i = 0
- -- for n=first,second do
- -- i = i+1
- -- term.setCursorPos(4, n)
- -- term.write(MenuStuff[i+DownDown])
- -- end
- -- term.setCursorPos(1, Mouse)
- -- term.write(">>")
- -- end
- -- Draw()
- -- while true do
- -- event,param1 = os.pullEvent()
- -- if event == "key" then
- -- term.setCursorPos(1, Mouse)
- -- term.write(" ")
- -- rewrite()
- -- if param1 == 200 then -- Up
- -- if Scrolled > 1 then
- -- if Mouse == first and MenuStuff[Scrolled-1] then
- -- DownDown = DownDown-1
- -- else
- -- Mouse = Mouse-1
- -- end
- -- Scrolled = Scrolled-1
- -- end
- -- elseif param1 == 208 then -- Down
- -- if Scrolled < #MenuStuff then
- -- if Mouse == second then
- -- DownDown = DownDown+1
- -- else
- -- Mouse = Mouse+1
- -- end
- -- Scrolled = Scrolled+1
- -- end
- -- elseif param1 == 28 then -- Enter
- -- rewrite()
- -- return MenuStuff[Scrolled]
- -- -- break
- -- end
- -- Draw()
- -- end
- -- end
- -- end
- -- function helpUi()
- -- clr()
- -- setColor(colors.yellow)
- -- term.write("Command> ")
- -- setCur(9,1)
- -- end
- -- function helpDraw()
- -- print("[ -------------------- ]")
- -- setColor(colors.green)
- -- print(" Known Functions ")
- -- setColor(colors.green)
- -- print("| In This Api There Is ")
- -- setColor(colors.green)
- -- print("| 65 Functions Total. ")
- -- setColor(colors.yellow)
- -- print("[ -------------------- ")
- -- setColor(colors.green)
- -- print("| [Type help 1-9] ")
- -- setColor(colors.green)
- -- print("| ")
- -- setColor(colors.yellow)
- -- print("[ -------------------- ")
- -- end
- -- local targs = {...}
- -- function help()
- -- helpUi()
- -- if targs then
- -- command = targs[1]
- -- if command == "help1" then
- -- clr()
- -- setColor(colors.yellow)
- -- helpDraw()
- -- elseif command == "help2" then
- -- clr()
- -- print("num"..draw[1])
- -- elseif command == "help3" then
- -- clr()
- -- print("num"..draw[2])
- -- elseif command == "help4" then
- -- clr()
- -- print("num"..draw[3])
- -- elseif command == "help5" then
- -- clr()
- -- print("num"..draw[4])
- -- elseif command == "help6" then
- -- clr()
- -- print("num"..draw[5])
- -- elseif command == "help7" then
- -- clr()
- -- print("num"..draw[6])
- -- elseif command == "help8" then
- -- clr()
- -- print("num"..draw[7])
- -- elseif command == "help9" then
- -- clr()
- -- setColor(colors.yellow)
- -- print("num"..draw[8])
- -- elseif command == "clr" then
- -- clr()
- -- print("cleared!")
- -- end
- -- end
- -- end
- -- ADV Turtle Functions
- -- Antimate
- function ani1(Atext,testX, testY)
- clrl(testX, testY)
- print(Atext)
- sleep(t)
- end
- function ani2(Atext2,testX, testY)
- clrl(testX, testY)
- print(Atext2)
- sleep(t)
- end
- function ani3(Atext3,testX, testY) -- Text ,, x,y
- clrl(testX, testY)
- print(Atext3)
- sleep(t)
- end
- function runA(Atext,Atext2,Atext3,testX, testY,t,LOOP,L1,L2) -- Text1 Text2 Text3 X,Y Time
- for LOOP = L1,L2 do -- It Works
- ani1(Atext,testX, testY)
- ani2(Atext2,testX, testY)
- ani3(Atext3,testX, testY)
- ani1(Atext,testX, testY)
- end
- end
- -- Cobble
- function count()
- testcobble = 1
- function theck()
- if turtle.getItemSpace(x) then
- turtle.dropDown(c)
- print(c)
- end
- end
- for testcobble = 1,16 do
- turtle.select(x)
- c = turtle.getItemCount()
- theck()
- if testcobble == 16 then
- turtle.select(1)
- os.reboot()
- end
- end
- end
- function runcobble2()
- turtle.select(cobble)
- while sRunning do
- while turtle.getItemSpace(cobble) < 1 do
- for i = 1,16 do
- turtle.select(i)
- if turtle.getItemSpace(i) > 0 then
- x = i
- turtle.select(i)
- break end
- if turtle.getItemSpace(i) == 16 then
- turtle.dropDown(64)
- for i = 1,16 do
- turtle.select(i)
- turtle.dropDown(64)
- end
- turtle.select(1)
- end
- end
- end
- if turtle.detect() then
- Acheck()
- turtle.dig()
- end
- end
- end
- function runCobble()
- local sRunning = true
- local cobble = 1
- clr()
- print("If It Stops, Barrel Is Full..")
- term.setCursorPos(1, 2)
- print("Waiting To Mine Press Any Key!")
- term.setCursorPos(1, 3)
- print("|Press Down To Drop|")
- term.setCursorPos(1, 4)
- print("Current Function [ ]")
- turtle.select(cobble)
- event, key = os.pullEvent("key")
- if event == "key" then
- if key == keys.enter then
- masterLock()
- sRunning = false
- elseif key == 208 then
- count()
- elseif not key == 208 then
- if not key == keys.enter then
- sRunning = true
- while sRunning do
- term.clear()
- term.setCursorPos(1, 1)
- while turtle.getItemSpace(cobble) < 1 do
- for i = 1,16 do
- term.clearLine(1, 2)
- term.setCursorPos(1, 2)
- print("Recalculating..")
- turtle.select(i)
- if turtle.getItemSpace(i) > 0 then
- x = i
- turtle.select(i)
- term.setCursorPos(1, 2)
- print(i)
- break end
- if turtle.getItemSpace(i) > 1 and i == 16 then
- turtle.dropDown(64)
- for i = 1,16 do
- sleep(0.15)
- turtle.select(i)
- turtle.dropDown(64)
- end
- turtle.select(1)
- if turtle.detect() then
- Acheck()
- turtle.dig()
- runCobble2()
- end
- end
- end
- end
- end
- end--
- end--
- end--
- end
- -- Obsid
- function finish()
- if sidD == 1 then
- texthelp()
- term.setTextColor(work)
- turtle.drop()
- elseif sidD == 0 then
- sleep(0.15)
- turtle.select(1)
- end
- end
- local function checkF()
- if turtle.getFuelLevel() < 5 then
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(1)
- else
- if turtle.getFuelLevel() < 5 then
- print("Need Fuel in Slot 16")
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(1)
- if turtle.getFuelLevel() > 5 then
- clr()
- print("Ready to Go")
- turtle.select(1)
- end
- end
- end
- end
- function tSel(selnum)
- turtle.select(selnum)
- end
- function cred()
- if red == 1 then
- setCur(1, 3)
- print("Testing Block/Dust..")
- stime(0.15)
- elseif red == 0 then
- setCur(1, 3)
- print("Testing Block/Dust..")
- stime(0.15)
- setCur(1, 4)
- if turtle.detect() == true then
- os.reboot()
- if turtle.detect() == false then
- bRunning = false
- return
- end
- end
- end
- end
- function wait1()
- clr()
- setCur(1, 1)
- print("Waiting.")
- stime(a)
- end
- function wait2()
- clr()
- setCur(1, 1)
- print("Waiting..")
- stime(a)
- end
- function wait3()
- clr()
- setCur(1, 1)
- print("Waiting...")
- stime(a)
- end
- function WaitA()
- testINS()
- wait1()
- wait2()
- wait3()
- wait1()
- end
- function testI()
- n = 1
- tSel(n)
- itemslot = turtle.getItemCount(n)
- setCur(1, 1)
- print("Number Of Redstone: "..itemslot)
- stime(0.56)
- if itemslot == 0 then
- red = 1
- setCur(1, 2)
- print("Need More Redstone, RedCount: "..itemslot)
- stime(0.56)
- setCur(1, 3)
- bRunning = false
- return
- end
- end
- function rsOut(side, redtest)
- rs.setOutput(side, redtest)
- end
- function tLeft()
- rsOut("front", true)
- turtle.turnLeft()
- sleep(3)
- end
- function tRight()
- rsOut("front", false)
- turtle.turnRight()
- sleep(3)
- end
- function tDig()
- turtle.select(2)
- turtle.dig()
- turtle.select(1)
- end
- function turnE()
- if tdetectOut == true then
- tLeft()
- tRight()
- tDig()
- elseif tdetectOut == false then
- --cred() --?
- red = 0
- cred()
- stime(0.15)
- testI()
- setCur(1, 4)
- return
- end
- end
- function tplace()
- tSel(1)
- setCur(1, 2)
- print("Is Placing Resource..")
- stime(0.35)
- turtle.place()
- setCur(1, 3)
- print("Clearing Screen..")
- stime(0.25)
- clr()
- testI()
- setCur(1, 4)
- end
- function testINS()
- p1, p2 = turtle.inspect()
- if p1 == true then
- for k,v in pairs(p2) do
- if v == "minecraft:obsidian" then
- print(v)
- sleep(0.15)
- turtle.select(2)
- tDig()
- turtle.select(1)
- setCur(1, 4)
- print("Found Obsidian Returning.")
- stime(0.25)
- tdetectOut = false
- return
- elseif v == "minecraft:redstone" then
- setCur(1, 3)
- print(r)
- stime(0.25)
- end
- end
- end
- end
- function tdet()
- turtle.detect()
- if turtle.detect(tdetectOut) == true then
- tdetectOut = true
- testINS()
- setCur(1, 1)
- term.write("Returned True Block: "..ptrue)
- stime(0.65)
- setCur(1, 2)
- print("Block is There.")
- stime(0.50)
- clr()
- elseif turtle.detect(tdetectOut) == false then
- tdetectOut = false
- setCur(1, 1)
- term.write("Returned False Block: "..pfalse)
- stime(0.50)
- setCur(1, 2)
- term.write("Its An AirBlock..")
- stime(0.6)
- tplace()
- --wTo()
- end
- end
- function trun()
- if rs.getInput("back", true) then
- clr()
- clrl(1, 1)
- print("Redstone Has Stoped The Program.")
- bRunning = false
- return
- end
- end
- function SidMonkey()
- if sid == 1 then
- trun()
- elseif sid == 0 then
- while bRunning do
- trun()
- end
- end
- end
- -- Put This In Ur obsid Turtle
- -- clr()
- -- WaitA()
- -- tdet()
- -- testINS()
- -- turnE()
- -- SidMonkey
- -- Crafter
- function cln()
- term.clear()
- term.setCursorPos(1, 1)
- setColor(colors.yellow)
- end
- function texthelp()
- term.setCursorPos(curX, curY)
- term.clearLine(clrX, clrY)
- end
- function refuelAll()
- turtle.select(16)
- turtle.refuel(64)
- turtle.select(1)
- end
- -- function fdis()
- -- Tf = turtle.getFuelLevel()
- -- term.setCursorPos(2, 11)
- -- print("Fuel Level = ".."["..Tf.."]")
- -- end
- function checkf()
- local amount = turtle.getFuelLevel()
- if turtle.getFuelLevel() < 5 then
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(1)
- elseif turtle.getFuelLevel() > 5 then
- texthelp()
- term.setTextColor(work)
- print(amount)
- sleep(0.35)
- gui()
- end
- end
- function check()
- for i = 1,16 do
- turtle.select(i)
- cln()
- print("Scaning Crafter: "..i)
- if i == 16 then
- turtle.select(1)
- term.setTextColor(work)
- print("Crafting...")
- sleep(0.15)
- cln()
- gui()
- end
- end
- end
- function srunB()
- cln()
- for b = 1,3 do
- print("DEBUG B")
- turtle.select(b)
- if turtle.getItemSpace(b) >=1 then
- turtle.transferTo(1, a)
- elseif turtle.getItemSpace(b) <=1 then
- if b == 3 then
- srunN()
- end
- end
- end
- end
- function srunN()
- cln()
- for n = 5,7 do
- print("DEBUG N")
- turtle.select(n)
- if turtle.getItemSpace(n) >=1 then
- turtle.transferTo(1, a)
- elseif turtle.getItemSpace(n) <=1 then
- if n == 7 then
- srunM()
- end
- end
- end
- end
- function srunM()
- cln()
- for m = 9,11 do
- print("DEBUG M")
- turtle.select(m)
- if turtle.getItemSpace(m) >=1 then
- turtle.transferTo(1, a)
- elseif turtle.getItemSpace(m) <=1 then
- if m == 11 then
- finish()
- gui()
- end
- end
- end
- end
- function test()
- gui()
- end
- function sCheck()
- cln()
- srunB()
- srunN()--
- srunM()--
- turtle.select(1)
- test()
- if sid == 1 then
- turtle.turnLeft()
- elseif sid == 0 then
- test()
- end
- end
- function gui()
- cln()
- print("|Press R to Refuel Min. |")
- print("|Press RAlt to Refuel Max. |")
- print("|Press Up/Down Go Up/Down. |")
- print("|Press ArrowKeys To Turn. |")
- print("|Press Alt To Compress. |")
- print("|Press Space To CraftMin. |")
- print("|Press LCtrl To CraftMax. |")
- print("|Press RCtrl To Go Forward.|")
- term.setTextColor(colors.green)
- print("|Press Enter To Exit. |")
- term.setTextColor(colors.yellow)
- print("---------------------------")
- print(" ")
- print("---------------------------")
- end
- --gui()
- function CRAFTER()
- while bRunning do
- event, key = os.pullEvent("key")
- if event == "key" then
- if key == keys.enter then
- cln()
- term.setTextColor(work2)
- turtle.turnRight()
- print("Please Enter Passcode..")
- sleep(0.25)
- cln()
- masterLock()
- bRunning = false
- end
- if not key == keys.enter then
- check()
- else
- if event == "key" then
- if key == 57 then -- #1 -- Space
- check()
- turtle.craft(1)
- elseif key == 29 then -- #1 -- Left Ctrl
- check()
- turtle.craft()
- elseif key == keys.left then -- Left Arrow
- texthelp()
- turtle.turnLeft()
- term.setTextColor(work)
- print("Turned Left")
- sleep(0.25)
- gui()
- elseif key == keys.right then -- Right Arrow
- texthelp()
- turtle.turnRight()
- term.setTextColor(work)
- print("Turned Right")
- sleep(0.25)
- gui()
- elseif key == 19 then -- R
- texthelp()
- -- Action Work
- texthelp()
- term.setTextColor(work)
- print("Refreashing!")
- sleep(0.25)
- turtle.select(1)
- gui()
- elseif key == 184 then -- Right Alt
- texthelp()
- refuelAll()
- term.setTextColor(work)
- print("Refueled All")
- sleep(1)
- refuelAll()
- sleep(0.8)
- gui()
- elseif key == 157 then --Right Ctrl
- texthelp()
- turtle.forward()
- term.setTextColor(work)
- print("Went Forward!")
- sleep(0.25)
- gui()
- elseif key == 56 then -- Left Alt
- texthelp()
- term.setTextColor(work)
- print("COMPRESSIN..")
- turtle.suckDown(64)
- turtle.select(1)
- turtle.suckDown(64)
- turtle.select(2)
- turtle.suckDown(64)
- turtle.select(3)
- turtle.suckDown(64)
- turtle.select(5)
- turtle.suckDown(64)
- turtle.select(6)
- turtle.suckDown(64)
- turtle.select(7)
- turtle.suckDown(64)
- turtle.select(9)
- turtle.suckDown(64)
- turtle.select(10)
- turtle.suckDown(64)
- turtle.select(11)
- turtle.suckDown(64)
- texthelp()
- term.setTextColor(work2)
- print("Compressed!")
- sleep(0.5)
- turtle.craft()
- turtle.transferTo(1, a)
- turtle.select(1)
- gui()
- elseif key == 200 then -- Up arrow
- turtle.up()
- texthelp()
- term.setTextColor(work)
- print("Went Up!")
- sleep(0.25)
- gui()
- elseif key == 210 then -- Keypad Ins - 0
- turtle.back()
- texthelp()
- term.setTextColor(work)
- print("Went Back!")
- sleep(0.25)
- gui()
- elseif key == 208 then -- Down Arrow
- turtle.down()
- texthelp()
- term.setTextColor(work)
- print("Went Down!")
- sleep(0.25)
- gui()
- elseif key == 48 then -- B
- bCheck()
- texthelp()
- term.setTextColor(work)
- print(test)
- sleep(t)
- gui()
- elseif key == 47 then -- V
- sCheck()
- texthelp()
- term.setTextColor(work)
- print(test)
- sleep(0.25)
- gui()
- if sidD == 1 then
- checkf()
- turtle.up()
- if turtle.detectUp(test) == true then -- Delete if doesnt work
- turtle.dropUp(64)
- turtle.down()
- texthelp()
- term.setTextColor(work)
- print(test)
- gui()
- elseif turtle.detectUp(test) == false then
- texthelp()
- term.setTextColor(work)
- turtle.down()
- print(test)
- gui()
- elseif not sidD == 0 then
- end
- end
- elseif key == 207 then
- for c = 1,16 do
- turtle.select(c)
- turtle.dropDown()
- texthelp()
- term.setTextColor(work)
- print("Takin out The Trash..")
- sleep(0.25)
- gui()
- if c == 16 then
- turtle.select(1)
- texthelp()
- print("Took Out The Trash!")
- sleep(0.25)
- gui()
- end
- end
- end
- end
- end
- end
- end
- end
- --CRAFTER()
- -- Antimation
- r1 = "Ooo"
- r2 = "oOo"
- r3 = "ooO"
- r1z = "Xoo"
- r2z = "oXo"
- r3z = "ooX"
- function drawA(writeA)
- run_a = writeA
- end
- function drawB(writeB)
- run_b = writeB
- end
- function drawC(writeC)
- run_c = writeC
- end
- local function testsid(sid)
- if sid == 0 then
- draw(r1)
- draw(r2)
- draw(r3)
- elseif sid == 1 then
- draw(r1z)
- draw(r2z)
- draw(r3z)
- end
- end
- -- Antimate Functions
- function a1(time)
- clrl(1, 2)
- print(drawA())
- sleep(time)
- end
- function a2(time)
- clrl(1, 2)
- print(drawB())
- sleep(time)
- end
- function a3(time)
- clrl(1, 2)
- print(drawC())
- sleep(time)
- end
- -- Run the antimation
- function AntiDraw(time)
- clrl(1, 2)
- a1(time)
- a2(time)
- a3(time)
- clrl(1, 2)
- print("Done.")
- clrl(1, 3)
- end
- -- Help Stuff
- -- fs stuff
- -- print("")
- -- if fs.exists("/text") then
- -- write("")
- -- file = fs.open("/text","r")
- -- varable = file.readall()
- -- fs.close()
- -- New Text
- -- print("No Gen")
- -- print("Do 1 now")
- -- newText = read()
- -- file = fs.open("/text", "w")
- -- file.write(newText)
- -- file.close()
- -- Send Program
- -- local id = 4
- -- targs = {...}
- -- if targs[1] then
- -- message = targs[1]
- -- if targs[1] == message then
- -- rednet.send(4, message)
- -- print("Sent!")
- -- end
- -- end
- -- Inspect Varable Method
- -- local success, data = turtle.inspect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement