←  Peripherals and Turtle Upgrades

ComputerCraft | Programmable Computers for Minecraft

»

[CC 1.33] [Beta 1.8.1] CCInput 0.27 (Big u...

Hackingroelz's Photo Hackingroelz 05 Oct 2012

Added CCInput2 beta download link.
Quote

ChunLing's Photo ChunLing 09 Oct 2012

I have been successful in loading the 1.25 version of this mod, and I have an IBlock and remote. I can change the ID of the IBlock and use the remote on it to set the remote to match (at least, this is what the screen tells me). The computer detects the event "peripheral" when I put the IBlock next to it, and the event "peripheral_detach" when I remove the IBlock. I can see the methods by using peripheral.wrap("right") and they are functions (except getKeyMouseWheel), but I have no idea what any of them do (they don't appear to return anything or do anything I can tell). And that's pretty much it. I'm not detecting any kind of events when I exit the console and try hitting various keys with the remote in hand (in either the green or red state, I don't know which state is "on" because neither seems to do anything).

Exactly what is supposed to happen? The way it's described, the computer next to the IBlock should be receiving any "key" events (and "char" events?) from my keyboard while I have the remote in hand.
Quote

SebaTeck's Photo SebaTeck 11 Oct 2012

hmm so. i put Iblock on left side of computer,on right i put a 4x4 monitor,then i connect remote keyboard with i block,on id 3,then i open computer and i start WORM.
now what i have to do ? e.e
Quote

ChunLing's Photo ChunLing 11 Oct 2012

Yes, that is my exact question.

Enter lua, then use "for i,v in ipairs(peripheral.getMethods("right")) do print(i..". "..v) end" to verify that the IBlock is present on the right side of the computer. You should get back a list that looks like:
1. getKey
2. getKeyPressed
3. getKeyMouseWheel
... (I don't remember them all, the last was somethihg like "blockplayer")

If the block is present, then right-click it with your hand (or something else that doesn't have a right-click function) and you should have a little window pop-up that allows you to select the channel (when you exit that screen, a message should appear saying what channel you've assigned the block). If you can do that, then equip your remote and right-click on the block. You should get a message saying that you've set the remote to match the channel assigned to that block.

Then go back to the computer and (still in lua) enter something like:
"repeat evnt,prm1 = os.pullEvent() print(evnt..": "..prm1) until prm1 == 45"

This should print the event type and first parameter of each event the computer gets, until you press the x key (or some other event with a first parameter equal to 45 occurs). Verify this by pressing various keys (except the x key). If you did this right then you should see "key: 46" (or other numbers) and then "char: c" (or other characters) for as long as you don't push x.

Leave this running and exit the computer by pushing escape. Then fool around with turning the remote on and pressing some more keys (turn the remote off and press keys as well, I think that green is supposed to be on but I don't know for sure). Then go back to your computer.

The simple key logging should still be running if you didn't press x (so don't press it). If you see that additional key presses have been logged while you weren't using the computer, then that means that something is happening. If, on the other hand, you see that the only new event since you exited is the "key: 1" from pushing the escape button, then I feel your pain because I am currently in the same situation.

If this helps you at all (as in, you get the computer to receive key/char events by using the remote) then I plead with you for precise descriptions of what you did.

Oops, left out a "=" Let me know if anything I told you doesn't work or works differently than I said it would.
Edited by ChunLing, 11 October 2012 - 11:19 PM.
Quote

SebaTeck's Photo SebaTeck 12 Oct 2012

 ChunLing, on 11 October 2012 - 11:17 PM, said:

Yes, that is my exact question.

Enter lua, then use "for i,v in ipairs(peripheral.getMethods("right")) do print(i..". "..v) end" to verify that the IBlock is present on the right side of the computer. You should get back a list that looks like:
1. getKey
2. getKeyPressed
3. getKeyMouseWheel
... (I don't remember them all, the last was somethihg like "blockplayer")

If the block is present, then right-click it with your hand (or something else that doesn't have a right-click function) and you should have a little window pop-up that allows you to select the channel (when you exit that screen, a message should appear saying what channel you've assigned the block). If you can do that, then equip your remote and right-click on the block. You should get a message saying that you've set the remote to match the channel assigned to that block.

Then go back to the computer and (still in lua) enter something like:
"repeat evnt,prm1 = os.pullEvent() print(evnt..": "..prm1) until prm1 == 45"

This should print the event type and first parameter of each event the computer gets, until you press the x key (or some other event with a first parameter equal to 45 occurs). Verify this by pressing various keys (except the x key). If you did this right then you should see "key: 46" (or other numbers) and then "char: c" (or other characters) for as long as you don't push x.

Leave this running and exit the computer by pushing escape. Then fool around with turning the remote on and pressing some more keys (turn the remote off and press keys as well, I think that green is supposed to be on but I don't know for sure). Then go back to your computer.

The simple key logging should still be running if you didn't press x (so don't press it). If you see that additional key presses have been logged while you weren't using the computer, then that means that something is happening. If, on the other hand, you see that the only new event since you exited is the "key: 1" from pushing the escape button, then I feel your pain because I am currently in the same situation.

If this helps you at all (as in, you get the computer to receive key/char events by using the remote) then I plead with you for precise descriptions of what you did.

Oops, left out a "=" Let me know if anything I told you doesn't work or works differently than I said it would.
one more thing,im a completely noob in scripting e.e
Quote

ChunLing's Photo ChunLing 12 Oct 2012

Okay, but the instructions are still relevant. Just to clarify, to enter lua you just right click on your computer to turn it on, then type "lua" at the command prompt and hit enter. That opens a program that interprets and executes any chunk you enter at the lua command prompt. You should see:
> lua
Interactive Lua prompt
Call exit() to exit
lua>
It is here that you enter things like "for i,v in ipairs(peripheral.getMethods("right")) do print(i..": "..v) end"

If you want a break down of each line I provided, I can do that.
Quote

ChunLing's Photo ChunLing 14 Oct 2012

So did it work?
Quote

skrypt's Photo skrypt 24 Oct 2012

I've tried everything, and I have no idea how to capture key events while not at the terminal.

I tried CCInput2 but cant get it to work with MC 1.2.5. Has anyone been able to get this to work? What are the steps to capture keys. I just want to capture keys away from terminal. How?
Quote

ChunLing's Photo ChunLing 24 Oct 2012

Wish I could help, I'm in the same boat.

I'm using CCPortable, it only works with programs specifically written to use it, but at least it works.
Quote

skrypt's Photo skrypt 24 Oct 2012

I've decided to use CCPortable as well. I cut out the main part of the pda GUI so that you can see through it, and with that method I can view my monitor while typing on the PDA.

I'd like to know how to remove the menu darkening effect to make this even easier to see. Know of any way to do this?
Quote

ChunLing's Photo ChunLing 24 Oct 2012

I asked, someone said it was something that everyone always put into their mod code when using a menu/inventory effect. It wasn't clear whether it was just a common option or absolutely required.
Quote

Hackingroelz's Photo Hackingroelz 24 Oct 2012

 skrypt, on 24 October 2012 - 01:35 AM, said:

I've tried everything, and I have no idea how to capture key events while not at the terminal.

I tried CCInput2 but cant get it to work with MC 1.2.5. Has anyone been able to get this to work? What are the steps to capture keys. I just want to capture keys away from terminal. How?

Just link the remote and use os.pullEvent()

Also, I'm not gonna do much work just to get CCInput2 working for people who are two updates behind.
Quote

ChunLing's Photo ChunLing 24 Oct 2012

Understandable. If we want it that much, we can update and get enderchests and stuff. I think that I'm still worried about losing my MCA and Millenaire worlds, but all things must eventually come to an end.
Quote

Leo Verto's Photo Leo Verto 24 Oct 2012

 ChunLing, on 24 October 2012 - 07:24 PM, said:

Understandable. If we want it that much, we can update and get enderchests and stuff. I think that I'm still worried about losing my MCA and Millenaire worlds, but all things must eventually come to an end.
Why would you lose your worlds? At least Millenaire is up to date.
Quote

ChunLing's Photo ChunLing 25 Oct 2012

Because they changed a bunch of their block ID's at some point in the upgrade cycle, so old villages don't have any of their special blocks (including the locked chests, which is crippling to the village economy).

I mean, it's okay, after I'm through the creation quests I'll probably just port the world and remove the village data...well, no, I guess that wouldn't help much. After I'm finished, I'll just backup the whole .minecraft folder and start new worlds on the newest version. I can always go back if I decide I want to.
Edited by ChunLing, 25 October 2012 - 01:20 AM.
Quote

skrypt's Photo skrypt 25 Oct 2012

 Hackingroelz, on 24 October 2012 - 02:46 PM, said:

 skrypt, on 24 October 2012 - 01:35 AM, said:

I've tried everything, and I have no idea how to capture key events while not at the terminal.

I tried CCInput2 but cant get it to work with MC 1.2.5. Has anyone been able to get this to work? What are the steps to capture keys. I just want to capture keys away from terminal. How?

Just link the remote and use os.pullEvent()

Also, I'm not gonna do much work just to get CCInput2 working for people who are two updates behind.

I've done that, and it does not work. Not sure how to be more descriptive of what I might be doing wrong. I run the os.pullEvent() and step away from the terminal, link the remote and try typing. No dice. Sometimes the remote wont even toggle between red/green states.

Is there more of a step by step procedure you can offer?
Quote

ChunLing's Photo ChunLing 25 Oct 2012

No, I think the 1.2.5 version just doesn't work, partly because (and this is the ironic part) Hackingroelz went back and was working on the 1.2.3 version for a while. The minecraft versions march on, and old worlds die...or at least their villagers do.
Quote