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 


lua hotkey wont work

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Mon Sep 21, 2015 10:33 am    Post subject: lua hotkey wont work Reply with quote

ay
tried to use this code to hotkey my address to change the value to 1 when i press f7 but the hotkey wont work
Code:
function LUApasser()
if isKeyPressed(VK_F7) then
LUAsetone = 1
local LUA = readInteger("server.CreateInterface+302140")
writeInteger("server.CreateInterface+302140, server.CreateInterface+302140",LUAsetone)
end
end

help?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Sep 21, 2015 11:22 am    Post subject: Reply with quote

is LUApasser called constantly using a timer or a thread in an infinite loop? Otherwise, this won't do much

try using createHotkey instead

_________________
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
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Sep 21, 2015 11:26 am    Post subject: Reply with quote

I don't believe writeInteger will accept a comma delimited list of addresses either.
If you want to change two addresses, make two separate writeInteger calls.
...although, both of the ones you listed are the same address
Back to top
View user's profile Send private message
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Mon Sep 21, 2015 2:55 pm    Post subject: Reply with quote

Dark Byte wrote:
is LUApasser called constantly using a timer or a thread in an infinite loop? Otherwise, this won't do much

try using createHotkey instead

yea.. i forgot about the timer but its still wont work
Code:
timer = createTimer(nil,true)
timer_setInterval(timer,100)
function LUApasser()
if isKeyPressed(VK_F7) then
LUAsetone = 1
local LUA = readInteger("server.CreateInterface+302140")
writeInteger("server.CreateInterface+302140, server.CreateInterface+302140",LUAsetone)
end
end
timer_onTimer(timer,LUApasser)
timer_setEnabled(t, true)


i tried to use createHotkey, but its wont work too
when i add the hotkey its always says something about access error
but whats funny about it, when i press f8(my hotkey) in cheat engine its working. when i save my trainer as .exe its wont work



bullshit.png
 Description:
error
 Filesize:  924.51 KB
 Viewed:  13708 Time(s)

bullshit.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Sep 21, 2015 5:03 pm    Post subject: Reply with quote

You are mixing several things together

First off, there is an f8 hotkey in the list. That's only possible with cheat table entries with such a hotkey, so why use a lua script like that? (if you delete the entry afterwards you'll get an access violation yes)

That writeInteger line is just wrong and won't work.

And don't save your trainer as hl2.exe , if you do that your trainer won't work

_________________
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
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Mon Sep 21, 2015 5:28 pm    Post subject: Reply with quote

Dark Byte wrote:
You are mixing several things together

First off, there is an f8 hotkey in the list. That's only possible with cheat table entries with such a hotkey, so why use a lua script like that? (if you delete the entry afterwards you'll get an access violation yes)

That writeInteger line is just wrong and won't work.

And don't save your trainer as hl2.exe , if you do that your trainer won't work

no i posted the screenshot just to show you what happened when i use the add hokey button
and hl2.exe is the game that i want to use my trainer for
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Mon Sep 21, 2015 5:51 pm    Post subject: Reply with quote

... and don't save it as that or the trainer won't work because it'll search for "hl2.exe" and it searches starting with the most recently-run programs.

So it'll find itself, not the game.

_________________
Back to top
View user's profile Send private message
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Mon Sep 21, 2015 5:58 pm    Post subject: Reply with quote

Rydian wrote:
... and don't save it as that or the trainer won't work because it'll search for "hl2.exe" and it searches starting with the most recently-run programs.

So it'll find itself, not the game.


i mean i dont get it if i will not use hl2.exe so the trainer will not get attached to the game or i have to open the game first and then the trainer
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Mon Sep 21, 2015 7:11 pm    Post subject: This post has 1 review(s) Reply with quote

He means don't name the trainer itself "hl2.exe" when you save it.
_________________
Back to top
View user's profile Send private message
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Mon Sep 21, 2015 7:27 pm    Post subject: Reply with quote

Rydian wrote:
He means don't name the trainer itself "hl2.exe" when you save it.

huh? i dont, i never saved it as hl2.exe
Dark Byte imma try again in the morning to use createHotkey(fac , hotkey) as you said
Back to top
View user's profile Send private message
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Tue Sep 22, 2015 9:32 am    Post subject: Reply with quote

i dont know if im fag or what but when i press my hotkey im getting"Error:attempt to call a nil value"
Code:
createHotkey(LUApasser , VK_F7)

timer = createTimer(nil,true)
timer_setInterval(timer,100)
function LUApasser()
local LUA = readInteger("server.CreateInterface+302140")
writeInteger("server.CreateInterface+302140", 1)
end
timer_onTimer(timer,LUApasser)
timer_setEnabled(t, true)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Tue Sep 22, 2015 9:59 am    Post subject: Reply with quote

call createHotkey after defining the function, not before
_________________
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
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Tue Sep 22, 2015 12:31 pm    Post subject: Reply with quote

Dark Byte wrote:
call createHotkey after defining the function, not before

thanks bro i got it, its working
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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