eight examples later im going the right way .... heres what i got
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
meta:set_string("formspec",
"size[20,11]"..
"list[current_name;main;0,0;1,4;]"..
"item_image[1,0;1,1;default:coal_lump]"..
"item_image[1,1;1,1;default:cobble]"..
"item_image[1,2;1,1;default:torch]"..
"item_image[1,3;1,1;default:rail]"..
"field[3,1;2,1;shaftdepth;'Depth of Shaft';100]"..
"button[5,0.70;2,1;drillbutton;Drill]"..
"list[current_name;inv;2,4;18,4;]"..
"list[current_player;main;2,9;16,2;]")
meta:set_string("infotext", "Road Paver Machine - " .. fuel)
meta:set_string("fuel", fuel)
local inv = meta:get_inventory()
inv:set_size("inv", 18*4)
inv:set_size("main", 1*4)
thats the form spec
this is how i handle the data...
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos);
fields.text = fields.text or ""
meta:set_string("depth", fields.shaftdepth)
print("ishotthe sherrif")
end,
have to put a little clapton in the debug, clapton and marley... lmao
from here i know how to get the data from meta:string_get and set
the only thing i cant figure out now is how to make the on recieve data reference a function in the same module.. i keep getting :
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
init.lua:423: attempt to index global 'tbmroads' (a nil value)