 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
damento Newbie cheater
Reputation: 0
Joined: 25 Mar 2014 Posts: 17
|
Posted: Mon Jan 04, 2016 4:59 pm Post subject: How to add an image to trainer? ( for a button ) |
|
|
I'm trying to add images to my trainer, and use onClick so I can use them as a button.
I have tried everything, I've read the main.lua docs and tried things from there, tried reading wiki and several threads here.
How can I do this? I've attached the image to the program in the Add files, and compiled it, but it's not working?
Here's the most recent thing I have tried:
Code: |
bmenuattach = createImage(MAXGUI[1])
image_loadImageFromFile(bmenuattach, [attach.png])
control_setPosition(bmenuattach, 20, 110)
|
and also tried this, taking something from another thread,
Code: |
bmenuattach = createImage(MAXGUI[1])
image_loadImageFromFile(bmenuattach, [attach.png])
control_setPosition(bmenuattach, 20, 110)
local p = image_getPicture(bmenuattach)
local s = findTableFile('attach.png');
picture_loadFromStream(p,s);
|
I've spent all day on this now, and I can't get it working - maybe I'm being stupid, is anyone able to help?
While anyone looks at this, I also have another side question -
Is it possible to integrate some kind of chat into my trainer, whether I use some kind of iframe to show a php chat I have on my website, or some other way?
Thanks to any help anyone can give
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Mon Jan 04, 2016 5:08 pm Post subject: |
|
|
the second one shoukd work although it's extremely outdated (not even using classes)
is MAXGUI a table where element 1 is your form?
is the form visible?
does the image show?
you can make it open a browser window with chat
alternatively you could write your own chat implementation using tbe internet class object and use a timer to refresh the chat you show in a memo
_________________
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
Last edited by Dark Byte on Mon Jan 04, 2016 5:13 pm; edited 1 time in total |
|
Back to top |
|
 |
damento Newbie cheater
Reputation: 0
Joined: 25 Mar 2014 Posts: 17
|
Posted: Mon Jan 04, 2016 5:12 pm Post subject: |
|
|
Here is the code for my program - and no, the image does not show it just produces an error.
Code: |
showMessage("LOADED \nTESTING...")
----------------------------------------- VARIABLES -----------------------------------------
title= "TEST"
white= "0x0052D6E9"
black= "0x00000000"
red= "0x00000FFF"
green= "0x0000FF00"
Dark= "0x0052D6E9"
list= "0x00CA59C7"
----------------------------------------- MAIN GUI-----------------------------------------
MAXGUI = {}
MAXGUI[1] = createForm(false)
-----------------------------------------MAIN WINDOW PROPERTIES-----------------------------------------
MAXGUI = {}
MAXGUI[1] = createForm(false)
setProperty(MAXGUI[1] , "color", black)
setProperty(MAXGUI[1] , "ShowInTaskBar", 'stAlways')
setProperty(MAXGUI[1] , "Position", "poScreenCenter")
setProperty(MAXGUI[1] , "BiDiMode", "bdLeftToRight")
control_setSize(MAXGUI[1], 736, 549)
x,y = control_getSize(MAXGUI[1])
control_setCaption(MAXGUI[1], title.." ")
function CloseTrainer()
form_hide(MAXGUI[1])
closeCE()
end
form_show(MAXGUI[1])
form_onClose(MAXGUI[1], CloseTrainer)
-----------------------------------------GLOBAL FUNCTIONS-----------------------------------------
function CloseTrainer()
form_hide(MAXGUI[1])
closeCE()
end
-----------------------------------------IMAGING-----------------------------------------
----------------------------------------BACKGROUND
function attachBackground(wc,tblFile)
local p = createPicture()
p.loadFromStream(findTableFile(tblFile).Stream)
wc.OnPaint = function(sender)
local c = sender.getCanvas()
local bitmap = p.getBitmap()
c.draw(0,0,bitmap)
end
end
attachBackground(MAXGUI[1] ,[[abg.png]])
----------------------------------------ATTACH BUTTON
bmenuattach = createImage(MAXGUI[1])
image_loadImageFromFile(bmenuattach, [attach.png])
control_setPosition(bmenuattach, 20, 110)
local p = image_getPicture(bmenuattach)
local s = findTableFile('attach.png');
picture_loadFromStream(p,s);
function attachClickk()
showMessage("ATTACH BUTTON CLICKED FROM BOTTOM MENU")
end
|
I literally cannot get this working for the life of me!
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Mon Jan 04, 2016 6:06 pm Post subject: |
|
|
Code: |
showMessage("LOADED \nTESTING...")
----------------------------------------- VARIABLES -----------------------------------------
title= "TEST"
white= "0x0052D6E9"
black= "0x00000000"
red= "0x00000FFF"
green= "0x0000FF00"
Dark= "0x0052D6E9"
list= "0x00CA59C7"
----------------------------------------- MAIN GUI-----------------------------------------
MAXGUI = {}
MAXGUI[1] = createForm(false)
-----------------------------------------MAIN WINDOW PROPERTIES-----------------------------------------
MAXGUI = {}
MAXGUI[1] = createForm(false)
setProperty(MAXGUI[1] , "color", black)
setProperty(MAXGUI[1] , "ShowInTaskBar", 'stAlways')
setProperty(MAXGUI[1] , "Position", "poScreenCenter")
setProperty(MAXGUI[1] , "BiDiMode", "bdLeftToRight")
control_setSize(MAXGUI[1], 736, 549)
x,y = control_getSize(MAXGUI[1])
control_setCaption(MAXGUI[1], title.." ")
function CloseTrainer()
form_hide(MAXGUI[1])
closeCE()
end
form_show(MAXGUI[1])
form_onClose(MAXGUI[1], CloseTrainer)
-----------------------------------------GLOBAL FUNCTIONS-----------------------------------------
function CloseTrainer()
form_hide(MAXGUI[1])
closeCE()
end
-----------------------------------------IMAGING-----------------------------------------
----------------------------------------BACKGROUND
function attachBackground(wc,tblFile)
local p = createPicture()
p.loadFromStream(findTableFile(tblFile).Stream)
wc.OnPaint = function(sender)
local c = sender.getCanvas()
local bitmap = p.getBitmap()
c.draw(0,0,bitmap)
end
end
attachBackground(MAXGUI[1] ,[[abg.png]])
----------------------------------------ATTACH BUTTON
bmenuattach = createImage(MAXGUI[1])
bmenuattach.Stretch=true
bmenuattach.setPosition(20,110)
local s = findTableFile('attach.png').stream;
bmenuattach.Picture.loadFromStream(s)
bmenuattach.OnClick=function(s)
showMessage("Clicked")
end
function attachClickk()
showMessage("ATTACH BUTTON CLICKED FROM BOTTOM MENU")
end
|
Description: |
|
 Download |
Filename: |
example.ct |
Filesize: |
50.11 KB |
Downloaded: |
798 Time(s) |
_________________
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 |
|
 |
damento Newbie cheater
Reputation: 0
Joined: 25 Mar 2014 Posts: 17
|
Posted: Mon Jan 04, 2016 6:19 pm Post subject: |
|
|
Great, I appreciate this so much, thank you VERY much for helping me with this
Can I suggest, maybe a developers section? Where people can request a developer/good coder can help/do things with/for them?
I'd 100% pay for a few little projects to be done, however I'm going to put all my time into learning Lua so I don't need to bother anyone for help aha.
Thanks again.
|
|
Back to top |
|
 |
Fluffer_Nutter Advanced Cheater
Reputation: 0
Joined: 26 Feb 2015 Posts: 67
|
Posted: Mon Jan 04, 2016 6:50 pm Post subject: |
|
|
You can also do it all without using Lua to attach the pictures. This is just a second way of doing it. I prefer to write the code out but is also something to know. This way is done under the "Create Form".
Description: |
|
 Download |
Filename: |
damento.CT |
Filesize: |
48.4 KB |
Downloaded: |
781 Time(s) |
|
|
Back to top |
|
 |
damento Newbie cheater
Reputation: 0
Joined: 25 Mar 2014 Posts: 17
|
Posted: Mon Jan 04, 2016 7:05 pm Post subject: |
|
|
Fluffer_Nutter wrote: | You can also do it all without using Lua to attach the pictures. This is just a second way of doing it. I prefer to write the code out but is also something to know. This way is done under the "Create Form". |
thanks for your, do you know much about Lua? I have a few little questions, I understand if you can't help, I'm trying my hardest to learn and putting lots of time in anyway.
Thanks again pal
|
|
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
|
|