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

Robbo5899's MiscPeripherals Tutorial

Started by Robbo5899, 21 June 2013 - 12:43 PM
Robbo5899 #1
Posted 21 June 2013 - 02:43 PM
Robbo5899's MiscPeripherals Tutorial

I take no credit for the Mod itself this is just what I know about the mod and I thought I would share it since it was so difficult to find anything about it when I was learning.
I will add to this as i learn more about the items and as more items are added.
If you want me to do a certain item next just post it below.

Player Detector:
Emits event 'player' when right clicked with 'username' as a parameter.

This piece of code will print the player event and the username of the player who clicks it.

event,name = os.pullEvent("player")
print(event)
print(name)


Firework Launcher:
Can be crafted alongside a turtle to produce a Firework Turtle. The block version has 54 slots of firework component storage, while the turtle version uses the turtle's inventory.
Has one function, launch(slot,slot,slot,slot,…)

The following code will launch a firework using the items in slots 1, 2, 3 and 4.

fw = peripheral.wrap("SIDE")
fw.launch(1,2,3,4)

Iron Note Block:
Can be crafted alongside a turtle to produce a Note Turtle. Produces In Game Note block sounds which you tell it.

Has one function; playNote(instrument, noteNumber)

Instruments are as follows;
0 = Piano
1 = Bass drum
2 = Snare
3 = Clicks
4 = Bass guitar

Notes are 0-24 in number of right clicks

The following code plays note 3 from the Snare.

note = peripheral.wrap("SIDE")

note.playNote(2, 3)

Computer Controlled Crafter:
Has 4 functions:
setPattern(slot,slot,slot…) - Sets the crafting recipe.
craft(amount) - Pretty self explanatory.
list() - Returns a list of all items in the inventory.
get(slot) - Returns the amount
Jappards #2
Posted 30 June 2013 - 08:47 AM
nice, keep up the good work, i hope to get see some more methods in the future for other players, i also would like to know how the ME bridge`s retrieve function works.

EDIT: 100 posts!!!
provet #3
Posted 12 July 2013 - 12:07 PM
A How to ME Bridge!

ME Bridge, From MiscPeripherals, is used with AE (Applied Energystics) networks to check for items and retrieve items.

So you will need:
a Computer,
a working AE network
ME Bridge placed beside a terminal (or?) ME Drive (or?) ME Controller. (or? = not confirmed)
Some networking cables and wired modem or wireless modem. (connect between the computer and bridge)
a chest placed at the ME bridge (optional)

Now with everything hooked up:

p = peripheral.wrap("meBridge_0")
local x = 0
t = p.listItems()
p.retrieve(id, amount, direction)
--example p.retrieve(89, 15, 1)
--will take 15 glowstone from the AE network and put it in a chest atop of the ME Bridge

for k, v in pairs(t) do --will list the remaining items (id, amount)
print(k.." = "..v)
end

Direction values are:
0 for down
1 for up
2 for -Z
3 for +Z
4 for -X
5 for +X

Items with damage values will not keep their usual ids. They get a whole new one like:
Fancy Polished Stone Brick 1467:3 gets id: 99771
Fancy Iron Brick 1467:4 gets id: 132539
(from tinkers' construct)
They don't actually get a new id, just named with a another "id" so the bridge know which item is what.

Note1: when ME Bridge is used (by a computer) it may crash the server. Not sure how or why, but the server freezes which generates no crash-report.
Zudo #4
Posted 12 July 2013 - 12:53 PM
Rather than waste memory on the event variable, do this:

_, player = os.pullEvent("player")
MudkipTheEpic #5
Posted 12 July 2013 - 02:28 PM
Rather than waste memory on the event variable, do this:

_, player = os.pullEvent("player")

_ saves little to no memory over event, as _ has no special meaning. Its just used for a scrap variable like foo is used for an example variable.