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

Scanner

Started by Jasonfran, 22 September 2012 - 06:09 PM
Jasonfran #1
Posted 22 September 2012 - 08:09 PM
Now that printers have been released in 1.4.2 I think there should be a scanner which can scan the text on a inserted piece of paper and save it as a string.

This would be useful as a ticketing system and would also encourage people to create advanced ticketing systems that cannot be forged using other people's printers. I think that would be a fun thing to do and could also act as money on a multiplayer server.


Functions there should be:

scanner.getText() - returns a string

scanner.eject() - ejects paper

scanner.isScanning() - returns true if there is paper already inside the machine, else false

scanner.lines() - returns the amount of lines on the piece of paper

Let me know what you think :P/>/>
Jan #2
Posted 22 September 2012 - 09:22 PM
Oh no… this topic will be similair to that large discussion 'turtles should read signs'. But this time with paper…
sjele #3
Posted 22 September 2012 - 09:35 PM
Anyways since this dosent involve turtles it could work. Scanners are not blind like turtles :P/>/>
OmegaVest #4
Posted 28 September 2012 - 04:14 PM
I doubt this will become a discussion on that scale. But, yeah, I can see this being useful, as I myself thought this would be good to have while playing around with printers. Mostly after I found out you can print programs. I thought it would be interesting to have a program printed out, then sent (like with forestry mail), then scanned in. You can, of course, do this with disks much easier, but for what I was building at the time, a scanner would have been preferable.

Furthermore, I like the idea of, say, putting a row of characters that act as a pass code. Easy to hack, of course. But then, disks are not much better, and these could be disposable. Like an automated ticket booth.
Cranium #5
Posted 28 September 2012 - 06:28 PM
Also, tickets make more sense of being paper than a floppy disk…
GopherAtl #6
Posted 29 September 2012 - 03:47 AM
To me, scanners made a lot more sense for the pixel printers in CCPrinters, since they could scan maps. Only being able to scan in text that was printed in the first place seems of very limited value by comparison…
Cranium #7
Posted 01 October 2012 - 05:08 PM
But you could make barcodes like this:

| || |||  | || |  || |
| || |||  | || |  || |
And have it be read by the scanner.
OmegaVest #8
Posted 01 October 2012 - 06:21 PM
Actually, that's not a bad usage, Cranium. I can kinda see how that would go.


scanner = peripheral.wrap("right")
tPage = scanner.getText()
sCode = tPage[4]
iCode
for i = #sCode, 1, -1 do
   bintar = #sCode - i +1
   if string.sub(sCode, i, i) ~= " " then
      iCode = iCode + 2^bintar
   end
end

Then, do whatever. And with this, it can literally be any character that you want, not just a barcode, but a keycard, analog mock magstrip, QR code, etc.
Cranium #9
Posted 01 October 2012 - 08:04 PM
O.O
QR codes, you say?
hmm…….
BigSHinyToys #10
Posted 01 October 2012 - 11:23 PM
computer + rednet + printer + scanner = FAX machine

I like this idea +1
Cranium #11
Posted 01 October 2012 - 11:43 PM
:)/>/> :(/>/> :P/>/> ;)/>/> :D/>/> :D/>/> :D/>/> :D/>/> :)/>/> :)/>/>
I had not thought about that til just now!
We gotta convice dan200 and Cloudy to add this! It fits so well into ComputerCraft!
Orwell #12
Posted 02 October 2012 - 12:09 AM
Now that printers have been released in 1.4.2 I think there should be a scanner which can scan the text on a inserted piece of paper and save it as a string.

This would be useful as a ticketing system and would also encourage people to create advanced ticketing systems that cannot be forged using other people's printers. I think that would be a fun thing to do and could also act as money on a multiplayer server.


Functions there should be:

scanner.getText() - returns a string

scanner.eject() - ejects paper

scanner.isScanning() - returns true if there is paper already inside the machine, else false

scanner.lines() - returns the amount of lines on the piece of paper

Let me know what you think :)/>/>

And what about the color of each character?
Cranium #13
Posted 02 October 2012 - 12:59 AM
We might have to have two scanners then, or something like we already have with turtle upgrades with a color peripheral? But I think that the scanners should be just black and white, rather than colored. It would make things so much easier to code for.
BigSHinyToys #14
Posted 02 October 2012 - 01:10 AM
something like this could work for color and char data

scan.loadpage()
local max_row_number,max_column_number = scan.getPageSize()
local page = {}
for row = 1,max_row_number do
page[row] = {}
for column = 1,max_column_number do
  page[row][column] = {}
  scan.selectPos(row,collom)
  page[row][column].char = scan.char()
  page[row][column].color = scan.color()
end
end
JJRcop #15
Posted 02 October 2012 - 02:24 AM
Yes, this is absolutely necessary, a must have!
BrolofTheViking #16
Posted 02 October 2012 - 08:29 PM
This… is interesting. Very interesting… I like this idea.
wilcomega #17
Posted 03 October 2012 - 03:12 PM
i argree, we gotta bug dan and cloudy about this :(/>/>
Aquilamo #18
Posted 09 October 2012 - 11:32 AM
If there was a scanner, I might actually be able to build a massive database using paper. Saving data has always been an issue for me in computercraft…
Along with a camera turtle (like from CameraCraft mod) I could record anything, muahahahahahah!
JJRcop #19
Posted 09 October 2012 - 08:43 PM
I imagine database backups with paper and scanners.
CastleMan2000 #20
Posted 10 October 2012 - 01:25 AM
I like this idea. :P/>/> I think it could be VERY useful, like if you had an email system between, say, two cities. There would be local mail servers in both cities, and anything addressed to the other city would be printed out, sent over storage carts delivered daily, and scanned into the server at the other end.
GopherAtl #21
Posted 10 October 2012 - 05:57 PM
fax machines are a neat idea, but why on earth would you transfer email by printing it to paper and scanning it back? If you're sending out of rednet range, why not store them to floppy disks? The storage capacity of a sheet of paper is 25x21==525 bytes…
Cranium #22
Posted 10 October 2012 - 06:33 PM
The idea is not practicality, it's just neat. If I gave you a ticket in game, you could do nothing with it, unless you had a scanner that could take that information. This could also work(as suggested before) as a barcode reader. Generating barcodes with paper seems really cool.
Sebra #23
Posted 10 October 2012 - 07:16 PM
If only fax machine could transfer maps…
And books without illustrations is just a… plain books.
GopherAtl #24
Posted 10 October 2012 - 07:19 PM
cranium, yeah, therea re neat applications I'm not objecting to. I was responding specifically to the suggestion of delivering in-game email to places too distant for rednet from an email server by printing, shipping, scanning, and then delivering electronically, when disks make much more sense for that specific application.
Cranium #25
Posted 11 October 2012 - 12:41 AM
cranium, yeah, therea re neat applications I'm not objecting to. I was responding specifically to the suggestion of delivering in-game email to places too distant for rednet from an email server by printing, shipping, scanning, and then delivering electronically, when disks make much more sense for that specific application.
But it doesn't HAVE to make sense. It's Minecraft!
Aquilamo #26
Posted 11 October 2012 - 09:02 AM
Besides printed letters can be sent to several people, and they don't really need to know how to use computercraft.
It's a pretty ethic subject, but I believe everyone should have some access to technology, even though they can't understand or use it.

I'd also rather do a database with printed information, that way I can record tons of information and then have a turtle sort them into different categories and then fetch them for me. Turtle Librarian XD
Doyle3694 #27
Posted 11 October 2012 - 09:21 AM
What if you made your program binary and put it all on a paper and then had your friend scan the paper and un-binary it.

Selling 0's and 1's for 20 bucks a paper!
PonyKuu #28
Posted 11 October 2012 - 12:36 PM
If you want to transfer programs - use floppies :P/>/>'

But idea is nice… but I don't know if I'll use it… I didn't even use printers yet.
GopherAtl #29
Posted 11 October 2012 - 03:17 PM
I'd also rather do a database with printed information, that way I can record tons of information and then have a turtle sort them into different categories and then fetch them for me. Turtle Librarian XD

If you just like the idea of doing it on paper, by all means, go to town, but every single part of that would be 10 times easier with files in a computer than with printed paper. Tons of information? one floppy can hold, by default, I think half a meg, which is 524288 bytes, one sheet of paper can hold 525 bytes. So, roughly 1000 printed pages per disk, and that's if you used 100% of every printed page. Since printed pages don't stack, that means it would take 40 chests to hold paper containing the same info that fits on one floppy.
Cranium #30
Posted 11 October 2012 - 04:50 PM
I'd also rather do a database with printed information, that way I can record tons of information and then have a turtle sort them into different categories and then fetch them for me. Turtle Librarian XD

If you just like the idea of doing it on paper, by all means, go to town, but every single part of that would be 10 times easier with files in a computer than with printed paper. Tons of information? one floppy can hold, by default, I think half a meg, which is 524288 bytes, one sheet of paper can hold 525 bytes. So, roughly 1000 printed pages per disk, and that's if you used 100% of every printed page. Since printed pages don't stack, that means it would take 40 chests to hold paper containing the same info that fits on one floppy.
So? that would make it that much harder to code some sort of reference system that the turtle can go back to. Makes it a challenge. I think that's kind of a nead idea.
Doyle3694 #31
Posted 11 October 2012 - 04:53 PM
yeah but seriously? the amount of code that can be stored on a paper is still enough for a simple program. I have yet to hear someone who filled up a floppy
Cranium #32
Posted 11 October 2012 - 05:02 PM
yeah but seriously? the amount of code that can be stored on a paper is still enough for a simple program. I have yet to hear someone who filled up a floppy

*ahem*

Umm……All of my programs are on ONE floppy. I have a couple hundred programs. Small, but enough of them can fill it up pretty fast.
GopherAtl #33
Posted 11 October 2012 - 05:56 PM
Well, as I said, if he just wants to do it on paper, by all means. I just wanted to be clear that it is hugely complicating things, because his comment, which I'd quoted, said "that way I can record tons of information and then have a turtle sort them into different categories and then fetch them for me" which kindof implies you couldn't do these things otherwise, which is silly.
Cranium #34
Posted 11 October 2012 - 06:53 PM
I see your point. But still…lots of fun coding all that stuff….
InputUsername #35
Posted 30 October 2012 - 10:28 PM
Awesome idea!

One tiny thing though: when implementing it as an 'unhackable' ticketing system, othet peeps could just scan the tickets and print them an infinite number of times. Just sayin'.

But still, the idea is great; I could really see it as a feature that will be added.
Aquilamo #36
Posted 31 October 2012 - 05:26 AM
Awesome idea!

One tiny thing though: when implementing it as an 'unhackable' ticketing system, othet peeps could just scan the tickets and print them an infinite number of times. Just sayin'.

But still, the idea is great; I could really see it as a feature that will be added.
That's great! Most progress in programming were done when there was an obstacle.
I guess you would need a way to encrypt the data and make every ticket unique, like a serial key number.
This sounds like a lot of fun to program…
CastleMan2000 #37
Posted 31 October 2012 - 01:42 PM
peeps could just scan the tickets and print them an infinite number of times. Just sayin'.

Ticket stealing aside, copy machine! That would be a pretty cool program. Just insert paper into the scanner, specify the number of copies, and let it go! That would be awesome.
Jasonfran #38
Posted 02 November 2012 - 04:16 AM
If you're clever enough you can make an 'unhackable' ticketing system. You just gotta make tickets with a lot of information which isn't easily guessed. I was actually working on a prototype using floppy disks. You have a computer you buy tickets from which communicates with the ticket server. When you buy a new ticket it puts an alphanumerical encrypted code which is sent to the ticket server and stored as an inactivated code. When you go to the ticket machine to use the ticket, the machine will decrypt the code and check it against the ticket server to see if they match. If they do then it will set the code as used, and it won't be able to be used again. This is how I would go about it anyway, thus rendering your ticket copying machines useless :-)
Aquilamo #39
Posted 02 November 2012 - 11:58 AM
Time to make that metro/train station using redpower frames XD. Oh wait, redpower isn't out yet, but soon…
I'll use turtle to dig things to reduce redundant labour too, so digging tunnels will be alright.
JJRcop #40
Posted 02 November 2012 - 03:16 PM
This is absolutely nessecary.