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

turtle mail

Started by solidmoose, 07 March 2013 - 08:19 AM
solidmoose #1
Posted 07 March 2013 - 09:19 AM
so I've been playing minecraft for a few days and I took a liking to computercraft. Ive been searching the forums for useful turtle programs and its really cool. I saw this one program ( http://pastebin.com/GyJZz4xw ) that lets me use the goto function with a gps. and even better, it lets me save locations with titles. For example, my friend's name is tuna, so i typed goto add <name> <x,y,z> (goto add tuna <his coords>, and it works perfectly. Now this got me thinking. how cool would it be if I could use the goto program as a sort of turtle mail. My friend tuna lives in the middle of the ocean a few hundred blocks from me and im too lazy to swim there, so I would like it if the turtle could go there, drop items down into a chest below him when he lands, and then return to his starting location ( which I've added to the goto program with goto add home <coords>.

I know I'm nowhere near the level of programming in Lua yet but I added like 2 lines of code to the bottom and now the turtle goes to the location and drops inventory slot 1 into the chest. My question is, how could i make him drop all inventory slots into the chest below him and then return to the original starting location? Ive searched the forum's program list and I cant see anyone who's had this snail mail (heh turtle mail) idea. Any help would be appreciated. thanks!

also, I gave my friend a turtle and he has my house and his house labelled too. Would like to get it so his turtle delivers my mail and then returns to him too. I know this is a lot to ask >_< but It's worth a shot
Lyqyd #2
Posted 07 March 2013 - 10:24 AM
Split into new topic.

You can use a for loop to iterate through the slots and drop each one.


for i = 1, 16 do
  turtle.select(i)
  turtle.dropDown()
end

You should probably also create a wrapper program that uses an unmodified goto program to move the turtle, then drops the items, then uses the unmodified goto program again to send it home.
solidmoose #3
Posted 07 March 2013 - 11:06 AM
thanks for the item drop :D/> unfortunately, I have no idea what a wrapper is or how to implement the other stuff lol. I guess i have some reading to do >_< any more help from anyone is also greatly appreciated!
Divide_By_0 #4
Posted 07 March 2013 - 03:13 PM
so I've been playing minecraft for a few days and I took a liking to computercraft.

Hey man, no offense, but maybe you should get your Vanilla Minecraft down before playing with mods, i doubt in a "few days" you could master the whole game, kill a wither and enderdragon without cheating or mods, and see if you can get there, if you can, you should then come back with that, im happy that new people are coming along, but if you have been playing for a few days you should most likely play the game singleplayer, and hone your skills.


[Sorry for my English, Its not my native language]
solidmoose #5
Posted 07 March 2013 - 04:34 PM
well im playing on a feed the beast server and im just slowly experimenting with stuff and learning how to do stuff. I've played Minecraft for like half a year or something on vanilla. what I meant by playing for a few days was playing on a modded server :)/> we just killed the ender dragon yesterday and today we killed naga and hydra in twilight forest. ive got turtles mining for me and made diamond armor and weapons and im diong pretty well. so the question isn't about playing minecraft. I can do that pretty well. It's about coding and stuff, which I cant do very well yet. Ive written simple programs like to make the turtle plant and then bonemeal and then chop wood and wheat. Its just a natural progression im making, going from very simple coding to somewhat more difficult stuff like gps goto :D/> Thanks for the concern and reply. not being sarcastic lol. Glad some people take time to read and give recommendations and such.
Doyle3694 #6
Posted 07 March 2013 - 08:32 PM
Besides, killing enderdragon or wither is just bizzare. Never actually done it myself and will probably never do it. Vanilla suck.
Or actually, killed wither in a grinder once because I wanted a portal gun, but meh.

You only need the skill to rightclick to place down a computer and start learning computercraft. An enderdragon egg or a netherstar or a piston or anything like that won't make you better at coding.
SuicidalSTDz #7
Posted 07 March 2013 - 08:49 PM
so I've been playing minecraft for a few days and I took a liking to computercraft.

Hey man, no offense, but maybe you should get your Vanilla Minecraft down before playing with mods, i doubt in a "few days" you could master the whole game, kill a wither and enderdragon without cheating or mods, and see if you can get there, if you can, you should then come back with that, im happy that new people are coming along, but if you have been playing for a few days you should most likely play the game singleplayer, and hone your skills.


[Sorry for my English, Its not my native language]

I don't do that stuff, my turtles do :P/> I have no time to be killing withers! I'm too busy spending time in The End with my beloved Endermen and wife – The Enderdragon – Coding EnderOS on the tallest of the obsidian pillars in the dimmest light given off by the EnderCrystals which keep my wife alive. That damn Steve character wants her baby. Mark my words, someday I will kill that "Steve".

On topic: Read this!
Doyle3694 #8
Posted 07 March 2013 - 09:26 PM
That though is some hard read stuff, I do more of recommend reading the required page on the cc wiki, it's alot less complex and more of a easy read
SuicidalSTDz #9
Posted 07 March 2013 - 09:38 PM
Blah! That "Manual" could save lives! The wiki page doesn't go into the much needed detail, well for users more aimed torwards more serious scripts
solidmoose #10
Posted 08 March 2013 - 01:55 AM
thanks both of you for the info! ill read both of them. hope I can come up with a solution after ive done my research.
Lyqyd #11
Posted 08 March 2013 - 04:21 AM
so I've been playing minecraft for a few days and I took a liking to computercraft.

Hey man, no offense, but maybe you should get your Vanilla Minecraft down before playing with mods, i doubt in a "few days" you could master the whole game, kill a wither and enderdragon without cheating or mods, and see if you can get there, if you can, you should then come back with that, im happy that new people are coming along, but if you have been playing for a few days you should most likely play the game singleplayer, and hone your skills.


[Sorry for my English, Its not my native language]

That is not at all what this section is for. This section is for answering coding questions, not denigrating question-askers and telling them what they should or should not be playing. If you are unable or unwilling to contribute to the conversation, please do not post here.
LordIkol #12
Posted 08 March 2013 - 10:09 AM
Hm its hard to edit the code of someone else.
But i like the idea of a Turtle Post :D/>
Maybe i can do this in the weekend if there is nobody who is able and willing to edit this code

Will post a message at the weekend
SuicidalSTDz #13
Posted 08 March 2013 - 10:21 AM
thanks both of you for the info! ill read both of them. hope I can come up with a solution after ive done my research.
After you read the wiki page and manual, you will be golden! Well, there are the occasional questions (Which are reasonable) but, you will be better at Lua than before the reading
Or actually, killed wither in a grinder once because I wanted a portal gun, but meh.
I got a Portal Gun from a dungeon :P/> Pretty lucky if you ask me!
LordIkol #14
Posted 08 March 2013 - 01:13 PM
Hi Guys,

could not sleep and liked the idea of a post delivery Turtle.
So i did a little programming and HERE is the first result.
name of my programm is mail.

You have to put the Turtle somewhere and set this position as home. ( mail add home x z y f)
in this case f represents the facing of your turtle when it is at its home location

then you can add locations of other people. For example add Steve (mail add steve x z y f)
in the case of your friends f is the facing of the chest to put the items in


now you can put things into the turtle and type mail Steve.
The turtle will go to Steves location
turn in the direction of the chest (f)
facings are: North=1 East=2 South=3 West= 4
and go back home

did a short testing on the code and so far it should work.
will add some more features and some bugfixin the next days

Greets
Loki

edit: at the moment its based on minimap or debug coords. good thing about this is you can build a chunk loader mining turtle and then you can send it everywhere in the world :)/>
Edited on 08 March 2013 - 12:19 PM
solidmoose #15
Posted 08 March 2013 - 04:17 PM
hm. I just tested your mail turtle for like half an hour and I cant get it to deliver. I first add home location. mail add home x y z f. then I add destination location. mail add friend x y z f. The destination of the turtle is directly in front of it. My house is 5 blocks in front and one block to the left of my friends for testing purposes. So all the turtle needs to do is move straight forward 5 blocks and one to the left. What the turtle does when I type mail friend is, it immediately rises up into the air 8 blocks and then spins to the right indefinitely. The second test I performed yielded different results, but still no success. On the second test, The original location and destination were on the same y and z axis and only the x was different by about 100 blocks. so all it had to do was move forward. home set. destination set. When the turtle is told to go to the destination, it immediately turns to the left and keeps going until it hits a wall.

Just some testing. Hope it helps :D/>
Mailmanq! #16
Posted 08 March 2013 - 04:43 PM
so I've been playing minecraft for a few days and I took a liking to computercraft.

Hey man, no offense, but maybe you should get your Vanilla Minecraft down before playing with mods, i doubt in a "few days" you could master the whole game, kill a wither and enderdragon without cheating or mods, and see if you can get there, if you can, you should then come back with that, im happy that new people are coming along, but if you have been playing for a few days you should most likely play the game singleplayer, and hone your skills.


[Sorry for my English, Its not my native language]

Still haven't kill a wither legit since they were added, also mods are encouraging because you will like never get bored
SuicidalSTDz #17
Posted 08 March 2013 - 04:44 PM
I could never kill an endermen or enderdragon… Instead, I simply spawn in the drop they would give me :P/>
Azhf #18
Posted 08 March 2013 - 04:47 PM
I could never kill an endermen or enderdragon… Instead, I simply spawn in the drop they would give me :P/>
I would not either. I would hope it would stay at peace with me. I would scour the End to find you. Wait a minute… Is that an enderman on a computer up there?! :D/>
SuicidalSTDz #19
Posted 08 March 2013 - 04:48 PM
I could never kill an endermen or enderdragon… Instead, I simply spawn in the drop they would give me :P/>
I would not either. I would hope it would stay at peace with me. I would scour the End to find you. Wait a minute… Is that an enderman on a computer up there?! :D/>
Hehe, you would never find me in The End! Soo many places to hide…

What was this thread even about?
Azhf #20
Posted 08 March 2013 - 04:51 PM
I could never kill an endermen or enderdragon… Instead, I simply spawn in the drop they would give me :P/>
I would not either. I would hope it would stay at peace with me. I would scour the End to find you. Wait a minute… Is that an enderman on a computer up there?! :D/>
Hehe, you would never find me in The End! Soo many places to hide…

What was this thread even about?
I dunno XD but I bet I would find you. One day… If you ever see Steve, ask if it is Azhf from the forums. :)/> We could meet and become great friends, and I could meet your wife! :lol:/>
SuicidalSTDz #21
Posted 08 March 2013 - 04:56 PM
I could never kill an endermen or enderdragon… Instead, I simply spawn in the drop they would give me :P/>
I would not either. I would hope it would stay at peace with me. I would scour the End to find you. Wait a minute… Is that an enderman on a computer up there?! :D/>
Hehe, you would never find me in The End! Soo many places to hide…

What was this thread even about?
I dunno XD but I bet I would find you. One day… If you ever see Steve, ask if it is Azhf from the forums. :)/> We could meet and become great friends, and I could meet your wife! :lol:/>
Meh, my wife isn't too much of a people person…But im sure steve knows that by now.
LordIkol #22
Posted 08 March 2013 - 06:38 PM
hm. I just tested your mail turtle for like half an hour and I cant get it to deliver. I first add home location. mail add home x y z f. then I add destination location. mail add friend x y z f. The destination of the turtle is directly in front of it. My house is 5 blocks in front and one block to the left of my friends for testing purposes. So all the turtle needs to do is move straight forward 5 blocks and one to the left. What the turtle does when I type mail friend is, it immediately rises up into the air 8 blocks and then spins to the right indefinitely. The second test I performed yielded different results, but still no success. On the second test, The original location and destination were on the same y and z axis and only the x was different by about 100 blocks. so all it had to do was move forward. home set. destination set. When the turtle is told to go to the destination, it immediately turns to the left and keeps going until it hits a wall.

Just some testing. Hope it helps :D/>/>

Thanks for the info will test this things tonight when im back home.
Seems to be a problem with the facing.
LordIkol #23
Posted 09 March 2013 - 02:19 AM
Hi Solid,

still at work but i did a little debugging with ccEmulator and for me it works fine.
could you use this code http://pastebin.com/1WtBrtUi to generate debugfile and put it on pastebin
would like to see how it behaves on your side

greets
Loki
solidmoose #24
Posted 09 March 2013 - 08:09 AM
alright i tried the new one and i think ive found the problem. you've got your axes confused. when I tell the turtle to move in a straight line across the x-axis, he moves that same straight line across the z-axis instead. when told to move across the z-axis, it moves across the y-axis. when told to move across the y-axis, he moves across the z-axis instead. hope this helps!
LordIkol #25
Posted 10 March 2013 - 04:40 AM
Hm now i see the problem



I first add home location. mail add home x y z f. then I add destination location. mail add friend x y z f.

and you should use it like this

You have to put the Turtle somewhere and set this position as home. ( mail add home x z y f)
in this case f represents the facing of your turtle when it is at its home location

if u use x z y f instead of x y z f it should work correct :)/>
solidmoose #26
Posted 10 March 2013 - 08:06 AM
switched the xyz to xzy and the turtle still just moves left until it hits something when i tell it to go to the friend's coordinates. Also the turtle wont even move if its on the ground. I have to raise it one block off the ground because the first movement it makes is move down one block, then goes left instead of straight. Im not sure really whats wrong with it :s
LordIkol #27
Posted 10 March 2013 - 08:56 AM
did u use the coordinates that you got from your GPS? or did you use coordinates from Minimap or Debug screen?

make shure that u use the correct facing. when u use the facing from the debug screen dont type in the number that is shown there. in this script like i mentioned before North = 1 East = 2 south = 3 West = 4


else use the debug script and send me the logfile or upload it to pastebin
that would help to see whats going wrong with your turtle