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

[SMP] [MC 1.2.5 | CC 1.33 / 1.41] Touch Pen v 1.11 - Touch your Monitors

Started by xuma202, 22 July 2012 - 11:45 AM
xuma202 #1
Posted 22 July 2012 - 01:45 PM
Intruduction:

A few days ago Pinkishu suggested Touch Monitors (http://www.computerc...creen-monitors/). But since dan did't wanted the Mouse In ComputerCraft I made a peripheral. Because I can't recode the Monitor itself I made Touch Pens that you can use on a Monitor.

And now it's there the port to SMP!!!!

Screenshots:





All Screenshots

How to use:

1. Craft a Pen Dock and place it next to a Computer
2. Add a Monitor using addMonitor(side) side is the side the Monitor is attached to the Computer ex. addMonitor("left")
3. Remove a Monitor with removeMonitor(side)
4. When you now right click the Monitor with a Touch Pen the Pen Dock will queue an event for the computer:

Parameter Description
1/Event Name string "Monitor_touched"
2 string side (to identify the Monitor)
3 number xIndex (the xIndex of the Block that was touched (will be 0 for the leftmost Block))
4 number yIndex (the yIndex of the Block that was touched (will be 0 for the topmost Block))
5 number hitX (0 <= hitX < 1)
6 number hitY (0 <= hitY < 1)

5. When you've added a Monitor you can still resize it!
6. When the Computer reboots all added Monitors will be lost!

For use with Peripheral Cables:

If not both (Monitor and Pen Dock) are attached to a Computer directly use addMonitorByXYZ(x, y, z, side)
Put in the coordinates of the Monitor instead of x,y,z. You have to do this once for each Monitor even if the Monitor is bigger than 1x1 Blocks!

You can get the Coordinates of a Monitor by right clicking a Monitor with a Touch Pen while sneaking.

Download:

v 1.1.1 [MC 1.2.5 | CC 1.33 / CC 1.41] Client: mediafire Server: mediafire

v 1.1.0 [MC 1.2.5 | CC 1.33 / CC 1.41] Client: mediafire Server: mediafire

v 1.0.0 [MC 1.2.5 | CC 1.33 / CC 1.41] Client: mediafire

Installation:

Version 1.1.0+: You can put the zip directly into the mods folder.
Version 1.0.0: Will have to be placed in the mods folder unpacked.

Requirements:
  • Computer Craft
  • Minecraft Forge 3.3.7.135 or later
Changelog:

v 1.1.1
  • Fixed a bug that caused the mod to ignore changes in the *.cfg file
v 1.1.0
  • Ported to SMP
  • Now only using Forge
  • Works with Peripheral Cables now
  • New Textures
  • Pens will only work if not more than 50Blocks away from the Pen Dock.
  • Warning: changed ids and the way config file gets read. Backup your worlds!!
v 1.0.0
  • Initial release
Upcomming features:
  • Update to MC 1.3.2
  • Better support for Peripheral Cables. No more need to transfer Coordinates manually.
Known bugs:
  • No known bug in latest version
If you like this it's highly appreciated to share you ideas, thoughts and suggestions here.


xuma202
Pinkishu #2
Posted 22 July 2012 - 05:05 PM
Heh nice :)/>/>

I still think mouse is completely unrealted to touchscreens but ohwell
Now we just need SMP and maybe a bukkit port
Xfel #3
Posted 22 July 2012 - 06:11 PM
How did you make it not connecting to cables?
xuma202 #4
Posted 22 July 2012 - 06:39 PM
How did you make it not connecting to cables?

When the attach method get's called i grab the tile entity on the given side. I check if it's an instance of IPeripheral if so I only return true if getType returns "computer". :)/>/>
xuma202 #5
Posted 22 July 2012 - 06:45 PM
Heh nice :)/>/>

I still think mouse is completely unrealted to touchscreens but ohwell
Now we just need SMP and maybe a bukkit port

Yes SMP is something I've already thought of. But I have no experience on that yet.

STATUS: Currently porting to SMP!
Dirkus7 #6
Posted 26 July 2012 - 03:04 PM
Got an ID conflict, where can i change the ID's?
xuma202 #7
Posted 26 July 2012 - 03:46 PM
In the config file that you can find at .minecraft/config the file is called mod_touchPen or similar
xuma202 #8
Posted 26 July 2012 - 03:48 PM
Sorry did not meant to doublepost.

EDIT: Status update. New version is out!!
Edited on 28 July 2012 - 04:09 PM
xuma202 #9
Posted 28 July 2012 - 06:10 PM
Happy to announce SMP support update!!! Get it before it costs money (will never be commercial)
KingMachine #10
Posted 29 July 2012 - 02:02 AM
This is great. Congratulations on a peripheral well done.
DarkSnake #11
Posted 29 July 2012 - 08:16 PM
The block ID won't change, and I edited the .cfg in /config/ :ph34r:/>/>
xuma202 #12
Posted 29 July 2012 - 08:30 PM
The block ID won't change, and I edited the .cfg in /config/ :ph34r:/>/>

What do you mean the default ID in v1.1.0 is 199 this should work if there is no other mod using this id installed. Whatever does it still not work now?
DarkSnake #13
Posted 29 July 2012 - 08:50 PM
The block ID won't change, and I edited the .cfg in /config/ :ph34r:/>/>

What do you mean the default ID in v1.1.0 is 199 this should work if there is no other mod using this id installed. Whatever does it still not work now?

What I mean is, I can't change the ID in the config.cfg, 199 is occupied by RedPower for me ;-) Im trying to put 4053(which is free for me!) in the config.cfg but it still tries to occupy 199.
xuma202 #14
Posted 29 July 2012 - 09:00 PM
Oh that seems to be a bug. I will fix this.
DarkSnake #15
Posted 29 July 2012 - 09:07 PM
Okay, sweet, thanks! :ph34r:/>/>
xuma202 #16
Posted 29 July 2012 - 09:29 PM
Ok fixing is done. Update is out.
DarkSnake #17
Posted 29 July 2012 - 09:42 PM
Works now thanks :ph34r:/>/>!
ArchAngel075 #18
Posted 18 August 2012 - 06:14 PM
I will like to point out that i will attempt to use this with my WIP LCD TV idea(search for my post in ASK a pro, im stuck on some parts of project)
Would be useful since users can more visually see what pixel will be lighted up(plus i can then add all the pixels binary vlaues instead of using a calculator on my desk XD)

Thanks, i just hope a bukkit port is made eventually!
Malte #19
Posted 16 September 2012 - 06:10 PM
Wird es einen Bukkit port geben? PS: Geniale idee
xuma202 #20
Posted 16 September 2012 - 08:33 PM
No there will be no bukit port. At least not by me.

If someone is interested in porting please send me a PM.
GalactusX #21
Posted 20 September 2012 - 05:41 AM
congratulations on your creation, I applaud you, now … need to create a wireless keyboard XD
saul #22
Posted 11 October 2012 - 12:48 AM
the toche moneter is cool but it lookes hared to do so but in thes codenets function Awesomeness()
reader = you
while true do
if reader = you then
reader = Matrixmage
else
Awesomeness()
end
end love the ide (/undo up 12down 123)
cant_delete_account #23
Posted 11 October 2012 - 02:09 AM
the toche moneter is cool but it lookes hared to do so but in thes codenets functionAwesomeness()
reader = you
while true do
if reader = you then
reader = Matrixmage
else
Awesomeness()
end
end love the ide (/undo up 12down 123)
First of all, use better Grammar, second, that could doesn't even work and isn't related to this mod at all.
Matrixmage #24
Posted 20 October 2012 - 02:26 AM
the toche moneter is cool but it lookes hared to do so but in thes codenets functionAwesomeness()
reader = you
while true do
if reader = you then
reader = Matrixmage
else
Awesomeness()
end
end love the ide (/undo up 12down 123)
First of all, use better Grammar, second, that could doesn't even work and isn't related to this mod at all.

He's been sending me crazy messages with next to no grammar, if you notice, that code he posted is my signature, it's like some weird stalking thing…
Xfel #25
Posted 20 October 2012 - 07:05 AM
Would it be possible to recode the touch events so that they are equal to the new advanced computer's click events?
xuma202 #26
Posted 20 October 2012 - 10:26 AM
I haven't looked into the new stuff in version 1.45 since I'd been on vacation for the last 10 days. But I'm guessing the click events return the row and column of the character that has been clicked right? - If so:

I've already thought about this from the beginning on but it seemed hard for me translating the coordinates 0-1 for each Block to character positions. Since would have to search for the offset values and the sizes of the characters in all font sizes and also the character spacing. But I can look into the code of CC 1.45 and maybe get some inspiration.
xuma202 #27
Posted 20 October 2012 - 05:18 PM
^^
Update: I've tried different stuff again and the offset is easy it is 2 pixels and there are 16 pixels on 1 block so the offset is 0.125.
Now I'd only need the the exact with/height of a character. I've tried to use the values from term.getSize() but these values are not exact since there only fit 27 chars in one row but there still is some space to the border on the right hand side.

I'm sure that it's possible to find these values somewhere in the code of cc but I'm not talented enough to do so. If anyone knows the with and height of the characters in all cc font sizes please tell me.
sirdabalot #28
Posted 20 October 2012 - 09:23 PM
the toche moneter is cool but it lookes hared to do so but in thes codenets functionAwesomeness()
reader = you
while true do
if reader = you then
reader = Matrixmage
else
Awesomeness()
end
end love the ide (/undo up 12down 123)

Spoiler
GeniusName3 #29
Posted 26 November 2012 - 10:09 AM
So,it's like a smartboard(I have one of those in nearly every class except strings and P.E)?