Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --mode = "SuccessesOnly"
- --mode = "LeftDelayRight"
- --mode = "RightJump"
- mode = "DuckRun"
- console.writeline("Starting StairClip")
- noInput = 0;
- startDuck = 0
- holdDuck = 0
- startJump = 0
- runLeft = 0
- noInput = 0
- if mode == "SuccessesOnly" then
- end
- if mode == "LeftDelayRight" then
- LeftMin = 10;
- LeftMax = 30;
- DelayMin = 0;
- DelayMax = 10;
- runLeft = LeftMin - 1;
- noInput = DelayMin;
- end
- if mode == "RightJump" then
- StartJumpMin = 50
- StartJumpMax = 80
- startJump = StartJumpMin-1
- end
- if mode == "DuckRun" then
- --[[
- StartDuckMin = 0
- StartDuckMax = 30
- HoldDuckMin = 1
- HoldDuckMax = 10
- ]]
- StartDuckMin = 0
- StartDuckMax = 1
- HoldDuckMin = 1
- HoldDuckMax = 50
- startDuck = StartDuckMin-1
- holdDuck = HoldDuckMin
- end
- --[[
- LeftMin=10
- LeftMax=11
- JumpMin=20
- JumpMax=70
- ]]--
- idx = 0;
- successes = {
- {10, 5},
- {24, 7},
- {13, 5},
- {11, 6},
- {18, 6},
- {18, 5},
- {22, 2},
- {23, 7},
- {28, 5},
- {27, 3},
- {10, 6},
- {28, 3},
- {11, 3},
- {15, 3},
- {24, 0},
- {25, 0},
- {17, 3},
- {16, 4},
- {21, 4},
- {20, 5},
- {19, 0},
- }
- function onFrame()
- frame = frame + 1;
- buttons = joypad.get();
- buttons["P1 Left"] = false
- buttons["P1 Right"] = false
- buttons["P1 Down"] = false
- buttons["P1 A"] = false
- buttons["P1 Y"] = true
- vx = memory.read_s8(0x7B);
- vy = memory.read_s8(0x7D);
- x = memory.read_u16_le(0x94);
- y = memory.read_u16_le(0x96);
- xsub = memory.readbyte(0x13DA)/16;
- ysub = memory.readbyte(0x13DC)/16;
- if frame == runLeft+noInput+1 then
- startV = vx;
- startXSub = xsub
- startFrame = frame
- end
- if frame >= startJump then
- buttons["P1 A"] = true
- gui.drawText(10, 34, "A");
- end
- if frame >= startDuck and frame < startDuck+holdDuck then
- buttons["P1 Down"] = true
- gui.drawText(10, 16, "Down")
- end
- if frame <= runLeft then
- buttons["P1 Left"] = true;
- gui.drawText(10, 50, "Left");
- elseif frame > runLeft + noInput then
- buttons["P1 Right"] = true;
- gui.drawText(10, 50, "Right");
- end
- gui.drawText(10, 66, "Left " .. runLeft)
- gui.drawText(10, 82, "Delay " .. noInput)
- gui.drawText(10, 98, "Jump " .. startJump)
- gui.drawText(10, 114, "Duck " .. startDuck)
- gui.drawText(10, 130, "HoldDuck " .. holdDuck)
- if vy == -20 and y > 230 and not displayed then
- console.writeline("Left " .. runLeft .. " Delay " .. noInput .. " Jump " .. startJump .. " Duck " .. startDuck .. " HoldDuck " .. holdDuck .. " clips at (" .. x .. "," .. y .. ") frame " .. frame);
- displayed = true;
- end
- if frame > 170 then
- initializeAttempt();
- end
- joypad.set(buttons);
- end
- function initializeAttempt()
- savestate.load("EnterDSH.State");
- frame = 0;
- if mode == "SuccessesOnly" then
- idx = idx + 1
- attempt = successes[idx];
- if attempt ~= nil then
- runLeft = attempt[1];
- noInput = attempt[2];
- else
- client.pause();
- end
- end
- if mode == "LeftDelayRight" then
- runLeft = runLeft+1;
- if runLeft == LeftMax then
- runLeft = LeftMin
- noInput = noInput+1
- if noInput == DelayMax then
- client.pause();
- end
- end
- end
- if mode == "RightJump" then
- startJump = startJump + 1
- if startJump == StartJumpMax then
- client.pause();
- end
- end
- if mode == "DuckRun" then
- startDuck = startDuck+1
- if startDuck == StartDuckMax then
- startDuck = StartDuckMin
- holdDuck = holdDuck + 1
- if holdDuck == HoldDuckMax then
- client.pause()
- end
- end
- end
- displayed = false;
- end
- initializeAttempt();
- while true do
- onFrame();
- emu.frameadvance();
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement