pydirectinput icon indicating copy to clipboard operation
pydirectinput copied to clipboard

Can't do 360s in game. Hits the border and stops spinning

Open Cazzola01 opened this issue 4 years ago • 1 comments

The left Fortnite game border is located at x position 1921. When the mouse has come to that position the rotation just stops. When I use my normal mouse I can continue spinning, even is the x position also is 1920.

with pydirectinput https://user-images.githubusercontent.com/42636768/103135357-0e227c80-46b8-11eb-8cce-5da913315780.mp4

with my mouse https://user-images.githubusercontent.com/42636768/103135363-21354c80-46b8-11eb-9a7d-1e8c7e0dd08b.mp4

`import mouse import time import pydirectinput import pyautogui

pydirectinput.PAUSE = 0

while True: move_amount = (-100, 0) pydirectinput.move(move_amount[0], move_amount[1]) print(pydirectinput.position()) time.sleep(1)

`

Cazzola01 avatar Dec 25 '20 12:12 Cazzola01

By default, the move function moves the cursor to the given coordinates on the screen. Since the screen is only x*y big, you cannot move beyond that.

Instead, just set the relative flag for the move function like so:

import mouse
import time
import pydirectinput
import pyautogui

pydirectinput.PAUSE = 0

while True:
    move_amount = (-100, 0)
    pydirectinput.move(move_amount[0], move_amount[1], relative=True)
    print(pydirectinput.position())
    time.sleep(1)

P.S.: If you are building a spinbot, get ready to be banned real fast. ;)

cetteup avatar Feb 02 '21 17:02 cetteup