Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How To Process Using a panel?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Venuine
How do I cheat?
Reputation: 0

Joined: 03 Dec 2018
Posts: 6

PostPosted: Tue Jun 25, 2019 7:08 am    Post subject: How To Process Using a panel? Reply with quote

Hi uh.. I wanna know how do you proccess a file or exe by pressing a button/panel


Capture.PNG
 Description:
 Filesize:  784 Bytes
 Viewed:  4009 Time(s)

Capture.PNG


Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Jun 25, 2019 8:17 am    Post subject: Reply with quote

The right question is 'How to add or manage events handler on an object?".

Read this:

https://forum.cheatengine.org/viewtopic.php?t=607338&sid=1363b273b26f6c288fd5b6e35a5fdf20

So then,
your event = process a file (what process you want?. Open, delete, copy, or whatever)
your object = button/panel
the handler = what you want to do (onClick, onMouseEnter, onMouseLeave, onKeyDown, onKeyUp, onClose and many others)
the handler you want = by/when pressing the object = onClick or onKeyDown
the command = function(s) or any command need/must do by the handler

Example:

Code:
-- the event
local myevent = shellExecute("C:/myexefile.exe")

-- the command
function process_my_file()
 myevent()
end

-- the object and the handler
mypanel.onClick = process_my_file

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1253

PostPosted: Tue Jun 25, 2019 8:37 am    Post subject: Reply with quote

Look, this is fun. Smile
Panel Click event function.


Code:
local form = createForm(true) --UDF1
form.Position = poDesktopCenter

local l1 = createLabel(form) --UDF1.CELabel1
l1.Left = 100
l1.Top = 150
l1.Font.Size = "18"
l1.visible=true
l1.Caption = "Color"

local p1 = createPanel(form) --UDF1.CEPanel1
p1.Height = 60
p1.Left = 60
p1.Top = 60
p1.Width = 200
p1.Color = '16716180'
p1.Caption = "Click me"
p1.Font.Size = "18"

p1.OnClick=function() --function CEPanel1Click(sender)
p1.Color = ((p1.Color)+100001)
l1.Caption = (p1.Color)
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Venuine
How do I cheat?
Reputation: 0

Joined: 03 Dec 2018
Posts: 6

PostPosted: Tue Jun 25, 2019 6:07 pm    Post subject: Reply with quote

I dont quite get what you are saying Corroder..

I tried the code and adjusted it a bit.

But i doesnt process or it gives me an error..

Confused?
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Jun 25, 2019 6:41 pm    Post subject: Reply with quote

Venuine wrote:

I tried the code and adjusted it a bit.

But i doesnt process or it gives me an error..

Confused?


Post your script here and if you said give an error, then at least explain what kind of error.

or if you want to inject a dll file.

Code:

load_dialog = createOpenDialog(your form name)

function pushDll()
 load_dialog.InitalDir = os.getenv('%USERPROFILE%')
 load_dialog.Filter = 'Dll files|*.DLL;*.dll|All files (*.*)|*'
 load_dialog.execute()
 local file = load_dialog.FileName
 if not file then return nil  end
 if file then injectDLL(file) end
end
mypanel.onClick = pushDll


Quote:
I dont quite get what you are saying Corroder..


I am also not good in English, then if all of these too difficult to understand, I give up.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Venuine
How do I cheat?
Reputation: 0

Joined: 03 Dec 2018
Posts: 6

PostPosted: Tue Jun 25, 2019 7:23 pm    Post subject: Reply with quote

Corroder wrote:
Venuine wrote:

I tried the code and adjusted it a bit.

But i doesnt process or it gives me an error..

Confused?


Post your script here and if you said give an error, then at least explain what kind of error.

or if you want to inject a dll file.

Code:

load_dialog = createOpenDialog(your form name)

function pushDll()
 load_dialog.InitalDir = os.getenv('%USERPROFILE%')
 load_dialog.Filter = 'Dll files|*.DLL;*.dll|All files (*.*)|*'
 load_dialog.execute()
 local file = load_dialog.FileName
 if not file then return nil  end
 if file then injectDLL(file) end
end
mypanel.onClick = pushDll


Quote:
I dont quite get what you are saying Corroder..


I am also not good in English, then if all of these too difficult to understand, I give up.



Capture.PNG
 Description:
 Filesize:  14.35 KB
 Viewed:  3955 Time(s)

Capture.PNG


Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Jun 25, 2019 7:47 pm    Post subject: Reply with quote

Seem you made your form using FORM DESIGNER.

Code:
local open = io.open

local function read_file(path)
    local file = open(path, "rb")
    if not file then return nil end
    local content = file:read "*a"
    file:close()
    return content
end

function CEPanel29Click(sender)
    local fileContent = read_file("C:/Test.txt")
    print(fileContent)
end

UDF1.CEPanel29.onClick = CEPanel29Click


You forgot this line:

Code:
CEPanel29.onClick = CEPanel29Click


Must be:

Code:
UDF1.CEPanel29.onClick = CEPanel29Click

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Venuine
How do I cheat?
Reputation: 0

Joined: 03 Dec 2018
Posts: 6

PostPosted: Tue Jun 25, 2019 9:39 pm    Post subject: Reply with quote

Corroder wrote:
Seem you made your form using FORM DESIGNER.

Code:
local open = io.open

local function read_file(path)
    local file = open(path, "rb")
    if not file then return nil end
    local content = file:read "*a"
    file:close()
    return content
end

function CEPanel29Click(sender)
    local fileContent = read_file("C:/Test.txt")
    print(fileContent)
end

UDF1.CEPanel29.onClick = CEPanel29Click


You forgot this line:

Code:
CEPanel29.onClick = CEPanel29Click


Must be:

Code:
UDF1.CEPanel29.onClick = CEPanel29Click


i did this and it shows whats inside the txt file.

But i wanna know how to process it??? it doesnt process it only shows the print output
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Jun 25, 2019 9:57 pm    Post subject: Reply with quote

Ii give up
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Tue Jun 25, 2019 10:33 pm    Post subject: Reply with quote

what do you mean by 'process a file'

do you mean openFileAsProcess(filename,is64bit) ?

_________________
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
View user's profile Send private message MSN Messenger
Venuine
How do I cheat?
Reputation: 0

Joined: 03 Dec 2018
Posts: 6

PostPosted: Tue Jun 25, 2019 10:37 pm    Post subject: Reply with quote

Dark Byte wrote:
what do you mean by 'process a file'

do you mean openFileAsProcess(filename,is64bit) ?


Like in cheat engine you process first a program so u can do something with it.

i wanna know how do i do that using a panel/button
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Jun 25, 2019 11:23 pm    Post subject: Reply with quote

function openpro()
openProcess('blablabla.exe')
end

UDF1.CEPanel29.onClick = openpro

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1253

PostPosted: Wed Jun 26, 2019 6:12 am    Post subject: Reply with quote

Venuine wrote:


i did this and it shows whats inside the txt file.

But i wanna know how to process it??? it doesnt process it only shows the print output


Maybe to understand the question you're asking.
Watch the video below:
Trainer: Creates a txt file,
opens the txt file,
allows you to write and save text in a file.
allows you to reopen and edit the recorded file.

https://www.youtube.com/watch?v=fMCg7ni5UEU&list=PL1yPHiegVpRoWx7jy6ecTqmbejos75O37&index=92


Is that one of these?

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites