.
This commit is contained in:
parent
fc646a0f0e
commit
911db9a237
@ -40,34 +40,36 @@ local lines = lines_from(file)
|
||||
|
||||
for k,v in pairs(lines) do
|
||||
sleep(1)
|
||||
if string.match(v, "green") then
|
||||
--print(k .. ": yay")
|
||||
-- lines containing "green"
|
||||
xStart = string.find(v, "x=\"")
|
||||
xEnd = string.find(v, "\" y=")
|
||||
yStart = string.find(v, "y=\"")
|
||||
yEnd = string.find(v, "\" st")
|
||||
if string.match(v, "rect") then
|
||||
if string.match(v, "green") then
|
||||
--print(k .. ": yay")
|
||||
-- lines containing "green"
|
||||
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)
|
||||
xStr = string.sub(v, xStart+3, xEnd-1)
|
||||
yStr = string.sub(v, yStart+3, yEnd-1)
|
||||
|
||||
x = tonumber(xStr) / steps
|
||||
y = tonumber(yStr) / steps
|
||||
x = tonumber(xStr) / steps
|
||||
y = tonumber(yStr) / steps
|
||||
|
||||
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")
|
||||
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)
|
||||
xStr = string.sub(v, xStart+3, xEnd-1)
|
||||
yStr = string.sub(v, yStart+3, yEnd-1)
|
||||
|
||||
x = tonumber(xStr) / steps
|
||||
y = tonumber(yStr) / steps
|
||||
x = tonumber(xStr) / steps
|
||||
y = tonumber(yStr) / steps
|
||||
|
||||
print(x .. " " .. y .. " x")
|
||||
print(x .. " " .. y .. " x")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user