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

Saving Turtle Programs

Started by Signit, 08 December 2015 - 11:23 PM
Signit #1
Posted 09 December 2015 - 12:23 AM
Hello.. new to all this turtle stuff…. I am a primary school computer teacher and planning in using Turtles this year to teach basic coding

Question.
If I spend time writing programs for turtles in one world … can the program be saved and used in other worlds?
If so .. How?

Thanks
Bomb Bloke #2
Posted 09 December 2015 - 01:40 AM
In the world save folder, there's a "computers" sub-folder, and each computer/turtle gets its own numbered directory within that (to serve as the "drive" of each system). Typing "id" into the command prompt of a given computer/turtle will give you its ID number.

Files and folders within these "drive" folders show up on the ComputerCraft systems immediately, so you can simply drag data in / out on the fly. You can even use external text editors directly on these files.

If you're going with a multiplayer environment, on the other hand, then the world save folder won't be available to all players: it'll be on the server, so presumably you'll have access to it and no one else will.

The free Pastebin site is usually used in such cases. The pastebin script (available to all ComputerCraft systems by default) can be used to upload and download script files using their servers.

If you're using the Beginner Turtles from ComputerCraftEdu (an addon mod for ComputerCraft), things are a little different: they're rigged to store information in a player's "library", as opposed to on the turtles themselves. Each player can approach any Beginner Turtle and see the script files from their library. These library files are still stored in the world save's "computers" folder, and regular computers / turtles can be used in a world with Beginner ones, too.
Signit #3
Posted 09 December 2015 - 01:56 AM
In the world save folder, there's a "computers" sub-folder, and each computer/turtle gets its own numbered directory within that (to serve as the "drive" of each system). Typing "id" into the command prompt of a given computer/turtle will give you its ID number.

Files and folders within these "drive" folders show up on the ComputerCraft systems immediately, so you can simply drag data in / out on the fly. You can even use external text editors directly on these files.

If you're going with a multiplayer environment, on the other hand, then the world save folder won't be available to all players: it'll be on the server, so presumably you'll have access to it and no one else will.

The free Pastebin site is usually used in such cases. The pastebin script (available to all ComputerCraft systems by default) can be used to upload and download script files using their servers.

If you're using the Beginner Turtles from ComputerCraftEdu (an addon mod for ComputerCraft), things are a little different: they're rigged to store information in a player's "library", as opposed to on the turtles themselves. Each player can approach any Beginner Turtle and see the script files from their library. These library files are still stored in the world save's "computers" folder, and regular computers / turtles can be used in a world with Beginner ones, too.
Thankyou.
Found them.
Yes I am trying to learn to use the Beginner turtle programming functions with the remote so that I can teach students. I don't; want to make code too "grand" if it can't be save into a shared environment.
Signit #4
Posted 09 December 2015 - 02:09 AM
Awesome… I just transferred the code from a beginner turtle to build a beacon in one world to an beginner turtle to build a beacon in another.

That's seemed simple enough… now.

Is there a site that has pre-made pastable code??? (that does cool stuff to show kids)

Can the programs be renamed in the saved world/computer folders something more logical than "3" to say "build a beacon" and still work???
Bomb Bloke #5
Posted 09 December 2015 - 03:30 AM
Renaming the folders in the "computers" directory won't work, I'm afraid - each is linked to a specific computer/turtle in the world via those numbers. You can call the contents of those folders whatever you like, however.

There are quite a few scripts available through these forums, posted in the programs section; these nearly all use Pastebin, meaning that users can easily get them onto their in-game computers (whether they're using the worlds you've set up, or even if they're playing at home). Note the sub-categories for Games, Turtles, etc. Each script takes a tiny amount of storage, so simply giving your students the paste codes and allowing each to have a copy on each of their turtles should not be a problem. You'll generally be using non-beginner turtles for these scripts - I recommend playing about with both beginner and non-beginner in order to get a handle on the differences between them..

In regards to turtles, most scripts users post are along the lines of "dig a quarry" or "build a basic shape". You might find this maze builder interesting, or perhaps this butler.

For regular computers, nitrogenfingers' games thread in particular is probably worth a look. He's also got some ComputerCraft related videos in his YouTube channel; they may be a bit beyond a beginner's understanding, but I imagine anyone with an interest in Minecraft and/or programming would enjoy watching them anyway.