←  Peripherals and Turtle Upgrades

ComputerCraft | Programmable Computers for Minecraft

»

[CC 1.33 | MC 1.2.5] CCPDA [1.0.1] - make...

xuma202's Photo xuma202 05 Apr 2012

Description

​An add-on that allows you to create GUIs.

Download

v 1.0.1 [CC 1.33 | MC 1.2.5] (mediafire)
v 1.0.1 [CC 1.33 | MC 1.2.4] (mediafire)

v 1.0.0 [CC 1.31 | MC 1.2.3] (mediafire)
v 1.0.0 [CC 1.32 | MC 1.2.4] (mediafire)
v 1.0.0 [CC 1.33 | MC 1.2.5] (mediafire)

Requirements
  • ComputerCraft
  • ModLoader (also needed by CC)
Installation

Unzip the file to the mods folder.

Screenshots

Posted Image

more here: imgur

Crafting

Posted Image
PDA Controller

Posted Image
PDA

How to use

The PDA Controller can be attached to any side of a Computer except for the bottom

The peripheral has plenty of functions and events.

Get a full list of them here

Colors

Some functions need a color parameter here you have to pass in an integer.

The easiest way to calculate this number from a hexadecimal A-R-G-B value (two hexadecimal digits for the Alpha-, Red-, Green-, Blue-value) (Alpha of FF => fully visible)
is to use this website.
You will have to input your 8digit Hex-number to the HEX input filed a the top. Now press the enter key.
You now pick the value in the field (decimal-column and 3rd row from bottom).
Now you simply multiply this value by -1. This is what you have to pass into the function.

Examples
  • A GUI accessible by using (right-click) the PDA, that allows to set Redstone Outputs of the computer. (pastebin)
Planed features

view

Changelog

v 1.0.1:
  • Fixed a serious bug that was causing the Iron Shovel to be replaced by the PDA
v 1.0.0:
  • first official release
If you like it, a comment is highly appreciated. :)/>
Quote

FuzzyPurp's Photo FuzzyPurp 05 Apr 2012

found a bug: You didnt state what version of Minecraft this supports.
Quote

xuma202's Photo xuma202 05 Apr 2012

Thanks I've added it.
Quote

coolblockj's Photo coolblockj 06 Apr 2012

You should add some sort of channel switch, because so far it can only use one thing.
Quote

FuzzyPurp's Photo FuzzyPurp 06 Apr 2012

As well as it needs more functions.
Quote

xuma202's Photo xuma202 06 Apr 2012

View Postcoolblockj, on 06 April 2012 - 01:37 AM, said:

You should add some sort of channel switch, because so far it can only use one thing.
Great idea. Still thinking how to realize this. I could add a selection when you use the PDA. But opening the GUI by the Computer could get difficult maybe there will something like a popup message that could be sent by a computer like "NEW update chicken-farm" or so and when you then use the PDA you can switch between all Channels.
Quote

xuma202's Photo xuma202 06 Apr 2012

View PostFuzzyPurp, on 06 April 2012 - 03:21 AM, said:

As well as it needs more functions.

In the next update I'll definitely add the ability to add, delete and modify Buttons without having the GUI open. I think I have to take a closer look at the GUI API maybe.
Quote

kamnxt's Photo kamnxt 08 Apr 2012

I get an error:
Spoiler

EDIT: Oops, i have minecraft 1.2.4... Can you make a 1.2.4 version?
EDIT 2: And i'm using CC 1.32... I must read the title first :P/>
Quote

xuma202's Photo xuma202 08 Apr 2012

View Postkamnxt, on 08 April 2012 - 10:57 AM, said:

EDIT: Oops, i have minecraft 1.2.4... Can you make a 1.2.4 version?

I've just updated the add-on for MC 1.2.4
Quote

kamnxt's Photo kamnxt 09 Apr 2012

Thanks for updating! :P/>



Don't try this code:
side = "top"
pda = peripheral.wrap(side)
pda.registerAsEventListener()
pda.createGui()
while true do
os.pullEvent()
pda.displayGui()
end
It makes it impossible to close the PDA GUI...
Quote

xuma202's Photo xuma202 09 Apr 2012

You can do this even more easy:

side = "top"
pda = peripheral.wrap(side)
pda.setOption("closeOnEscape", false)
pda.createGui()
pda.displayGui

WARNING: DO NOT TRY!

You would have to quit the game in order to close the GUI
Quote

djblocksaway's Photo djblocksaway 10 Apr 2012

woah nice but as mentiond needs more functions :P/>
Quote

xuma202's Photo xuma202 11 Apr 2012

Yes, I know that it would be great if you can easily put checkboxes, edit fields and process bars on the GUI.
And I'll definitely add this but for now it's already possible:

For a text field you could draw a black rectangle with a gray border made out of lines. You save a lua variable whether the field is selected. When the mouse get's pressed you compare the coordinates and if the click was performed inside the field you select it otherwise you deselect it. When a key get's pressed you add the char to a variable and add the text to the GUI right above the rectangle. You would just have to limit the length of the value .

So as you can see you could do it. But of course it's not easy and it's slow. That's why I'll definitely add this.

I only what to give a way of how you can do it until the mod get's updated.
Quote

Wolvan's Photo Wolvan 12 Apr 2012

What I would love to see is SMP Support and another thing: You can mark the port to 1.2.4 as done on your to do list
Quote

xuma202's Photo xuma202 13 Apr 2012

Well there will not be SMP support or at least not in the near future because I have no experience in SMP mods yet.
If someone is interested in making this mod a SPM mod send me a PM and I'll serve you the source code.

PS: updated the to do list.
Quote

WiolfCat7's Photo WiolfCat7 28 Apr 2012

FAIL I CANT EVEN CREATE A GUI NO MATTER WHAT I TYPE IT SAYS ATTEMPT TO CALL NIL AND YES I PUT THE THING NEXT TO THE COMPUTER
Quote

xuma202's Photo xuma202 30 Apr 2012

Well have you wraped the Peripheral?
Also you can only place it next to a side or the top!
You then have to create the GUI and after that you can add stuff to it and then you can display it but make sure you have a PDA in hotbar!
Quote

xuma202's Photo xuma202 04 Jun 2012

Sorry guys I totally missed the update. But as I found out the 1.2.4 version works just fine on 1.2.5
Quote

Yurameki's Photo Yurameki 30 Jun 2012

great in concept, more flexibility and SMP support are a must!
Quote

Soundlogic's Photo Soundlogic 20 Jul 2012

I am trying to use this, and it seems to work fine, except that the PDA keeps going to id 256 and stealing my iron shovel. I am using id resolver, but both id resolver and your config file are set to things besides 256. I'm not quite sure what to do.
Thank you,
Sound Logic
Quote