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

Control a turtle with PHP

Started by andyspam, 18 May 2013 - 01:16 AM
andyspam #1
Posted 18 May 2013 - 03:16 AM
I made a program for turtles that will use a text file on a server as a movement array. I also made a php file to generate the text file for you.

The turtle program can be downloaded by running pastebin get yc0Mb8nW.
When you have the program edit it and change the url(line 29) to your domain.

The PHP file can be downloaded from mediafire or pastebin.
Once you have the file you need to upload it to a web server that supports PHP.

Whenever you go on the website and enter an array in the box it'll generate a .txt file on your server called "turtle.txt".
The turtle will get the contents of that file and interpret it as movements. This is definitely not the most efficient way to
do something like this so don't be mad. Its not secure at all so if someone has the url they can control your turtle.

If you have any questions/problems/suggestions leave a reply and I'll see what I can do. You can use it for whatever you want just give credit where it's due.
unobtanium #2
Posted 18 May 2013 - 05:27 AM
I think this is something Etho was looking for. This is really cool accually, but it needs some more commands like waiting and redstone and drop and suck.

Btw, why are you adding a 1.5 second delay after every movement? This slows the turtle down like hell :3
andyspam #3
Posted 18 May 2013 - 05:38 AM
I think this is something Etho was looking for. This is really cool accually, but it needs some more commands like waiting and redstone and drop and suck.

Btw, why are you adding a 1.5 second delay after every movement? This slows the turtle down like hell :3
That 1.5 delay is only how often it checks for a keypress. The movements themselves only have a 0.3 second delay in-between. Its fairly easy to add more commands, just add another elseif. I might add more functions eventually, this is just something simple I wanted to do.

I think Etho was looking for a way to control turtles with a program on his real computer. It'd be fairly hard to do that, but it would be a lot more secure.