 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
gamjadory Cheater
Reputation: 0
Joined: 04 Dec 2011 Posts: 27
|
Posted: Sat Mar 05, 2016 10:30 pm Post subject: Hotkey register error |
|
|
Code: |
createHotkey(bossHP,VK_NUMPAD1)
function bossHP()
ms=createMemScan()
memscan_firstScan(ms, soExactValue, vtQword, rtRounded, 2660989938529320, "", 0x0000000000200000, 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)
for i = 0, count -1 do
local saddress=foundlist_getAddress(fl, i)
writeQword(saddress, 1)
end
else
end
object_destroy(fl)
object_destroy(ms)
end
|
debug is "Error:attempt to call a nil value"
if not register hotkey = no error
why print error message?
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sat Mar 05, 2016 11:11 pm Post subject: |
|
|
Follow the directions in your other post?
|
|
Back to top |
|
 |
gamjadory Cheater
Reputation: 0
Joined: 04 Dec 2011 Posts: 27
|
Posted: Sun Mar 06, 2016 5:58 am Post subject: |
|
|
Zanzer wrote: | Follow the directions in your other post? |
Kinky do not want as answers.
If I did not bother to reply to my post.
Be just do not like, Pass. OK?
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Mar 06, 2016 6:32 am Post subject: |
|
|
Code: | function bossHP()
ms=createMemScan()
memscan_firstScan(ms, soExactValue, vtQword, rtRounded, 2660989938529320, "", 0x0000000000200000, 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)
for i = 0, count -1 do
local saddress=foundlist_getAddress(fl, i)
writeQword(saddress, 1)
end
else
end
object_destroy(fl)
object_destroy(ms)
end
createHotkey(bossHP,VK_NUMPAD1) |
or
Code: | createHotkey("bossHP" , VK_NUMPAD1)
function bossHP()
ms=createMemScan()
memscan_firstScan(ms, soExactValue, vtQword, rtRounded, 2660989938529320, "", 0x0000000000200000, 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)
for i = 0, count -1 do
local saddress=foundlist_getAddress(fl, i)
writeQword(saddress, 1)
end
else
end
object_destroy(fl)
object_destroy(ms)
end |
or
Code: | createHotkey(function ()
ms=createMemScan()
memscan_firstScan(ms, soExactValue, vtQword, rtRounded, 2660989938529320, "", 0x0000000000200000, 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)
for i = 0, count -1 do
local saddress=foundlist_getAddress(fl, i)
writeQword(saddress, 1)
end
else
end
object_destroy(fl)
object_destroy(ms)
end ,VK_NUMPAD1) |
Note:
Executing your script few times will create few objects with the same key combination - you press NUMPAD1 once and function is executed few times.
It is better to keep those objects in Lua variables. That is:
Code: | variable = createHotkey(func, VK_NUMPAD1) |
And check if it already exist, so:
Code: | if variable==nil then variable = createHotkey(func, VK_NUMPAD1) end |
Summary:
Code: | function bossHP()
ms=createMemScan()
memscan_firstScan(ms, soExactValue, vtQword, rtRounded, 2660989938529320, "", 0x0000000000200000, 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)
for i = 0, count -1 do
local saddress=foundlist_getAddress(fl, i)
writeQword(saddress, 1)
end
else
end
object_destroy(fl)
object_destroy(ms)
end
if bossHPhotkey==nil then bossHPhotkey = createHotkey(bossHP,VK_NUMPAD1) end |
_________________
|
|
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
|
|