19 posts
Location
Canada
Posted 29 March 2013 - 07:05 PM
Ever feel the need to send files to your partner computer but aren't enjoying the hassle of copying files to disks and getting off your programmers butt to move it? Well make haste, out-of-date disk drives, as a bran new FTP has arrived! This version of NET includes file transfer, wireless commands, string support, as well as a shiny new API!
If you manage to spot any bugs, mistakes, or unreticulated splines, please feel free to criticize me on them, I'm all about criticism.
This image showcases the net program, which uses the network API.
FAQSpoiler
Q. What is the difference between Net and Network?
A. Network is an api, while Net is a program. DOWNLOADSpoiler
Net Networking + Net in one file << RECOMMENDED
http://pastebin.com/TRKQKJ9W
pastebin get TRKQKJ9W net
Network API
http://pastebin.com/5GxKr0Fi
pastebin get 5GxKr0Fi network
Must be manually installed.
Net Program standalone (without api)
http://pastebin.com/jvDHaCVS
pastebin get jvDHaCVS net PROGRAM USAGESpoiler
<mandatory> [optional]
NET prints usage as well as installs api and close all ports
NET CLOSE [port] Closes given or all ports
NET OPEN <port> Opens given port
NET SEND <file command="" message=""> [file name/command/message] [port] Sends either a file, a command, or a message.
NET RECEIVE [port] Waits for message and will perform function based on type.
Additionally a side can be given for each command if you have more than one modem. APISpoiler
These are the functions available under the network api.
function version()
[indent=1]Returns the version[/indent]
function getModemPos(modempos)
[indent=1]returns the position of the modem, if a modem position is not given it is automatically found[/indent]
function openPort(port, modempos)
[indent=1]Opens given port on modem side. returns success boolean[/indent]
function closePort(port, modempos)
[indent=1]Closes given or all port on modem side. returns success boolean[/indent]
function receive(port, modempos)
[indent=1]Waits to receive message or any key, returns Type of message(file/command/string), message(filename, command, string), message(file contents), reply channel; false on error.[/indent]
function send(mType, message, port, modempos)
[indent=1]transmits type of message(file/command/string) and message(filename, command, string) on port. Returns success boolean[/indent] UPDATE LOG:Spoiler
1.1
- API
- String Support
- Automatic Modem Detection
- Code refactoring. Less complicated code for easier reading. (but thats just my excuse)
1.0
- Initial release TODOSpoiler
- Wired modem support, peripheral support
- improve GUI
- servers (request files or text, relay strings)
- passwords/encryption
</file>
537 posts
Location
Copenhagen, Denmark
Posted 29 March 2013 - 09:49 PM
How is this a replacement for Rednet, if you can only send/receive files. Not really useful for multiplayer games, chats, or whatever. But nice work.
19 posts
Location
Canada
Posted 30 March 2013 - 10:09 AM
Thanks, and I plan on implementing string support as well, added to the to-do list.
126 posts
Location
The Netherlands
Posted 31 March 2013 - 11:55 AM
tip for modem detection:
for i,v in pairs(rs.getSides()) do
if peripheral.isPresent(v) and peripheral.getType(v)=="modem" then
modemSide = v
end
end
1688 posts
Location
'MURICA
Posted 31 March 2013 - 12:05 PM
I was going to state what masterdisasterHD has, but I don't think it would be very flexible if you found the modem automatically. You should probably either ask the user to input a modem side when running the program without one defined, or make the user define a modem side.
Or just make autodetection a default and the modem side switch an option/configuration, since most normal people don't need to specify which modem they want to use.
19 posts
Location
Canada
Posted 31 March 2013 - 05:38 PM
I was going to state what masterdisasterHD has, but I don't think it would be very flexible if you found the modem automatically. You should probably either ask the user to input a modem side when running the program without one defined, or make the user define a modem side.
Or just make autodetection a default and the modem side switch an option/configuration, since most normal people don't need to specify which modem they want to use.
Flexibility is my goal when programming, I hate confined programs that only do what you want them to. I'd probably go with this, with an option to temporarily define which modem you would like to use, or store it in the file.
By the way, congrats on your thousandth post.
131 posts
Location
I am omnipresent... DUH
Posted 31 March 2013 - 05:45 PM
Looks great!
Edit: 100th Post!
620 posts
Location
Holland
Posted 01 April 2013 - 10:23 AM
This is pretty cool
67 posts
Posted 01 April 2013 - 01:52 PM
I made something like this back is 1.2.5, but yours is better since you actually spent time on it.
19 posts
Location
Canada
Posted 01 April 2013 - 08:06 PM
Thank you all! Expect a new version soon! (With an api standalone.)
7508 posts
Location
Australia
Posted 01 April 2013 - 08:10 PM
very nice. i like it. :)/> now if you could inject it as a coroutine above the shell so that it ran in the background and prompted you when one is received, that would be awesome! :D/>
453 posts
Location
Holland
Posted 02 April 2013 - 10:49 AM
its nice, but the wierd thing is that at closing and receiving you call them ports but at opening you call them channel…
but its a very nice program
19 posts
Location
Canada
Posted 03 April 2013 - 12:30 AM
its nice, but the wierd thing is that at closing and receiving you call them ports but at opening you call them channel…
but its a very nice program
yeah, haha, I was debating as I was writing the program whether or not I would call them channels or ports, but I ended up calling them both by accident, fixed in next release.
19 posts
Location
Canada
Posted 03 April 2013 - 01:25 PM
New release up! Put a couple hours of work in for procrastination sake.
620 posts
Location
Holland
Posted 03 April 2013 - 07:57 PM
Ooh a api…AWESOME
89 posts
Posted 04 April 2013 - 12:11 AM
Good but its like you have copied the net command from batch and then written it
7508 posts
Location
Australia
Posted 04 April 2013 - 12:16 AM
Good but its like you have copied the net command from batch and then written it
and the problem with that is? some of the best inspiration and ideas can come from existing products… look at Angry Birds, thats just Crush the Castle, yet they have made millions from it… look at Windows' origins, thats just a copy of many things! Yet look at them…
1190 posts
Location
RHIT
Posted 04 April 2013 - 12:18 AM
Good but its like you have copied the net command from batch and then written it
and the problem with that is? some of the best inspiration and ideas can come from existing products… look at Angry Birds, thats just Crush the Castle, yet they have made millions from it… look at Windows' origins, thats just a copy of many things! Yet look at them…
Yeah but you had better be pretty brilliant at marketing to be able to sell your copy to a wide userbase.
Ontopic, I was thinking about implementing something like this program into the shell so that it could run in the background. Have the whole thing behave a bit like google drive where all your files are accessable from any rednet enabled computer/turtle without any delay.
19 posts
Location
Canada
Posted 05 April 2013 - 10:53 AM
<snip>
Ontopic, I was thinking about implementing something like this program into the shell so that it could run in the background. Have the whole thing behave a bit like google drive where all your files are accessable from any rednet enabled computer/turtle without any delay.
Thanks, feel free to use/modify my api for whatever suits your needs. I'm currently developer something quite similar, actually. Just less syncing.
419 posts
Location
your hardrive
Posted 05 April 2013 - 02:42 PM
are you serious!?! as soon as i get done coding a rednet file share program this one comes out. oh well :angry:/> :P/>
1190 posts
Location
RHIT
Posted 05 April 2013 - 02:46 PM
are you serious!?! as soon as i get done coding a rednet file share program this one comes out. oh well :angry:/> :P/>
How does that stop you from trying to improve you own and making it even better than this one? Never give up just because it's been done before. Hell, look at myspace/facebook.
419 posts
Location
your hardrive
Posted 05 April 2013 - 03:35 PM
are you serious!?! as soon as i get done coding a rednet file share program this one comes out. oh well :angry:/>/> :P/>/>
How does that stop you from trying to improve you own and making it even better than this one? Never give up just because it's been done before. Hell, look at myspace/facebook.
actually I have some great plans for it
19 posts
Location
Canada
Posted 05 April 2013 - 03:54 PM
are you serious!?! as soon as i get done coding a rednet file share program this one comes out. oh well :angry:/> :P/>
Go ahead and code your own, man! You could probably make one better than mine with a little love.