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

World to World Computer Communication

Started by Prototypep, 07 April 2013 - 02:30 AM
Prototypep #1
Posted 07 April 2013 - 04:30 AM
Please help! I made a program for one computer and another computer to communicate with each other, without rednet. Thi program would be especially helpful for computer communication in different worlds. I need some help on the program. Here's the prototype:

fileToBeChanged = (dSend)
function computerOneDisk()
start = false
localrun = false
filetrue = false
if event == "disk" then
write ("Disk located.")
term.setTextColor(colors.blue)
sleep(1)
print (" System loaded.")
start = true
end
term.setTextColor(colors.red)
print ("ERROR: No disk. Please insert correct disk to activate program.")
sleep(1)
term.setTextColor(colors.white)
computerOneDisk
if (start = true) then
function computerOneStart()
function computerOneMain()
end
term.setTextColor(colors.white)
if shell.resolve( "." )=="" then
print ("Running on computer.")
localrun = true
end
print ("Please run this program on your computer, and not a disk.")
computerOneStart
if (local run = true) then
function computerOneFileCheck()
end
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.green)
print ("Program startup successful!")
term.setTextColor(colors.cyan)
sleep(0.5)
write ("Checking disk for ")
term.setTextColor(colors.red)
write ("dSend ")
term.setTextColor(colors.cyan)
print ("file…")
sleep(1)
local sDir = sPath:sub(dSend)
if not fs.exists( sDir ) then
term.setTextColor(colors.red)
print ("File non-exsistant. Creating file…")
fs.makeDir( sDir )
print ("File created.")
end
if fs.exists( sDir ) then
term.setTextColor(colors.green)
print ("File exists!")
sleep(0.5)
end
filetrue = true
computerOneFileCheck
if (filetrue = true) then
function computerOneSend()
end
term.setTextColor(colors.blue)
term.clear()
term.setCursorPos(1,1)
print ("FINAL SYSTEM STARTING UP…")
sleep(1)
while true do
print ("Enter message:")
input = read()
newmessage = (input)
local file = nil
local function computerOneREsave
file = fs.open( _sPath, "w" )
if file then
for n, sLine in ipairs( tLines ) do
file.write( newmessage )
end
computerOneREsave
end
while true do
if (file = newmessage) then
sleep(1)
end
load(sPath)
sleep(1)
end
computerOneSend
Please help!
Thanks,

EDIT: This program was made when I was bad at programming! Don't judge me on it!
Dlcruz129 #2
Posted 07 April 2013 - 05:34 AM
Anytime you call a function you have made, you need to put parentheses around it. computerOneSend needs to be computerOneSend()

Also, when comparing variables, use two equal signs. (==)
Prototypep #3
Posted 07 April 2013 - 06:13 AM
Thanks for the help, and I'm still learning Lua. I'll re-post my code here when I have another version.
EDIT: Also, how badly would this fail?
Prototypep #4
Posted 07 April 2013 - 06:17 AM
Also, I think I'll start out with some more simple programs.
FuuuAInfiniteLoop(F.A.I.L) #5
Posted 07 April 2013 - 08:20 AM
program to write to disk and the read it


args = {...}
if not fs.exists("/disk") then
os.pullEvent("disk")
end
if args[1]=="-send" then
fs.copy(args[2], "/disk/"..fs.getName(args[2])
else
a = fs.list
for i=1, #a do fs.copy("/disk/"..a[i], a[i]) end
end
I havent test it but it should work, you have to call it like this: programname -send|-receive programtosend
Prototypep #6
Posted 07 April 2013 - 10:51 AM
I understand the program, but could you help me with the name? If I called the program "program1" and the other program "program2", I would call it "program1 -sendl-receive program2," right? Thanks
Nevermind! :mellow:/> Feel dumb for asking in the first place…
TheArchitect #7
Posted 07 April 2013 - 11:09 AM
I looked at the date first, but no, it's April 5th. I may proceed.

I don't think this program would work at all. Basically because computers' files are stored independently for each world, meaning you can't just write a file in one world and read it from another world without copying lots of files between world save folders in between. And you can already do that without doing all this.
Prototypep #8
Posted 07 April 2013 - 01:52 PM
I looked at the date first, but no, it's April 5th. I may proceed.

I don't think this program would work at all. Basically because computers' files are stored independently for each world, meaning you can't just write a file in one world and read it from another world without copying lots of files between world save folders in between. And you can already do that without doing all this.

I own a Tekkit multiplayer server, and I noticed that if there are two floppy disks with the same : # at the back, and a program is changed on one, the second one's program would ALSO be changed. So this is what I thought: "Hey! Why don't I have a system to link two computers using a rednet-like program between worlds!" Because of the fact this is possible, I think, almost know, that someone can create a program that does this. So I ask of everyone this: Help me make one.
EDIT: I forgot to say, if I get help from someone I WILL give them some credit, depending on how much they did.
Engineer #9
Posted 07 April 2013 - 02:57 PM
But if you label a disk wit 'a' in world x, you wont find a disk labeled with 'a' in world z
Prototypep #10
Posted 08 April 2013 - 12:35 AM
But if you label a disk wit 'a' in world x, you wont find a disk labeled with 'a' in world z
I know this, but the only place where I would use this is my multiplayer server. I could use "/give prototypep floppydisk:2 2" which would give me 2 floppy disks with the :2. Then if I could have a program to receive and change another program, on a disk. The only requirement would be that both worlds would have to be loaded.
jumpingjoran #11
Posted 08 April 2013 - 07:40 AM
Use a pipe system and store everything on discs then with pipes roll it to the otherworld and then in the other pc server lol
Prototypep #12
Posted 08 April 2013 - 11:04 AM
I don't even know what that means…
SadKingBilly #13
Posted 08 April 2013 - 11:20 AM
I don't even know what that means…
I'm having a lot of trouble even understanding what you're asking in this topic. By "worlds", do you mean different dimensions (Nether, End, Twilight Forest, etc.), different ages (from that one mod that I can't remember the name of), different universes (different worlds under a single server), or different servers altogether?

Either way, jumpingjoran's post implies to me that you are talking about having computers communicate through either different dimensions or different ages, or both. What he means, then, is to use transport pipes to take a disk written to on one computer and send it to a computer in another dimension/age. Which would be pretty easy to do, actually. And is the only way of getting computers to communicate across dimensions and ages, as far as I know.
Prototypep #14
Posted 08 April 2013 - 12:57 PM
I'm talking about 2 worlds under 1 server. Also, transport pipes crash my server. :mellow:/>
Engineer #15
Posted 08 April 2013 - 01:15 PM
So you have to separate save files. Then its impossible, unless you want to make use of some sort of website.
Smiley43210 #16
Posted 08 April 2013 - 01:16 PM
I think what Prototype means is that if two floppy disks have the same ID, changing the content on one of them will change the content on the other.

-snip-
I could use "/give prototypep floppydisk:2 2" which would give me 2 floppy disks with the :2.
-snip-
Pretty sure that wouldn't work in this case, since the "damage" value of a disk stores the color of it, not the ID.

Edit: Wait, perhaps it might give you two with the same disk ID anyway, so it will work…
SadKingBilly #17
Posted 08 April 2013 - 01:28 PM
Okay then. Now that I understand what you're asking, I can say without a doubt that Engineer is right. The only way to do this is to connect both computers to the Internet. You could possibly use something like Dropbox for this. Though I have no idea how you would implement it.
Lyqyd #18
Posted 08 April 2013 - 01:49 PM
It still doesn't seem entirely clear. Please try typing more than half a sentence for your answer. Are you trying to transport data between two different dimensions in the same world? For instance, between the overworld and the nether, or between the twilight forest and a Mystcraft age. Or are you trying to transfer data between two different world saves that happen to use two different ports on the same physical server?

It sounds like you mean the first one, which is pretty easy. However, if you meant the second one, it's essentially impossible.
SadKingBilly #19
Posted 08 April 2013 - 01:53 PM
It still doesn't seem entirely clear. Please try typing more than half a sentence for your answer. Are you trying to transport data between two different dimensions in the same world? For instance, between the overworld and the nether, or between the twilight forest and a Mystcraft age. Or are you trying to transfer data between two different world saves that happen to use two different ports on the same physical server?

It sounds like you mean the first one, which is pretty easy. However, if you meant the second one, it's essentially impossible.
Doesn't GravityScore's Thunderbird program transfer data between computers on completely unrelated servers, using an online database? If so, shouldn't it be equally as possible to transfer data between computers on different world saves of the same server?
Prototypep #20
Posted 09 April 2013 - 12:30 AM
I think what Prototype means is that if two floppy disks have the same ID, changing the content on one of them will change the content on the other.

-snip-
I could use "/give prototypep floppydisk:2 2" which would give me 2 floppy disks with the :2.
-snip-
Pretty sure that wouldn't work in this case, since the "damage" value of a disk stores the color of it, not the ID.

Edit: Wait, perhaps it might give you two with the same disk ID anyway, so it will work…
Well, I'm trying to do this on a Tekkit server, with Computercraft for 1.2.5. So floppy disks are all still the same, with damage values at the end. So this would work on the server.
Prototypep #21
Posted 09 April 2013 - 12:36 AM
It still doesn't seem entirely clear. Please try typing more than half a sentence for your answer. Are you trying to transport data between two different dimensions in the same world? For instance, between the overworld and the nether, or between the twilight forest and a Mystcraft age. Or are you trying to transfer data between two different world saves that happen to use two different ports on the same physical server?

It sounds like you mean the first one, which is pretty easy. However, if you meant the second one, it's essentially impossible.
What I'm trying to do is have world1 in a server connect to world2 in a server. This is what I think you mean by the second one. But I think it's possable because:
a) It's on the same server
B)/> With the TubeStuffs (I think) mod, you can teleport items through the added "Teleport Pipe" (Pipes from buildcraft.) With two different worlds on the same server, it will still teleport the item.
c) With a wireless signal from the Wireless Redstone Mod, two different worlds on a server can share the same redstone signal.

Please help with this project, guys. Give me ideas and help with programming, for example:
Have a folder in the server files to link the two worlds with information.
Thanks,

EDIT: The B)/> face was me putting b + )
LordIkol #22
Posted 09 April 2013 - 02:16 AM
i dont think that this is possible the way you described
neither with Pipes or with redstone.

I never set up 2 Worlds on 1 Server but i think its the same way then on Singleplayer.
You have 2 Worldsave Files that share nothing with each other.
Even when you create two disks with the Same ID in World 1 there are still zero Disks in World2.

Second thing is that Computercraft Computers can only Acess Data within they Main Folder so there is no way to change files in another Worldsave.

If you want to Communicate through different worlds you need to enable HTTP in the config and send data to a Website.
Second thing that might work is the batch turtle from Aperture Science Mod

Greets
Loki
SadKingBilly #23
Posted 09 April 2013 - 02:33 AM
If you are saying what we think you're saying, then no, this is not possible using floppy disks. Especially not using the damage values. The only way to do it, as Loki said, would be to enable HTTP and use the Internet. And that would not be an easy thing to accomplish, as far as I can tell.
Lyqyd #24
Posted 09 April 2013 - 04:50 AM
It still doesn't seem entirely clear. Please try typing more than half a sentence for your answer. Are you trying to transport data between two different dimensions in the same world? For instance, between the overworld and the nether, or between the twilight forest and a Mystcraft age. Or are you trying to transfer data between two different world saves that happen to use two different ports on the same physical server?

It sounds like you mean the first one, which is pretty easy. However, if you meant the second one, it's essentially impossible.
What I'm trying to do is have world1 in a server connect to world2 in a server. This is what I think you mean by the second one. But I think it's possable because:
a) It's on the same server
B)/>/> With the TubeStuffs (I think) mod, you can teleport items through the added "Teleport Pipe" (Pipes from buildcraft.) With two different worlds on the same server, it will still teleport the item.
c) With a wireless signal from the Wireless Redstone Mod, two different worlds on a server can share the same redstone signal.

Please help with this project, guys. Give me ideas and help with programming, for example:
Have a folder in the server files to link the two worlds with information.
Thanks,

EDIT: The B)/>/> face was me putting b + )

That didn't clarify at all, but thank you for the longer explanation. So, if wireless redstone works from one to the other, can you also walk from one to the other? Or would you have to disconnect and reconnect to another port at the same IP? It sounds very much like you are talking about the first one, not the second one.
SadKingBilly #25
Posted 09 April 2013 - 05:25 AM
It still doesn't seem entirely clear. Please try typing more than half a sentence for your answer. Are you trying to transport data between two different dimensions in the same world? For instance, between the overworld and the nether, or between the twilight forest and a Mystcraft age. Or are you trying to transfer data between two different world saves that happen to use two different ports on the same physical server?

It sounds like you mean the first one, which is pretty easy. However, if you meant the second one, it's essentially impossible.
What I'm trying to do is have world1 in a server connect to world2 in a server. This is what I think you mean by the second one. But I think it's possable because:
a) It's on the same server
B)/> With the TubeStuffs (I think) mod, you can teleport items through the added "Teleport Pipe" (Pipes from buildcraft.) With two different worlds on the same server, it will still teleport the item.
c) With a wireless signal from the Wireless Redstone Mod, two different worlds on a server can share the same redstone signal.

Please help with this project, guys. Give me ideas and help with programming, for example:
Have a folder in the server files to link the two worlds with information.
Thanks,

EDIT: The B)/> face was me putting b + )
Oooh, I didn't see the part of your post about you being able to send redstone signals between worlds. While I have a hard time believing there is a server out there set up like that, if you are correct, then it is possible to have two computers transmit data back-and-forth without using HTTP or floppies. I think there's a program in the Programs section that uses RedPower bundled cables to transmit data. If you can combine RedPower and Wireless Redstone, then you could theoretically do what you're talking about. But it would be difficult and highly technical, and I doubt anyone here will do the work for you.
Prototypep #26
Posted 10 April 2013 - 12:01 AM
I'll read more about Thunderbird, but I really want a program of my own.
NotAmaster #27
Posted 10 April 2013 - 06:24 PM
You really need to space your code….
Left4Cake #28
Posted 14 April 2013 - 02:50 AM
I thought there was a peripheral mod some where on the forms that did this. Not sure if its compatible with Tekkit, but I do remember it required you dump a ton of ender pearls to use it. Its work looking around but no promises.