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

[DISC/OpenSourced] Portable Peripherals 1.0 - PDAs, turtle transmitter!

Started by mentlerd, 15 February 2013 - 07:49 AM
mentlerd #1
Posted 15 February 2013 - 08:49 AM
PortablePeripherals v1.0b Discontinued

It appears I wont be able to work on this anymore, so I decided to make my source code public, hoping someone could make something out of it:




[right]Latest version: PortablePeripherals 1.0b[/right]
Since this is my first serious mod, I am open to any suggestions!

What is this?

This is a mod that adds wireless terminals (or PDAs if you prefer), and transmitters to computercraft! Using these these devices you can access your computers from 256-640 meters away, no more turtle chasing!






Terminals have support for multiple computer screens, colors, multiple users, and events! Pressing a key, or clicking the screen will queue an event on the host computer. For further info, see technical details.


How do I craft X?

Recipes are quite simple, they use vanilla minecraft items, for now. You can see their recipes on the image:
Spoiler

How do I use these items?

For a simple connection, you will need to create a transmitter, a terminal, and two quartz crystals. Transmitters and terminals are linked using crystals, if your terminal has a crystal that matches your transmitters, it will link up automatically.

If you wish to extend the range of your transmitter, put up to 4 antenna blocks on the top of it.

Altought crystals are not that simple. They have a frequency associated with. To change the frequency of a crystal, you need to 'pollute' it with other items. Put a crystal in the center of the crafting grid, and start placing items around: ( Be aware that the crystal does NOT support items that can be damaged, like tools, or armor )

Spoiler
As mentioned above, your crystals must have the same frequency to work!

Simplest usecase

Well, if you are not an advanced programmer, just use the built in program: transmit!
This little program will start the specified program, and transmit its output to a wireless transmitter. All events from the pda are translated, just like you started a program on a real computer!

transmit <side> <program>
transmit right shell

API

The api is quite simple, it is exactly the same as a monitors. You have to wrap the device, and you can use it just like a monitor!

Since version 1.0, there are a few new functions tough:
SpoilergetFreq()
getFrequency()

getRange()

setCrystal() – Turtle only!

Technical details

The range of transmitters is limited to 256 right now, but it is a subject to change.
For people who want to mess with the internal workings, currently these events are supported:
Spoilerpda_key
pda_char

pda_click
pda_scroll
pda_drag

pda_open
pda_close

(I am not going to explain what they do, their name implies their functionality)

Downloads, and Changelog

[CC. 1.481][MC 1.4.7] - PortablePeripherals_1.0b

[CC. 1.481][MC 1.4.7] - PortablePeripherals 0.9b
[CC. 1.481][MC 1.4.7] - PortablePeripherals 0.9 RC1


Changelog:
Spoilerv1.0b
- Fixed issues with the transmitter block
- Extended background

v1.0
- Added Antenna blocks, for range extension
- Added Terminal turtle upgrade
- Added a lot more config options

- Added new block textures by Left4Cake. Thanks!

v0.9b
- Fixed mouse events being off
- added pda_scroll, and pda_drag events
- Moved items to the CC Creative tab
- Added config option for the transmitter range

v0.9 RC1
- Initial release
Xavura #2
Posted 15 February 2013 - 08:57 AM
It's great that we finally have an alternative to CCPortable (which was never updated for 1.4). I have really enjoyed testing this add-on and am happy to see a release. :)/>

Give it a try people, I've had some fun with this.
Shnupbups #3
Posted 15 February 2013 - 09:43 AM
*Claps* Well done! Downloading…
EDIT: Amazing! But I recommend moving them to the ComputerCraft creative tab.
EDIT 2: Clicking isn't working…
EDIT 3: If you insert a crystal and then immediately try to access the terminal, Minecraft crashes. You have to close and re-open the PDA not to crash.
Ehrlingby #4
Posted 15 February 2013 - 11:11 AM
CCPortable is going to update too, I'm kind of the beta tester for the upcoming version! :)/>
mentlerd #5
Posted 15 February 2013 - 11:20 AM
If you insert a crystal and then immediately try to access the terminal, Minecraft crashes. You have to close and re-open the PDA not to crash.

Could you send me the crashlog, or give more detailed info about this? I can't seem to reproduce.

I have fixed mouse events not working, also plan to add mouse_drag, mouse_scroll in the bugfix version. (Sometime tomorrow)
Left4Cake #6
Posted 16 February 2013 - 03:38 AM
The range should be configurable like with Computer Craft as a whole. Or may be it could be (computer range x 4) since that kind of what it is right now with the default settings.
Xavura #7
Posted 16 February 2013 - 06:56 AM
CCPortable is going to update too, I'm kind of the beta tester for the upcoming version! :)/>
Ah that's cool, competition is healthy anyway. ;)/>

The range should be configurable like with Computer Craft as a whole. Or may be it could be (computer range x 4) since that kind of what it is right now with the default settings.

I agree that the range should be configurable but I'm also fond of the antenna idea…
Left4Cake #8
Posted 16 February 2013 - 08:27 AM
*Claps* Well done! Downloading…
EDIT: Amazing! But I recommend moving them to the ComputerCraft creative tab.
EDIT 2: Clicking isn't working…
EDIT 3: If you insert a crystal and then immediately try to access the terminal, Minecraft crashes. You have to close and re-open the PDA not to crash.

It seems to happen when you click a terminal and there is no crstal in the tab. However the tab dose not load the crystal imminently on insertion, but rather when you close and reopen it.
absorr #9
Posted 16 February 2013 - 10:27 AM
Hi, I would like to add your mod into a Tekkit addon I am making called the Hackers' Modkit. The modkit is all about adding more things for programming lovers to be able to do more with their code within Tekkit Lite. It will be an addon through the new custom zip feature in the Technic Launcher. You will, of course, be given the proper credit for your mod. I hope to hear from you soon with your reply!
mentlerd #10
Posted 16 February 2013 - 11:49 AM
Thank you for the detailed crash report. Fixed.

Current versions changelog:
- Fixed mouse events being off
* added pda_scroll, and pda_drag events
- Moved items to the CC Creative tab
- Added config option for the transmitter max range
Left4Cake #11
Posted 16 February 2013 - 04:18 PM
Not sure if this is really a big deal, but I have a 4:3 monitor and if full screen with GUI set to auto the edges of the window go off screen. Not so much that any aspect of it is un-usable, but just thought you would like to know.
Thomasims3 #12
Posted 17 February 2013 - 01:44 AM
CCPortable is going to update too, I'm kind of the beta tester for the upcoming version! :)/>/>
Ah that's cool, competition is healthy anyway. ;)/>/>
Ah great now I have to compete with someone who already released his peripheral… oh well, i have a great feature planned anyway

Nice peripheral btw
EDIT: it might not be a big competition now that I look at it, mentlerd has worked mostly on the transmitter while I've been putting my time in the PDA.( no spoilers untill I release first version :)/>)
DorfDepp #13
Posted 18 February 2013 - 02:53 AM
Any way to make your mod compatible with xfel peripheral cable?



Time: 17.02.13 14:50

Description: Exception in server tick loop

java.lang.AbstractMethodError: hu.mentlerd.ccportable.shared.TileEntityTransmitter.writeToNBT(Lbq;)V
at xfel.mods.cccable.common.blocks.TileCableServer.b(TileCableServer.java:193)
at aam.a(AnvilChunkLoader.java:311)
at aam.a(AnvilChunkLoader.java:127)
at im.b(ChunkProviderServer.java:232)
at im.a(ChunkProviderServer.java:284)
at in.a(WorldServer.java:844)
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:373)
at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:605)
at bdz.q(IntegratedServer.java:170)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at fy.run(SourceFile:849)

mentlerd #14
Posted 18 February 2013 - 03:48 AM
I tracked down the problem, I have to refactor the codebase entirely, because I made a design mistake with interfaces. I already made the code compile without errors, but I have to test everything again, so it will take a while. ( I think it will be done in less than 2 days )
schilcote #15
Posted 18 February 2013 - 07:53 AM
Neat-O.

I'm working on a little project that this could be helpful for, for mapping and stuff. The range limit is going to be a tremendous pain for that though.

You might make it so that we can have boosters that take EU or something to transmit their signal for long distances.

EDIT:

Though I just tested it, and 256 blocks is a lot further than I thought. :P/>
abihoooo #16
Posted 18 February 2013 - 09:34 AM
It would be awesome if you could make a turtle peripheral for the PDAs. RC turtles!
mentlerd #17
Posted 18 February 2013 - 09:58 AM
At the end, I decided to implement antenna blocks

The range limit is going to be a tremendous pain for that though.

I might add a cheat antenn, uncraftable, and it would give you infinite range. If there is a need for it.

It would be awesome if you could make a turtle peripheral for the PDAs. RC turtles!

The refactoring has a positive side effect that transmitters can exist now without tile entites, so this is comeing in the next update!

Update:


I still have to work on antenn blocks, and a way to allow turtles to select their transmitters frequency.
abihoooo #18
Posted 18 February 2013 - 11:05 AM
I still have to work on antenn blocks, and a way to allow turtles to select their transmitters frequency.

You can do something like t.selectCrystal(slot), or craft the peripheral with a crystal.
Left4Cake #19
Posted 19 February 2013 - 01:05 PM
You said you looking for better textures.
How about this? [attachment=1020:PP.png]
mentlerd #20
Posted 20 February 2013 - 05:56 AM
Updated to 1.0

Added turtle peripheral for terminals, and antenna blocks. I tried to resolve compatibility issues, but did not really tested it.
PixelToast #21
Posted 20 February 2013 - 12:02 PM
you have to open and close the pda to refresh the screen :s
backround color dosent fill spaces
any fix?
this is for 1.5 cc
mentlerd #22
Posted 21 February 2013 - 03:22 AM
Fixed, thanks for the report

Download the updated 1.0b version
PixelToast #23
Posted 21 February 2013 - 04:56 AM
thanks, this mod is great :D/>
PixelToast #24
Posted 21 February 2013 - 08:46 AM
hmm, it still wont handle background colors properly:
http://puu.sh/25IdG
mentlerd #25
Posted 22 February 2013 - 01:55 AM
I am not sure what it it supposed to do, could you provide a reference image, or explain what is expected?
PixelToast #26
Posted 22 February 2013 - 04:03 AM
its supposed to look like this:

and not:


spaces dont seem to be keeping their background color :s
but then what is that space under devices?

its probably term.clear not filling background colors >_<


im also having a verry strange computer crash when running my diskplayer

i fixed the problem by editing transmit, it was clear and clearLine not keeping colors properly
i also fixed my disk player, printing things outside of the screen crashes the computer with no error :|
OmegaVest #27
Posted 22 February 2013 - 04:46 AM
First off, I love this peripheral. I can't say why, except that it has made part of my build a bit simpler.

But, I found a few issues with it. I'm pretty sure these are small things, but one is kinda annoying. First, pullEvent works weirdly. Some pre-existing programs (such as help) don't recognize the redirect. I had to restart the base terminal to get it to do anything.

Also, terminate seems to not work yet, though I see the redirect in the code.
mentlerd #28
Posted 22 February 2013 - 04:49 AM
its probably term.clear not filling background colors >_<

That was it. Fixed, but I can't reproduce the crashing.

Download: PortablePeripherals 1.0c.zip
I am still not sure if it is doing the expected behavior, so could you check it please?

Edit:

.. pullEvent works weirdly. Some pre-existing programs (such as help) don't recognize the redirect. I had to restart the base terminal to get it to do anything.

Also, terminate seems to not work yet, though I see the redirect in the code.

I am looking into this now. Not fixed in the test zip yet.
PixelToast #29
Posted 22 February 2013 - 05:14 AM
clearing was fixed but crashing isnt, im trying to make some steps to reproduce now
having a pure black background instead of that eyehurt grey would be nice
EDIT: mouse_scroll events are reversed
Meni #30
Posted 13 March 2013 - 02:02 PM
Awesome mod i loved it!
But i just have a suggestion to have like private crystals, just because i wont like anyone hacking my network. And a very expensive antenna that remove the range limit would be awesome but very expensive. Just loved ur peripheral!
TomyLobo #31
Posted 04 April 2013 - 04:14 AM
The 'transmit' program only works in the root folder.
That is because you use the shell resolver twice (shell.run also resolves).

The easiest way to fix this is to prefix the resolved path with a slash, forcing shell.run to interpret it as an absolute path:

Add
'/'..
in front of path in the run function (line 35 in 1.0b) so it reads
shell.run( '/'..path, select( 3, ... ) )

Another way would be to use os.run, which does not resolve relative paths.
JustPingo #32
Posted 04 April 2013 - 05:29 AM
Woh ! Great peripheral !

But I have a little request.
Can you make a system to custom the crafts or change the craft of the crystal, because it's in conflict with MineChem Tubes ?

Thanks you in advance !
(maybe put sand or redstone on the right and left centers slots will be nice)
PixelToast #33
Posted 04 April 2013 - 06:52 AM
Can you make a system to custom the crafts or change the craft of the crystal, because it's in conflict with MineChem Tubes ?
we know minechem wont change its recipe because it never updates >_>
mentlerd #34
Posted 04 April 2013 - 10:30 PM
Well, I am sorry but it appears I wont be able to work on this at all anytime soon, so I decided to opensource it:

PPeripherals_stable.zip

Devs, do whatever you want to with it, just make sure to drop my name somewhere in your credits section. :)/>
PixelToast #35
Posted 06 April 2013 - 05:29 AM
aww, this was one of my favorite peripherals
any specific reason you cant develop it, or was it just bordem?
mentlerd #36
Posted 06 April 2013 - 05:40 AM
Well, I am going to graduate in a month, so I have to learn a lot.. And because a slight addiction to coding ( :P/>) I am falling behind with that.
Bubba #37
Posted 06 April 2013 - 07:53 AM
I love this peripheral, so I'm really sad to see you discontinue it. Maybe you should drop college and pick this up full time instead? :P/>
TehSomeLuigi #38
Posted 13 April 2013 - 10:21 AM
I'll try and see if I can port this into my peripherals, since I really like this extension.



Edit: I have ported this for 1.5.1, (currently in prerelease with a bug), it's in my peripherals mod.

http://www.computercraft.info/forums2/index.php?/topic/10872-cc-152-mc-151-someluigis-peripherals-portableperipherals-port-now-opensource/


It's been a good experience for me also, I've learnt some things when looking through here.
TomyLobo #39
Posted 20 April 2013 - 01:43 AM
I was going to add the frequency to the events so you can make multi-user programs basically.
But there are no compilation instructions. I don't know where to begin compiling it.

modding it without de/reobfuscation doesn't work either since classes from the default package are used.

Man, what I would give for a tool that just moves all default-package classes to a regular package and back…
Bubba #40
Posted 20 April 2013 - 02:52 AM
I was going to add the frequency to the events so you can make multi-user programs basically.
But there are no compilation instructions. I don't know where to begin compiling it.

modding it without de/reobfuscation doesn't work either since classes from the default package are used.

Man, what I would give for a tool that just moves all default-package classes to a regular package and back…

Have you tried using Bearded Octo Nemesis? That deobfuscates the classes for use in Forge/MCP.
TehSomeLuigi #41
Posted 20 April 2013 - 07:13 AM
I was going to add the frequency to the events so you can make multi-user programs basically.
But there are no compilation instructions. I don't know where to begin compiling it.

modding it without de/reobfuscation doesn't work either since classes from the default package are used.

Man, what I would give for a tool that just moves all default-package classes to a regular package and back…

I'll add that to my port, soon.
TomyLobo #42
Posted 30 April 2013 - 04:49 PM
Was there a rollback? where'd my post go?
Espen #43
Posted 30 April 2013 - 06:38 PM
Was there a rollback? where'd my post go?
[topic='12444']The case of the missing week (or: where did the last 5 days of posts go?)[/topic]
Ashton #44
Posted 02 May 2013 - 12:06 AM
How do I use the input hooks for the portable terminal? I'd like full keyboard input, obviously, but if I can even just assign 2 keys to function as "page up/down" so I can display multiple pages of text (or even 1 key to function as "press _ for next page") I've tried using the hooks mentioned in the input of the source terminal (i.e. wraped the transmitter as "PDA" and then used input.PDA and PDA.input and tried assigning those as input.pda_key and input.pda_char, etc), but it doesn't get me anything when I try to input on the portable terminal…

Otherwise, awesome mod, found quite a few uses for it including adding another interesting layer to my server's Space Station plot (hidden crystals that relay messages that slowly expose the traitor — yes I could have used books, but where's the fun in that? ;)/>)