Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Fix move_camera method#167

Open
OSRS-B0b wants to merge 8 commits intokelltom:mainfrom
OSRS-B0b:fix_move_camera
Open

Fix move_camera method#167
OSRS-B0b wants to merge 8 commits intokelltom:mainfrom
OSRS-B0b:fix_move_camera

Conversation

@OSRS-B0b
Copy link

@OSRS-B0b OSRS-B0b commented May 14, 2023

Issue: When calling move_camera and passing vertical=0 or horizontal=0 the camera will still move slightly in that direction

Steps to reproduce: run this code in an OSRSBot main_loop method

while True:
    time.sleep(1)
    self.move_camera(vertical=10)

Root cause: Even though the direction is passed as 0, move_camera still presses the key down and then up - it just sleeps for 0 seconds.

Solution: Don't call keypress when one direction = 0. (There is already logic that handles the case when both are 0.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments