This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Vliekkie's profile picture

Platform Builder

Started by Vliekkie, 27 March 2012 - 04:47 PM
Vliekkie #1
Posted 27 March 2012 - 06:47 PM
Howdey.. New to CC.. wanted to post this nifty platform builder i made.. took me 2 hours it did!!
Correct me where wrong
this has a WTFPL lisence

Check further down for new versions

Spoiler
term.clear()
term.setCursorPos(1,1)
print("how Long?")
a=tonumber(read())
term.setCursorPos(1,3)
term.clearLine()
print("how Wide?")
b=tonumber(read())
turtle.placeDown()
x=1
y=0
s=1
print("using slot " ..s)
  while y<b do
   y=y+1
	while x<a do
	x=x+1
		turtle.forward()
		turtle.placeDown()
		   if turtle.getItemCount(s)==0 then
		   s=s+1
	 print("now using slot " ..s)
		   turtle.select(s)
		   end  
end
x=1
q=tonumber(y)
		 if q%2==1 then
			turtle.turnRight()
			turtle.forward()
   turtle.placeDown()
			turtle.turnRight()
		 elseif q%2==0 then
			turtle.turnLeft()
			turtle.forward()
   turtle.placeDown()
			turtle.turnLeft()
		 end
end
term.clear()
term.setCursorPos(1,1)
print("done")

critsize me hard..
even on spelling.. punsishment learns a person.. :o/>/>

EDIT: fixed a bug :o/>/>
EDIT2: New version Posted 30 march!
EDIT3: NEW NEW version Posted 15 minutes later on March 30!!!
Wolvan #2
Posted 27 March 2012 - 08:14 PM
Nice! Why not add a function that let's the turtle build for example a 3x3 part up to a height you can choose and place a ladder inside like this
SSS
SLS
SSS

S…Stone
L…Ladders
Ian-Moone #3
Posted 27 March 2012 - 08:49 PM
pics?
Vliekkie #4
Posted 30 March 2012 - 03:46 PM
Ha.. cant u read!!.. im clueless.. and that aint nothin but tha truth mon'..
I'll play around some more.. and see what i can come up with..
Dont put any money on it.. Also vandie.. sorry pics are a kite that wont fly..
Im on a VERY limited broadband cap.. and in SA that means DL as little as possible and UL even less
Vliekkie #5
Posted 30 March 2012 - 03:52 PM
Oh yeh.. Also..
Seem'd that it built 1 block too long.. so i made x=0 into x=1 Should fix it..
AND it doesnt say when it switches slots :S
Vliekkie #6
Posted 30 March 2012 - 04:31 PM
Here's a NEW version that comes back to the start point when its done.. unless it runs out of blocks.. then it stops after a few more spaces

SpoilerPlatform builder V1.2
term.clear()
term.setCursorPos(1,1)
print("how Long?")
a=tonumber(read())
term.setCursorPos(1,3)
term.clearLine()
print("how Wide?")
b=tonumber(read())
turtle.placeDown()
x=1
y=0
s=1
print("using slot " ..s)
  while y<b do
   y=y+1
	    while x<a do
	    x=x+1
			    turtle.forward()
			    turtle.placeDown()
				   if turtle.getItemCount(s)==0 then
				   s=s+1
		 print("now using slot " ..s)
				   turtle.select(s)
				   end 
end
x=1
  if y~=b then
  q=tonumber(y)
				 if q%2==1 then
					    turtle.turnRight()
					    turtle.forward()
   turtle.placeDown()
					    turtle.turnRight()
				 elseif q%2==0 then
					    turtle.turnLeft()
					    turtle.forward()
   turtle.placeDown()
					    turtle.turnLeft()		   
   end
  end
end
ry=1
rx=1  
turtle.turnLeft()
turtle.turnLeft()
    if b%2==1 then
turtle.turnRight()
while ry<b do						  --} } } }
turtle.forward()					   --{ { { {
ry=ry+1							    --} } } }
end								    --{ { { {					
end
turtle.turnLeft()
    while rx<a do
    turtle.forward()
    rx=rx+1
    end 
term.clear()
term.setCursorPos(1,1)
print("done")
Vliekkie #7
Posted 30 March 2012 - 04:53 PM
Same one as above… BUT this one stalls when empty until you refill at least the selected slot.. and press any button..

SpoilerPlatform builder V1.3
term.clear()
term.setCursorPos(1,1)
print("how Long?")
a=tonumber(read())
term.setCursorPos(1,3)
term.clearLine()
print("how Wide?")
b=tonumber(read())
turtle.placeDown()
x=1
y=0
s=1
print("using slot " ..s)
  while y<b do
   y=y+1
		while x<a do
		x=x+1
				turtle.forward()
				turtle.placeDown()
				   if turtle.getItemCount(s)==0 then
				   s=s+1
		 print("now using slot " ..s)
				   turtle.select(s)
		  if turtle.getItemCount(tonumber(s))<2 then
       print("Fill'er up Scotty!! and hit any button")
	   os.pullEvent(key)
	   end
	   end
				
	  
end
x=1
  if y~=b then
  q=tonumber(y)
				 if q%2==1 then
						turtle.turnRight()
						turtle.forward()
   turtle.placeDown()
						turtle.turnRight()
				 elseif q%2==0 then
						turtle.turnLeft()
						turtle.forward()
   turtle.placeDown()
						turtle.turnLeft()		  
   end
  end
end
ry=1
rx=1  
turtle.turnLeft()
turtle.turnLeft()
	if b%2==1 then
turtle.turnRight()
while ry<b do						  --} } } }
turtle.forward()					   --{ { { {
ry=ry+1								--} } } }
end									--{ { { {					
end
turtle.turnLeft()
	while rx<a do
	turtle.forward()
	rx=rx+1
	end
term.clear()
term.setCursorPos(1,1)
print("done")