Possible to have perfect 180 script without having to adjust each game?

Ask gaming related questions (AHK v1.1 and older)
User avatar
Fren
Posts: 4
Joined: 01 Dec 2022, 16:41

Possible to have perfect 180 script without having to adjust each game?

Post by Fren » 07 Dec 2022, 16:15

What would be the best way to have a 180 degree instant turn, not granular/gradual mouse movement, in increments, but just instantly turn around. Is there some easy quick way to get it right?

User avatar
boiler
Posts: 16923
Joined: 21 Dec 2014, 02:44

Re: Possible to have perfect 180 script without having to adjust each game?

Post by boiler » 07 Dec 2022, 16:27

Are you able to turn 180 degrees instantly when you are playing a game? If not, how would a script be able to do it if you are not able to do it yourself? Even if a script was able to turn very quickly by performing incremental turns in rapid succession so it seemed almost instant, how could it know when it is facing 180 degrees from where it started in any game, let alone be able to know that know that no matter what the game is?

These are the kinds of questions you have to be able to answer before being able to create a script to do these things. The answer is very likely that it cannot be done unless you knew exactly how many incremental turns it took to perform a 180 degree turn for each game and have the script perform whatever is required by knowing what game it is playing and act accordingly.

User avatar
Fren
Posts: 4
Joined: 01 Dec 2022, 16:41

Re: Possible to have perfect 180 script without having to adjust each game?

Post by Fren » 09 Dec 2022, 04:15

@boiler

Hey, so this script turns without increments, but it is not exactly 180 degrees and it hinges on mouse sensitivity in os / mouse software and mouse software in game. I thought maybe there existed something which grabs a pixel, spins very very incrementally you in 360 then generates a script based on this, based on what you want to do, dynamically with some sliders and checkboxes.

Code: Select all

SendMode Input   
SetWorkingDir %A_ScriptDir%  


;Settings
;============
;===============================
sens:=1
zoomsens:=1

;Binds
;============
;==============================
;Key Bind
key_Terminate:="hotkey"

;Sens
;==========
;=============================
;Don't touch, only if you know what this does.
modifier:=2.52/sens
modifierr:=2.600/sens
modifiers:=2.52/sens
amodifier:=2/sens
modifierz:=1.9/sens

;Script
;========
;============================
;180 Turnaround If you want to change the hotkey: Change (F3::)
Hotkey2::
Hotkey, *~$v, Toggle
SoundPlay, %A_ScriptDir%\11.mp3
return
*~$v::
DllCall("mouse_event", "UInt", 0x01, "UInt", 660*modifiers, "UInt", 0)
return

hotkey3::ExitApp
return
As it is I have to play around with the sensitivity, and the turn number/modifier to get it exactly 180 degrees, or at least with the modifier which here is at 660. You set it then you hold the hotkey to spam it so you see if it starts spinning, it is not perfect 180.


[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

Post Reply

Return to “Gaming Help (v1)”