-- 11 - / steep slope
-- 12 - \ steep slope
-- 14 - / slight slope
-- 15 - \ slight slope
-- find nearest slope
xPos = math.floor(memory.readword(0x300125A) / 64)
yPos = math.floor(memory.readword(0x300125C) / 64)
width = memory.readbyte(0x3000090)
clipStart = 0x2026000 + (yPos * width + xPos) * 2
slope = 0
offset = 0
while offset < 8 do
for i=-2,2,2 do
local clip = memory.readword(clipStart + (i * width) + offset)
if clip == 0x11 or clip == 0x12 or clip == 0x14 or clip == 0x15 then
slope = clip
break
end
end
if slope ~= 0 then
break
end
offset = -1 * offset
if offset >= 0 then
offset = offset + 2
end
end
-- exit program if slope not found
if slope == 0 then
vba.print("No slope detected")
return
end
-- get direction
dir1 = nil
dir2 = nil
if slope == 0x11 or slope == 0x14 then
dir1 = 1 -- / slope
else
dir2 = 1 -- \ slope
end
-- get necessary position
xClip = (xPos + (offset / 2)) * 64 + 31
if dir2 == 1 then
xClip = xClip + 1
end
-- move to position
xPos = memory.readword(0x300125A)
while xPos ~= xClip do
if xPos < xClip then
joypad.set(1, {right=1})
vba.frameadvance()
else
joypad.set(1, {left=1})
vba.frameadvance()
end
xPos = memory.readword(0x300125A)
end
-- set facing direction
vba.frameadvance()
joypad.set(1, {left=dir1, right=dir2})
vba.frameadvance()
-- lay bomb and perform clip
joypad.set(1, {B=1})
for i=0,66 do
vba.frameadvance()
end
joypad.set(1, {up=1})
vba.frameadvance()
joypad.set(1, {A=1})
vba.frameadvance()
joypad.set(1, {A=1})
vba.frameadvance()
joypad.set(1, {down=1})
vba.frameadvance()
vba.frameadvance()
joypad.set(1, {down=1})
vba.frameadvance()
vba.frameadvance()
vba.frameadvance()
vba.frameadvance()
joypad.set(1, {left=dir1, right=dir2})
vba.frameadvance()
joypad.set(1, {left=dir1, right=dir2})
vba.frameadvance()
for i=0,3 do
joypad.set(1, {left=dir2, right=dir1})
vba.frameadvance()
end
joypad.set(1, {up=1})
vba.frameadvance()
joypad.set(1, {A=1})
vba.frameadvance()
vba.pause()
This script will automatically do the slope clip for you. Use it when you're morphed and storing a shinespark while on the slope. Try to position samus in the middle of the block, otherwise it might not work. The script needs a more reliable way of finding the clip location.
Edit: Fixed the script. It will now reliably find the nearest slope within a few blocks.