Hello everyone,
I just finished a program for computercraft (but not only...) that took me 2 hours and I tought it would be cool to share it with you guys.
I got the idea watching one of the latest EthosLab videos,where he told that he would like to control turtles from outside of the Minecraft environment in runtime.
Well,I did it!
Using LUA,AutoIt and PHP I just made a basic proof of concept (that uses a Joypad) on how to control the turtle using the Joypad itself!
I'm gonna post a video about it soon,but this is sooooo cool! It's like having a little radio controlled robot !
I am gonna post the code for those of you guys who are interested
Bye bye.
Ok,video:
Quick language Note:
Sx : Left
Dx: Right
Interprete: Interpreter
Ricevitore: Receiver
Avanti: Forward
Autoit:
http://pastebin.com/1qqLe12T
PHP
interprete.php
http://pastebin.com/zzFrCS3s
ricevitore.php
http://pastebin.com/sYG69ACA
LUA
http://pastebin.com/1RFPsAMC
I just finished a program for computercraft (but not only...) that took me 2 hours and I tought it would be cool to share it with you guys.
I got the idea watching one of the latest EthosLab videos,where he told that he would like to control turtles from outside of the Minecraft environment in runtime.
Well,I did it!
Using LUA,AutoIt and PHP I just made a basic proof of concept (that uses a Joypad) on how to control the turtle using the Joypad itself!
I'm gonna post a video about it soon,but this is sooooo cool! It's like having a little radio controlled robot !
I am gonna post the code for those of you guys who are interested
Bye bye.
Ok,video:
Quick language Note:
Sx : Left
Dx: Right
Interprete: Interpreter
Ricevitore: Receiver
Avanti: Forward
Autoit:
http://pastebin.com/1qqLe12T
PHP
interprete.php
http://pastebin.com/zzFrCS3s
ricevitore.php
http://pastebin.com/sYG69ACA
LUA
http://pastebin.com/1RFPsAMC
- function post()
- http.post(
- "http://phpdesigner.altervista.org/turtle/ricevitore.php",
- "a="..""
- )
- end
- while true do
- local source = http.get("http://phpdesigner.altervista.org/turtle/com.txt")
- local aSource = source.readAll()
- if aSource == "10" then
- turtle.forward()
- post()
- elseif aSource == "065535" then
- turtle.turnRight()
- post()
- elseif aSource == "00" then
- turtle.turnLeft()
- post()
- elseif aSource == "2" then
- turtle.up()
- post()
- elseif aSource == "3" then
- turtle.down()
- post()
- elseif aSource == "1" then
- turtle.digUp()
- post()
- elseif aSource == "4" then
- turtle.digDown()
- post()
- elseif aSource == "6" then
- turtle.dig()
- post()
- elseif aSource == "5" then
- turtle.place()
- post()
- elseif aSource == "11" then
- turtle.back()
- post()
- end
- os.sleep(0.10)
- end