This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Interacting with GUIs
Started by HDeffo, 11 August 2016 - 01:01 PMPosted 11 August 2016 - 03:01 PM
Pretty sure this isnt realistic but I always figure its best to ask the community before I just give up on something. Essentially what i want to know is if theres anyway to create a peripheral which can record/"play" clicks within a GUI of (most) blocks which open a GUI on right click. So far the only ways I have thought I could even begin to implement something like this are all way beyond any reasonable time I would like to focus on any game let alone a mod to a game.
Posted 19 August 2016 - 06:22 AM
That's really impractical. Instead of doing that, it would be better to make a mod, that added a computercraft API to vanilla blocks to make it easier to interact with them.-snip-
(Totally not suggesting to someone for it to be made)
Posted 19 August 2016 - 05:39 PM
That's already been well and made. I am not aiming to make a massive mod that I have to manage a bunch of individual things for various types of blocks. No point in reinventing the wheel right? :P/>
Posted 22 August 2016 - 06:33 PM
Technically you could implement a click recorder that records the coordinates of every click within the interface. storing them in a meta table, after pressing a hotkey, then you press another one and it would re-enact them.That's already been well and made. I am not aiming to make a massive mod that I have to manage a bunch of individual things for various types of blocks. No point in reinventing the wheel right? :P/>
But I'm not really sure if you can implement a click recorder in Java, let alone minecraft.
Posted 22 August 2016 - 10:58 PM
Recording from a client perspective isn't the issue of this at all. That honestly would be very easy to implement. My issue here is how to how to simulate the GUI and "replay" clicks without a player there.
Posted 23 August 2016 - 12:21 AM
fake player sounds like the answer to meMy issue here is how to how to simulate the GUI and "replay" clicks without a player there.
Edited on 22 August 2016 - 10:22 PM
Posted 23 August 2016 - 07:37 AM
The issue is that the server doesn't really know about GUIs: it deals with containers (the GUI classes don't exist server side).
When you press a button in a GUI the mouse click isn't sent: you send a packet saying "move this item" or "reconfigure this side". This might be possible to emulate but could be quite buggy.
When you press a button in a GUI the mouse click isn't sent: you send a packet saying "move this item" or "reconfigure this side". This might be possible to emulate but could be quite buggy.
Posted 23 August 2016 - 10:52 AM
use os.queueEvent("mouse_click",button,xcoord,ycoord)?
Edit: Yeah quite infeasible to interact with GUIs from other mods.
Edit: Yeah quite infeasible to interact with GUIs from other mods.
Edited on 23 August 2016 - 10:03 AM