.
This commit is contained in:
parent
8ed0a2bf39
commit
b519308f7e
@ -39,8 +39,9 @@ local lines = lines_from(file)
|
||||
|
||||
|
||||
for k,v in pairs(lines) do
|
||||
sleep(1)
|
||||
if string.match(v, "green") then
|
||||
print(k .. ": yay")
|
||||
--print(k .. ": yay")
|
||||
-- lines containing "green"
|
||||
xStart = string.find(v, "x=\"")
|
||||
xEnd = string.find(v, "\" y=")
|
||||
@ -53,12 +54,27 @@ for k,v in pairs(lines) do
|
||||
x = tonumber(xStr) / steps
|
||||
y = tonumber(yStr) / steps
|
||||
|
||||
print(x .. " " .. y)
|
||||
print(x .. " " .. y .. " g")
|
||||
else
|
||||
xStart = string.find(v, "x=\"")
|
||||
xEnd = string.find(v, "\" y=")
|
||||
yStart = string.find(v, "y=\"")
|
||||
yEnd = string.find(v, "\" st")
|
||||
|
||||
xStr = string.sub(v, xStart+3, xEnd-1)
|
||||
yStr = string.sub(v, yStart+3, yEnd-1)
|
||||
|
||||
x = tonumber(xStr) / steps
|
||||
y = tonumber(yStr) / steps
|
||||
|
||||
print(x .. " " .. y . " x")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--local shapeFile = basic.readFileAll("/brulijam/shape0.svg")
|
||||
|
||||
--print(shapeFile)
|
||||
|
Loading…
Reference in New Issue
Block a user