Formspec element for your text input:
field[x pos,y pos;width,height;field_name;label text;]
Getting the formspec callback (when pressing a button)
minetest.register_on_player_receive_fields(function(sender, formname, fields)
if formname ~= "formspec_name" then
return
end
if not fields["field_name"] then
return
end
-- String lookup code
end)
local mytable = {
"stuff1 things",
"foobar attack",
"string operation",
"iamstupid.com"
}
-- Looking through the whole table
for i,v in ipairs(mytable) do
if string.match(string.lower(v), "text to search") then
-- Found something!
end
endUsers browsing this forum: No registered users and 4 guests