Reportado area incorreta!
Mais atenção da proxima ves,leia as regras de cada seção antes de postar !
Por sabrina9292, 16 de dez. de 2012 em Resolvidos
info
Grupo: Marquês
Registrado: 29/10/11
Posts: 1.2k
Reputação: +134
Gênero: Masculino

Reportado area incorreta!
Mais atenção da proxima ves,leia as regras de cada seção antes de postar !
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

Movido!
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

function onSay(cid, words, param, channel)
local str = "pokes = {"
local file = io.open('data/writeTable.txt', 'w')
if (not file) then
sendMsgToPlayer(cid, 20, "File: data/writeTable.txt, not found...")
return true
end
for i, table in ipairs(oldpokedex) do
local t = pokes[table[1]]
str = str.. '\n\n["'..table[1]..'"] = {offense = '..t.offense..', defense = '..t.defense..', specialattack = '..t.specialattack..', vitality = '..t.vitality..', agility = '..t.agility..', exp = '..t.exp..', level = '..t.level..', wildLvl = '..t.level..', type = "'..t.type..'", type2 = "'..t.type2..'"},'
end
str = str.."\n}"
file:write(str)
file:close()
sendMsgToPlayer(cid, 20, "Table add in file 'data/writeTable.txt'...")
return true
end
info
Grupo: Campones
Registrado: 02/02/08
Posts: 29
Reputação: +1

function onSay(cid, words, param, channel) local str = "pokes = {" local file = io.open('data/writeTable.txt', 'w') if (not file) then sendMsgToPlayer(cid, 20, "File: data/writeTable.txt, not found...") return true end for i, table in ipairs(oldpokedex) do local t = pokes[table[1]] str = str.. '\n\n["'..table[1]..'"] = {offense = '..t.offense..', defense = '..t.defense..', specialattack = '..t.specialattack..', vitality = '..t.vitality..', agility = '..t.agility..', exp = '..t.exp..', level = '..t.level..', wildLvl = '..t.level..', type = "'..t.type..'", type2 = "'..t.type2..'"},' end str = str.."\n}" file:write(str) file:close() sendMsgToPlayer(cid, 20, "Table add in file 'data/writeTable.txt'...") return true end
Muito obrigada...
Vou estudar seu código...
Com certeza ajudará =)
Levou meu rep++
Muito obrigada mesmo...
Editado Dezembro 17 por sabrina9292
info
Grupo: Campones
Registrado: 02/02/08
Posts: 29
Reputação: +1
Olá pessoal...
Gostaria de saber se é possível armazenar informações na memória secundária, igual Arquivos na linguagem C, acho que é possível, pois existe aquele sisteminha de Logs que armazena os comando utilizados na memória secundária...
Andei dando uma pesquisada e encontrei *algo:
--Manipulação arquivos nomeArquivo = "Aula3.txt" arquivo = assert(io.open(nomeArquivo, "w"), "Arquivo não pode ser criado") --Modos: r, Leitura; a, anexo; w escrita; r+,a+,w+, preservam os dados anteriores arquivo:write("Arquivo da Aula 3 de Lua!\n") arquivo:flush(); io.close(arquivo) arquivo = assert(io.open(nomeArquivo, "a+"), "Arquivo não pode ser criado") --Abre arquivo no modo de anexo arquivo:write("Segunda Linha\n") arquivo:flush(); io.close(arquivo) arquivo = assert(io.open(nomeArquivo, "r"), "Arquivo não pode ser criado") --Abre no modo de leitura arquivo:seek('set')--Busca o inicio do arquivos io.write(arquivo:read("*line"), "\n") --Le uma linha e pula para a próxima io.write(arquivo:read("*line"), "\n")mas não consigo fazer funcionar em OT server...
Alguém pode me dar uma ajudinha por favor?
*Isto é o que encontrei:
Desde já...
Obrigada...