[1.4] cable
#1
Posted 14 March 2012 - 11:22 AM
#2
Posted 14 March 2012 - 12:40 PM
#3
Posted 14 March 2012 - 02:03 PM
#4
Posted 14 March 2012 - 02:56 PM
Lavawire cabling.
lavawire.init(side) - Initializes the connection.
lavawire.close(side) - Breaks the connection
lavawire.list(side) - Returns list of all device types connected to the lavawire cable
lavawire.mount(side, device#, virtualside) - Mounts the device conneted to the lavawire cable to a given virtual side
lavawire.mountFs(side, device#) - mounts the lavawire conneteced computer/turtle block's file system to the "lavashared" folder of the host OS
Lavawire only has a 4 block range (no more than 4 pieces of cable between the device and the host). Maybe extended by hub blocks?
#5
Posted 19 March 2012 - 08:23 PM
#6
Posted 19 March 2012 - 08:29 PM
#7
Posted 20 March 2012 - 05:40 AM
#9
Posted 20 March 2012 - 11:48 AM
Liraal, on 19 March 2012 - 08:29 PM, said:
Why does it? Surely the interface is easy enough to understand - it's just a case of interacting with peripherals and passing the data back to ComputerCraft. You'd pretty much be a transparent proxy. Multiple peripherals to one cable would be more complex, but not impossible.
#10
Posted 20 March 2012 - 02:16 PM
Cloudy, on 20 March 2012 - 11:48 AM, said:
#11
Posted 21 March 2012 - 01:58 AM
#12
Posted 23 March 2012 - 05:42 PM
Mrjoecool123, on 21 March 2012 - 01:58 AM, said:
Let's not start giving peripherals unique ids. Maybe unique to one side. Attach a disk drive, a monitor, and a turtle to one side's lavacable (I like that, btw), and each would get a number. remove one and replace it with something else (such as removing the turtle and replacing it with another disk drive) and the number is reassigned.
Blatantly I give an example (because I cannot be otherwise eloquent about it):
pList = lavawire.list(side)
for x = 1, pList.len do
if pList(x) == "disk" then
os.copy(path/file,disk.getMountPath(getPeripheral(x))/file)
end
end
etc.
Mass disk writer. For the purposes of this particular code fragment,itallics are pseudo, bold is unmentioned, user-created content. It comes out easier if I just make stuff up as I go. Also why no code tags.
#13
Posted 24 March 2012 - 04:52 AM
What if Peripheral connected with a cable by several sides?
What if you make one cable from two with intersecting sets of Peripherals?
#14
Posted 24 March 2012 - 06:43 AM
Sebra, on 24 March 2012 - 04:52 AM, said:
You can already connect peripherals to multiple terminals. Monitors don't like it so much, but I use disk drives like quick-copy machines all the time. It's actually how my turtle network works right now.
Quote
A single cable would only recognize one block the one time, no matter how many cables are attached to it. See: Industrialcraft2 wires that only feed a machine once, even when there are multiple cables attached.
Quote
I don't quite understand what you are trying to ask here, but from what I can tell, you are asking about exactly what this latter discussion has been about. Connecting multiple peripherals to multiple computers would have to reference from the terminals, not globally. This is what I was trying to get at in my post. If I've missed something, tell me about it in the morning.
To reiterate: Two computers on a single line would individually look at the line when a new peripheral was attached (peripheral and peripheral_detach). Independently of each other, they would compile a list of peripherals on the line. In fact, you could make sub-sets on a single line by making them a certain space away, if lavawire was implemented. Put three disk drives in the center, with two further wires to each side. I would continue, but I think I made my point, and I'm getting worked up. Rise-Against + late night + pepsi max = not good, assuming good is true.
#15
Posted 24 March 2012 - 07:23 AM
In another thought peripherals should have internal ids already.
May be cable should be peripheral, which translate methods from {"north","south","west","east","top","bottom"} sides? Like that:
cable=peripheral.wrap("right")
disk=cable.wrap("north")
mon=cable.wrap("top")
It can be done as peripheral without Dan200 efforts. With or without lenght check.
If I'm not mistaken IC2 cables feed each side of machine. Can be wrong, not tested, just read somewhere.
#16
Posted 25 March 2012 - 01:51 PM
[C][L][W][W][L][P]
C = computer, L = lavaconnector, W = lavawire, P = peripheral.
The lavaconnectors could have:
1. Colors (a dye in the recipe?)
2. Unique IDs
3. IDs you could set from a computer
If they would be colored, the lavawire would change the color to the color of the lavaconnector connected to the computer. It would only connect to lavaconnectors and lavawires with the same color. The cables would call the peripherals like this:
m = peripheral.wrap("back") --The lavaconnector
disk.eject(m.disk1) -- ejects the disk from the first disk drive...
m.monitor1.write("Monitor") --Writes "Monitor" to the first monitor...
They would label them like a computer labels disks.
#17
Posted 25 March 2012 - 05:55 PM
what do you think about this scheme?
Cable
connects like red alloy wire in RP2 or something like that. Can be connected to pc and connector/controller.
Connector/controllerIt can be colored to make difference between them, it doesnt needs and UID.
It can have direction.
ComputerFloppy drive
Monitor
Rules:
Each peripheral can be connected to multiplie connectors/controllers.
To get peripheral wee ned only side where cable is connected to computer and color of the connector/controller.
If there more than one connector/controller with single color then (first found / nearest by cable) will be returned.
Each peripheral have its metatable so it can be used as class.
Pseudo code to use:
monitor1 = cable.get("right","red") monitor1.write("Hello!") floppy = cable.get("right","green") print(floppy.diskName) floppy.eject()
something like that ?
#18
Posted 25 March 2012 - 07:22 PM
#19
Posted 25 March 2012 - 08:29 PM
#20
Posted 25 March 2012 - 08:41 PM
Cloudy, on 25 March 2012 - 08:29 PM, said:
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users