Jump to content




Interacting with GUIs


7 replies to this topic

#1 HDeffo

  • Members
  • 214 posts

Posted 11 August 2016 - 02: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.

#2 Tripy998

  • Members
  • 104 posts
  • LocationIn Front of Computer

Posted 19 August 2016 - 05:22 AM

View PostHDeffo, on 11 August 2016 - 02:01 PM, said:

-snip-
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.
(Totally not suggesting to someone for it to be made)

#3 HDeffo

  • Members
  • 214 posts

Posted 19 August 2016 - 04: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

#4 Tripy998

  • Members
  • 104 posts
  • LocationIn Front of Computer

Posted 22 August 2016 - 05:33 PM

View PostHDeffo, on 19 August 2016 - 04:39 PM, said:

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
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.
But I'm not really sure if you can implement a click recorder in Java, let alone minecraft.

#5 HDeffo

  • Members
  • 214 posts

Posted 22 August 2016 - 09: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.

#6 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 22 August 2016 - 11:21 PM

View PostHDeffo, on 22 August 2016 - 09:58 PM, said:

My issue here is how to how to simulate the GUI and "replay" clicks without a player there.
fake player sounds like the answer to me

Edited by Lupus590, 22 August 2016 - 11:22 PM.


#7 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 23 August 2016 - 06: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.

#8 Jarle212

  • Members
  • 198 posts
  • LocationNorway

Posted 23 August 2016 - 09:52 AM

use os.queueEvent("mouse_click",button,xcoord,ycoord)?

Edit: Yeah quite infeasible to interact with GUIs from other mods.

Edited by Jarle212, 23 August 2016 - 11:03 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users