## Search found 295 matches

15 Oct 2019, 07:31
Topic: PostMessage MAKEWPARAM 5 param
Replies: 1
Views: 263

### PostMessage MAKEWPARAM 5 param

Try to do this: Code:

Code: Select all

``````WPARAM wParam = MAKEWPARAM(MK_LBUTTON, MK_RBUTTON, VK_SHIFT, VK_CONTROL, MK_MBUTTON);
PostMessage(hWnd, WM_MOUSEMOVE, wParam, MAKELPARAM(0, 0));
``````
Get this: Anybody know how to fix it?
11 Apr 2018, 14:27
Topic: Easy Questions about expressions Topic is solved
Replies: 8
Views: 1988

### Re: Easy Questions about expressions Topic is solved

How to reduce the expression?

Code: Select all

``````if(p = 1 and p = 2){
...
}
``````

Code: Select all

``````while 1{
if (A_index = 1,5){ ; if a_index = 1 or a_index = 5

MsgBox, % A_index ;want 1 then 5 dont work
}
}
``````
06 Apr 2018, 02:31
Replies: 1
Views: 596

Plz help. I have array with coordinates. Array := [] Array[1,1] := 4844.2578125000 ;x Array[1,2] := 4740.5839843750 ;y Array[2,1] := 4905.8173828125 ;x Array[2,2] := 4721.2353515625 ;y Array[3,1] := 4860.1962890625 ;x Array[3,2] := 4724.5092773438 ;y Array[4,1] := 4893.0820312500 ;x Array[4,2] := 47...
04 Apr 2018, 06:11
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Re: Question about Coord System Topic is solved

It's a little different than what you showed, but thank you so much for the idea. Need AngleBetween * Direction. 01 Apr 2018, 09:54
Topic: How to expresison on sting Topic is solved
Replies: 4
Views: 1264

### Re: How to expresison on sting Topic is solved

Renz wrote:Try this

Code: Select all

``(result := (3.324 - 0.624) * 180 / Pi) > 180 ? result *= -1:""``
wrong
01 Apr 2018, 09:22
Topic: How to expresison on sting Topic is solved
Replies: 4
Views: 1264

### How to expresison on sting Topic is solved

How to do one line:

Code: Select all

``````result = (3.324 - 0.624) * 180 / Pi
IF result > 180
result *= -1
``````
Dont work

Code: Select all

``````result := (3.324 - 0.624) * 180 / Pi > 180 ? *-1 : *1
``````
01 Apr 2018, 00:39
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Re: Question about Coord System Topic is solved

if I'd seen this before and I'd have understood. This is easy, like 2+2 31 Mar 2018, 08:06
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Re: Question about Coord System Topic is solved

After you adjusted your diagram, your question will be as simple as: To rotate from currentAngle to desiredAngle, which way is shorter - turning right (clockwise = math neg) or turning left (from 0 towards 90, anti-clockwise, math pos)? Answer: ; use standard math Direction := +1 ; math pos = anti-...
31 Mar 2018, 03:38
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Re: Question about Coord System Topic is solved

Please check the following angles: 0 degrees (= 0 radians) and 90 degrees (= Pi/2 radians). You will find that points on the x-axis like {x: 5, y: 0) have an angle of 0 degrees. You will also find that points on the y-axis like {x: 0, y: 5} or {x: 0, y: -5} have an angle of +/-90 degrees. Next: adj...
31 Mar 2018, 01:48
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Re: Question about Coord System Topic is solved

Try with numbers from other quadrant also, Like dx=-3 and dy=+3 for example. Compare two points which both lie on the diagonal with slope of -1: (Angle in degrees = -45 or 135) ATan() goes between +90 and -90, and you seem to prefer 135 as result if possible, as far as I understand you. ; point in ...
30 Mar 2018, 16:40
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Re: Question about Coord System Topic is solved

Look for this pattern: ATan(dy / dx) and replace with this: ATan2(dy, dx). Same result. If I misunderstood what is dx dy then I'm sorry, geometry I have trouble. dy := 5.2 dx := 7.9 MsgBox % ATan(dy / dx) ;0.582138 MsgBox % ATan2(dy, dx) ;0.582138 ATan2(y, x) { ; ATan() with correct sign static PI ...
30 Mar 2018, 15:11
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Re: Question about Coord System Topic is solved

The problem lies within using the ATan() function, It does not do what you hope it to do. ATan() gives back value between -Pi/2 and +Pi/2. You need a function like ATan2() to get back a range from -Pi to +Pi. Check Wikipedia . ATan2(y, x) { ; ATan() with correct sign static PI := 4 * ATan(1) If (x ...
30 Mar 2018, 14:00
Topic: How to do ? -1 : 1 Topic is solved
Replies: 4
Views: 1272

### Re: How to do ? -1 : 1 Topic is solved

jeeswg wrote:Like this?

Code: Select all

``````camRec3 := maxCamG / (2 * Pi) * (Atan((Y2 - Y1) / (X2 - X1)) + 3 * Pi / 2) - (X1 < X2 ? Pi : 0)
``````
Thx
30 Mar 2018, 12:57
Topic: Question about Coord System Topic is solved
Replies: 12
Views: 2657

### Question about Coord System Topic is solved

Hi I recently asked a question on the forum about how to get value1? https://autohotkey.com/boards/viewtopic.php?f=5&t=46216 https://i.imgur.com/n7axO2b.png Pi := 4 * Atan(1) ;3.14 maxCam := 4 * Atan(1) * 2 ;6.28 value1 := maxCam / (2 * Pi) * (Atan((Y2 - Y1) / (X2 - X1)) + 3 * Pi / 2) - (X1 < X2 ? -...
30 Mar 2018, 11:57
Topic: How to do ? -1 : 1 Topic is solved
Replies: 4
Views: 1272

### How to do ? -1 : 1 Topic is solved

Hi how to do this expression one line. if (X1 < X2 ) { camRec3 := maxCamG / (2 * Pi) * (Atan((Y2 - Y1) / (X2 - X1)) + 3 * Pi / 2) - Pi }else{ camRec3 := maxCamG / (2 * Pi) * (Atan((Y2 - Y1) / (X2 - X1)) + 3 * Pi / 2) } dont work :( camRec3 := maxCamG / (2 * Pi) * (Atan((Y2 - Y1) / (X2 - X1)) + 3 * P...
29 Mar 2018, 08:10
Topic: The question is not on topic Topic is solved
Replies: 7
Views: 1882

### Re: The question is not on topic Topic is solved

So it sounds like you need to find the angle between 5,10 and 20,20. Then you need to translate that geometric angle into the in-game camera angle -- this part we'd need details on. There are two different angles you may be working with. It depends on where the origin is. In Autohotkey using ImageS...
28 Mar 2018, 04:47
Topic: The question is not on topic Topic is solved
Replies: 7
Views: 1882

### Re: The question is not on topic Topic is solved

Code: Select all

``````Random, var, 0, 255
MsgBox %var%
``````
Or do you mean you want to know the Asc value of the character ? -- question mark?

Code: Select all

``````MsgBox % Asc("?")
Send {ASC 63}
``````
27 Mar 2018, 16:43
Topic: The question is not on topic Topic is solved
Replies: 7
Views: 1882

### Re: The question is not on topic Topic is solved

If something is not clear I can explain more details what I need.
27 Mar 2018, 15:24
Topic: The question is not on topic Topic is solved
Replies: 7
Views: 1882

### The question is not on topic Topic is solved

Hi. My question is not quite on topic, but I'm sure that someone can help me. Someone who is well versed in geometry. I tried to draw as clear as possible. The question is what is equal to "?" from 0 to 255. I need a formula to calculate, can be directly in AHK code. If there's not enough data to ca...
24 Mar 2018, 06:20