I'm kinda new to lua's strings, being a C guy and all, and I don't really know every function, so can you help me?
I have this string: wood|1000
so the pattern is word|digits
First I need to get word and compare it, if it's =="wood" for example and then I need to get the value. How would I do that? I could only get either the word with "%a+" or the value "%d+" but I failed getting both. Maybe because I used gsub, dunno.
EDIT: Ok so I got this now:
Code: Select all
local arg = string.match(string_recv, "%a+")
if arg == "wood" then wood = string.match(string_recv, "%d+") end