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

turtle initial install

Started by goldensecret, 28 February 2014 - 11:17 PM
goldensecret #1
Posted 01 March 2014 - 12:17 AM
this is a program that puts a basic yet cool, (imo) program made by a cool guy called goldensecret, this

pastebin:http://pastebin.com/sdmtFLrF


pastebin get sdmtFLrF startup

MUST PUT ON DISK, NOT TURTLE

is the program that makes the turtle consume 16 buckets of lava, the specifics are as follows,

must:
have a disk drive with the program adjacent to the turtle, and the disk must be called 'startup' or the program will not run when you open the turtle

have a label on it in order for it to run properly.
(although this is not crucial, this is recommended because it will wipe the programs and all its fuel will be gone, alas, making this program pointless.

optional:
what ever the hell you want. i cant stop ya! i had a hopper with a chest above it with 16 lava buckets inside always ready so i don't have to go and refuel the chests when i am in need of a working turtle, i have not implemented a way of only having 16 buckets in there every install, i may do it in the future, if i can find out. this is my first program i have made that is fully functional. and plan to post all my programs on here in the future, small and pointless, or big and crucial.

the empty buckets will be thrown out once they have been consumed. id advise a chest in front of it.


have fun guys! i hope you like it.
CometWolf #2
Posted 01 March 2014 - 12:51 AM
Since you insist on calling them both startup for no apparent reason, you should probably have the first program rename itself or replace itself with the second one. Instead of alywas needing a disk…
goldensecret #3
Posted 01 March 2014 - 12:31 PM
Since you insist on calling them both startup for no apparent reason, you should probably have the first program rename itself or replace itself with the second one. Instead of always needing a disk…

i called them startup so then it required the least amount of user interaction as possible, the turtle will use the disks startup program when it runs, then it downloads its own startup program, and then moves back, and restarts, with its own startup program onboard the disk, but since my title is clueless, and yours is Pro Coder, i would be stupid not to listen to you. how do you mean the first code? the one that refuels itself? or the one the turtle downloads? sorry i don't understand, i have only just started programming in any language about a day or two ago.
CometWolf #4
Posted 01 March 2014 - 03:38 PM
Well tbh the one that's downloaded is somewhat pointless in my opinion, but to each their own i suppose. What im saying is, you could set this up so it would work without a disk aswell, just downloading the program from pastebin. Makes more sense in terms of other people using it really. Also, quick note
This

turtle.refuel(1)
turtle.drop(1)
turtle.select(2)

turtle.refuel(1)
turtle.drop(1)
turtle.select(3)

turtle.refuel(1)
turtle.drop(1)
turtle.select(4)

turtle.refuel(1)
turtle.drop(1)
turtle.select(5)

turtle.refuel(1)
turtle.drop(1)
turtle.select(6)

turtle.refuel(1)
turtle.drop(1)
turtle.select(7)

turtle.refuel(1)
turtle.drop(1)
turtle.select(8)

turtle.refuel(1)
turtle.drop(1)
turtle.select(9)

print ("50% complete")

turtle.refuel(1)
turtle.drop(1)
turtle.select(10)

turtle.refuel(1)
turtle.drop(1)
turtle.select(11)

turtle.refuel(1)
turtle.drop(1)
turtle.select(12)

turtle.refuel(1)
turtle.drop(1)
turtle.select(13)

turtle.refuel(1)
turtle.drop(1)
turtle.select(14)

turtle.refuel(1)
turtle.drop(1)
turtle.select(15)

turtle.refuel(1)
turtle.drop(1)
turtle.select(16)

turtle.refuel(1)
turtle.drop(1)
turtle.select(1)

print ("refuel done")
Could be condensed considerably using a for loop http://computercraft.info/wiki/Loops

for slot = 1,16 do
  turtle.select(slot)
  turtle.refuel(1)
  turtle.drop(1)
  if slot == 8 then
    print("50% complete")
  end
end
turtle.select(1)
print("refuel done")
goldensecret #5
Posted 03 March 2014 - 11:37 AM
Well tbh the one that's downloaded is somewhat pointless in my opinion, but to each their own i suppose. What im saying is, you could set this up so it would work without a disk aswell, just downloading the program from pastebin. Makes more sense in terms of other people using it really. Also, quick note
This

turtle.refuel(1)
turtle.drop(1)
turtle.select(2)

turtle.refuel(1)
turtle.drop(1)
turtle.select(3)

turtle.refuel(1)
turtle.drop(1)
turtle.select(4)

turtle.refuel(1)
turtle.drop(1)
turtle.select(5)

turtle.refuel(1)
turtle.drop(1)
turtle.select(6)

turtle.refuel(1)
turtle.drop(1)
turtle.select(7)

turtle.refuel(1)
turtle.drop(1)
turtle.select(8)

turtle.refuel(1)
turtle.drop(1)
turtle.select(9)

print ("50% complete")

turtle.refuel(1)
turtle.drop(1)
turtle.select(10)

turtle.refuel(1)
turtle.drop(1)
turtle.select(11)

turtle.refuel(1)
turtle.drop(1)
turtle.select(12)

turtle.refuel(1)
turtle.drop(1)
turtle.select(13)

turtle.refuel(1)
turtle.drop(1)
turtle.select(14)

turtle.refuel(1)
turtle.drop(1)
turtle.select(15)

turtle.refuel(1)
turtle.drop(1)
turtle.select(16)

turtle.refuel(1)
turtle.drop(1)
turtle.select(1)

print ("refuel done")
Could be condensed considerably using a for loop http://computercraft.info/wiki/Loops

for slot = 1,16 do
  turtle.select(slot)
  turtle.refuel(1)
  turtle.drop(1)
  if slot == 8 then
	print("50% complete")
  end
end
turtle.select(1)
print("refuel done")

adapted to your code, thanks! will definitely have a look at loops for future