Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ^Seamark:\s+(.+)$
- ^Capacity:\s+(\d+).+$
- local spaces = (string.len(multimatches[2][1]) + 2)
- if not harbours[multimatches[1][2]] then
- harbours[multimatches[1][2]] = {}
- harbours[multimatches[1][2]].count = tonumber(multimatches[2][2])
- harbours[multimatches[1][2]].time = getTime(true, "HH:mm:ss")
- else
- if harbours[multimatches[1][2]].count ~= tonumber(multimatches[2][2]) then
- local change = (harbours[multimatches[1][2]].count - tonumber(multimatches[2][2]))
- local newTime = getTime(true, "HH:mm:ss")
- if change > 0 then
- cecho("<gray> (<green>-"..math.abs(change).."<gray>)<orange> DOWN!<cyan>\n"..string.rep(" ", spaces).."Last time: <white>"..harbours[multimatches[1][2]].time.."<cyan>\n"..string.rep(" ", spaces).."Current time: <white>"..newTime)
- else
- cecho("<gray> (<red>+"..math.abs(change).."<gray>)<magenta> up<cyan>\n"..string.rep(" ", spaces).."Last time: <white>"..harbours[multimatches[1][2]].time.."<cyan>\n"..string.rep(" ", spaces).."Current time: <white>"..newTime)
- end
- --update count/time after changes calculated
- harbours[multimatches[1][2]].time = newTime
- harbours[multimatches[1][2]].count = tonumber(multimatches[2][2])
- else
- cecho("<magenta> No change<cyan>\n"..string.rep(" ", spaces).."Last time: <white>"..harbours[multimatches[1][2]].time.."\n<cyan>"..string.rep(" ", spaces).."Current time: <white>"..getTime(true, "HH:mm:ss"))
- --update time after changes displayed
- harbours[multimatches[1][2]].time = getTime(true, "HH:mm:ss")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement