Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 23/04/2017
- --Last update: 23/04/2017
- --[[ Notes:
- Does:
- Cria tabelas de cores
- Commands:
- !Number x Number Space --> Primeiro número deverá ser as colunas e o segundo número deverá ser as linhas. Space pode ou não existir e é o espaço entre as textareas (padrão 20); Exemplo !4x4 e !4x4 25
- ]]--
- local create
- start = {}
- eventChatCommand = function(n,c)
- local row,cel,space = c:match("(%d+) ?x ?(%d+)( %d*)$")
- row,cel = tonumber(row) or 1,tonumber(cel) or 1
- space = space and tonumber(space) or 20
- if cel > 1 then
- start = {row,cel,space}
- create = coroutine.create(make)
- end
- end
- x,y = 5,30
- make = function(row,cel,space)
- local id = 0
- for i = 1,row do
- local color = math.random(0xFFFFFF)
- ui.addTextArea(id,"",nil,x,y,10,10,color,color,1,true)
- for i = 1,cel do
- local color = math.random(0xFFFFFF)
- ui.addTextArea(-id,"",nil,x,y,10,10,-color,-color,1,true)
- y = y + space
- id = id + 1
- if id % 5 == 0 then
- coroutine.yield()
- end
- end
- y = 30
- x = x + space
- id = id + 1
- end
- x,y = 5,30
- start = {}
- end
- eventLoop = function()
- if #start == 3 then
- if coroutine.status(create) ~= "dead" then
- coroutine.resume(create,start[1],start[2],start[3])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement