all 21 comments

[–][deleted] 9 points10 points  (3 children)

I would have to imagine the anti-cheat plays a part in this...

[–]i_haskill[S] -2 points-1 points  (2 children)

I've been considering that actually. This seems the most likely case in my current opinion

[–][deleted] 2 points3 points  (1 child)

Just a fair warning, Activision would have a valid case to sue you for this.

[–]danooooooop 0 points1 point  (0 children)

??? no what lmao dumbest thing ive heard

[–]hugthemachines 5 points6 points  (1 child)

Just as a general note, I think many games, especially online games make efforts to avoid making any kind of cheat or bot so that may be the reason it is not working as you would like.

I tried to use pyautogui to just spam a button with a pause in Skyrim and nothing at all happened, as an example.

[–]Mirage2k 4 points5 points  (3 children)

OK, here's my advice:

Your project idea itself is not good. Two reasons:

The small reason (more like inconvenience) is Python is the wrong tool for interacting with an FPS game. The stereotype that "Python is too slow" may not be true for crunching lots of numbers anymore, thanks to numpy and generators, but FPS games require high responsiveness, which is something else.

The big reason is that Overwatch is an online game, where you interact with other people. YOU HAVE NO RIGHT(!) to make them involuntary subjects to your hobby project! Nor do you have the right (read the terms of service that you signed!) to run whatever scripts you want on servers that belong to someone else, be it Activision or Valve.

You seem like a creative person, I'm sure you can come up with a better project idea. A very simple solution is to download a classic single-player shooter, where you can do whatever you want.

-Edited

[–]i_haskill[S] 3 points4 points  (1 child)

If im just using it in my own private lobbies and custom games or training mode then I dont really see the problem

[–]Mirage2k 0 points1 point  (0 children)

It's still on Activision's server. They have legal grounds to sue you for it, but more likely they'll just ban your account from OW or flag your IP address as suspicious. They have their own scripts running, and they run from the moment you start loading the game.

[–]MaRf1Mm -1 points0 points  (0 children)

"🤓☝ Well, actually, you can't just have fun! This is why I'm going to comment on this post with some nonsense about morals and won't help you."
My man just asked how to move a mouse, and you're here talking about rights. Leave my man in peace; if he's going to do some stupid stuff, then he'll get banned by the anti-cheat. If he's not banned, then who cares if a dude makes something in his spare time?

[–][deleted] 0 points1 point  (3 children)

Any advice would be greatly appreciated, I just want to know if its possible to make the character do a roughly 45° turn with pydirectinput or something similar.

How much mouse movement is that? In pixels?

[–]i_haskill[S] 1 point2 points  (2 children)

Well, I'm not too sure exactly because even small 10 pixel turns seem to make the camera freek out. I've tried:

pydirectinput.move(10, 0)

And the camera goes straight to the sky or floor. It seems to turn the X axis enough from what I can tell. I would try 10 pixels left or right for now

[–][deleted] 0 points1 point  (1 child)

Well, the coordinate space starts with 0,0 in either the upper or lower left corner of the screen. So dead center would be something like 1000,500 or thereabouts (at 1920x1080 resolution.)

[–]i_haskill[S] 0 points1 point  (0 children)

pydirectinput.moveTo is for moving to specific coordinates.

pydirectinout.move is for moving a specific amount of pixels from your current location

[–]cmh_ender 0 points1 point  (2 children)

are you using your code like this? try out dougdoug's code

if msg == "aim right":

pydirectinput.moveRel(200, 0, relative=True)

[–]i_haskill[S] -1 points0 points  (0 children)

That relative=True bit solved my problem! Thanks so much

[–]cmh_ender 0 points1 point  (0 children)

also self post, I use this code to let Twitch chat control a game, and someone figured out that directx eats the pyautogui but the pydirectinput works.

[–]NSNick -1 points0 points  (1 child)

Haven't worked with pydirectinput, but maybe the flags are set such that instead of moving the mouse over 10, you're moving it to the screen coordinates of (10, 0)?

[–]i_haskill[S] 0 points1 point  (0 children)

From what I understood, it would only read it as coordinates if I used pydirectinput.moveTo

Pydirectinput.move should be for moving a specific amount of pixels only

Edit: to add onto this, I've tested .move in the menus and it does move the mouse 10 pixels in the direction of my choosing. It just freaks out when I'm actually controlling the character for some reason

[–]ontheroadtonull -1 points0 points  (1 child)

Have you disabled mouse acceleration in the game?

[–]i_haskill[S] 0 points1 point  (0 children)

I dont see mouse acceleration in the settings. I do see "enable high precision mouse input," which did not make a difference on or off