Jump to content




[Turtle Quarry Program] Turtle Quarry Line Up Program.


2 replies to this topic

#1 plazter

  • Members
  • 134 posts

Posted 29 September 2013 - 10:18 PM

Hello again people!

- i saw a topic last night, about a turtle setting up a quarry (from BuildCraft) so i decided to try make my own :D

So far i've got it working and all, but it will not clear out the area since its a engineering turtle sadly that is, but im gonna make it so that it will jump into the air to place the stuff it has to

Link: http://pastebin.com/wvMj4dQ5

Version: 1.0.0
Spoiler

New version: v.1.0.1
Spoiler

BUG FIXED:
- Fuel check has been fixed a new Pastebin link has been given.
---
BUGS NEED TO FIX:
- When you Press N on the air bit, it will continue but will crash as it's gonna go make your quarry, will fix this when i figure out how :)


Hope you like it :)

theres an ingame guide that tells where to put things in slots :)

Regard Plazter

#2 deFENCE_

  • Members
  • 26 posts

Posted 31 October 2013 - 03:36 AM

Quote

BUGS NEED TO FIX:
- When you Press N on the air bit, it will continue but will crash as it's gonna go make your quarry, will fix this when i figure out how :)

function height()
  term.clear()
term.setCursorPos(1,1)
print("Do you wish the turtle to setup the quarry in air?")
print("Press Y/N to confirm")
  local event, key = os.pullEvent("key")
   if key == keys.y then
          print("How far up?")
                input = read()
         if input then
        height = tonumber(input)
   else
     height = 0
   end
return
end
end


Take this. Didn't test it, but it should work.

#3 valithor

  • Members
  • 1,053 posts

Posted 31 October 2013 - 04:30 PM

View PostdeFENCE_, on 31 October 2013 - 03:36 AM, said:

Quote

BUGS NEED TO FIX:
- When you Press N on the air bit, it will continue but will crash as it's gonna go make your quarry, will fix this when i figure out how :)

function height()
  term.clear()
term.setCursorPos(1,1)
print("Do you wish the turtle to setup the quarry in air?")
print("Press Y/N to confirm")
  local event, key = os.pullEvent("key")
   if key == keys.y then
		  print("How far up?")
				input = read()
		 if input then
		height = tonumber(input)
   else
	 height = 0
   end
return
end
end


Take this. Didn't test it, but it should work.

you will also want to add
if tonumber(input) != nil then
  height = tonumber(input)
else
  height = 0
end


This will make it to where if the variable input is a string and not a number it will not crash put it where "if input then" is and it should work

function height()
  term.clear()
  term.setCursorPos(1,1)
  print("Do you wish the turtle to setup the quarry in air?")
  print("Press Y/N to confirm")
    local event, key = os.pullEvent("key")
    if key == keys.y then
	  print("How far up?")
	    input = read()
	  if tonumber(input) ~= nil then
	    height = tonumber(input)
	  else
	    height = 0
	  end
    else
	  height = 0
    end
    return
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users