Jump to content




Bluetooth: GUI edition released!

wireless utility networking

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

#1 Mitchfizz05

  • Members
  • 125 posts
  • LocationAdelaide, Australia

Posted 27 June 2013 - 07:17 AM

BLUETOOTH: Command line edition! (v1.1)

Bluetooth is a program that allows you to easily share files with your ComputerCraft mates.
I'm trying to make it as similar to real Bluetooth as I can, and so far I'm quite happy with my work.

Note: This program is currently in beta. You may find bugs, if you do, please report them.


FEATURES:
  • Allows you to quickly send files to other computers.
  • Simple and easy parameters.
  • Doesn't have a 24hr limit like using pastebin does (not saying there is anything wrong with pastebin, it's great for releasing stuff to lots of people)
  • Can send any file, even paint files!
PLANNED:
  • Another separate Bluetooth program that has a GUI. Done!
  • A Bluetooth API for developers to send files over Bluetooth.
  • Less bugs!
  • Maybe sending of whole folders. (Maybe - I don't think this isn't possible in real Bluetooth, but it would be useful.)
FOR DEVELOPERS:
If you want to tap into Bluetooth with your own programs, until the Bluetooth API comes, here are what is sent and received when sending/receiving Bluetooth requests.

The sender computer sends, "bluetooth.connect"
The sender computer waits for "bluetooth.accept"
The receiving computer replies, "bluetooth.accept"
The sending computer sends, "bluetooth.filename:<FILE NAME>"

Then the sending of the program begins. The program is sent line by line.

The sending computer sends "bluetooth.file:<FILE LINE>" for each line, while the receiving computer is taking in all these lines and usually would write them to a file.
The sending computer finally sends "bluetooth.done".

The transfer is compete.
Sorry for my terrible explanation.You could also look in the source code to find out yourself how it all goes down.

SCREENSHOTS:
Spoiler

HOW TO GET IT:
Easy!
First you must make sure the server you play on has the HTTP API enabled or if your playing singleplayer your client has the HTTP API enabled.
Then simply type: pastebin get GhP5SqaP bluetooth
You now have bluetooth!

CHANGELOG:

Quote

1.0 (UEQsyJUG):
* Initial release.

1.1 (GhP5SqaP):
* File closes after reading it when sending a file.
* Fixed delete mistake.


HOW TO USE IT:
Make sure you have a rednet modem on the right side of your computer and run "bluetooth receive" on the computer you wish to receive the file, then on the sending computer type "bluetooth send <file> <computer ID>".
Using incorrect syntax or typing bluetooth will show the usage.

Thanks. Hope you like it. =)

Also: does anyone know why as I write this post my cursor moves? It's really annoying and causing me to backspace stuff I'm not supposed to.

BLUETOOTH: GUI Edition!
Due to the great response I got for my command line Bluetooth, I instantly went ahead and made... BLUETOOTH: GUI Edition!
It does what the command-line bluetooth does, except this one has a fairly nice GUI (I'm not the best with graphical user interfaces, but I tried.).
It is cross-compatible with the command-line Bluetooth, therefore you can receive a file using the command-line bluetooth and send a file using the GUI bluetooth (or vice-versa).
Run this command on an in-game computer: pastebin get 8c4kCDw0 bluetoothGUI.
Then type "bluetoothGUI"!


Spoiler

Sorry if I made any mistakes on this thread, I was in a rush.

#2 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 27 June 2013 - 08:03 AM

Hey nice job!

#3 Goof

  • Members
  • 751 posts

Posted 27 June 2013 - 08:21 AM

View Postmitchfizz05, on 27 June 2013 - 07:17 AM, said:


Also: does anyone know why as I write this post my cursor moves? It's really annoying and causing me to backspace stuff I'm not supposed to.
That also happens to me, when i posts.. I dont know what to do.. imo i think its a bug with the forum script.

Btw.. Really nice Program.

#4 PsychoDuck

  • Members
  • 40 posts
  • LocationBrazil

Posted 27 June 2013 - 09:11 AM

Why don't you serialize the file?

#5 Xiretza

  • Members
  • 24 posts
  • LocationSomewhere behind the moon

Posted 27 June 2013 - 02:15 PM

Hey! I'm working on a file transfer program too atm! And no, I won't look at your code, because I want to figure it out myself :)

#6 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 28 June 2013 - 06:31 AM

Good to see some clueless with clear, organized code! :D

You gave me an idea for next project :ph34r:

#7 Mitchfizz05

  • Members
  • 125 posts
  • LocationAdelaide, Australia

Posted 28 June 2013 - 09:18 PM

View PostLeonardoas26, on 27 June 2013 - 09:11 AM, said:

Why don't you serialize the file?
Could, but I like it how it semi-slowly sends the file, I'm trying to replicate real Bluetooth.

View Postjesusthekiller, on 28 June 2013 - 06:31 AM, said:

Good to see some clueless with clear, organized code! :D

You gave me an idea for next project :ph34r:
Thanks =D

#8 Hoguesteele

  • New Members
  • 2 posts

Posted 28 June 2013 - 10:47 PM

Hey, I hope you dont mind. I edited this already great program in a few ways that I thought could make it a little better. Now the wireless modem can be placed anywhere on the computer or turtle. When you type "bluetooth" into the shell without any arguements or a modem attached, it runs the printUsage() command right away instead of erroring over the missing modem. And now when you run "bluetooth receive", it first does shell.run("id") then prints, "Waiting for a bluetooth connection..." so that you don't have to check the id of the computer you are sending a file to in addition to running this program.
It's on pastebin as an edit of your code, named as such as well.
link: http://pastebin.com/nBG9h6YL

Also, I would like to state that the ability to place the wireless modem on any side, is code that I took line for line from the gps program that comes with ComputerCraft. Why change something that works perfectly? (Unless that violates some sort of copyright or plagerism law?)

#9 Mitchfizz05

  • Members
  • 125 posts
  • LocationAdelaide, Australia

Posted 29 June 2013 - 02:12 AM

View PostHoguesteele, on 28 June 2013 - 10:47 PM, said:

Hey, I hope you dont mind. I edited this already great program in a few ways that I thought could make it a little better. Now the wireless modem can be placed anywhere on the computer or turtle. When you type "bluetooth" into the shell without any arguements or a modem attached, it runs the printUsage() command right away instead of erroring over the missing modem. And now when you run "bluetooth receive", it first does shell.run("id") then prints, "Waiting for a bluetooth connection..." so that you don't have to check the id of the computer you are sending a file to in addition to running this program.
It's on pastebin as an edit of your code, named as such as well.
link: http://pastebin.com/nBG9h6YL
I'm fine with people making edits of my program. It makes me quite happy that people are interested, so... thanks. =)

I've been quite happy with the response of my program, and have started working on the GUI version.
Note that I ain't very good with graphical user interfaces, but I'm trying to make this as good as I can.

#10 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 June 2013 - 01:05 PM

Use the edit button, please.

#11 steel_toed_boot

  • Members
  • 25 posts

Posted 29 June 2013 - 02:26 PM

Sounds really cool! :D

#12 hobo124

  • Members
  • 3 posts

Posted 04 July 2013 - 01:16 PM

I'm going to make use of this since im a CC noob, thanks!

#13 computercraftprogrammer

  • Members
  • 122 posts
  • Location$house->Earth->MilkyWay->Universe;

Posted 04 July 2013 - 02:26 PM

Nice work! my OS will have a built in File transfer protocol in the Network API. A lot of people seem to be making these types of programs.

#14 albrat

  • Members
  • 162 posts
  • LocationA Chair

Posted 12 July 2013 - 05:19 AM

you could extend the Gui toinclude a directory listing... :D

-- function get Dir listing
function Dirlist(folder)
local list = fs.list(folder)
return list
end

returns a table index of the folder.
to call the function list = Dirlist(foldename) - Returns a table of file names. list[1] , list [2] .. etc.

you could list the files with numbers, then have a prompt input file number... then the inputted number calls directly from the table (after a limits check) eg. if input >= 1 or <= #list then ... else print("bad number") end

then you don't have to check filenames (filename mis- spellings) . hehe

#15 Mitchfizz05

  • Members
  • 125 posts
  • LocationAdelaide, Australia

Posted 13 July 2013 - 03:18 AM

View Postalbrat, on 12 July 2013 - 05:19 AM, said:

you could extend the Gui toinclude a directory listing... :D

-- function get Dir listing
function Dirlist(folder)
local list = fs.list(folder)
return list
end

returns a table index of the folder.
to call the function list = Dirlist(foldename) - Returns a table of file names. list[1] , list [2] .. etc.

you could list the files with numbers, then have a prompt input file number... then the inputted number calls directly from the table (after a limits check) eg. if input >= 1 or <= #list then ... else print("bad number") end

then you don't have to check filenames (filename mis- spellings) . hehe

I might add a clickable file selection type thing.

( also, cool signature. :P )

#16 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 30 October 2014 - 02:19 AM

Hey, I saw this post and I was relieved to find a GOOD file transfer program! Although, I did see some flaws.

1. It does not seek for rednet modems, causing errors on pocket computers
2. It was unnecessarily slow.

I took the time to rewrite it a bit, and here is the pastebin of the modified bluetooth:

pastebin get 8cqWivAE bt

I hope you like the changes!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users