i'm new here and a programming noob but I would like to process touch-events from the monitor and WirelessRedstone input signals in parallel for my program. My question is, how this can be implemented technically.
The touch event is currently:
whiletruedolocal component = require("component")local rs = component.redstone
local gpu = component.gpu
local colors = require("colors")local event = require("event")local id , _, x, y = event.pull("touch")if id =="touch"and x ==97and y ==2then--1
term.setCursor(1,49)
term.clearLine()
print("Verbindungen: 1->23 | 1->105 | 1->12 | 1->20 | 1->21")local id , _, x, y = event.pull("touch")if id =="touch"and x >70and x <73and y ==20then--23
term.setCursor(1,49)
term.clearLine()
print("1->23")
rs.setWirelessFrequency(101)
rs.setWirelessOutput(true)
os.sleep(1)
rs.setWirelessOutput(false)elseif id =="touch"and x >106and x <110and y ==30then--105
term.setCursor(1,49)
term.clearLine()
print("1->105")
rs.setWirelessFrequency(102)
rs.setWirelessOutput(true)
os.sleep(1)
rs.setWirelessOutput(false)-- reducedelse
term.setCursor(1,49)
term.clearLine()endelseif id =="touch"and x ==94and y ==2then--2
term.setCursor(1,49)
term.clearLine()
print("Verbindungen: 2->23 | 2->105 | 2->12 | 2->20 | 2->21")local id , _, x, y = event.pull("touch")if id =="touch"and x >70and x <73and y ==20then--23
term.setCursor(1,49)
term.clearLine()
print("2->23")
rs.setWirelessFrequency(106)
rs.setWirelessOutput(true)
os.sleep(1)
rs.setWirelessOutput(false)elseif id =="touch"and x >106and x <110and y ==30then--105
term.setCursor(1,49)
term.clearLine()
print("2->105")
rs.setWirelessFrequency(107)
rs.setWirelessOutput(true)
os.sleep(1)
rs.setWirelessOutput(false)-- reducedelse
term.setCursor(1,49)
term.clearLine()end-- reduced a lotelseif id =="touch"and x ==1and y ==1then
term.clear()breakelse
term.setCursor(1,49)
term.clearLine()endend
Now the WirelessRedstone Input Part should come. There I have no idea how to implement it. In general, this would also have to run via an if then query, since I would have to listen for around 187 frequencies. I need the input for printing stuff on the screen. Of course, there is also the question of how performant it will be in the end. If someone had an idea, it would be really nice.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hey,
i'm new here and a programming noob but I would like to process touch-events from the monitor and WirelessRedstone input signals in parallel for my program. My question is, how this can be implemented technically.
The touch event is currently:
Now the WirelessRedstone Input Part should come. There I have no idea how to implement it. In general, this would also have to run via an if then query, since I would have to listen for around 187 frequencies. I need the input for printing stuff on the screen. Of course, there is also the question of how performant it will be in the end. If someone had an idea, it would be really nice.
Thank you in advance!
Mc_Jeronimo
And sorry for my english
Link to post
Share on other sites