[Lua] Edit Pos KillList

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
local memory = require 'memory'
local ffi = require 'ffi'
local function moveKillList(x, y)
-- x
memory.setuint8(sampGetBase() + 0x66668, 0xB8, true)
memory.setuint32(sampGetBase() + 0x66669, math.floor(x), true)
-- y
memory.setuint8(sampGetBase() + 0x66655, 0xB8, true)
memory.setuint32(sampGetBase() + 0x66656, math.floor(y), true)
end
local function resetKillList()
-- x
local protect = memory.unprotect(sampGetBase() + 0x66655, 5)
memory.hex2bin('E88AF60400', sampGetBase() + 0x66655, 5)
memory.protect(sampGetBase() + 0x66655, 5, protect)
-- y
protect = memory.unprotect(sampGetBase() + 0x66668, 5)
memory.hex2bin('E877F60400', sampGetBase() + 0x66668, 5)
memory.protect(sampGetBase() + 0x66668, 5, protect)
end
local killlist = false
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('epkl', function()
killlist = not killlist
end)
sampRegisterChatCommand('rpkl', resetKillList)
while true do wait(0)
if killlist then
sampToggleCursor(true)
local x, y = getCursorPos()
moveKillList(x - 100, y - 100)
if wasKeyPressed(0x1) then
killlist = false
sampToggleCursor(false)
end
end
end
end