Advertisement
Chdata

Untitled

Oct 15th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. #SingleInstance, Force
  2. SetMouseDelay, 1
  3. CoordMode, Mouse, Screen
  4. Esc::
  5. Click up
  6. Reload
  7. Return
  8.  
  9. ;((i * 2) + 2 + i)
  10.  
  11. 9::
  12. MouseGetPos, xcenter, ycenter
  13. BlockInput MouseMove
  14.  
  15. Skip:=1
  16. Nxt:=Skip + 1
  17. Pnt:=(2 * Skip) + 2 + Skip
  18.  
  19. ;This evaluates to Nxt as 2 and Pnt as 5, a 5 pointed star
  20. ;Problem: It doesn't seem to work out for the code below
  21. ;If I replace Nxt with the actual number 2 and Pnt with 5, it draws a five pointed star correctly
  22. ;With Nxt/Pnt, it just moves to the right and draws a dot then stops
  23. ;The MsgBox below confirms the evaluations do go out to 2 and 5
  24. ;What's wrong?
  25.  
  26. ;MsgBox, 0x00, Input Log, Nxt: %Nxt%`nPnt: %Pnt%
  27.  
  28. Theta:=0 ;I forget if I really have to initialize this
  29.  
  30. x:=50*Cos(Theta) ;50 pixel radius
  31. y:=50*Sin(Theta)
  32. mx:=Round(xcenter+x)
  33. my:=Round(ycenter+y)
  34. MouseMove, mx, my
  35. Theta+=(Nxt * (360 / Pnt)) * (3.14159265 / 180) ;Nxt (while it's 2) says we skip to the second point when connecting the dots instead of the one next to it, which would just give us a pentagon
  36.  
  37. Click down
  38. Loop, Pnt ;x points to connect (In this case, 5 for a 5 pointed star)
  39. {
  40. x:=50*Cos(Theta) ;50 pixel radius
  41. y:=50*Sin(Theta)
  42. mx:=Round(xcenter+x)
  43. my:=Round(ycenter+y)
  44. MouseMove, mx, my
  45. Theta+=(Nxt * (360 / Pnt)) * (3.14159265 / 180)
  46. }
  47. Click up
  48.  
  49. MouseMove, xcenter, ycenter
  50. BlockInput MouseMoveOff
  51. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement