Jump to content




Cookiebal's Programs (CookieSystem || Turtle advanced movement || Skynet networking || Project World Eater || And a lot more)


  • You cannot reply to this topic
160 replies to this topic

#21 Cookiebal

  • Members
  • 82 posts

Posted 25 February 2012 - 12:46 PM

Ah, I see. You put it in the rom folder. That won't work, it's all turtle specific either way (since turtles can't share coordinates).

Put it in saves/<worldname>/computer/<ID of the turtle>/

Then everything should work fine :(/>

#22 Cookiebal

  • Members
  • 82 posts

Posted 25 February 2012 - 01:05 PM

Guide to automatic turtle activator and installer:
(the last step of the turtle factory)

First, build a setup like this:
The redpower wire and logic stuff is only necessary if you want to automate it. Else you can just make a simple button system. Most important is that you get the deployer, computer and disk drive right.
Spoiler
The computer should have a file named "startup" (this is so that the computer will automatically work, even after you restarted the game) which contains this:
while true do
event, par1 = os.pullEvent()
if event == "peripheral" and par1 == "back"
then
  peripheral.call("back", "turnOn")
end
end

Note that you may have to change "back" in line 2 and 5 if your computer's orientation is different than mine.

Second you need a floppy in the disk drive which contains a "startup" file.
The contents of the startup depends on what you do with, for the Turtle Factory I made an installer that gives all the movement and automine files, the starting coordinates (the spot above the deployer) and some other important stuff.
At the end of the file you will probably want to put some code that makes it move away, so that it won't block the next turtle's creation.

To make a simple installer you can use things like
file = io.open("program you want to install name here", "w")
file:write([[
<Code here>
]])
file:close()

If you need folders you just put the mkdir function (fs.makeDir(path)) somewhere in there.

#23 cybervico

  • New Members
  • 3 posts

Posted 25 February 2012 - 03:07 PM

It work in saves/<worldname>/computer/<ID of the turtle>/ thank you

#24 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 25 February 2012 - 03:46 PM

Nice thing, but i beat you to the Auto-building API :(/>

#25 Cookiebal

  • Members
  • 82 posts

Posted 25 February 2012 - 06:33 PM

View PostLiraal, on 25 February 2012 - 03:46 PM, said:

Nice thing, but i beat you to the Auto-building API :(/>

Beat me to making it public, I had it ready a few days ago. I had the beta advantage though :)/>

#26 toniko

  • New Members
  • 3 posts

Posted 27 February 2012 - 05:44 PM

I need a help!
if I need to use a function after using and then use the followwaypoints followwaypoints to return, as I could?
For example, I use the APi to send an item in a certain place, after using the DropAll (), use the API to return to the place of origin.


sorry for my bad english

#27 Cookiebal

  • Members
  • 82 posts

Posted 27 February 2012 - 07:29 PM

You could make a file and put something like this in it

file = io.open("waypoints.txt", "w")
file:write(first set of coords)
file:close()
shell.run("followwaypoints")

shell.run("dropall")

file = io.open("waypoints.txt", "w")
file:write(second set of coords)
file:close()
shell.run("followwaypoints")


#28 toniko

  • New Members
  • 3 posts

Posted 28 February 2012 - 02:56 PM

View PostCookiebal, on 27 February 2012 - 07:29 PM, said:

You could make a file and put something like this in it

file = io.open("waypoints.txt", "w")
file:write(first set of coords)
file:close()
shell.run("followwaypoints")

shell.run("dropall")

file = io.open("waypoints.txt", "w")
file:write(second set of coords)
file:close()
shell.run("followwaypoints")

thanks, works perfectly :D/> , I made a function like this:

function go_waypoints(txt,coord)
file = io.open(txt, "w")
file:write(coord)
file:close()
shell.run("followwaypoints")


#29 Cookiebal

  • Members
  • 82 posts

Posted 28 February 2012 - 03:31 PM

If you only use a single coordinate, you could try to just do shell.run("pathfinding", xcoord, ycoord, zcoord). However I always set waypoints so that the turtle first goes to the air and then towards the destination, this way the turtle won't get stuck somewhere.

#30 modernzink

  • New Members
  • 8 posts

Posted 28 February 2012 - 04:41 PM

i try to make it like your video project world eater, but i fail ;)/> ( just training :D/> )
so i think for diging i could use the default programm excavate with a 1x1 field
but i fail at the point, that the turtle go to the "chest" , drop all , fly back but this time 1 block forward.
I tried to make it with while
All in all, i must learn much to get better, so maybe someone could help me with this :)/>

#31 Cookiebal

  • Members
  • 82 posts

Posted 28 February 2012 - 05:10 PM

I programmed in the coordinates of the bucket and the starting coords for the first mineshaft, I also made it count the amount of shafts it dug already.

So when it is done with mining it will move to the bucketcoords and run the drop program.
To make it go to the new mineshaft coordinates I make it add the counter to the x or z coord. So if it started mining at -30,90,75 and has already mined 3 shafts the next coord it will go to is -30,90,78.

#32 modernzink

  • New Members
  • 8 posts

Posted 28 February 2012 - 05:33 PM

I copied your code, but when i start followwaypoints and there is a block ( in cause i want to go down) , its stuck there.
run pathfinding gives me this error : pathfinding:191: attempt to compare __lt on nil and number

so i didn't see anything like turtle.dig()
By me it doen`t mine anything, so maybe i missunderstood you.
Think you mean another program that isn't published now ^^

#33 Cookiebal

  • Members
  • 82 posts

Posted 28 February 2012 - 06:03 PM

The waypoints and pathfinding stuff doesn't do any blockbreaking, I have a separate function in the automine program which does that part of the job.

#34 modernzink

  • New Members
  • 8 posts

Posted 28 February 2012 - 06:38 PM

But this automine program isn't released yet, thats was i actually wanted to say ;)/>
so i tried to make this by my own, but im to bad to make it :D/> ( all beginning is difficult )

#35 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 28 February 2012 - 06:40 PM

ad removed

#36 Cookiebal

  • Members
  • 82 posts

Posted 28 February 2012 - 07:14 PM

Here's the current automine program.

You'll need to take a look trough it and get all the correct variables as pervar .txt files though. The ones on top of my head are bucketcoord, startminingcoordx, startminingcoordz and maxoffset. The first three are obvious, the fourth one is the amount of shafts it digs before ending.

Spoiler


#37 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 28 February 2012 - 07:18 PM

okay, BTW, your stuff's more advanced :D/>

But i'll keep trying to keep up ;)/>

#38 Cookiebal

  • Members
  • 82 posts

Posted 28 February 2012 - 07:25 PM

View PostLiraal, on 28 February 2012 - 07:18 PM, said:

But i'll keep trying to keep up ;)/>

You're doing a good job at that :D/>

Also sorry if my comment was a bit snappy, tired + French homework I don't understand a single thing about = annoyed Cookiebal

#39 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 28 February 2012 - 07:28 PM

sorry for posting that too, but it gets annoying when ppl all round the forum are asking for things that are already done (however in slightly less efficient fashion :D/> )

However, now i think im entering a totally different path of development. No moar conficts ;)/>

#40 Cookiebal

  • Members
  • 82 posts

Posted 28 February 2012 - 07:32 PM

I'm currently doing a basic long range network and will work on something specifically for project world eater afterwards (to automate sending sleeping turtles to quarries). :D/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users