Create moonloader_thread.lua
Browse files- moonloader_thread.lua +20 -0
moonloader_thread.lua
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
-- Создадим функцию, которая с задержкой будет выводить текст
|
2 |
+
function printText()
|
3 |
+
print("printText: One")
|
4 |
+
wait(1000)
|
5 |
+
print("printText: Two")
|
6 |
+
wait(1000)
|
7 |
+
print("printText: Bye!")
|
8 |
+
end
|
9 |
+
|
10 |
+
function secondPrintText()
|
11 |
+
print("secondPrintText: One")
|
12 |
+
wait(500)
|
13 |
+
print("secondPrintText: Two")
|
14 |
+
wait(1500)
|
15 |
+
print("secondPrintText: Bye!")
|
16 |
+
end
|
17 |
+
|
18 |
+
-- Создадим оба потока одновременно
|
19 |
+
lua_thread.create(printText)
|
20 |
+
lua_thread.create(secondPrintText)
|