Knowing the FOV of both hipfire and scope is crucial, MDH 0% is a multiplier based on this as a result of the formula in your first post.
So if you know both FOV's and the 360 distance for hipfire, you can calculate the correct 360 distance for the scope.
You can use the calculator for this like so:
So if you know the 360 distance for hipfire is 12 inches, the FOV is 90 Hdeg 4:3 and the scope FOV is 53 Hdeg Res (you can mix and match FOV types), the scope should be 32 inches to be MDH 0%. Note that you can't necessarily just use the sensitivity multiplier (12/32=0.375) and use it directly on the sensitivity value like in this example. A lot of games do not scale linearly like this.
Regarding scripts, here's an example that binds to the back side-button on most G mice:
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
for i = 0, 99 do
MoveMouseRelative(10,0)
Sleep(2)
end
end
end
What this does is to move the mouse 10 counts to the right (MoveMouseRelative(10,0)) 100 times (for i = 0, 99 do) with a 2 ms delay between each report (Sleep(2)).
The script is only able to send a count size of maximum 127 counts.