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

CraftNet Project

Started by App1eGenius93, 26 September 2012 - 02:08 PM
App1eGenius93 #1
Posted 26 September 2012 - 04:08 PM
CraftNet

(Note: Midterm week for me so I'll get this page updated this weekend)

Description:

CraftNet is a project that aims at recreating actual network interfaces and hopes to provide powerful ComputerCraft networking functionality in the world of Minecraft. We hope to achieve this by creating API's and programs that allow any user to create a file server with just a few keystrokes.

Members:
  • App1eGenius93 (Dustin)
  • MysticT
  • thesbros
  • Heli25 (Joe) (Won't find on these forums)
  • Danny
In Progress:
  • DNS
  • FTP
Completed Tasks:
  • None
Server Address:
  • cvmc.mclegacyhosting.com:25567 (Minecraft) (whitelisted)
  • dustinschreiber.com (Teamspeak) (Non-members won't be able to do anything)
I'll try to keep the to-do list photo up to date.

[attachment=495:Screen Shot 2012-09-26 at 1.57.19 PM.png]
jag #2
Posted 26 September 2012 - 04:29 PM
Sooooooooooo….. Can we have some more specific defined description?
I can't figure if you are making a way of connecting to FTP and DNS in-game or make a virtual FTP and DNS system…
App1eGenius93 #3
Posted 26 September 2012 - 04:35 PM
Sooooooooooo….. Can we have some more specific defined description?
I can't figure if you are making a way of connecting to FTP and DNS in-game or make a virtual FTP and DNS system…

Yes, I'm just writing it externally and I had to run to class but wanted to get this up. I'll have a good description in a few hours. Sorry for lack of info.
jag #4
Posted 26 September 2012 - 06:33 PM
Sooooooooooo….. Can we have some more specific defined description?
I can't figure if you are making a way of connecting to FTP and DNS in-game or make a virtual FTP and DNS system…

Yes, I'm just writing it externally and I had to run to class but wanted to get this up. I'll have a good description in a few hours. Sorry for lack of info.
It's ok :P/>/>
I'm just curious
jag #5
Posted 26 September 2012 - 08:50 PM
It would be so cool if this came along and became something big, so that you can have like a internet connection. So someone can host like a website or something and others can use a web browser (add that to the to-do :P/>/> ) to see the website.

Just go a step further and someone creates games that uses your internet so that you can play online via rednet :D/>/>
App1eGenius93 #6
Posted 26 September 2012 - 09:56 PM
It would be so cool if this came along and became something big, so that you can have like a internet connection. So someone can host like a website or something and others can use a web browser (add that to the to-do :P/>/> ) to see the website.

Just go a step further and someone creates games that uses your internet so that you can play online via rednet :D/>/>

Oooo! I like that! R u interested in joining the team at all? And when you say web browser, do u mean like you can use firefox or something to browse the website that's running via computercraft? Or do you mean it all runs within minecraft and people can have websites in the game?
Orwell #7
Posted 26 September 2012 - 10:11 PM
I'm studying IT myself and used to work on networking in CC myself (didn't find the time to continue though). However, I started implementing the ISO OSI model from scratch (layer 3 actually, bottom 2 layers are implemented by rednet allready). Wouldn't that be more 'base safe' than writing two procedures that behave like DNS and FTP but are actual just totally different protocols? Correct me if I understood you wrong and you're not doing that at all. : )

The advantage of simulating the OSI layers is the power of interfacing and flexibilty. You can adapt the bottom layers to the medium (like modem/bundled cables/something new) and all above still works…
Or even better yet, I was having this dream… I planned to port LuaSocket to CC (built on the OSI model), I also made a simple html browser that used the HTTP API. Now, the HTTP API used in CC is the exact same API as the HTTP part of LuaSocket, so my browser could browse on the CC networks as well as on the actual internet… Never got to porting LuaSocket though :P/>/>.

As I had two courses on Computer Networking last year and I'm following another one at the moment, I guess I could try and help on this project. I live in Europe though, and got little time on my hands.
MysticT #8
Posted 26 September 2012 - 10:33 PM
I'm studying IT myself and used to work on networking in CC myself (didn't find the time to continue though). However, I started implementing the ISO OSI model from scratch (layer 3 actually, bottom 2 layers are implemented by rednet allready). Wouldn't that be more 'base safe' than writing two procedures that behave like DNS and FTP but are actual just totally different protocols? Correct me if I understood you wrong and you're not doing that at all. : )

The advantage of simulating the OSI layers is the power of interfacing and flexibilty. You can adapt the bottom layers to the medium (like modem/bundled cables/something new) and all above still works…
Or even better yet, I was having this dream… I planned to port LuaSocket to CC (built on the OSI model), I also made a simple html browser that used the HTTP API. Now, the HTTP API used in CC is the exact same API as the HTTP part of LuaSocket, so my browser could browse on the CC networks as well as on the actual internet… Never got to porting LuaSocket though :P/>/>.

As I had two courses on Computer Networking last year and I'm following another one at the moment, I guess I could try and help on this project. I live in Europe though, and got little time on my hands.
That's exactly what I was planning to do, except that I don't wanted to use rednet and was planning to add my own peripherals (cables, switches and wireless modems, already working).
I don't know if you (Dustin) had the same idea, but I think we should try to do that. Once we have that, we can use it as a base to higher level stuff.
Orwell #9
Posted 26 September 2012 - 11:00 PM
I'm glad someone else is walking the same path, I'm very interested to watch the progress in that. And actually, if you implement the OSI model correctly, adding rednet support on top of your own peripheral stuff would be of minimal effort, right?
App1eGenius93 #10
Posted 26 September 2012 - 11:07 PM
I'm in my first year of IT at Rochester Institute of Technology. I've self taught myself a lot but you two are talking about some things (i mean some of the things you are saying) completely go over my head lol. I'm sure I could learn and understand that quickly haha. I haven't really thought much about the actual implementation yet I've just been thinking about programming part so far. I was waiting till I was able to get people on teamspeak and we actually talked about the best way to do some of this stuff. So who knows, we may be on the same path here lol.
MetalMiner #11
Posted 27 September 2012 - 09:05 AM
It would be so cool if this came along and became something big, so that you can have like a internet connection. So someone can host like a website or something and others can use a web browser (add that to the to-do :P/>/> ) to see the website.

For a few weeks, im working on something like that. I made a 'webbrowser', wich allows you to call a website from another cc computer (with the server software). The browser has something like a html interpreter. Currently i implemented just the </br> tag, but i'll add more (currently i'm working on the <a> tag, wich allows you to mark a text as selectable link to another website).

Perhaps there is a way to combine these things (my browser will use your network)?
nutcase84 #12
Posted 27 September 2012 - 12:18 PM
This looks awesome! I hope it has a good turnout! :P/>/>
App1eGenius93 #13
Posted 09 October 2012 - 04:16 PM
Okay I forgot to update over the weekend. While try and fix up some things today. I'm working on a site that will have the news and eventual download for the project. Also will have our progress posted there so I may or may not update this thread much once I finish the site.

Stay tuned! :P/>/>
FuzzyPurp #14
Posted 17 October 2012 - 07:49 AM
Please post a code or this thread will be removed from the programs section.
App1eGenius93 #15
Posted 17 October 2012 - 03:19 PM
Please post a code or this thread will be removed from the programs section.

We don't really have any code ready for the public yet… Is there another section that this should be for now then?
DaWooShit #16
Posted 20 October 2012 - 05:57 PM
I have made a simple ftp program and a simple ftp client. Again, very simple and basic. But it might be of use to you…

Commands is:
download - download a file from the server
goto - go to a page (if there is a lot of files/folders in a directory)
up - move on directory up.
exit - Exit program and clear ftp server.

FTP Client:


local running = true
local selected = 1
settings={}
--[[Load settings]]--
test = io.open("settings.txt", "r")
if test == nil then
file = io.open("settings.txt", "w")
 
while X~="top" and X~="bottom" and X~="left" and X~="right" and X~="back" and X~="front" do
  term.clear()
  term.setCursorPos(1,1)
  print("Which side is the router on?:")
  X=io.read()
end
 
file:write(X)
file:write("n")
file:write("stop")
file:write("n")
file:close()
print("Settings completed...")
print("Please restart the program...")
sleep(4)
os.reboot()
else
test:close()
file = io.open("settings.txt", "r")
running=true
while running do
  X = file:read()
  if X~="stop" then
   table.insert(settings,X)
  else
   running=false
  end
end
file:close()
end
--[[Download]]--
function Download()
term.clear()
term.setCursorPos(1,1) 
print("Enter number next to the ")
print("file you wish to download:")
Z=io.read()
term.clear()
term.setCursorPos(1,1)
print("Enter name of the final file")
print("EX: Downloadedfile.txt")
Y=io.read()
file = io.open(Y, "w")
rednet.send(FTPSERVER,"download")
rednet.send(FTPSERVER,Z)
msg="none"
while msg~="StopDownloadNow" do
  id, msg=rednet.receive(5)
  if msg~="StopDownloadNow" then
   print("Data stream: ",msg)
   file:write(msg)
   file:write("n")
  end
end
file:close()
print("Download Completed...")
sleep(4)
os.reboot()
end
--[[functions in menu]]--
FTPSERVER=0
Files={}

while FTPSERVER<=0 do
  term.clear()
  term.setCursorPos(1,1)
  print("Enter ID of ftp server")
  FTPSERVER=io.read()
  if tonumber(FTPSERVER)~=nil then
   FTPSERVER=math.ceil(tonumber(FTPSERVER))
  else
   FTPSERVER=0
  end
end
rednet.open(settings[1])
rednet.send(FTPSERVER,"ftp")
X=10
while X>0 do
  id, msg=rednet.receive(5)
  X=X-1
  if msg=="confirmed" and id==FTPSERVER then
   X=0
   print("Ftp server found...")
   sleep(1)
   rednet.send(FTPSERVER,"/ftp")
  else
   print("Ftp server not found")
   print("Attempt to restart server?")
   print("y/n?")
   Z=io.read()
   if Z=="y" then
    rednet.send(FTPSERVER,"exit")
   end
   os.reboot()
  end
 
  while true do
   msg="none"
   Files={}
   while msg~="true" and msg~="false" do
    id, msg=rednet.receive(5)
    if msg~="true" and msg~="false" then
	 table.insert(Files,msg)
    end
   end
   Print=true
   Side=1
   Printlist=1
   Sides=math.ceil(#Files/14)
   while Print do
    term.clear()
    term.setCursorPos(1,1)
    for i=Printlist,Printlist+14 do
  if i<10 then
	  print(i,"  : ",Files[i])
  else
   print(i," : ",Files[i])
  end
    end
print(Side,"/",Sides)
    if msg=="true" then
   print("Folder found")
    else
   print("Folder not found")
    end
Y=io.read()
 
    if Y=="exit" then
  Print=false
	 rednet.send(FTPSERVER,"exit")
   os.reboot()
    elseif Y=="up" then
  Print=false
	 rednet.send(FTPSERVER,"up")
    elseif Y=="download" then
  Print=false
	 Download()
elseif Y=="goto" then
  term.clear()
  term.setCursorPos(1,1)
  print("Goto what page?")
  Y=io.read()
  if tonumber(Y)~=nil and tonumber(Y)<=Sides then
   Side=math.ceil(tonumber(Y))
   Printlist=Side*14
  end
    else
  Print=false
	 if tonumber(Y)~=nil then
   Y=math.ceil(tonumber(Y))
   Directory=Files[Y]
   Directory="/"..Directory
	  rednet.send(FTPSERVER,Directory)
  end 
   end
   end
   end
   end


FTP server:


Dontshow="config"
if fs.isDir("/ftp")==false then
fs.makeDir("/ftp")
end

function Download(X)
print("Uploadning file:")
msg=tonumber(msg)
TempDir=""
for i=1,#Directories do
  TempDir=TempDir..Directories[i]
end
TempDir=TempDir.."/"..Files[msg]
print("Sending: ",TempDir)
if fs.exists(TempDir)==true then
file = io.open(TempDir, "r")
  while X~=nil do
   X = file:read()
   if X~=nil then
    print("Send data:",X)
    rednet.send(idX,X)
   end
   sleep(0.1)
  end
  rednet.send(idX,"StopDownloadNow")
end
end

rednet.open("top")
msg="none"
idX, msg=rednet.receive()
if msg=="exit" then
  os.reboot()
end
if msg=="ftp" then
  Directories={}
  rednet.send(idX,"confirmed")
  TempDir=""
 
  while true do
   print("Waiting for command...")
   msg="nullstate"
   id, msg=rednet.receive(300)
   if msg=="nullstate" then
    os.reboot()
   end
   if id==idX then
   if msg=="up" then
    table.remove(Directories,#Directories)
   elseif msg=="exit" then
    os.reboot()
   elseif msg=="download" then
    id, msg=rednet.receive(5)
    Download(msg)
   else
    print("Searching for files in: ",msg)
    search=false
    TempDir=""
    for i=1,#Directories do
	 TempDir=TempDir..Directories[i]
    end
    TempDir=TempDir..msg
    if fs.isDir(TempDir)==true then
	 search=true
  print("Directory found")
  table.insert(Directories,msg)
    end
   end
 
  TempDir=""
  for i=1,#Directories do
   TempDir=TempDir..Directories[i]
  end
 
  print("Final directory: ",TempDir)
 
  Files=fs.list(TempDir)
  print("Files found: ")
  for i=1,#Files do
   if Files[i]~=Dontshow then
    print(Files[i])
    rednet.send(idX,Files[i])
    sleep(0.1)
   end
  end
  sleep(0.5)
  if search==true then
    rednet.send(idX,"true")
  else
    rednet.send(idX,"false")
  end
  end
end
end
Cruor #17
Posted 27 October 2012 - 08:13 PM
Moved to general as this is not a program.
Dlcruz129 #18
Posted 28 October 2012 - 04:36 AM
Oh, please, not another "I'm gonna make the Internet!" topics. At least the poster of this one seems to understand networking.
Grim Reaper #19
Posted 28 October 2012 - 04:45 AM
Are there any openings in your development team? If so, I'd love to help if I can.
Dlcruz129 #20
Posted 28 October 2012 - 04:46 AM
I have made a simple ftp program and a simple ftp client. Again, very simple and basic. But it might be of use to you…

Commands is:
download - download a file from the server
goto - go to a page (if there is a lot of files/folders in a directory)
up - move on directory up.
exit - Exit program and clear ftp server.

FTP Client:


local running = true
local selected = 1
settings={}
--[[Load settings]]--
test = io.open("settings.txt", "r")
if test == nil then
file = io.open("settings.txt", "w")

while X~="top" and X~="bottom" and X~="left" and X~="right" and X~="back" and X~="front" do
  term.clear()
  term.setCursorPos(1,1)
  print("Which side is the router on?:")
  X=io.read()
end

file:write(X)
file:write("n")
file:write("stop")
file:write("n")
file:close()
print("Settings completed...")
print("Please restart the program...")
sleep(4)
os.reboot()
else
test:close()
file = io.open("settings.txt", "r")
running=true
while running do
  X = file:read()
  if X~="stop" then
   table.insert(settings,X)
  else
   running=false
  end
end
file:close()
end
--[[Download]]--
function Download()
term.clear()
term.setCursorPos(1,1) 
print("Enter number next to the ")
print("file you wish to download:")
Z=io.read()
term.clear()
term.setCursorPos(1,1)
print("Enter name of the final file")
print("EX: Downloadedfile.txt")
Y=io.read()
file = io.open(Y, "w")
rednet.send(FTPSERVER,"download")
rednet.send(FTPSERVER,Z)
msg="none"
while msg~="StopDownloadNow" do
  id, msg=rednet.receive(5)
  if msg~="StopDownloadNow" then
   print("Data stream: ",msg)
   file:write(msg)
   file:write("n")
  end
end
file:close()
print("Download Completed...")
sleep(4)
os.reboot()
end
--[[functions in menu]]--
FTPSERVER=0
Files={}

while FTPSERVER<=0 do
  term.clear()
  term.setCursorPos(1,1)
  print("Enter ID of ftp server")
  FTPSERVER=io.read()
  if tonumber(FTPSERVER)~=nil then
   FTPSERVER=math.ceil(tonumber(FTPSERVER))
  else
   FTPSERVER=0
  end
end
rednet.open(settings[1])
rednet.send(FTPSERVER,"ftp")
X=10
while X>0 do
  id, msg=rednet.receive(5)
  X=X-1
  if msg=="confirmed" and id==FTPSERVER then
   X=0
   print("Ftp server found...")
   sleep(1)
   rednet.send(FTPSERVER,"/ftp")
  else
   print("Ftp server not found")
   print("Attempt to restart server?")
   print("y/n?")
   Z=io.read()
   if Z=="y" then
    rednet.send(FTPSERVER,"exit")
   end
   os.reboot()
  end

  while true do
   msg="none"
   Files={}
   while msg~="true" and msg~="false" do
    id, msg=rednet.receive(5)
    if msg~="true" and msg~="false" then
	 table.insert(Files,msg)
    end
   end
   Print=true
   Side=1
   Printlist=1
   Sides=math.ceil(#Files/14)
   while Print do
    term.clear()
    term.setCursorPos(1,1)
    for i=Printlist,Printlist+14 do
  if i<10 then
	  print(i,"  : ",Files[i])
  else
   print(i," : ",Files[i])
  end
    end
print(Side,"/",Sides)
    if msg=="true" then
   print("Folder found")
    else
   print("Folder not found")
    end
Y=io.read()

    if Y=="exit" then
  Print=false
	 rednet.send(FTPSERVER,"exit")
   os.reboot()
    elseif Y=="up" then
  Print=false
	 rednet.send(FTPSERVER,"up")
    elseif Y=="download" then
  Print=false
	 Download()
elseif Y=="goto" then
  term.clear()
  term.setCursorPos(1,1)
  print("Goto what page?")
  Y=io.read()
  if tonumber(Y)~=nil and tonumber(Y)<=Sides then
   Side=math.ceil(tonumber(Y))
   Printlist=Side*14
  end
    else
  Print=false
	 if tonumber(Y)~=nil then
   Y=math.ceil(tonumber(Y))
   Directory=Files[Y]
   Directory="/"..Directory
	  rednet.send(FTPSERVER,Directory)
  end 
   end
   end
   end
   end


FTP server:


Dontshow="config"
if fs.isDir("/ftp")==false then
fs.makeDir("/ftp")
end

function Download(X)
print("Uploadning file:")
msg=tonumber(msg)
TempDir=""
for i=1,#Directories do
  TempDir=TempDir..Directories[i]
end
TempDir=TempDir.."/"..Files[msg]
print("Sending: ",TempDir)
if fs.exists(TempDir)==true then
file = io.open(TempDir, "r")
  while X~=nil do
   X = file:read()
   if X~=nil then
    print("Send data:",X)
    rednet.send(idX,X)
   end
   sleep(0.1)
  end
  rednet.send(idX,"StopDownloadNow")
end
end

rednet.open("top")
msg="none"
idX, msg=rednet.receive()
if msg=="exit" then
  os.reboot()
end
if msg=="ftp" then
  Directories={}
  rednet.send(idX,"confirmed")
  TempDir=""

  while true do
   print("Waiting for command...")
   msg="nullstate"
   id, msg=rednet.receive(300)
   if msg=="nullstate" then
    os.reboot()
   end
   if id==idX then
   if msg=="up" then
    table.remove(Directories,#Directories)
   elseif msg=="exit" then
    os.reboot()
   elseif msg=="download" then
    id, msg=rednet.receive(5)
    Download(msg)
   else
    print("Searching for files in: ",msg)
    search=false
    TempDir=""
    for i=1,#Directories do
	 TempDir=TempDir..Directories[i]
    end
    TempDir=TempDir..msg
    if fs.isDir(TempDir)==true then
	 search=true
  print("Directory found")
  table.insert(Directories,msg)
    end
   end

  TempDir=""
  for i=1,#Directories do
   TempDir=TempDir..Directories[i]
  end

  print("Final directory: ",TempDir)

  Files=fs.list(TempDir)
  print("Files found: ")
  for i=1,#Files do
   if Files[i]~=Dontshow then
    print(Files[i])
    rednet.send(idX,Files[i])
    sleep(0.1)
   end
  end
  sleep(0.5)
  if search==true then
    rednet.send(idX,"true")
  else
    rednet.send(idX,"false")
  end
  end
end
end

This could work… Maybe this will b the first time we make Internet in CC?

PS: Also, try to get in the habit of using local variables.
App1eGenius93 #21
Posted 28 October 2012 - 04:51 AM
Oh, please, not another "I'm gonna make the Internet!" topics. At least the poster of this one seems to understand networking.

No, not another "I'm gonna make the Internet". And I do understand networking. I'm an IT Student at Rochester Institute of Technology. We are mainly bringing different network services and protocols into Minecraft. It would be possible to make a "Minecraft Internet" with what we are making.
Grim Reaper #22
Posted 28 October 2012 - 04:52 AM
I have made a simple ftp program and a simple ftp client. Again, very simple and basic. But it might be of use to you…

Commands is:
download - download a file from the server
goto - go to a page (if there is a lot of files/folders in a directory)
up - move on directory up.
exit - Exit program and clear ftp server.

FTP Client:


local running = true
local selected = 1
settings={}
--[[Load settings]]--
test = io.open("settings.txt", "r")
if test == nil then
file = io.open("settings.txt", "w")

while X~="top" and X~="bottom" and X~="left" and X~="right" and X~="back" and X~="front" do
  term.clear()
  term.setCursorPos(1,1)
  print("Which side is the router on?:")
  X=io.read()
end

file:write(X)
file:write("n")
file:write("stop")
file:write("n")
file:close()
print("Settings completed...")
print("Please restart the program...")
sleep(4)
os.reboot()
else
test:close()
file = io.open("settings.txt", "r")
running=true
while running do
  X = file:read()
  if X~="stop" then
   table.insert(settings,X)
  else
   running=false
  end
end
file:close()
end
--[[Download]]--
function Download()
term.clear()
term.setCursorPos(1,1)
print("Enter number next to the ")
print("file you wish to download:")
Z=io.read()
term.clear()
term.setCursorPos(1,1)
print("Enter name of the final file")
print("EX: Downloadedfile.txt")
Y=io.read()
file = io.open(Y, "w")
rednet.send(FTPSERVER,"download")
rednet.send(FTPSERVER,Z)
msg="none"
while msg~="StopDownloadNow" do
  id, msg=rednet.receive(5)
  if msg~="StopDownloadNow" then
   print("Data stream: ",msg)
   file:write(msg)
   file:write("n")
  end
end
file:close()
print("Download Completed...")
sleep(4)
os.reboot()
end
--[[functions in menu]]--
FTPSERVER=0
Files={}

while FTPSERVER<=0 do
  term.clear()
  term.setCursorPos(1,1)
  print("Enter ID of ftp server")
  FTPSERVER=io.read()
  if tonumber(FTPSERVER)~=nil then
   FTPSERVER=math.ceil(tonumber(FTPSERVER))
  else
   FTPSERVER=0
  end
end
rednet.open(settings[1])
rednet.send(FTPSERVER,"ftp")
X=10
while X>0 do
  id, msg=rednet.receive(5)
  X=X-1
  if msg=="confirmed" and id==FTPSERVER then
   X=0
   print("Ftp server found...")
   sleep(1)
   rednet.send(FTPSERVER,"/ftp")
  else
   print("Ftp server not found")
   print("Attempt to restart server?")
   print("y/n?")
   Z=io.read()
   if Z=="y" then
	rednet.send(FTPSERVER,"exit")
   end
   os.reboot()
  end

  while true do
   msg="none"
   Files={}
   while msg~="true" and msg~="false" do
	id, msg=rednet.receive(5)
	if msg~="true" and msg~="false" then
	 table.insert(Files,msg)
	end
   end
   Print=true
   Side=1
   Printlist=1
   Sides=math.ceil(#Files/14)
   while Print do
	term.clear()
	term.setCursorPos(1,1)
	for i=Printlist,Printlist+14 do
  if i<10 then
	  print(i,"  : ",Files[i])
  else
   print(i," : ",Files[i])
  end
	end
print(Side,"/",Sides)
	if msg=="true" then
   print("Folder found")
	else
   print("Folder not found")
	end
Y=io.read()

	if Y=="exit" then
  Print=false
	 rednet.send(FTPSERVER,"exit")
   os.reboot()
	elseif Y=="up" then
  Print=false
	 rednet.send(FTPSERVER,"up")
	elseif Y=="download" then
  Print=false
	 Download()
elseif Y=="goto" then
  term.clear()
  term.setCursorPos(1,1)
  print("Goto what page?")
  Y=io.read()
  if tonumber(Y)~=nil and tonumber(Y)<=Sides then
   Side=math.ceil(tonumber(Y))
   Printlist=Side*14
  end
	else
  Print=false
	 if tonumber(Y)~=nil then
   Y=math.ceil(tonumber(Y))
   Directory=Files[Y]
   Directory="/"..Directory
	  rednet.send(FTPSERVER,Directory)
  end
   end
   end
   end
   end


FTP server:


Dontshow="config"
if fs.isDir("/ftp")==false then
fs.makeDir("/ftp")
end

function Download(X)
print("Uploadning file:")
msg=tonumber(msg)
TempDir=""
for i=1,#Directories do
  TempDir=TempDir..Directories[i]
end
TempDir=TempDir.."/"..Files[msg]
print("Sending: ",TempDir)
if fs.exists(TempDir)==true then
file = io.open(TempDir, "r")
  while X~=nil do
   X = file:read()
   if X~=nil then
	print("Send data:",X)
	rednet.send(idX,X)
   end
   sleep(0.1)
  end
  rednet.send(idX,"StopDownloadNow")
end
end

rednet.open("top")
msg="none"
idX, msg=rednet.receive()
if msg=="exit" then
  os.reboot()
end
if msg=="ftp" then
  Directories={}
  rednet.send(idX,"confirmed")
  TempDir=""

  while true do
   print("Waiting for command...")
   msg="nullstate"
   id, msg=rednet.receive(300)
   if msg=="nullstate" then
	os.reboot()
   end
   if id==idX then
   if msg=="up" then
	table.remove(Directories,#Directories)
   elseif msg=="exit" then
	os.reboot()
   elseif msg=="download" then
	id, msg=rednet.receive(5)
	Download(msg)
   else
	print("Searching for files in: ",msg)
	search=false
	TempDir=""
	for i=1,#Directories do
	 TempDir=TempDir..Directories[i]
	end
	TempDir=TempDir..msg
	if fs.isDir(TempDir)==true then
	 search=true
  print("Directory found")
  table.insert(Directories,msg)
	end
   end

  TempDir=""
  for i=1,#Directories do
   TempDir=TempDir..Directories[i]
  end

  print("Final directory: ",TempDir)

  Files=fs.list(TempDir)
  print("Files found: ")
  for i=1,#Files do
   if Files[i]~=Dontshow then
	print(Files[i])
	rednet.send(idX,Files[i])
	sleep(0.1)
   end
  end
  sleep(0.5)
  if search==true then
	rednet.send(idX,"true")
  else
	rednet.send(idX,"false")
  end
  end
end
end

This could work… Maybe this will b the first time we make Internet in CC?

PS: Also, try to get in the habit of using local variables.

Also, you might want to try to use more realistic/relevant identifiers and writing comments that kind of explain what a block of code is accomplishing helps readability. Do whatever works for you, though.
App1eGenius93 #23
Posted 28 October 2012 - 04:52 AM
Are there any openings in your development team? If so, I'd love to help if I can.

I will contact you via PM in a day or two. I have to get my webserver repaired and homework. I'm a little behind :D/>/>
strideynet #24
Posted 01 November 2012 - 09:49 PM
Here's the deal we can team up. Aslong as you can write fairly good protocol documents. I never team up unless the other team understands the concepts of networking. Are you decentralized, centralized. What's your system plan. Also I wanna see some code your team made together. Nice idea. We are also working on a bridge system. Aka using a in real life server to send rednet comes over two minecrAft servers. That's when fun begins. Gaming competitions where servers fight to the death virtually. The main reason my team uses tekkit is because we want to make a networked world. Where a nuclear refactoring your home can be controlled by your pc at work. We are planning on a os that runs a networking reciever Parellel to the main console. This allows constant email to be received and updates to be in the background. I'm starting to write up some protocol papers. I liek your thinking. Just have you actually achieved much yet.
App1eGenius93 #25
Posted 03 November 2012 - 03:53 PM
Here's the deal we can team up. Aslong as you can write fairly good protocol documents. I never team up unless the other team understands the concepts of networking. Are you decentralized, centralized. What's your system plan. Also I wanna see some code your team made together. Nice idea. We are also working on a bridge system. Aka using a in real life server to send rednet comes over two minecrAft servers. That's when fun begins. Gaming competitions where servers fight to the death virtually. The main reason my team uses tekkit is because we want to make a networked world. Where a nuclear refactoring your home can be controlled by your pc at work. We are planning on a os that runs a networking reciever Parellel to the main console. This allows constant email to be received and updates to be in the background. I'm starting to write up some protocol papers. I liek your thinking. Just have you actually achieved much yet.

I do think my team and I are capable of good documentation. :D/>/> I'll have to talk to the team and get back to you as some of us had tests the past few weeks and had to focus more on the real world (sucks lol)
strideynet #26
Posted 04 November 2012 - 09:17 PM
The problem is two groups can't work together. It's just well netblock is planning to do anything and doesn't want to drop something for co developers to make. How abouts we buy you out for free. Apple you can be co owner of netblock. We already have code and stuff from the old one. I dunno. Let's see what we can work out
lieudusty #27
Posted 05 November 2012 - 05:17 PM
Are there any free spots available? I would love you join you guys! This seems very interesting to me