I edited a little bit for use on a server. In case the server restarts/crashes while the turtle is facing the chest, I made it so that it will check to see which block matches whatever block you put in slot 16, then do a 180 (spins around so block matching slot 16 is in the back). Also, it empties the inventory when the item in slot 1 has more than 15 items (Since I'm using for a blaze farm) Edited version which will only attack when it recieves a redstone signal from the back: Edited by KykyRocks1, 03 June 2015 - 11:56 PM.
Code: while true do turtle.attack turtle.sleep endI personally use a sleep timer of 0.5 sec, but have a redstone toggle in the loop so it's not running constantly. While using a rudimentary system like this it is recommended that you stuff the turtle's inventory with cobble or something beforehand so that you don't need to worry about getting items out of the turtle. However, it's a fairly simple matter to add turtle.drop to your loop (as egor does) or to add in a loop that clears the inventory when the turtle starts to get full. For instance: add this in to the above loop and it will empty its inventory whenever an item lands in slot 16. Code: if turtle.getItemCount(16) 0 then for i = 1, 16 do turtle.select(i) turtle.drop end turtle.select(1) endYou of course can tweak this to fit your tastes. Whether that means reducing the number of slots you throw out or disposing of the if statement all together to handle mobs that have multiple drops. Though if you scrap the if statement, I would strongly recommend only throwing out the first 4 slots or so - that should cover all the random drops like stone swords and such.
The code for using an xp turtle all depends on how automated your system is. If you're just manually feeding the turtle items and taking them out it's really easy. Code: xp=peripheral.wrap('right') xp.setAutoCollect(true) if xp.getLevels = 30 then turtle.select(16) turtle.transferTo(15, 1) turtle.select(15) xp.enchant(30) turtle.drop turtle.select(1) endUsing this, if you place a bunch of books in slot 16 whenever the turtle has 30 levels of experience it will move 1 of those books to slot 15, enchant it, then drop it off in a chest in front of it. It finishes with turtle.select(1) because I'm building this with the assumption that your xp turtle will also be killing stuff, so we want mob drops to accrue in the earlier slots and not interfere with the enchanting process. To bring these together, we should really make the enchanting process its own function so everything is easy to see.
Code: xp = peripheral.wrap('right') xp.setAutoCollect(true) function enchantBook turtle.select(16) turtle.transferTo(15, 1) turtle.select(15) xp.enchant(30) turtle.drop turtle.select(1) end while true do if xp.getLevels = 30 then enchantBook end turtle.attack for i = 1, 4 do turtle.select(i) turtle.drop end turtle.select(1) turtle.sleep(0.5) endThis will automatically enchant books placed in slot 16 (the last slot), can handle up to 4 mob drops at a time, and will attack quite quickly. However, there are still 3 problems with it: 1st it drops mob drops and enchanted books in the same place. 2nd it doesn't turn off. 3rd it needs to be manually refilled with books.
The 1st problem is easy to correct. If we change turtle.drop into turtle.dropUp or turtle.dropDown we can send items to different places. Moreover, since this will be a melee turtle, we can assume there won't be a chest in front of it, so we really should set one chest to the top and one to the bottom, leaving the front clear for killing. Fixing the 2nd problem is pretty simple in terms of coding, but this is where you start running into questions about your mob grinder setup. If you run a redstone signal into the back of the turtle or one of the sides, you can turn off the turtle by replacing. Code: while rs.getInput('back') dohowever, if you have multiple turtles next to each other, you obviously can't run redstone to the sides, limiting your input to the back of the turtle.
99% of the time this is fine, but blazes have a nasty habit of every now and then shooting around your turtle and setting you on fire. It's rare, but it sucks. However, for now, let's just write that off as an acceptable risk. Finally, the 3rd problem is a real doosey if we're trying to keep things simple. If you've incorporated a redstone shutoff then you don't have an extra face of the turtle available to use.
Even if you didn't, the top, bottom, and front faces of the turtle are already occupied, making the process of having the turtle automatically refill its books tricky. The solution I use on occasion and have seen other people use is to have your enchanted book chest (usually an ender chest) serve double duty as both the receptacle for enchanted books and the holding area for extra unenchanted books. However, using this sort of system isn't very practical unless you use outside infrastructure to pull the enchanted books away for storage elsewhere (i.e. Use an emerald pipe).
Checking whether there are books in slot 16 is accomplished via our old friend turtle.getItemCount(16).Retrieving new books can be accomplished via turtle.suck. So, let's bring this all together: Assumptions. Code: shell.run('killer') Then press ctrl to bring up the menu and save. To restart your turtle (and thus start the program running for the first time) either hold down ctrl+r or log out/back in (or unload the chunk and load it back in, whatever). For what it's worth, most of the really nice auto-enchanting programs you can find on the CC forums aren't really much more than this.
They incorporate things like safety checks (i.e. If the book chest is full, don't throw books on the ground), movement, monitor support, and other nice features, but the functional bit is all here. So, if you followed along at all you're probably already ready to jump into actual ComputerCraft programming.
Melee Attack Mass Effect
If you'd like a rundown of some of the basics that went into making this program, I highly recommend Direwolf20's series of CC. For info on more of the awesome peripherals like the XP module added by Misc. Peripherals, you can refer to its on the CC forums. Finally, if you get serious about programming, I strongly suggest doing your programming with some of the from the CC wiki open in another window until you've got the hang of things.
A simple program instructing 5 melee turtles to attack - - until given the command to stop. Turtles must be rednet - - local. Commands are sent from a local computer.
Once - - given the stop command from the computer, they reboot - - and await the start command. If you use this, just change - - the computer ID to your computer's ID. rednet.open('right') print('Ready for Action Sire!'
) while true do local sender, msg, dist = rednet.receive if msg 'go' then rednet.send(248,'Attacking Sire') print('Sire - I'm Kicking Ass!' ) local firing = true while firing do turtle.attack sender, msg, dist = rednet.receive(1) if msg 'stop' then firing = false end end rednet.send(248,'Resting Arm Sire') print('Resting Arm Sire') os.reboot end end. Aisc steel manual shapes and names.
Melee Turtle Name Melee Turtle Tool Stackable Yes (64) Data Value 210:3 Mod Included The Melee Turtle is a specialized for fighting. It gives the highest damage of all turtles dealing 10 hit points of damage (5 hearts). It was added in Tekkit 3.1.3. Unlike most killing mob methods, mobs DO drop experience orbs when killed by a turtle, this can be a good way to make a fully automatic xp farm.
But the turtle itself will only take mob loot, and the experience orb(s) will be dropped on the ground. The attack command is Turtle.attack although this might not be the program It can be upgraded to Crafty Melee Turtle.
About This sub-reddit was originally created for discussion around FTB launcher. It has later grown to be the main subreddit for all things related to modded minecraft. Mod developers will be given a personal flair when confirmed. Please message the subreddit moderators if you think you, or anyone else, deserve a flair. Rules and Guidelines.
Only post content relating to Modded Minecraft or Minecraft mods. Be kind to everyone and try to help out as best you can. Do not expose any exploits that may break the game or mod(s) balance using either a bug within a mod(s) or a combination of mods. Do not expose any bugs here.
Send them straight to the mod's developers or post to the appropriate bug trackers. Do not spam. This includes low-effort memes, and vote manipulation (e.g. 'don't upvote'). Keep 'Drama' posts at a minimum.
It will only be allowed if a healthy discussion can come out of it. Please post Server Ads and ANY Crashes/Issues to the correct sub-reddit. Posts and links for money and donations will be removed unless for registered charities and the mods are provided will proof that all the money will be given to the organisation(s). This includes Patreon links. We reserve the right to ban users and remove posts on a case by case basis depending on if they break any of these rules Discords. 's own Discord for all modded minecraft discussion. MMD is a place to ask specific questions about mods and development.
Technic's discord for their platform. ATLauncher's discord Weekly Threads Archive If you would like more information on FTB then check out our to see all the current modpacks, and discussions from the community, as well as helpful links! Tools & Resources.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |