User File #23813469500312316

Upload All User Files

#23813469500312316 (unlisted) - Crash Bandicoot Huge Adventure - lua v2.1.4-beta - Virtual Boy Advance

CrashGBA - v2.1.4-beta VBA.lua
40 downloads
Uploaded 6/30/2015 10:16 AM by Spikestuff (see all 269)
-- Crash Huge Adventure lua v2.1.4-beta Virtual Boy Advance
-- This is Community Work Please Help
-- Join in add updates of your own and add your name

-- Values found by: Spikestuff, Got4n, Dica
-- Script Edited by: Spikestuff, Ilari, Dica, TASEditor, RGamma, Warepire

auto = 0
x_pos = 0
y_pos = 0
x_pos_bonus = 0
y_pos_bonus = 0

while true do
area = memory.readbyte(0x3001644)
areab = memory.readbyte(0x200000E)
mask = memory.readbyte(0x200009C)
lvl = memory.readbyte(0x200000E)
ex = memory.readbyte(0x2003AB8)

x_pos_prev = x_pos
y_pos_prev = y_pos
x_pos = memory.readlong(0x2010A14)
y_pos = memory.readlong(0x2010A18)
x_speed = x_pos - x_pos_prev
y_speed = y_pos - y_pos_prev
real_speed = math.sqrt(x_speed*x_speed + y_speed*y_speed) -- do not trust during jumps!

x_pos_prev_bonus = x_pos_bonus
y_pos_prev_bonus = y_pos_bonus
x_pos_bonus = memory.readlong(0x2010E2C)
y_pos_bonus = memory.readlong(0x2010E30)
x_speed_bonus = x_pos_bonus - x_pos_prev_bonus
y_speed_bonus = y_pos_bonus - y_pos_prev_bonus
real_speed_bonus = math.sqrt(x_speed_bonus*x_speed_bonus + y_speed_bonus*y_speed_bonus) -- do not trust during jumps!

if ex > 0 and ex <= 3 or area == 1 or area == 5 or area == 8 or area == 9 or area == 11 or area == 13 or area == 14 or area == 15 or area == 17 then
	auto = 0
else
	if input.get()["i"] or input.get()["I"] then
		auto = 1
	else if input.get()["o"] or input.get()["O"] then
		auto = 0
end end end

if auto == 1 then -- Automatic Slide Spin Script. Still needs to be worked on.
	if area ~= 6 then -- Normal
		gui.text(2,24,"Automatic Mode","yellow")
		if  x_speed >= 100 and memory.readwordsigned(0x2010DDC) == 0 and y_speed == 0 then
			joypad.set(1,{right = true, R = true})
		end
		if x_speed < 800 and x_speed > 700 then
			joypad.set(1,{right = true, B = true});
		end

		if  x_speed <= -100 and memory.readwordsigned(0x2010DDC) == 0 and y_speed == 0 then
			joypad.set(1,{left = true, R = true})
		end
		if x_speed > -800 and x_speed < -700 then
			joypad.set(1,{left = true, B = true});
		end
	else -- Bonus Round
		gui.text(2,24,"Automatic Mode","orange")
		if  x_speed_bonus >= 100 and memory.readwordsigned(0x20111F4) == 0 and y_speed_bonus == 0 then
			joypad.set(1,{right = true, R = true})
		end
		if x_speed_bonus < 800 and x_speed_bonus > 700 then
			joypad.set(1,{right = true, B = true});
		end

		if  x_speed_bonus <= -100 and memory.readwordsigned(0x20111F4) == 0 and y_speed_bonus == 0 then
			joypad.set(1,{left = true, R = true})
		end
		if x_speed_bonus > -800 and x_speed_bonus < -700 then
			joypad.set(1,{left = true, B = true});
		end end	
end

if area == 11 or area == 13 or area == 14 or area == 15 or area == 16 or area == 17 then else
	if area == 5 or area == 9 then
			gui.text(2,32,memory.readwordsigned(0x3003F34),"orange")
		else
	if area == 2 and areab == 3 or area == 18 then
			gui.text(2,120,memory.readwordsigned(0x3001404),"yellow")
		else
			gui.text(2,120,memory.readwordsigned(0x300082C),"yellow")
end end end

if area == 9 then  -- N.Gin Fight
	bhealth = memory.readbyte(0x3004130)
	thealth = memory.readbyte(0x30040B0)
	lhealth = memory.readshort(0x30041B0)
	rhealth = memory.readshort(0x3004230)
	if bhealth ~= 255 and bhealth ~= -1 then
		gui.text(18,48,"Bomb: " .. (bhealth+1)/2) end
	if lhealth ~= 0 or rhealth ~= 0 then
		gui.text(6,56,"Rockets: " .. (lhealth/2) .. "/" .. (rhealth/2)) end
	if thealth ~= 255 and thealth ~= -1 then
		gui.text(10,64,"Turret: " .. (thealth+1)/2) end
end

if area == 8 then -- Dingodile Fight
	dshi = memory.readbyte(0x2003EFC)
	gui.text(2,24,"Shield: " .. ((dshi == 1) and "ON" or "OFF")); else
end

if area == 7 then -- Tiny Fight
	tatt = memory.readbyte(0x2011FDC)
	gui.text(2,24,"Can Hit: " .. ((tatt == 8) and "YES - " .. memory.readbyte(0x02011FF4) or "NO")); else
end

if area == 16 then
	slide_count = 0
	aku = memory.readbyte(0x200009C)
	gui.text(2,9,"Mask Level: " .. aku,"yellow") else
end

if area == 2 and areab == 3 then else
	if area == 11 or area == 13 or area == 14 or area == 15 or area == 16 or area == 17 then else
		if area == 6 then --Bonus
			gui.text(2,32,"Pixel X: " .. x_pos_bonus)
			gui.text(2,40,"Pixel Y: " .. y_pos_bonus)
			gui.text(2,48,"Speed X: " .. x_speed_bonus)
			gui.text(2,56,"Speed Y: " .. y_speed_bonus)
			gui.text(2,64,"RealSpd: " .. real_speed_bonus)
			gui.text(2,128,"Slide Time: 22/" .. memory.readwordsigned(0x20111F4),"orange")
			gui.text(2,136," Spin Time: 23/" .. memory.readwordsigned(0x20111F4),"orange")
		else
		if area == 5 or area == 9 then -- Flying Cooldown
			cdwn = memory.readbyte(0x30014E0)-1
			if cdwn ~= -1 then
				gui.text(2,40,"Cooldown: " .. cdwn)
			end
		else
		if area == 10 then -- Neo Cortex and Mega Mix
			gui.box(0,142,240,160,"black")
			gui.text(116,143,"Pixel X: " .. x_pos)
			gui.text(116,151,"Pixel Y: " .. y_pos)
			gui.text(188,143,"Speed X: " .. x_speed)
			gui.text(188,151,"Speed Y: " .. y_speed)
			gui.text(128,134,"Slide: 22| " .. memory.readwordsigned(0x2010DDC).. " |23 :Spin","yellow")
			gui.text(2,134,"Real Speed: " .. real_speed)
		else -- Normal
			gui.text(2,32,"Pixel X: " .. x_pos)
			gui.text(2,40,"Pixel Y: " .. y_pos)
			gui.text(2,48,"Speed X: " .. x_speed)
			gui.text(2,56,"Speed Y: " .. y_speed)
			gui.text(2,64,"RealSpd: " .. real_speed)
			if area == 1 or area == 8 then
				gui.text(2,136," Spin Dur.: 24/" .. memory.readwordsigned(0x2010DDC),"green")
			else
				gui.text(2,128,"Slide Time: 22/" .. memory.readwordsigned(0x2010DDC),"yellow")
				gui.text(2,136," Spin Time: 23/" .. memory.readwordsigned(0x2010DDC),"yellow") end
end end end end end

if movie.active()==false then
	gui.drawbox(0,0,78,8, "red")
	gui.text(2,1, "MOVIE NOT RECORDING")
	else gui.text(2,1,"RR: " .. movie.rerecordcount())
end

vba.frameadvance() end