Advertisement
fatboychummy

Parallel Example IRC

Feb 6th, 2025
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.32 KB | None | 0 0
  1. local function task1()
  2.   while true do
  3.     sleep(1)
  4.     print("task1")
  5.     peripheral.call("dynamicValve_2","getFilledPercentage")
  6.   end
  7. end
  8.  
  9. local function task2()
  10.   while true do
  11.     sleep(2)
  12.     print("task2")
  13.     peripheral.call("dynamicValve_2","getTankCapacity")
  14.   end
  15. end
  16.  
  17. parallel.waitForAny(task1, task2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement