1
0
mirror of https://github.com/HybridDog/pdisc.git synced 2024-11-13 05:40:38 +01:00
a mod supposed to be used for programming robots in minetest https://github.com/HybridDog/pdisc
Go to file
HybridDog 4b5455dcc6 fix weird nonsense less instruction code
M  standardbefehlssatz.lua
2016-12-29 22:37:03 +01:00
textures 💥 2016-11-13 14:42:57 +01:00
.gitignore 💥 2016-11-13 14:42:57 +01:00
faden.lua more instructions, string length test and dont try executing nil 2016-12-29 14:14:20 +01:00
init.lua 💥 2016-11-13 14:42:57 +01:00
LICENSE.txt 💥 2016-11-13 14:42:57 +01:00
parser.lua buxfixes and more instructions 2016-12-28 18:27:41 +01:00
README.md buxfixes and more instructions 2016-12-28 18:27:41 +01:00
standardbefehlssatz.lua fix weird nonsense less instruction code 2016-12-29 22:37:03 +01:00

commands are read line by line

[<labelname>:] [<commandname> [<arg1>[,<arg2[…]]]] [; <comment>]

arguments can be either variables, labels or immediates, labels are replaced with immediates which have the line numbers of the labels as their values 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(thread)
end

mystart(parsed_code)

local function mykeepalive(thread)
	thread:suscitate()
	if not thread.stopped then
		return
	end
	thread:try_rebirth()
	minetest.after(0.1, function()
		mykeepalive()
	end)
end