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 


[Q] Lua Hotkey error

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

Joined: 04 Dec 2011
Posts: 27

PostPosted: Mon Jan 15, 2018 9:24 am    Post subject: [Q] Lua Hotkey error Reply with quote

I Made a Lua script

'Execute Script' Button click is normally execute.
But, press NUMPAD 1 key is print error message as follow.

"Error:attempt to call a nil value"

script is as follow

Code:

function bossHP2()
local valA = 825789067226893
--local valB = 1806639338777377
ms=createMemScan()
memscan_firstScan(ms, soExactValue, vtQword, rtRounded, valA, "", 0x0000000001200000, 0x7fffffffffffffff, "", fsmAligned, 4, false, false, false, true) --change the last true to false if you do not wish case sensitivity
memscan_waitTillDone(ms)
--get the result of the scans
fl=createFoundList(ms)
foundlist_initialize(fl)
local count=foundlist_getCount(fl)

if (count>0) then
local saddress=foundlist_getAddress(fl, 0) --get the first address
writeQword(saddress, 1)
else
print("No addresses found")
end

--cleanup
object_destroy(fl)
object_destroy(ms)
end

createHotkey(bossHP2(),VK_NUMPAD1)
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 Jan 15, 2018 9:37 am    Post subject: Reply with quote

bossHP2 instead of bossHP2()
_________________
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
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Tue Jan 16, 2018 10:26 am    Post subject: thanks Reply with quote

^^
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 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