Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- currentIndex = 1
- maxIndex = 30
- firstSpawnIndex = 0x02153A1A
- indexOffset = 0xD0
- -- Custom commands
- local lastInput = {}
- function executeCustomCommands()
- local Input = input.get()
- if Input.F and not lastInput.F then
- increaseIndex()
- -- if you reached an illegal index, continue increasing it
- -- stop at 1 in any case to prevent an endless loop
- local loopCounter = maxIndex
- while loopCounter > 0 and controlSpawnByte(getIndexAddr(currentIndex)) == false do
- increaseIndex()
- loopCounter = loopCounter - 1
- end
- -- Print a notice for the user
- print("New index = " .. currentIndex)
- end
- if Input.D and not lastInput.D then
- print("Number of spawned enemies: " .. countEnemies())
- end
- lastInput = Input
- end
- function countEnemies()
- local counter = 0
- local i = 1
- while i <= maxIndex do
- if controlSpawnByte2(getIndexAddr(i)) then
- counter = counter + 1
- end
- i = i + 1
- end
- return counter
- end
- function increaseIndex()
- currentIndex = currentIndex + 1
- if currentIndex > maxIndex then
- currentIndex = 1
- end
- end
- function getIndexAddr(index)
- return firstSpawnIndex + (index - 1) * indexOffset
- end
- function controlSpawnByte(spawnByte)
- local value = memory.readbyte(spawnByte)
- return value ~= 0
- end
- function controlSpawnByte2(spawnByte)
- local value = memory.readbyte(spawnByte)
- return value == 5 or value == 0x17 or value == 7 or value == 4
- end
- function drawEnemyInfo(spawnByte)
- local spawnValue = memory.readbyte(spawnByte)
- if controlSpawnByte(spawnByte) then
- addr1 = spawnByte - 0x10
- value1 = memory.readbyte(addr1)
- addr2 = spawnByte - 0xF
- value2 = memory.readbyte(addr2)
- addr3 = spawnByte - 0xA
- value3 = memory.readbyte(addr3)
- status = spawnByte - 0x8
- value4 = memory.readbyte(status)
- AI = spawnByte - 0x6
- value5 = memory.readbyte(AI)
- addr6 = spawnByte - 0x4
- value6 = memory.readbyte(addr6)
- addr7 = spawnByte - 0x3
- value7 = memory.readbyte(addr7)
- spawn4 = spawnByte - 0x2
- value8 = memory.readdword(spawn4)
- changeCrash = spawnByte + 0x1
- value9 = memory.readbyte(changeCrash)
- addr10 = spawnByte + 0x10
- value10 = memory.readbyte(addr10)
- addr11 = spawnByte + 0x11
- value11 = memory.readbyte(addr11)
- X = spawnByte + 0x42
- value12 = memory.readdwordsigned(X)
- Y = spawnByte + 0x46
- value13 = memory.readdwordsigned(Y)
- Xspeed = spawnByte + 0x4A
- value14 = memory.readdwordsigned(Xspeed)
- Yspeed = spawnByte + 0x4E
- value15 = memory.readdwordsigned(Yspeed)
- health = spawnByte + 0x90
- value16 = memory.readbyte(health)
- home = spawnByte + 0xA6
- value17 = memory.readdword(home)
- addr18 = spawnByte + 0xAE
- value18 = memory.readbyte(addr18)
- addr19 = spawnByte + 0xB2
- value19 = memory.readbyte(addr19)
- gui.text(1, 1, string.format ("%X", addr1) .. ": after death weird (try 0x13): " .. "0x" .. string.format ("%X", value1))
- gui.text(1, 10, string.format ("%X", addr2) .. ": RB=visibility; LB=facing: " .. "0x" .. string.format ("%X", value2))
- gui.text(1, 20, string.format ("%X", addr3) .. ": LB=huge hitbox possible: " .. "0x" .. string.format ("%X", value3))
- gui.text(1, 30, "Status: " .. value4)
- gui.text(1, 40, "AI: " .. value5)
- gui.text(1, 50, "Animation wait timer: " .. value6)
- gui.text(1, 60, string.format ("%X", spawn4) .. ": Spawn 4 bytes: " .. "0x" .. string.format ("%X", value8), "#00FF00")
- gui.text(1, 70, "If changed, crashes: " .. value9)
- gui.text(1, 80, string.format ("%X", addr10) .. ": " .. value10)
- gui.text(1, 90, string.format ("%X", addr11) .. ": " .. value11)
- gui.text(1, 100, string.format ("%X", X) .. ": X: " .. value12, "#00FF00")
- gui.text(1, 110, string.format ("%X", Y) .. ": Y: " .. value13, "#00FF00")
- gui.text(1, 120, string.format ("%X", Xspeed) .. ": X Speed: " .. value14)
- gui.text(1, 130, string.format ("%X", Yspeed) .. ": Y Speed: " .. value15)
- gui.text(1, 140, "Health: " .. value16, "#00FF00")
- gui.text(1, 150, "Home: " .. value17)
- gui.text(1, 160, string.format ("%X", addr18) .. ": " .. value18)
- gui.text(1, 170, string.format ("%X", addr19) .. ": " .. value19)
- gui.text(1, 180, "Spawn byte: " .. "0x" .. string.format ("%X", spawnValue))
- end
- end
- function drawGUI()
- executeCustomCommands()
- spawnByte = getIndexAddr(currentIndex)
- drawEnemyInfo(spawnByte)
- end
- gui.register(drawGUI)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement