Jump to content




Simulating User Input


  • You cannot reply to this topic
2 replies to this topic

#1 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 20 August 2013 - 05:52 PM

Now I'm playing for a while on Mackans server and Mack and I created to Companys. Both of them has a hosting service. I wan't that every user whobis using my service is able to upload and remove files and start,stop the firewolf server when he is on his plot. Now I need a program which runs parallel (my first question) to firewolf so I can simulate user input (my second question).

Here are the questions:
1.How can I run a program parallel to firewolf which can handle rednet messages and simulate user input

2.How can I simulate userinput like keypresses and mouse clicks?

Thx
Freack100


#2 Grim Reaper

  • Members
  • 503 posts
  • LocationSeattle, WA

Posted 20 August 2013 - 06:58 PM

If you have your rednet handling in a function and load firewolf as a function, you can distribute events to either function when loaded as coroutines. (You could also use the parallel API, although I'm less familiar with that).

Example:
Spoiler

You can simulate events by using os.queueEvent.
Example for an enter key press:
os.queueEvent ("key", keys.return)
local event, key = os.pullEvent() -- Will catch the enter key press.


#3 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 20 August 2013 - 07:02 PM

Thank you very much Grim!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users