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

[WIP/Beta] Wireless Printing

Started by 1lann, 24 November 2012 - 08:17 PM
1lann #1
Posted 24 November 2012 - 09:17 PM
Hey there!

I made a little wireless printing program that allows you to print wirelessly through rednet. What's so special about this? Well it hooks into the peripheral API, so it makes a virtual peripheral. What this means is if you use it, you can print from any existing programs which already prints, like "edit", without having to use any special program to print. It is currently in beta and be careful, if two computers try to print at the same time to the same printer, it will stuff up ;)/>/>.

tl;dr: I made a wireless printing that "hooks" into the peripheral API, so you can print straight from "edit" wirelessly.

Here is the client software:
Syntax: programname <id of printer server> <side to mount your virtual printer to, ex: "left">
Make sure the side you mount your virtual printer to doesn't already have anything mounted on
http://pastebin.com/WQS0qCHi

Here is the server software:
http://pastebin.com/txhHKyDY

Enjoy,
1lann
Sammich Lord #2
Posted 24 November 2012 - 09:34 PM
I love it!
Dlcruz129 #3
Posted 25 November 2012 - 05:01 AM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer.

Permission to use this in my Operating System?
1lann #4
Posted 25 November 2012 - 02:35 PM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer. Permission to use this in my Operating System?
Sure! Giving credit would be nice but not necessary :D/>/>
Dlcruz129 #5
Posted 25 November 2012 - 02:49 PM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer. Permission to use this in my Operating System?
Sure! Giving credit would be nice but not necessary :D/>/>/>

Of course ill give you credit. You're a genius.
Sammich Lord #6
Posted 25 November 2012 - 04:45 PM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer. Permission to use this in my Operating System?
Sure! Giving credit would be nice but not necessary :D/>/>/>/>
Of course ill give you credit. You're a genius.
He is the person that made a fucking Olympic scoreboard in minecraft!
GravityScore #7
Posted 25 November 2012 - 04:54 PM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer. Permission to use this in my Operating System?
Sure! Giving credit would be nice but not necessary :P/>/>/>/>/>
Of course ill give you credit. You're a genius.
He is the person that made a fucking Olympic scoreboard in minecraft!

It was funny cause he did that in 5 minutes while bored :D/>/> (I quote him there)
Sammich Lord #8
Posted 25 November 2012 - 04:57 PM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer. Permission to use this in my Operating System?
Sure! Giving credit would be nice but not necessary :lol:/>/>/>/>/>/>
Of course ill give you credit. You're a genius.
He is the person that made a fucking Olympic scoreboard in minecraft!
It was funny cause he did that in 5 minutes while bored :D/>/>/> (I quote him there)
And Dan200 still tells everybody about it :P/>/>
Expenox #9
Posted 25 November 2012 - 06:10 PM
ima call my dad cuz he gave me the phone he made cuz he makes phones nad ima ask him about printers cuz he make printers so ima asckil mil how to use it with this and thne try to blend it with the blednders he makes
Bad troll leave.
1lann #10
Posted 25 November 2012 - 06:28 PM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer. Permission to use this in my Operating System?
Sure! Giving credit would be nice but not necessary :P/>/>/>/>/>/>
Of course ill give you credit. You're a genius.
He is the person that made a fucking Olympic scoreboard in minecraft!
It was funny cause he did that in 5 minutes while bored :D/>/>/> (I quote him there)
I didn't say 5 minutes >:lol:/>/> I said 30 min.
Sammich Lord #11
Posted 26 November 2012 - 03:46 AM
Pretty clever! Good job tricking it into thinking its a printer right next to the computer. Permission to use this in my Operating System?
Sure! Giving credit would be nice but not necessary :P/>/>/>/>/>/>/>
Of course ill give you credit. You're a genius.
He is the person that made a fucking Olympic scoreboard in minecraft!
It was funny cause he did that in 5 minutes while bored :D/>/>/>/> (I quote him there)
I didn't say 5 minutes >:lol:/>/>/> I said 30 min.
Same difference.
This is also my 400th post on the forums.
rick3333 #12
Posted 23 December 2012 - 12:40 PM
you are a genius to be able to make this in 30 minutes.
InputUsername #13
Posted 25 December 2012 - 04:47 AM
One word: superawesomegenius.
1lann #14
Posted 26 December 2012 - 05:11 AM
This program? Maybe not 30 min XD more probably like 1 hour with all dat debugging.
6677 #15
Posted 30 December 2012 - 01:51 AM
I've been having issues with this.

I have the host computer set up nicely somewhere else. Seems to work.

I then run "WiPrint 7 left" as I have saved the program as WiPrint, the host is id 7 and I want the printer to be mounted on the left.

I then print. Bam, all computers in the game lock up completely and it becomes impossible to close minecraft without task manager.
1lann #16
Posted 30 December 2012 - 02:48 AM
I've been having issues with this.

I have the host computer set up nicely somewhere else. Seems to work.

I then run "WiPrint 7 left" as I have saved the program as WiPrint, the host is id 7 and I want the printer to be mounted on the left.

I then print. Bam, all computers in the game lock up completely and it becomes impossible to close minecraft without task manager.
Uhh, that's really strange. My program only tampers with the peripheral api, not the coroutine/os api which would most likely be the cause of this problem. Try updating your forge? Maybe submit a bug report on the forums? Idk what's wrong
Cozzimoto #17
Posted 30 December 2012 - 03:07 AM
you should make it where the server sends a reply to all the connected computers on the network to wait till its done printing before it can take any more requests, or what you can do is make an array where everything is put in there as a que so the printer doesnt gum up
1lann #18
Posted 30 December 2012 - 02:10 PM
you should make it where the server sends a reply to all the connected computers on the network to wait till its done printing before it can take any more requests, or what you can do is make an array where everything is put in there as a que so the printer doesnt gum up
Yeah I was planning to do that, great idea. I've thought it through before, but I'm worried someone could jam the printer by never doing printer.endPage(), but possibly make it so there is a timeout
MudkipTheEpic #19
Posted 31 December 2012 - 11:18 AM
As there is a peripheral for adjacent computers, would it be possible to wirelessly control them? As in the commands at the bottom of this page:
http://computercraft.info/wiki/Computer
Cozzimoto #20
Posted 31 December 2012 - 04:09 PM
Spoiler
you should make it where the server sends a reply to all the connected computers on the network to wait till its done printing before it can take any more requests, or what you can do is make an array where everything is put in there as a que so the printer doesnt gum up
Yeah I was planning to do that, great idea. I've thought it through before, but I'm worried someone could jam the printer by never doing printer.endPage(), but possibly make it so there is a timeout

just make it in the printer if it times out after the last line do a printer.endPage() in the program
or make it where people just send the contents and the printer handles the starting of a page and ending of a page

so you can add in some kind of formatting software to your wireless printer
6677 #21
Posted 01 January 2013 - 01:52 AM
I was using the most recent forge but earlier that day I had installed the 32 bit JDK on 64 bit windows by accident instead of the 64 bit version, this also installs a 32 bit JRE. Minecraft seems to throw extensive wobblies with 32 bit java on 64 bit windows, seems computercraft does aswell.

I installed the 64 bit JRE again and we're sorted. Wireless printing now works :D/>
Seems weird, I think theres probably more to the problem than that but either way, its fixed.
MulticolouredMarshmellow #22
Posted 20 January 2013 - 06:15 AM
Wow! I was about to make this but apparently you beat me! Good job!
turtledude01 #23
Posted 12 February 2013 - 07:38 AM
I've been using this for a while. I love how it works. I just have problems with it giving errors and crashing the program when there's an invalid rednet signal from something else (my rednet browsers) it gives serialized:1 :P/> so I just set it to loop the program on the crash, but now….. Now it just won't allow my rednet browser to access any pages :P/>
anonimo182 #24
Posted 12 February 2013 - 10:40 AM
Nemocrancy, also starting on this thread
nateracecar5 #25
Posted 03 March 2013 - 04:52 PM
I've been having issues with this.

I have the host computer set up nicely somewhere else. Seems to work.

I then run "WiPrint 7 left" as I have saved the program as WiPrint, the host is id 7 and I want the printer to be mounted on the left.

I then print. Bam, all computers in the game lock up completely and it becomes impossible to close minecraft without task manager.

I had this same problem once when installing an API. What you should do is not put it in the rom folder but load it as an API with os.loadAPI("WiPrint")
ardera #26
Posted 01 May 2013 - 02:49 AM
Cool :)/>
I used this in my ComputerCraft world, and modified it a bit, now I have my lights, my speakers, my monitor, my disk reader, my ami (adventure map interface, I am using Immibis' peripherals), my printer, my drive (I am working on that, because it's broken) as peripherals in my main computer :)/> The only problem is, I've modified it for LAN cables, but I didn't know that there is a upload speed limit for LAN modems, so printing on the monitor is real slow…

(But now the program seems to be useless, because there are peripheral cables, but I didn't see that this post already got published for about half a year)
Cranium #27
Posted 06 May 2013 - 10:42 AM
Cool :)/>
I used this in my ComputerCraft world, and modified it a bit, now I have my lights, my speakers, my monitor, my disk reader, my ami (adventure map interface, I am using Immibis' peripherals), my printer, my drive (I am working on that, because it's broken) as peripherals in my main computer :)/> The only problem is, I've modified it for LAN cables, but I didn't know that there is a upload speed limit for LAN modems, so printing on the monitor is real slow…

(But now the program seems to be useless, because there are peripheral cables, but I didn't see that this post already got published for about half a year)

Please don't revive topics from the dead.
Looks like this topic isn't being updated by the OP. If it is, 1Lann please PM a moderator to unlock it.