Jump to content




[v0.1 - Beta] disknet


  • You cannot reply to this topic
43 replies to this topic

#21 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 29 September 2014 - 08:23 PM

View PostLDDestroier, on 29 September 2014 - 08:02 PM, said:

-snip-
So can I simply not put the pFilter thing if I want it to see everything? And simply ignore sender?

Yep. Sender is irrelevant.

#22 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 30 September 2014 - 04:22 PM

I tried making the routing program, but it didn't work. Didn't error either, but I need it debugged. Could you give it a go?
http://pastebin.com/dv6LDhVa

I promise not to remove it.

#23 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 30 September 2014 - 05:46 PM

View PostLDDestroier, on 30 September 2014 - 04:22 PM, said:

I tried making the routing program, but it didn't work. Didn't error either, but I need it debugged. Could you give it a go?
http://pastebin.com/dv6LDhVa

I promise not to remove it.

as far as I can tell, the only problem is line 189:
        disknet.broadcast(a)

Since you have not loaded the api, just pasted the code in, shouldn't it be this?
       broadcast(a)


#24 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 30 September 2014 - 08:04 PM

View PostKingofGamesYami, on 30 September 2014 - 05:46 PM, said:

View PostLDDestroier, on 30 September 2014 - 04:22 PM, said:

I tried making the routing program, but it didn't work. Didn't error either, but I need it debugged. Could you give it a go?
http://pastebin.com/dv6LDhVa

I promise not to remove it.

as far as I can tell, the only problem is line 189:
		disknet.broadcast(a)

Since you have not loaded the api, just pasted the code in, shouldn't it be this?
	   broadcast(a)

I fixed that, but it still doesn't work right. I don't know if it's not broadcasting or not receiving. Could you please please get it working? The program goes on a computer with a disk drive and a wireless modem. I am completely lost.

#25 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 30 September 2014 - 08:18 PM

Are you sending a rednet message to the computer running the program? Also whenever it stops, just press ctrl+t and it should give a line number where you stopped it.

#26 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 01 October 2014 - 10:25 PM

View PostDragon53535, on 30 September 2014 - 08:18 PM, said:

Are you sending a rednet message to the computer running the program? Also whenever it stops, just press ctrl+t and it should give a line number where you stopped it.

The program should take in rednet information and broadcast it on disknet, while at the same time broadcasting received disknet data on rednet.
Posted Image
This is a schematic (sort of) of how it should be connected. Note: where it says client, there can be multiple computers.

(By the way, the picture was made using a cheap linux paint clone. I've yet to find something as simple as mspaint.)

Edited by LDDestroier, 01 October 2014 - 10:26 PM.


#27 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 01 October 2014 - 10:43 PM

I understand the purpose you are using it for, however it might stop whenever it's trying to rednet.receive() if nothing is being sent to it.

#28 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 01 October 2014 - 11:02 PM

while true do
  local event = { os.pullEvent() }
  if event[ 1 ] == "disknet_message" then
    --#send on rednet
  elseif event[ 1 ] == "rednet_message" then
    --#send on disknet
  end
end


#29 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 01 October 2014 - 11:52 PM

View PostKingofGamesYami, on 01 October 2014 - 11:02 PM, said:

while true do
  local event = { os.pullEvent() }
  if event[ 1 ] == "disknet_message" then
	--#send on rednet
  elseif event[ 1 ] == "rednet_message" then
	--#send on disknet
  end
end

Will this go on if there isn't a rednet/disknet message? Because I'm using my laptop, and it lags with Lubuntu, so I can't run ComputerCraft.

#30 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 02 October 2014 - 12:01 AM

No it will wait for some kind of event, and if that event's not one of those then it will start from the top

#31 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 02 October 2014 - 12:50 AM

View PostDragon53535, on 02 October 2014 - 12:01 AM, said:

No it will wait for some kind of event, and if that event's not one of those then it will start from the top

So if it gets any rednet message or disknet message, then it executes the right code?

#32 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 02 October 2014 - 01:09 AM

it should, however the code Yami had when i was testing was flawed and it kept raising a disknet event

#33 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 02 October 2014 - 01:58 PM

View PostDragon53535, on 02 October 2014 - 01:09 AM, said:

it should, however the code Yami had when i was testing was flawed and it kept raising a disknet event

So should http://pastebin.com/dv6LDhVa work as intended? Because this could be an invaluable tool for huge multiverse city-based tekkit servers.

#34 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 02 October 2014 - 10:06 PM

You have too many ends at the end of your program, you indented improperly, just delete one.
Line 141, you're using disknet.broadcast, since you're not loading the disknet api that should just be broadcast Same for 192.
When calling a broadcast from disknet when you receive a redstone message, i would assume you would want to send the message from the client, the way it's setup is that the client has to send 2 messages.
The same with rednet.send

#35 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 03 October 2014 - 02:35 PM

View PostDragon53535, on 02 October 2014 - 10:06 PM, said:

You have too many ends at the end of your program, you indented improperly, just delete one.
Line 141, you're using disknet.broadcast, since you're not loading the disknet api that should just be broadcast Same for 192.
When calling a broadcast from disknet when you receive a redstone message, i would assume you would want to send the message from the client, the way it's setup is that the client has to send 2 messages.
The same with rednet.send

Fixed. Does it work now? I can't test it right now.

#36 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 03 October 2014 - 07:06 PM

My pastebin has been updated, and it looks good. There's just one fatal problem.

I noticed that the code for your api looks for an event called "disknet_message". The router program recognizes the event "rednet_message" okay, but it doesn't see the event "disknet_message".

How does that get invoked? Do I have to add some code to my pastebin? If I do, please give me it. This actually might work.

#37 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 03 October 2014 - 07:30 PM

No, it should have everything.

#38 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 03 October 2014 - 07:54 PM

Here are the problems that I got right now:

-It appears to accept a rednet input once, but another one crashes it with the error: 'expected string, got number'.
-It either doesn't broadcast the disknet at all, or can't receive disknet.


Please revise it. I need this to work, and I am not skilled enough to pull this off.

#39 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 04 October 2014 - 12:34 AM

Your code is flawed (If you are using the same pastebin) You should change inside your os.pullEvent() these
print("rednet: " .. rednet.receive())
broadcast(rednet.receive())

print("disknet: " .. receive())
rednet.broadcast(receive())
To these
print("rednet: ".. event[3])
broadcast(event[3])

print("disknet: " .. event[5])
rednet.broadcast(event[5])


#40 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 07 October 2014 - 04:17 PM

Should I just modify redrepeat() to print what text it gets and simply use that instead of what I added? Because if that works, then that would be great, and I would be annoyed because I tried for a while to get it to route data another way.

View PostLDDestroier, on 07 October 2014 - 04:14 PM, said:

Should I just modify redrepeat() to print what text it gets and simply use that instead of what I added? Because if that works, then that would be great, and I would be annoyed because I tried for a while to get it to route data another way.

Even better, disknet could also use an encryption algorithm. It would use the public/private key thing, where two huge prime numbers are generated, then multiplied together as your public key.

That, or simply use a password to encrypt disknet data.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users