Jump to content




Remote controlled turtle

turtle wireless

14 replies to this topic

#1 NanoBob

  • Members
  • 102 posts

Posted 02 May 2013 - 07:48 AM

hello all

This topic is about my wireless turtle program : WirelessTurtle v1.5
The "cool" feature about this is no other signals will interfere,
It can be controlled from a nearby turtle/computer.
It's easy to set up, in your turtle and/or computer you have to type :
 pastebin get Zxq5hFqr startup
It's best to run it as startup.
Once you launched the program the program will ask you a few questions.
Once you have answered them all you can get started.

If you don't understand all questions here's the possible answers
Spoiler

the code:
Spoiler

pastebin link:

Screenshots:
Spoiler

Things being worked on:
Spoiler


#2 NanoBob

  • Members
  • 102 posts

Posted 03 May 2013 - 07:21 AM

Can anyone try it out? Post feedback maybe? Please?

#3 kalkins

  • Members
  • 3 posts

Posted 04 May 2013 - 02:30 PM

It's a nice program that does what it's meant to do without problems, but you could make it better. here are some suggestions:
1. remove question 2.5 and make it find the modem automaticly
2. make it ask the question again if it doesn't understand the answer(in case the user typed a word wrong)
3. instead of asking if it's a computer or a turtle(which you can find out automaticly), ask if it should be transmitting or receiving
4. you didn't check the sender ID when the stop command was given. makes it possible for another computer to stop the program.
5. you don't need to assign i and k to id and message. you can just do i, k = rednet.receive()
6. correct the typos
7. instead of checking the ID every time you can check it once and then check the message
8. maybe make it possible to change the commands
9. In addition i would have preferred to use elseif instead of nesting every if statement, but that is up to you.

#4 NanoBob

  • Members
  • 102 posts

Posted 04 May 2013 - 04:29 PM

Thanks for the tips! I knew about the typos, but i haven't had the chance to fix em, but how do you find the modem automaticly? Or should i go ask in ask a pro,

#5 kalkins

  • Members
  • 3 posts

Posted 04 May 2013 - 05:17 PM

you use a for loop to go through the sides and see if there is a modem there

for key, side in pairs(rs.getSides()) do
    if peripheral.getType(side) == "modem" then
	    rednet.open(side)
    end
end

you can use the same code for other peripherals, such as monitors. just change "modem" to "monitor"

#6 NanoBob

  • Members
  • 102 posts

Posted 05 May 2013 - 03:46 AM

Thanks,

#7 NanoBob

  • Members
  • 102 posts

Posted 05 May 2013 - 05:51 AM

version 1.5 is out

in the new version I changed some things
it now does find the modem automaticly(question 2.5 is gone)
if you type something wrong it will ask again.
no possible interference from other transmitters (I might have skipped something but i hope not)
some minor changes in code

#8 kalkins

  • Members
  • 3 posts

Posted 10 May 2013 - 06:50 AM

looks good, but what if you want it to go a long way and dont want to type "w" all the time to get there? maybe you can make it so that you can type "w 5" and it moves forwards 5 blocks, and make it possible to send multiple commands at once, such as "w 5 d w 10" to make it move 5 blocks forwards, turn right, and then move another 10 blocks forward. it might require you to change most of your code, but it would make the program better

#9 NanoBob

  • Members
  • 102 posts

Posted 10 May 2013 - 04:12 PM

I've had that idea in mind for a long time, but I am currently working on something else (adding commands yourself from GUI) wich I will upload soon

#10 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 10 May 2013 - 05:40 PM

Nice work :)/>


#11 NanoBob

  • Members
  • 102 posts

Posted 12 May 2013 - 04:06 PM

updated to version 2.0!

features:
-Adding commands through gui
-Collors for advanced computers.
-Nicer gui
-Big changes in code/indenting
-Turtle returns message saying whether the command was correct
-Automaticly refuels if there's fuel.
-Turtle returns message if out of fuel and coal.
-terminates program if answer to question 1 was no

#12 GyroW

  • Members
  • 11 posts

Posted 19 June 2013 - 09:11 AM

Hey there, I'm trying to code my own program and (if you don't mind i used part of your code for the rednet stuffs) but i can't get the
if k == ("w') to work
it always returns false could you help me out with this?

#13 Tjakka5

  • Members
  • 256 posts

Posted 19 June 2013 - 09:41 AM

View PostGyroW, on 19 June 2013 - 09:11 AM, said:

Hey there, I'm trying to code my own program and (if you don't mind i used part of your code for the rednet stuffs) but i can't get the
if k == ("w') to work
it always returns false could you help me out with this?

if (k == w) then --where w is a variable.
  doStuff()
end


#14 KatraAmalia

  • Members
  • 6 posts

Posted 21 October 2013 - 04:43 PM

Hey! I love your program, but I did have one question. When I'm adding a new command to the turtle, is it possible to set it up to run a program on the turtle? I know this is probably a very stupid question, but I can't figure it out. For example, if I have a turtle with a program called "tap", and I want to use your code to run the turtle program remotely, how would I set up the new command?

#15 NanoBob

  • Members
  • 102 posts

Posted 26 October 2013 - 09:01 AM

Sorry for the late response. I haven't been into computercraft for a long time.
And to answer your question , no I don't think you can run a custom program by adding a new command. but I am probably gonna redo a lot of the code to make it work better.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users