Posted 18 December 2013 - 06:18 PM
Greetings, I've been playing with computercraft for quite a while, which is in my opinion top tier mod, and so useful that I wouldn't be able to accomplish half of stuff I've done while playing minecraft… In the past I didn't really care about saving what I made, since I could reproduce it from top of my head, but I now I felt like someone can actually spare some time on research and explosions by using some of the stuff I wrote in the past :)/>/> It will be also an opportunity for people that are quite new to computercraft to see how things can be done, so enjoy!
I will be updating this topic whenever I come up with something new, or when someone in this topic point out some mistake or just propose a better way to achieve same effect. Every program/utility will have short description so you can figure out what is this program/utility for.(1.6.4 packs are not out for too long, currently my programs are witten for FTB Unleashed 1.5.2 modpack, but I'm already getting around rewriting them to work on 1.6.4, soon enough I will have all my programs updated for 1.6.4 as well, unless I come across some issue with new OpenPeripherals that will require waiting on mod update).
Let's get to the point:
(Listed versions along with pastebins are just versions of modpacks that I have successfully tested programs I made, however they should work with any other modpack that has ComputerCraft and OpenPeripherals in them. Also bear in mind that while 1.5.2 tests were done with ComputerCraft and OpenPeripherals versions supplied in 1.1.7 version of the modpack by default, I strongly suggest to use latest OpenPeripherals version in 1.6.4 version of minecraft, which you can find at http://openmods.info:8080/job/OpenPeripheralCore/ ).
AS OF NOW PROGRAMS ARE SEPARATE FOR MC 1.5.2 AND 1.6.4 BUT I WILL SHORTLY UPDATE THEM WITH SINGLE PASTEBIN LINKS WHICH WILL PROVIDE COMPATIBILITY FOR BOTH VERSIONS OF MINECRAFT.
*getLiquidAmount(side,tankSide) function:
[indent=1]-1.5.2 and 1.6.4 compatible function by theoriginalbit:http://pastebin.com/3bzUZkdc[/indent]
*MFR automatic books/items enchanter program:
[indent=1]This program will let you enchant specific amount of items/books at once certain amount of times. It supports up to 16 items/stacks of books(full turtle, continuous items/books input possible to exceed 16 items/stacks limit) and will deposit enchanted items into any valid inventory north(default) of Auto-Enchanter. Side to which enchanted items will be sent to is configurable in line 1 of the program. Basic setup goes as follows: Any turtle facing MFR Auto-Enchanter and any valid inventory(Hopper,ME interface, anything) next to Auto-Enchanter in direction you specified in the program(default is north, therefore turtle needs to be in different spot. Valid sides to output items to are:”up”,”down”,”north”,”south”,”east”,”west”)[/indent]
[indent=1]-1.5.2&1.6.4: http://pastebin.com/yh9X22KU[/indent]
[indent=1]In 1.6.4 version Auto-Enchanter no longer let you enchant multiple books at once with same enchant, therefore you can no longer input amount of books to enchant at once.[/indent]*DartCraft Spoils Bags processing program:
[indent=1]
Ever ran into situation where your fancy MFR spawner with monsters killed by Extra Utilities Iron Spikes gives you ton of Spoils Bags that just can’t be simply imported into turtle and opened by it without having first “initializing” them by taking them into player inventory ? This program with small help of AE will let you automatically open any amount of non-initialized Spoils bags! Basic setup goes as follows: PIM from OpenPeripherals with Fuzzy Export Bus attached with Spoils bag inside(Match Any setting), a turtle below PIM with this program with any valid inventory(preferably ME interface to import Spoils bag contents directly into the network) in front of it. After that all player has to do is to stand on PIM until turtle open all the bags![/indent]
[indent=1]-1.5.2(FTB Unleashed): http://pastebin.com/ZZHKvr8W[/indent]
[indent=1]-1.6.4(FTB Direwolf20 with DartCraft installed): (Not updated yet)[/indent]
*Program to display current ticks/second:
[indent=1]This program will let you see current t/s of server/single player world. During first run it adjusts sleep time to match 19-20 t/s and saves as computer/turtle name for later usage. As of now I am unsure how exact it is going to be at lower t/s, it will require further testing. It doesn't use any peripherals so OpenPeripherals doesn't need to be installed.Default website it gets timestamps from may get you blocked for too many requests(happened on test subject server), so I recommend hosting PHP script which returns the timestamps on your own hosting. Requires http api to be enabled![/indent]
[indent=1]-Any ComputerCraft: http://pastebin.com/y2AG6MXJ[/indent]
[indent=1]-PHP script, which return unix timestamp with microseconds: http://pastebin.com/pm1ejZMR[/indent]*Program which empties your entire inventory while maintaining layout of items:
This program empties all your inventory slots(hotbar, inventory and armor) into enderchests while keeping track of amount of items that you had in your inventory, works like this : You go through pressure plate, then stand on PIM, it will check if your inventory is totally empty(as if you just used it) and then will proceed to restore all items into their places, otherwise it will store everything in enderchests to be later restored to player, after that just step on pressure plate on the other side(A potential usage for this explained below). Basic setup requires 2 sets of enderchests, 1 set for turtle/computer and 1 set for PIM, a turtle/computer, and 2 pressure plates. You can configure sides on which chests are in first 2 lines of the program, valid sides for PIM are ”north”,”south”,”east”,”west”(default west and east),turtle/computer just needs enderchests to be at left/right sides it.
I felt like writing this program because I saw decent way to use this along with mod called Sync(made by ichun for modjam) which lets you travel to your clones in overworld and nether almost instantly, however clones do not share inventory with each other, therefore i wrote this to overcome that problem.
-1.6.4:http://pastebin.com/kuExyAYD*Program which is sorting items based on pattern in chest:
Long story short, this program will push items from input chest down(into trash can for example) if they match set up filter, or send it to other direction if they dont. It loads the filter once per startup, so be sure to restart the program after you change contents of the filter chest.
Basically if you want something to match the filter you just have to keep at least 1 piece of that item/block in filter chest(default:left), and after you start the program it will print out names of items that are added to filter. After that every now and then the program will iterate through input chest(default: right) and will send items matching the filter into certain direction(default:down), or if they dont match the filter into other certain direction(default:south). Default set up is shown is shown on screenshot.
The reason I did it this way is because names of items are not always obvious as they should be(tile.block.marble.0.name yo). Any block with valid inventory and getStackInSlot() method available can be either filter chest or input chest(ender chest, diamond chest etc). Things that you may want to change are declared and commented in the beginning of the program.
-1.6.4:http://pastebin.com/g4Yhyn8X
That is all for now, feel free to provide feedback, or report any issues. :)/>
I will be updating this topic whenever I come up with something new, or when someone in this topic point out some mistake or just propose a better way to achieve same effect. Every program/utility will have short description so you can figure out what is this program/utility for.(1.6.4 packs are not out for too long, currently my programs are witten for FTB Unleashed 1.5.2 modpack, but I'm already getting around rewriting them to work on 1.6.4, soon enough I will have all my programs updated for 1.6.4 as well, unless I come across some issue with new OpenPeripherals that will require waiting on mod update).
Let's get to the point:
(Listed versions along with pastebins are just versions of modpacks that I have successfully tested programs I made, however they should work with any other modpack that has ComputerCraft and OpenPeripherals in them. Also bear in mind that while 1.5.2 tests were done with ComputerCraft and OpenPeripherals versions supplied in 1.1.7 version of the modpack by default, I strongly suggest to use latest OpenPeripherals version in 1.6.4 version of minecraft, which you can find at http://openmods.info:8080/job/OpenPeripheralCore/ ).
AS OF NOW PROGRAMS ARE SEPARATE FOR MC 1.5.2 AND 1.6.4 BUT I WILL SHORTLY UPDATE THEM WITH SINGLE PASTEBIN LINKS WHICH WILL PROVIDE COMPATIBILITY FOR BOTH VERSIONS OF MINECRAFT.
*getLiquidAmount(side,tankSide) function:
Spoiler
[indent=1]This function will let you check amount of liquid stored in tank on "side" of turtle, by getting info from specified tank side "tankSide". If given no arguments function will use default arguments which are “top” for tank position in relation to turtle and “unknown” as side of tank to get information from.[/indent][indent=1]-1.5.2 and 1.6.4 compatible function by theoriginalbit:http://pastebin.com/3bzUZkdc[/indent]
Spoiler
[indent=1][/indent][indent=1]This program will let you enchant specific amount of items/books at once certain amount of times. It supports up to 16 items/stacks of books(full turtle, continuous items/books input possible to exceed 16 items/stacks limit) and will deposit enchanted items into any valid inventory north(default) of Auto-Enchanter. Side to which enchanted items will be sent to is configurable in line 1 of the program. Basic setup goes as follows: Any turtle facing MFR Auto-Enchanter and any valid inventory(Hopper,ME interface, anything) next to Auto-Enchanter in direction you specified in the program(default is north, therefore turtle needs to be in different spot. Valid sides to output items to are:”up”,”down”,”north”,”south”,”east”,”west”)[/indent]
[indent=1]-1.5.2&1.6.4: http://pastebin.com/yh9X22KU[/indent]
[indent=1]In 1.6.4 version Auto-Enchanter no longer let you enchant multiple books at once with same enchant, therefore you can no longer input amount of books to enchant at once.[/indent]
Spoiler
[indent=1][/indent][indent=1]
Ever ran into situation where your fancy MFR spawner with monsters killed by Extra Utilities Iron Spikes gives you ton of Spoils Bags that just can’t be simply imported into turtle and opened by it without having first “initializing” them by taking them into player inventory ? This program with small help of AE will let you automatically open any amount of non-initialized Spoils bags! Basic setup goes as follows: PIM from OpenPeripherals with Fuzzy Export Bus attached with Spoils bag inside(Match Any setting), a turtle below PIM with this program with any valid inventory(preferably ME interface to import Spoils bag contents directly into the network) in front of it. After that all player has to do is to stand on PIM until turtle open all the bags![/indent]
[indent=1]-1.5.2(FTB Unleashed): http://pastebin.com/ZZHKvr8W[/indent]
[indent=1]-1.6.4(FTB Direwolf20 with DartCraft installed): (Not updated yet)[/indent]
*Program to display current ticks/second:
Spoiler
[indent=1][/indent][indent=1]This program will let you see current t/s of server/single player world. During first run it adjusts sleep time to match 19-20 t/s and saves as computer/turtle name for later usage. As of now I am unsure how exact it is going to be at lower t/s, it will require further testing. It doesn't use any peripherals so OpenPeripherals doesn't need to be installed.Default website it gets timestamps from may get you blocked for too many requests(happened on test subject server), so I recommend hosting PHP script which returns the timestamps on your own hosting. Requires http api to be enabled![/indent]
[indent=1]-Any ComputerCraft: http://pastebin.com/y2AG6MXJ[/indent]
[indent=1]-PHP script, which return unix timestamp with microseconds: http://pastebin.com/pm1ejZMR[/indent]
Spoiler
This program empties all your inventory slots(hotbar, inventory and armor) into enderchests while keeping track of amount of items that you had in your inventory, works like this : You go through pressure plate, then stand on PIM, it will check if your inventory is totally empty(as if you just used it) and then will proceed to restore all items into their places, otherwise it will store everything in enderchests to be later restored to player, after that just step on pressure plate on the other side(A potential usage for this explained below). Basic setup requires 2 sets of enderchests, 1 set for turtle/computer and 1 set for PIM, a turtle/computer, and 2 pressure plates. You can configure sides on which chests are in first 2 lines of the program, valid sides for PIM are ”north”,”south”,”east”,”west”(default west and east),turtle/computer just needs enderchests to be at left/right sides it.
I felt like writing this program because I saw decent way to use this along with mod called Sync(made by ichun for modjam) which lets you travel to your clones in overworld and nether almost instantly, however clones do not share inventory with each other, therefore i wrote this to overcome that problem.
-1.6.4:http://pastebin.com/kuExyAYD
Spoiler
Long story short, this program will push items from input chest down(into trash can for example) if they match set up filter, or send it to other direction if they dont. It loads the filter once per startup, so be sure to restart the program after you change contents of the filter chest.
Basically if you want something to match the filter you just have to keep at least 1 piece of that item/block in filter chest(default:left), and after you start the program it will print out names of items that are added to filter. After that every now and then the program will iterate through input chest(default: right) and will send items matching the filter into certain direction(default:down), or if they dont match the filter into other certain direction(default:south). Default set up is shown is shown on screenshot.
The reason I did it this way is because names of items are not always obvious as they should be(tile.block.marble.0.name yo). Any block with valid inventory and getStackInSlot() method available can be either filter chest or input chest(ender chest, diamond chest etc). Things that you may want to change are declared and commented in the beginning of the program.
-1.6.4:http://pastebin.com/g4Yhyn8X
That is all for now, feel free to provide feedback, or report any issues. :)/>
Edited on 25 January 2014 - 08:36 PM