Module:ValComp: Difference between revisions
From Exiled Kingdoms Wiki
(Created page with "function Compare(Arg1, Symb, Arg2) result = false if (Symb == 'gt' or Symb == '>') then if (tonumber(Arg1) > tonumber(Arg2)) then resul...") |
mNo edit summary |
||
Line 1: | Line 1: | ||
function Compare(Arg1, Symb, Arg2) | p = {} | ||
function p.Compare(Arg1, Symb, Arg2) | |||
result = false | result = false | ||
if (Symb == 'gt' or Symb == '>') then | if (Symb == 'gt' or Symb == '>') then | ||
Line 28: | Line 30: | ||
return result | return result | ||
end | end | ||
return p |
Revision as of 19:37, 7 June 2017
p = {}
function p.Compare(Arg1, Symb, Arg2)
result = false if (Symb == 'gt' or Symb == '>') then if (tonumber(Arg1) > tonumber(Arg2)) then result = true end elseif (Symb == 'lt' or Symb == '<') then if (tonumber(Arg1) < tonumber(Arg2)) then result = true end elseif (Symb == 'ge' or Symb == '>=') then if (tonumber(Arg1) >= tonumber(Arg2)) then result = true end elseif (Symb == 'le' or Symb == '<=') then if (tonumber(Arg1) <= tonumber(Arg2)) then result = true end elseif (Symb == 'eq' or Symb == '=') then if (tonumber(Arg1) == tonumber(Arg2)) then result = true end elseif (Symb == 'ne' or Symb == '!=') then if (tonumber(Arg1) ~= tonumber(Arg2)) then result = true end end return result
end
return p