forked from mtcontrib/pdisc
update readme
M README.md M faden.lua
This commit is contained in:
parent
b3ce57c5b4
commit
479885a80f
34
README.md
34
README.md
|
@ -8,3 +8,37 @@ true/false: boolean (immediate)
|
|||
12.6: number (immediate)
|
||||
$hello nwae: string (immediate)
|
||||
nodolla: either a label is called so (immediate) or it's a variable
|
||||
|
||||
|
||||
|
||||
How to use this mod:
|
||||
|
||||
```
|
||||
local mylog = print
|
||||
|
||||
local parsed_code = pdisc.parse(code_text)
|
||||
|
||||
local function mystart(parsed_code)
|
||||
local thread = pdisc.create_thread(function(thread)
|
||||
thread.flush = function(self)
|
||||
mylog(self.log)
|
||||
self.log = ""
|
||||
return true
|
||||
end
|
||||
end, parsed_code)
|
||||
mykeepalive()
|
||||
end
|
||||
|
||||
mystart(parsed_code)
|
||||
|
||||
local function mykeepalive()
|
||||
thread:suscitate()
|
||||
if not thread.stopped then
|
||||
return
|
||||
end
|
||||
thread:try_rebirth()
|
||||
minetest.after(0.1, function()
|
||||
mykeepalive()
|
||||
end)
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user