when i use trigger Regex, i intend to get variable by doing the following:
regex(****(\d+)**)
dodge_current=matches[2]
if (\d+)=200, this can set the variable "dodge_current" to 200.
however the type of dodge_current is a string, so when i try to write an if syntax:
if dodge_current<300 then
end
---------not working.
only when i go to Variables and manually change type to number, then working.
QUESTION: how can i define "dodge_current" as a number, when the first time i use dodge_current=matches[2]?
thanks!
how to set a variable type as number?
Re: how to set a variable type as number?
dodge_current = tonumber(matches[2])