|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Akiros Newbie cheater Reputation: 0
Joined: 11 Apr 2020 Posts: 24 Location: my house
|
Posted: Sat Jul 30, 2022 6:42 pm Post subject: why does this stop at 99 ? |
|
|
mTbl = {"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
}
nTbl = {"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
}
function generate(atbl,btbl,loop,rst)
res = ""
s = #atbl
if rst==2 then
for i,k in pairs(btbl) do
res = res .. k .. "" .. atbl[loop] .. "\n"
end
end
if rst==3 then
for i,k in pairs(btbl) do
--if i~=loop then s = atbl[loop] end
res = res .. btbl[i] .. "" .. btbl[s] .. "" .. atbl[loop] .. "\n"
s = tonumber(s) - 1
--print(res)
end
end
s = tonumber(s) - 1
return res
end
-- 2 tbl
YHUK = generate(nTbl,mTbl,1,3) --3 tbl
HMUK = generate(nTbl,mTbl,2,3) --3 tbl
GMUK = generate(nTbl,mTbl,3,3) --3 tbl
LVUK = generate(nTbl,mTbl,4,3) --3 tbl
YHUS = generate(nTbl,mTbl,5,3) --3 tbl
HMUS = generate(nTbl,mTbl,6,3) --3 tbl
GMUS = generate(nTbl,mTbl,7,3) --3 tbl
COLLECTIVE = ((YHUK) .. (HMUK) .. (GMUK) .. (LVUK) .. (YHUS) .. (HMUS) .. (GMUS))
amt = 1
function createfor(sender)
YHUK = generate(nTbl,mTbl,(amt),3)
if amt ~="99" then
print(a)
amt = amt + 1
createfor()
end
end
createfor()
_________________
help pls im noob |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat Jul 30, 2022 8:16 pm Post subject: |
|
|
Because this counter :
Code: | if amt ~="99" then
print(a)
..
.. |
The counter allow the function to print 'amt' as long as the counter not equal to 99.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Sun Jul 31, 2022 3:36 am Post subject: |
|
|
Code: | mTbl = {"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
}
nTbl = {"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
}
function generate(atbl,btbl,loop,rst)
res = ""
s = #atbl
if rst==2 then
for i,k in pairs(btbl) do
res = res .. k .. "" .. atbl[loop] .. "\n"
end
end
if rst==3 then
for i,k in pairs(btbl) do
res = res .. btbl[i] .. "" .. btbl[s] .. "" .. atbl[loop] .. "\n"
s = tonumber(s) - 1
--print(res)
end
end
s = tonumber(s) - 1
return res
end
--"amt" must be equal to the current table length.
--"amt" must be a number (99), not a string ("99").
--Use below code to avoid infinite loop and loop 99.
amt = 1
Loop = 0
findLoop = 0
function createfor(sender)
YHUK = generate(nTbl,mTbl,(amt),3)
if Loop ~= findLoop then
print(YHUK) -- a ?
amt = tonumber(amt) + 1
--check amt = #nTbl then ..
ftbl = #nTbl + 1
if amt==ftbl then amt = 1 end
Loop = tonumber(Loop) + 1
createfor()
else
print("finish loop: "..Loop)
end
end
findLoop = 17 -- or 25 .. or 99 .. Or "Not Responding" :) ..
createfor() |
It will give you the same output again in loops after the table length.
So don't give the loop more than the table length.
findLoop = 9
or
findLoop = #nTbl
_________________
|
|
Back to top |
|
|
Akiros Newbie cheater Reputation: 0
Joined: 11 Apr 2020 Posts: 24 Location: my house
|
Posted: Sun Jul 31, 2022 4:45 am Post subject: |
|
|
Thank you, this is what I needed. I did not know about tonumber and loop function
_________________
help pls im noob |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|