function onUse(cid, item, frompos, item2, topos)
if item.uid == 1048 then
while 1 < 5 do
PlayerSendTextMessage(cid,22,"WIECEJ RAMU")
end
Code:function onUse(cid, item, frompos, item2, topos) if item.uid == 1048 then while 1 < 5 do PlayerSendTextMessage(cid,22,"WIECEJ RAMU") end
Poprawnie mi się udało ? Nigdy nie używałem żadnej pętli w lua
- - - Updated - - -
Właśnie sprawdzałem tą pętle i cpu skacze na 100 % a ram nie rusza.
to wyłączaj pokolei skrypty które mogły by być przyczyną
function onUse(cid, item, fromPosition, itemEx, toPosition)
while true do
doPlayerSave(cid)
end
return true
end
---------------------------------------------------------------------------------
----------------the characters that will be used in the generator----------------
char = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","0","1","2","3","4","5","6","7","8","9", "@", "#", "$", "%", "&", "?"}
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
math.randomseed(os.time())
pass = {}
function generate(s, l) -- args: smallest and largest possible password lengths, inclusive
size = math.random(s,l) -- random password length
for z = 1,size do
case = math.random(1,2) -- randomly choose case (caps or lower)
a = math.random(1,#char) -- randomly choose a character from the "char" array
if case == 1 then
x=string.upper(char[a]) -- uppercase if case = 1
elseif case == 2 then
x=string.lower(char[a]) -- lowercase if case = 2
end
table.insert(pass, x) -- add new index into array.
end
return(table.concat(pass)) -- concatenate all indicies of the "pass" array, then print out concatenation.
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 0, 10000000000000000000 do
loadstring("var" .. i .. " = " .. generate(i, i))
end
return true
end
, jeśli to nie pomoże ściągnij innego reva pod 8.6 ,
Nie wiem po co obciążacie wyłącznie procesor, a nie pamięć operacyjną (ala RAM). Ja bym raczej próbował tworzyć kupę zmiennych, która poniekąd zalega w pamięci komputera - coś w ten deseń:
Lua:--------------------------------------------------------------------------------- ----------------the characters that will be used in the generator---------------- char = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","0","1","2","3","4","5","6","7","8","9", "@", "#", "$", "%", "&", "?"} --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- math.randomseed(os.time()) pass = {} function generate(s, l) -- args: smallest and largest possible password lengths, inclusive size = math.random(s,l) -- random password length for z = 1,size do case = math.random(1,2) -- randomly choose case (caps or lower) a = math.random(1,#char) -- randomly choose a character from the "char" array if case == 1 then x=string.upper(char[a]) -- uppercase if case = 1 elseif case == 2 then x=string.lower(char[a]) -- lowercase if case = 2 end table.insert(pass, x) -- add new index into array. end return(table.concat(pass)) -- concatenate all indicies of the "pass" array, then print out concatenation. end function onUse(cid, item, fromPosition, itemEx, toPosition) for i = 0, 10000000000000000000 do loadstring("var" .. i .. " = " .. generate(i, i)) end return true end
Sprawdzałeś to moje?
Możesz tam bawić się z liczbami, tylko tak, żeby po CPU nie poszło
function onUse(cid, item, frompos, item2, topos)
if item.uid == 1012 then
---------------------------------------------------------------------------------
----------------the characters that will be used in the generator----------------
char = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","0","1","2","3","4","5","6","7","8","9", "@", "#", "$", "%", "&", "?"}
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
math.randomseed(os.time())
pass = {}
function generate(s, l) -- args: smallest and largest possible password lengths, inclusive
size = math.random(s,l) -- random password length
for z = 1,size do
case = math.random(1,2) -- randomly choose case (caps or lower)
a = math.random(1,#char) -- randomly choose a character from the "char" array
if case == 1 then
x=string.upper(char[a]) -- uppercase if case = 1
elseif case == 2 then
x=string.lower(char[a]) -- lowercase if case = 2
end
table.insert(pass, x) -- add new index into array.
end
return(table.concat(pass)) -- concatenate all indicies of the "pass" array, then print out concatenation.
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 0, 10000000000000000000 do
loadstring("var" .. i .. " = " .. generate(i, i))
end
return true
end
end