i got that, thanks. but my if clause is never entered. why?
Download speed.luaLanguage: lua
local count = 0
local timer
while true do
local status= memory.readbyte(0x7E1B03)
table = joypad.get(1)
if (status == 1) then
count = count + 1 --This is to force if when stage entered.
if (count == 1) then
timer = emu.framecount() + 60 --Increments timer to 60 more than frame count on stafe entrance
end
if (timer == emu.framecount()) then
if table.Y then
if table.right then
memory.writeword(0x7E0E8B, 3)
memory.writeword(0x7E0E8D, 2000)
elseif table.left then
memory.writeword(0x7E0E8B, -3)
memory.writeword(0x7E0E8D, -2000)
end
else
if table.right then
memory.writeword(0x7E0E8B, 2)
elseif table.left then
memory.writeword(0x7E0E8B, -2)
end
end
end
count = 0
end
emu.frameadvance()
end
-edit: i hate notepad++. it is formatted right when i send it
im guessing tabs arent counted?
---edit:i added this code towards the end, replacing count = 0
elseif status == 0 then
count = 0
end
but it doesnt solve my problem
-----edit: I SOLVED IT!!!
Download speed.luaLanguage: lua
local count = 0
local timer
local setup
while true do
local status= memory.readbyte(0x7E1B03)
table = joypad.get(1)
if (status == 1) then
count = count + 1 --This is to force if when stage entered.
if (count == 1) then
timer = emu.framecount() + 60 --Increments timer to 60 more than frame count on stafe entrance
end
if timer == emu.framecount() then
setup = 1
end
if (setup == 1) then
if table.Y then
if table.right then
memory.writeword(0x7E0E8B, 3)
memory.writeword(0x7E0E8D, 2000)
elseif table.left then
memory.writeword(0x7E0E8B, -3)
memory.writeword(0x7E0E8D, -2000)
end
else
if table.right then
memory.writeword(0x7E0E8B, 2)
elseif table.left then
memory.writeword(0x7E0E8B, -2)
end
end
end
count = 5
elseif status == 0 then
count = 0
setup = 0
end
emu.frameadvance()
end