View previous topic :: View next topic |
Author |
Message |
LisaBall How do I cheat? Reputation: 0
Joined: 05 Sep 2013 Posts: 6
|
Posted: Thu Sep 05, 2013 4:09 pm Post subject: Print varable in Hud |
|
|
First day coding and I am trying to print or at least get a visual on what my random timer variable has been set to
Code: |
---Set random time between two ranges
timer = math.random (175, 210)
-- Message on screen what the random time event was set to\
if managers.hud then
managers.hud:show_hint( { text = "Timer has been set to " .. timer } )
end
|
Any help on this would be great
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Thu Sep 05, 2013 5:42 pm Post subject: |
|
|
Here some examples, if I understood correctly what you're trying to do.
Code: | timer = math.random(175,210);
print("Timer has been set to " .. timer);
|
Code: | timer = math.random(175,210);
showMessage("Timer has been set to " .. timer);
|
Code: | f = { "Hud", "Nil", "Random..", math.random(175,210)};
f.form = createForm();
f.form.Width = 100;
f.form.Height = 30;
f.label = createLabel(f.form);
f.button = createButton(f.form);
f.form.Caption = f[1];
f.label.Caption = f[2];
f.button.Caption = f[3];
f.label.Top = 10;
f.label.Left = 5;
f.button.Top = 5;
f.button.Left = 30;
f.button.Width = 55;
f.button.OnClick = function () f.label.caption = f[4] end;
|
_________________
|
|
Back to top |
|
|
LisaBall How do I cheat? Reputation: 0
Joined: 05 Sep 2013 Posts: 6
|
Posted: Thu Sep 05, 2013 6:17 pm Post subject: |
|
|
Thank you for the reply DaSpamer,
As you can see I am setting a random number to the timer , this is used else where in the script , but as the number is going to be random I would like to get a visual view of what it has been set to. This was the reason I was trying to write a line in to the managers.hud.
This is what I am trying now
Code: |
---Set random time between two ranges
timer = math.random (175, 210)
function show_hint( msg )
if managers.hud then
managers.hud:show_hint( { text = msg } )
end
end
function show_mid_text( msg, msg_title, show_secs )
if managers.hud then
managers.hud:present_mid_text( { text = msg, title = msg_title, time = show_secs } )
end
end
show_mid_text( "Timer has been set to " .. timer .. " seconds", 2 );
|
As this is for a set game would you recommend I post it there as its using set functions of that game
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Thu Sep 05, 2013 8:02 pm Post subject: |
|
|
I though you were using your own functions, and didn't knew the C.E Lua features.
And yes, the game functions could help.
Also, doesn't the game has console? (where it can print stuff for debugging..)
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Fri Sep 06, 2013 10:27 am Post subject: |
|
|
CheatEngine has it's own Lua, game has it's own Lua.
They are separate. You can not use game's Lua functions inside CheatEngine's Lua, and you can not use CheatEngine's Lua functions inside game's Lua.
Yes, a bit confusing...
So, you can not do it the easy way...
If you want to print something on game's hud with game's Lua functions (managers.hud:show_hint) you have to "hijack" game's Lua.
This might help (or not. Because there is code injection, some manual searching, etc)
http://forum.cheatengine.org/viewtopic.php?t=564665
Which game you are trying?
_________________
|
|
Back to top |
|
|
LisaBall How do I cheat? Reputation: 0
Joined: 05 Sep 2013 Posts: 6
|
Posted: Fri Sep 06, 2013 7:52 pm Post subject: |
|
|
Thank you both for your help , mgr.inz.Player This is for the game payday2
|
|
Back to top |
|
|
|