User File #23580756880692663

Upload All User Files

#23580756880692663 (unlisted) - The Combatribes Lua script

ctribe.lua
24 downloads
Uploaded 6/19/2015 10:45 PM by Dooty (see all 36)
Pretty unrefined, but it was somewhat useful for the first stage.
--The Combatribes (US) - Arcade - Written by Dooty

print("The Combatribes (US): Player Input and Enemy Health")

function ctribe()
gui.clearuncommitted()

EnemyHealth = {
ene1 = memory.readbyte(0x0001C0359),
ene2 = memory.readbyte(0x0001C0419),
ene3 = memory.readbyte(0x0001C04D9),
ene4 = memory.readbyte(0x0001C0599),
ene5 = memory.readbyte(0x0001C0659)
}

for k,v in pairs(EnemyHealth) do
	if v ~= 0 then
 if k == "ene1" then enh,env,enm = 5,55,"Enemy 1: "..v; end
 if k == "ene2" then enh,env,enm = 5,65,"Enemy 2: "..v; end
 if k == "ene3" then enh,env,enm = 5,75,"Enemy 3: "..v; end
 if k == "ene4" then enh,env,enm = 5,85,"Enemy 4: "..v; end
 if k == "ene5" then enh,env,enm = 5,95,"Enemy 5: "..v; end

gui.text(enh, env, enm)
	end
end

PlayerInput = joypad.get()
	for k,v in pairs(PlayerInput) do
		if v == true then
 if k == "P1 Right" then inp,hor,ver = ">",55,230; end
 if k == "P1 Left" then inp,hor,ver = "<",45,230; end
 if k == "P1 Up" then inp,hor,ver = "^",50,230; end
 if k == "P1 Down" then inp,hor,ver = "v",60,230; end
 if k == "P1 Fire 1" then inp,hor,ver = "P",65,230; end
 if k == "P1 Fire 2" then inp,hor,ver = "K",70,230; end
 if k == "Coin 1" then inp,hor,ver = "C",75,230; end
 if k == "Start 1" then inp,hor,ver = "S",80,230; end
 if k == "P2 Right" then inp,hor,ver = ">",55,220; end
 if k == "P2 Left" then inp,hor,ver = "<",45,220; end
 if k == "P2 Up" then inp,hor,ver = "^",50,220; end
 if k == "P2 Down" then inp,hor,ver = "v",60,220; end
 if k == "P2 Fire 1" then inp,hor,ver = "P",65,220; end
 if k == "P2 Fire 2" then inp,hor,ver = "K",70,220; end
 if k == "Coin 2" then inp,hor,ver = "C",75,220; end
 if k == "Start 2" then inp,hor,ver = "S",80,220; end
 if k == "P3 Right" then inp,hor,ver = ">",55,210; end
 if k == "P3 Left" then inp,hor,ver = "<",45,210; end
 if k == "P3 Up" then inp,hor,ver = "^",50,210; end
 if k == "P3 Down" then inp,hor,ver = "v",60,210; end
 if k == "P3 Fire 1" then inp,hor,ver = "P",65,210; end
 if k == "P3 Fire 2" then inp,hor,ver = "K",70,210; end
 if k == "Start 3" then inp,hor,ver = "S",80,210; end
 if ver == 230 then gui.text(5, ver, "Player 1:"); end
 if ver == 220 then gui.text(5, ver, "Player 2:"); end
 if ver == 210 then gui.text(5, ver, "Player 3:"); end
gui.text(hor,ver, inp)

		end
	end
end
gui.register(ctribe)