If anyone else wants to join in feel free to, but as a legal warning I would just like to state that all code I post in this thread will be under the Whatever the Fuck you please Permissive License (sorry for the vulgarity). Anyone posting in this thread should also include a, small, permissive license, too.
Code: Select all
local WAIT = coroutine.wrap(function(f, returnvar)
local starttime = {}
local duration = {}
local counter = 0
local timecheck = false
local wordcount = 0
for i in love.filesystem.lines("main.lua") do
if string.find(i, "WAIT%b()") then
wordcount = wordcount + 1
end
end
while #starttime < wordcount do
local time = coroutine.yield()
starttime[#starttime + 1] = love.timer.getTime()
duration[#duration + 1] = time
end
while true do
timecheck = false
if love.timer.getTime() >= starttime[#starttime - counter] + duration[#duration - counter] then
starttime[#starttime - counter] = love.timer.getTime()
timecheck = returnvar or true
end
counter = counter + 1
if counter >= #starttime then
counter = 0
end
coroutine.yield(timecheck)
end
end)