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

Brewing Turtle!

Started by include Vico, 29 September 2013 - 03:38 AM
include Vico #1
Posted 29 September 2013 - 05:38 AM
Hi!
i'm here to show you my first computercraft programs!
it is an automatic brewing turtle.
you have to choose in the turtle interface what potion you want the turtle to make and it will get to work as soon as you confirmed!

At the moment you can only make : speed, fire resistance, regeneration and night vision potion.
And you can only add : gunpowder, glowstone and restone..
But if I have enought time if the next week i will try to add some recipies.

code : http://pastebin.com/s9eZEg14


code (edited) : http://pastebin.com/jUmuW1bH

So, as i said i'm new to computercraft and i'm new to coding
This is my first ''big'' programs.. so there might be a lots of mistakes and useless line in my code so if you want to improve it, or tell me what i done wrong that would be really nice!

oh, and sorry for my bad english.. i'm french :D/>

here are some screeshot :
sleeping : http://postimg.org/image/qocf8j2zp/


interface : http://postimg.org/image/3kuvbg1nl/
http://postimg.org/image/7lj6isvnd/



turtle bringing ressouces : http://postimg.org/image/qrov1q4bl/
Zudo #2
Posted 29 September 2013 - 07:24 AM

shell.run("turn right 2")

This line could be exploited. It probably won't, but imagine that someone made a program called turn that deletes everything on the computer when it is run. At least do:


shell.run("/rom/programs/turtle/turn", "right", "2")
or

for i = 1, 2 do
 turtle.turnRight()
end
include Vico #3
Posted 29 September 2013 - 08:32 AM
hum yeah! That was just a test (i'm new :P/> ) and i forgot to replace it.
but what is better :
turtle.turnRight()
turtle.turnRight()
wich is 2line
or
for i = 1, 2 do
turtle.turnRight()
end
wich is 3line ?
Zudo #4
Posted 29 September 2013 - 02:17 PM
The second one, because you can easily change it like this:


for i = 1, 50 do
turtle.turnRight()
end

Rather than:
Spoiler

turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
include Vico #5
Posted 29 September 2013 - 04:54 PM
hum that's a good example ahah
changement completed