Beginner Help Needed

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
DaSpamer
Posts: 2
Joined: Sat Mar 04, 2017 2:03 am
Reputation: 0

Re: Beginner Help Needed

Post by DaSpamer » Sat Mar 04, 2017 3:24 am

A little bit offtopic
The table.search function provided here is updated and much more optimized, (based on my test in that post, using very same laptop model, or desktop using i7-4790k @4GHz).
It seems that table.search is 2-3 times much faster, thus this function could be handy almost in any situation, and I really hope you guys make use of it.
I commented new timestamps, along with the older previous test ones.

Code: Select all

-- i7-4720HQ @3.5GHz 4Cores
local start_time = os.clock();
t = {}
for i=1,500000 do --500k table size
    t[i]=i-1
end
print(os.clock()-start_time) -- 0.0280000.. -- 0.05 sec to create the table
local start_time = os.clock();
print(tostring(table.search(t,500000,false,true)))--true -- will try to find a key with the value of 500,000
print(os.clock()-start_time) -- 0.08799999.. -- 0.197sec sec to scan the whole table

function nestedTable(object,times) -- creates nested table -> object={{{{..n times}}}}
    if (times > 0 ) then
        object[#object+1] = {times = times}
        return (nestedTable(object[#object],times-1))
    end
end
local start_time = os.clock();
t = {};
nestedTable(t,15000) --> will create table inside a table x 15000 times.
print(os.clock()-start_time) -- 0.017000 .. --0.007 sec to create the nested table
local start_time = os.clock();
print(tostring(table.search(t,1,false)))-- true -- will try to find a 1 (as a table value), the very last table value
print(os.clock()-start_time) -- 0.04199999.. -- 0.014 sec to find the value in the nested table


I recommend using the code as it is, It's very simple, basically iterates over the whole table and it's childs childs childs...

User avatar
++METHOS
Posts: 106
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 8

Re: Beginner Help Needed

Post by ++METHOS » Sat Mar 04, 2017 3:36 am

Thanks, DaSpamer.

I wish I could make more sense of what you wrote here. I will be sure to study it more and hopefully make use of it in the future. :mrgreen:

User avatar
TheyCallMeTim13
Posts: 34
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 1

Re: Beginner Help Needed

Post by TheyCallMeTim13 » Sat Mar 04, 2017 3:49 am

DaSpamer wrote:
Sat Mar 04, 2017 2:34 am

Some quick method to create a dir (Silently).

Code: Select all

YOURPATH = "%APPDATA%\\blah"
shellExecute('cmd.exe', '/c mkdir "' .. YOURPATH .. '"', nil, false);
Thank you been kinda trying to do that, with lua.

User avatar
++METHOS
Posts: 106
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 8

Re: Beginner Help Needed

Post by ++METHOS » Sat Mar 04, 2017 3:59 am

Yes. :D I skimmed over that part as soon as I saw what it was for.

Post Reply

Who is online

Users browsing this forum: Google [Bot], WarCOzes and 2 guests