View previous topic :: View next topic |
Author |
Message |
Almaftuchin Newbie cheater Reputation: 0
Joined: 01 Oct 2015 Posts: 13
|
Posted: Mon Mar 27, 2017 10:29 am Post subject: [HELP] Select Combo box list + button = open file |
|
|
Hello, i made form and add some cetrainer in cheat engine, then i want to my form functional.
For example if select trainer1 then click open button, there will open the trainer1.cetrainer file
pls fix with my CT example and Cetrainer below:
www*dropbox*com/sh/pioev8nm9zpyqra/AADX45wEjSbdUwzbqjKwuagsa?dl=1
_________________
beginner |
|
Back to top |
|
|
Almaftuchin Newbie cheater Reputation: 0
Joined: 01 Oct 2015 Posts: 13
|
Posted: Tue Mar 28, 2017 3:21 pm Post subject: |
|
|
bump
_________________
beginner |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Mar 28, 2017 5:41 pm Post subject: |
|
|
Code: | loadTable("C:\\mytable.ct") |
|
|
Back to top |
|
|
Almaftuchin Newbie cheater Reputation: 0
Joined: 01 Oct 2015 Posts: 13
|
Posted: Tue Mar 28, 2017 9:20 pm Post subject: |
|
|
Do you have download the CT file example from link above?
how to load the cetrainer from addeed file in cheat engine?
Can you fix this?
Code: | UDF1.visible = true
--- Combo box
al = combobox_getItems(UDF1.CEComboBox1)
strings_clear(al)
strings_add(al, 'Select')
strings_add(al, 'Trainer 1')
strings_add(al, 'Trainer 2')
strings_add(al, 'Trainer 3')
--- Open file
function openFile()
AttachItems = combobox_getItems(UDF1.CEComboBox1)
AttachIndex = combobox_getItemIndex(UDF1.CEComboBox1)
local check = strings_getString(AttachItems,AttachIndex)
if check == 'Select' then showMessage('Select trainer first') end
if check == 'Trainer 1' then open("trainer1.CETRAINER") end
if check == 'Trainer 2' then open("trainer2.CETRAINER") end
if check == 'Trainer 3' then open("trainer3.CETRAINER") end
end
--- On Click Event
control_onClick(UDF1.CEButton1, openFile)
--- Function button
|
Description: |
how to call cetrainer file with lua? |
|
Filesize: |
183.89 KB |
Viewed: |
10002 Time(s) |
|
_________________
beginner |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Tue Mar 28, 2017 10:54 pm Post subject: |
|
|
Code: | UDF1.visible = true
--- Combo box
al = combobox_getItems(UDF1.CEComboBox1)
ali = combobox_getItemIndex(UDF1.CEComboBox1)
strings_clear(al)
strings_add(al, 'Select')
strings_add(al, 'Trainer 1')
strings_add(al, 'Trainer 2')
strings_add(al, 'Trainer 3')
combobox_setItemIndex(UDF1.CEComboBox1, ali)
--- Open file
function openFile()
AttachItems = combobox_getItems(UDF1.CEComboBox1)
AttachIndex = combobox_getItemIndex(UDF1.CEComboBox1)
if not (AttachIndex > 0 and AttachIndex < AttachItems.Count) then
showMessage("You must select a trainer!")
return
end
check = AttachItems[AttachIndex]
if check == 'Trainer 1' then createTrainer("trainer1.CETRAINER") end
if check == 'Trainer 2' then createTrainer("trainer2.CETRAINER") end
if check == 'Trainer 3' then createTrainer("trainer3.CETRAINER") end
end
function createTrainer(filename)
filepath = os.getenv("TEMP") .. "\\" .. filename
trainer = findTableFile(filename)
trainer.saveToFile(filepath)
os.execute(filepath)
end
--- On Click Event
control_onClick(UDF1.CEButton1, openFile) |
to load file form stream file you need a function like this below, I am not sure this work since I am not testing it yet.
Code: | function loadTableCode(n2)
local t2 = findTableFile(n2)
if t2 ~= nil then
local s2 = t2.Stream
local c2 = readStringLocal(s2.Memory,s2.Size)
return c2 ~= nil and loadstring(c2)
end
end
local f2 = loadTableCode('blabla.CETRAINER')
print(type(f2))
if type(f2) == 'function' then f2() else print('not loaded') end |
or use loadString
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
Almaftuchin Newbie cheater Reputation: 0
Joined: 01 Oct 2015 Posts: 13
|
Posted: Wed Mar 29, 2017 12:39 am Post subject: |
|
|
thank you very much! working perfect!
_________________
beginner |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Wed Mar 29, 2017 1:51 am Post subject: |
|
|
this also works if you have cheat tables/cetrainers as files inside your table:
Code: |
loadTable(findTableFile(n2).Stream)
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Wed Mar 29, 2017 4:45 am Post subject: |
|
|
Dark Byte wrote: | this also works if you have cheat tables/cetrainers as files inside your table:
Code: |
loadTable(findTableFile(n2).Stream)
|
|
ah,,yes, CE have this build in function already... since 6.5.1 ?
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
|