Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local monPeriph = tArgs[1]
- local mon = peripheral.wrap(monPeriph)
- local oldTerm = term.redirect(mon)
- local function a()
- while true do
- local ev, sd, x, y = os.pullEvent("monitor_touch")
- if sd == monPeriph then
- os.queueEvent("mouse_click", 1, x, y)
- os.sleep()
- os.queueEvent("mouse_up", 1, x, y)
- end
- end
- end
- local function b()
- shell.run(table.unpack(tArgs, 2))
- end
- local ok, err = pcall(parallel.waitForAny, a, b)
- term.redirect(term.native())
- if not ok then
- printError(err)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement