Code:
Vector one = Read<Vector>(dwPlayer + dwVecPunch);
Sleep(50); //will calculate difference for 50 ms calls - I use around 90 ms in my AHK based on weapon RPM
Vector two = Read<Vector>(dwPlayer + dwVecPunch);
Vector diff;
diff.x = (one.x - two.x) * 2.f; //also you gotta multiply by two because of the recoil scale
diff.y = (one.y - two.y) * -2.f; //will throw negative values which is good since you compensate the other way
y = diff.x / (m_yaw * sensitivity * windows_sens_modifier); //by default m_yaw is 0.022, use 1 for sensitivity as you can scale the pattern later on very well, windows_sens_modifier is 1 for middle mouse sens value in control panel (6/11)
x = diff.y / (m_yaw * sensitivity * windows_sens_modifier); //y is actually x coordinate since in csgo, x is pitch (up and down)
std::cout << "x difference: " << x << "y difference: " << y << "\n";
mouse_event(MOUSEEVENTF_MOVE, x, y, 0, 0);
The code above is to record relative mouse movement for recoil script(made by pean153) when I was lurking on the UC (I don't know if it's ok to call other forum on here)
I'm trying to find the variable for weapons in CSGO and other games but i don't know the language in which the code is written, is it C#?
I have asked Pean but he didn't answer so i hope someone who's kind enough to answer. Thank you