User File #2502329683870168

Upload All User Files

#2502329683870168 - Timecop Lua script

timecop.lua
Game: Timecop ( SNES, see all files )
918 downloads
Uploaded 11/12/2012 4:11 PM by Dooty (see all 36)
Still unfinished, but seems to be the final release.
--Timecop for SNES script by Dooty
--Addresses courtesy of Omnigamer

function timecop()

------------
---Camera---
------------

local camY = memory.read_u16_le(0x0002C)
local camX = memory.read_u16_le(0x01654)
gui.text(10,450,"Camera X position: "..camX)
gui.text(10,470,"Camera Y position: "..camY)


-------------
---Player----
-------------

--todo; find out how to put spaces on the table
--some actions have the same value, try to separate them

local playerX1 = memory.read_u16_le(0x00718)
local playerX2 = memory.read_u16_le(0x0071A)
local playerY1 = memory.read_u16_le(0x0071C)
local playerY2 = memory.read_u16_le(0x0071E)
gui.text(10,410,"Player Y position: "..playerY2)
gui.text(10,430,"Player X position: "..playerX2)
local playerAction = memory.read_u8(0x7E06E1)
--gui.text(10,350,playerAction) debug

local tableAction = {
idle=0,
running=1,
walkingorturning=2,
skidding=3,
jumpingup=4,
kicking=5,
sliding=6,
jumpingforward=7,
uppercutting=8,
crouching=9,
punchingoronsub=10,
shooting=12,
shootingup=15,
jumpingkicking=16,
crouchedshooting=17,
underwater=19,
runningshooting=22,
shootingdiagonallyup=23,
shootingdiagonallydown=24,
crouchedkicking=25
}

for k,v in pairs(tableAction) do
if v == playerAction then
action = k
gui.text(10,510,"Player is "..action)
end
end

local inputBuffer = memory.read_u8(0x7E0671)
local tableBuffer = {
goright=1,
goleft=2,
crouch=4,
usebomb=32,
shoot=64,
jumpup=128,
jumpright=129,
jumpleft=130,
}

for k,v in pairs(tableBuffer) do
if v == inputBuffer then
buffer = k
gui.text(10,390,"The player will: "..buffer)
end
end

local inputReady = memory.read_u8(0x7E0674)
local rngValue = memory.read_u8(0x7E066E)
local playerHP = memory.read_u8(0x7E06F3)

gui.text(10,370,"RNG: "..rngValue)
gui.text(10,530,"Player HP: "..playerHP)
if inputReady == 00 then
condition = "No"
else condition = "Yes"
end
gui.text(10,490,"Accept input: "..condition)

-------------
---Enemies---
-------------

--todo; add the health bar of the enemies
local tankHP = memory.read_u8(0x00683)
local enemyDrop = memory.read_u8(0x7E0666)
local bossHP = memory.read_u16_le(0x7E0760)
gui.text(10,570,"Tank/General HP: "..tankHP)
gui.text(10,550,"Boss HP: "..bossHP)
if enemyDrop == 01 then
willDrop = "have an item"
else willDrop = "have nothing"
end
gui.text(10,590,"Next enemy "..willDrop)

--------------
---Hitboxes---
--------------

--todo; add hitboxes of enemies and objects
--fix the hitbox of the player on some stages

gui.drawBox(playerX1-camX*2, playerY1-camY,playerX2-camX*2, playerY2-camY,0x7D00FF00,0x3500FF00)

end

----------
---Loop---
----------

while true do
timecop()
emu.frameadvance()
end