SHOW:
|
|
- or go back to the newest paste.
| 1 | local path = system.pathForFile("wordlist.txt",system.ResourceDirectory)
| |
| 2 | ||
| 3 | local function dictionary(path, trigger) | |
| 4 | local dictTable = {}
| |
| 5 | coroutine.yield(dictTable) | |
| 6 | local lineCounter = 100 | |
| 7 | for line in io.lines(path) do | |
| 8 | dictTable[line] = true | |
| 9 | print(tostring(line)) | |
| 10 | lineCounter = lineCounter - 1 | |
| 11 | if lineCounter <= 0 then | |
| 12 | lineCounter = lineCounter + 100 | |
| 13 | coroutine.yield() | |
| 14 | end | |
| 15 | end | |
| 16 | timer.cancel(trigger) | |
| 17 | end | |
| 18 | ||
| 19 | local loader = coroutine.wrap(dictionary) | |
| 20 | ||
| 21 | return loader(path, timer.performWithDelay(1, loader, 0)) |