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

Rednet (Internet in tekkit computercraft)

Started by Lukas Madrid, 22 May 2014 - 06:51 PM
Lukas Madrid #1
Posted 22 May 2014 - 08:51 PM
:)/> Hi im Lukas

I am making a OS and stuff with computer craft and i think its the best mod out there, I have a server with my friends and i was wondering if someone could tell me how to make a mini custom internet in tekkit (computer craft). I have made a server room ready to host each website and it would be really cool if one of you pros could tell me how to make a rednet internet, THANK YOU SO MUCH!!!

Lukas
Madrid
KingofGamesYami #2
Posted 22 May 2014 - 10:15 PM
Short answer: not possible, but look at the firewolf browser written in CC. Also, if someone is more than (i think) 64 blocks (depending on the height) from your server they are out of range. You need to set up repeaters all over the server, or just keep all access limited to that area.
long answer
SpoilerYou can create a server that sends webpage data upon request of the URL, create your own custom web browser that parses the webpages. This requires extensive knowledge of lua & computercraft apis. considering this is your first post, I doubt you could set this up correctly. Start with something less overcomplicated, like a door lock. Or using a monitor.
If you think you can do this, here is a list of apis to look at:
fs
io
term
paintutils
rednet
os (pullEvent specifically)
and lua stuff
patterns
string manipulation (advanced)
Lukas Madrid #3
Posted 25 May 2014 - 11:30 AM
But i have seen videos do it before like this one https://www.youtube.com/watch?v=mRZa0OPR1mU
KingofGamesYami #4
Posted 25 May 2014 - 03:43 PM
Looks like something similar to the FireWolf browser, ei. It does not access the internet at all, it has it's own "data type"
He says in the video that the rednet only extends 64 blocks. Why you would need a DNS server and that stuff I have no idea, it serves no purpose. Basically you need one computer to "host" the websites.
An example of a server's code:

while true do
 msg = rednet.receive("url")
 if fs.exists(msg) then
  file = fs.open(msg)
  data = file.readAll()
  file.close()
  rednet.broadcast(data)
 else
  rednet.broadcast("failed to access"..msg)
 end
end

You need to code a web browser that interprets code somehow, FireWolf uses an html-like pattern. Since you have 2 posts, I'm going to assume you don't know how to code an actual browser. I could probably write one in a few months, but I have no idea as to how one would work right now. Just use FireWolf.
Sir_Mr_Bman #5
Posted 25 May 2014 - 04:40 PM
Use FireWolf.
It has in-built website hosting, documentation, and it's super easy to use.

Have fun!
Lukas Madrid #6
Posted 26 May 2014 - 07:49 PM
thanks this is what i wanted guys!
Creator #7
Posted 12 February 2015 - 09:44 PM
Try the IPnet. It is currently under developement. See the page for more info.

Creator