Advertisement
Guest User

Untitled

a guest
May 5th, 2017
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance Force
  2. #Persistent
  3. #NoEnv
  4. SetWorkingDir %A_ScriptDir%
  5. SendMode Input
  6. SetKeyDelay 0
  7. SetMouseDelay 0
  8. SetTitleMatchMode 3
  9.  
  10.  
  11. GroupAdd rotmg, % "Realm of the Mad God"
  12. GroupAdd rotmg, % "Realm of the Mad God - Google Chrome"
  13.  
  14.  
  15.  
  16.  
  17. Loop
  18. {
  19.     Process, Exist, Realm of the Mad God.exe
  20.     {
  21.         If errorLevel
  22.         {
  23.             WinSet, Style, -0x40000, ahk_class ApolloRuntimeContentWindow
  24.             WinMove, ahk_class ApolloRuntimeContentWindow,,,, 806, 629
  25.         }
  26.     }
  27.     Sleep, 5000
  28. }
  29.  
  30.  
  31.  
  32.  
  33. #IfWinActive ahk_class Chrome_WidgetWin_1
  34.  
  35. ^+a::
  36. {
  37.     Run, "C:\Users\<<USERNAME>>\Documents\Rotmg\Notepad++ Portable\Notepad++Portable.exe"
  38.     Return
  39. }
  40.  
  41. #IfWinActive
  42.  
  43.  
  44.  
  45.  
  46. #IfWinActive ahk_group rotmg
  47.  
  48. F1::
  49. {
  50.     takeScreenshot()
  51.     Return
  52. }  
  53.    
  54. F3::
  55. {
  56.     sendChat("Heal Please")
  57.     Return
  58. }
  59.  
  60. F4::
  61. {
  62.     sendChat("Thanks!")
  63.     Return
  64. }
  65.  
  66. F5::
  67. {
  68.     InputBox, tradingmsg, Trading message, Please enter a trading message:,,,,,,,,%tradingmsg%
  69.     keep_x_running = y
  70.  
  71.     Loop,
  72.     {
  73.         ifWinActive Realm of the Mad God
  74.         {
  75.             If keep_x_running = y
  76.             {
  77.                 sendChat(tradingmsg)
  78.             }
  79.             Else
  80.             {
  81.                 Return
  82.             }
  83.         }
  84.         Sleep, 1500
  85.     }
  86.     Return
  87. }
  88.  
  89. F6::
  90. {
  91.     keep_x_running = n
  92.     Return
  93. }
  94.  
  95. F7::
  96. {
  97.     sendChat("/nexustutorial")
  98.     Return
  99. }
  100.  
  101. F8::
  102. {
  103.     sendChat("/tell mreyeball password")
  104.     Return
  105. }
  106.  
  107. F9::
  108. {
  109.     sendChat("/tell mreyeball stats")
  110.     Return
  111. }
  112.  
  113. F10::
  114. {
  115.     sendChat("/tell mreyeball lefttomax")
  116.     Return
  117. }
  118.  
  119. F11::
  120. {
  121.     sendChat("/tell mreyeball mates")
  122.     Return
  123. }
  124.  
  125. F12::
  126. {
  127.     sendChat("/tell mreyeball server")
  128.     Return
  129. }
  130.  
  131. ^+S::
  132. {
  133.     Run, %A_ScriptDir%\MoveScreenshots.ahk
  134.     Return
  135. }
  136.  
  137. X::
  138. {
  139.     ;swapItem(640,420) Slot 1
  140.     ;swapItem(680,420) Slot 2
  141.     ;swapItem(720,420) Slot 3
  142.     swapItem(760,420) Slot 4
  143.     Return
  144. }
  145.  
  146.  
  147. LAlt::
  148. {
  149.     takeScreenshot()
  150.     Return
  151. }
  152.  
  153. Numpad1::
  154. {
  155.     sendChat("ready")
  156.     Return
  157. }
  158.  
  159. NumpadEnd::
  160. {
  161.     sendChat("ready")
  162.     Return
  163. }
  164.  
  165. Numpad2::
  166. {
  167.     sendChat("He lives and reigns and conquers the world")
  168.     Return
  169. }
  170.  
  171. NumpadDown::
  172. {
  173.     sendChat("He lives and reigns and conquers the world")
  174.     Return
  175. }
  176.  
  177. +WheelUp::
  178. {
  179.     Send {PgUp}
  180.     Return
  181. }
  182.  
  183. +WheelDown::
  184. {
  185.     Send {PgDn}
  186.     Return
  187. }
  188.  
  189. XButton2::
  190. {
  191.     SendInput I
  192.     Return
  193. }
  194.    
  195. XButton1::
  196. {
  197.     swapItem(640,420)
  198.     Return
  199. }
  200.  
  201. MButton::
  202. {
  203.     SendInput N
  204.     Return
  205. }
  206.  
  207. SC028::
  208. {
  209.     SendInput ae
  210.     Return
  211. }
  212.  
  213. SC027::
  214. {
  215.     SendInput oe
  216.     Return
  217. }
  218.  
  219. SC01A::
  220. {
  221.     SendInput ue
  222.     Return
  223. }
  224.  
  225. +SC028::
  226. {
  227.     SendInput AE
  228.     Return
  229. }
  230.  
  231. +SC027::
  232. {
  233.     SendInput OE
  234.     Return
  235. }
  236.  
  237. +SC01A::
  238. {
  239.     SendInput UE
  240.     Return
  241. }
  242.  
  243. SC00C::
  244. {
  245.     SendInput ss
  246.     Return
  247. }
  248.  
  249.  
  250.  
  251.  
  252. sendChat(Message)
  253. {
  254.     ClipSaved = %ClipboardAll%
  255.     ClipWait
  256.     Clipboard = %Message%
  257.     ClipWait
  258.    
  259.     Loop,
  260.         If Clipboard = %Message%
  261.         {
  262.             Blockinput, on
  263.             Send {Enter}
  264.             Send ^v
  265.             Send {Enter}
  266.             Blockinput, off
  267.             Break
  268.         }
  269.         Sleep, 100
  270.    
  271.     Clipboard = %ClipSaved%
  272.     Return
  273. }
  274.  
  275.  
  276. takeScreenshot()
  277. {
  278.     IniRead, OutputVar, %A_ScriptDir%\<<ININAME>>.ini, <<INIVAR>>, Switch
  279.    
  280.     If (%OutputVar% == 0)
  281.     {
  282.         Run, "%A_ScriptDir%\Ifran View\i_view64.exe" /capture=2 /convert=C:\Users\<<USERNAME>>\Documents\Rotmg\Screenshots\Rotmg_$U(`%Y-`%m-`%d_`%H`%M`%S) %A_TickCount%.png
  283.         Return
  284.     }
  285.     Else
  286.     {
  287.         Run, "%A_ScriptDir%\Ifran View\i_view64.exe" /capture=2 /convert=<<PATH>><<USERNAME>>\Screenshots\Rotmg_$U(`%Y-`%m-`%d_`%H`%M`%S) %A_TickCount%.png
  288.         Return
  289.     }
  290. }
  291.  
  292.  
  293. swapItem(xPos,yPos)
  294. {
  295.     MouseGetPos, mousePosX, mousePosY ; mousePosX/Y have old mouse position
  296.     WinGetPos, , , winSizeX, winSizeY, Realm of the Mad God ; winSizeX/Y have window size
  297.     BlockInput, on
  298.     CoordMode, Mouse, Relative
  299.     MouseMove, %xPos%, %yPos%
  300.     SendEvent {Control Up}
  301.     SendEvent {LButton Down}
  302.     SendEvent {LButton Up}
  303.     SendEvent {LButton Down}
  304.     SendEvent {LButton Up}
  305.     CoordMode, Mouse, Window
  306.     MouseMove, mousePosX, mousePosY
  307.     If (LB == "D") {
  308.         Send {LButton down}
  309.     }
  310.     BlockInput, off
  311.     Return
  312. }
  313.  
  314. #IfWinActive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement