SHARE
TWEET

Rawm2.3.7

a guest Nov 26th, 2015 247 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #Persistent
  3. #SingleInstance, force
  4. #InstallKeybdHook
  5. #UseHook
  6. SetBatchLines, -1
  7. SendMode, Input
  8.  
  9. CoordMode,Mouse,Window
  10. CoordMode,Pixel,Window
  11.  
  12. SetWorkingDir, %A_ScriptDir%
  13. OnMessage(0x201,"GuiMove")
  14.  
  15. Menu, Tray, Icon, Images\Rawm.ico
  16. Menu, Tray, Tip, Rawm v2.3.7`nMade by Wickster
  17.  
  18. Version = v2.3.7
  19. Date = 11.26.2015
  20. Credits=tidbit, Snow_Flake, Latem5, AfterLemon, Tomoe_Uehara and Cappuccino
  21.  
  22. if not A_IsAdmin
  23.     Run *RunAs "%A_ScriptFullPath%"
  24. MyToggle:=FALSE
  25.  
  26. ;=========================================================================================================================================================
  27. ;===Variables=============================================================================================================================================
  28. ;=========================================================================================================================================================
  29. ;Variables that are dependent of the Resolution
  30.  
  31.  
  32. ;Clicks Play
  33. x1 := % Round(701 / (800 / w))
  34. y1 := % Round(533 / (600 / h))
  35. ;Clicks Username
  36. x2 := % Round(188 / (1280 / w))
  37. y2 := % Round(321 / (800 / h))
  38. ;Clicks Password
  39. x3 := % Round(147 / (1280 / w))
  40. y3 := % Round(382 / (800 / h))
  41. ;Clicks Login
  42. x4 := % Round(361 / (1280 / w))
  43. y4 := % Round(426 / (800 / h))
  44. ;AutoAccept
  45. x5 := % Round(538 / (1280 / w))  
  46. y5 := % Round(447 / (800 / h))    
  47. ;Check coordinates ready to click play  
  48. x6 := % Round(690 / (800 / w))
  49. y6 := % Round(505 / (600 / h))
  50. ;Check coordinates for username  
  51. x7 := % Round(79 / (1280 / w))
  52. y7 := % Round(723 / (800 / h))
  53.  
  54. ;=================================================================================================
  55. ;===GUI1==========================================================================================
  56.  
  57.  
  58.   IfNotExist, RAWM.config
  59.   {
  60.     goto, menugui
  61.   } else
  62.   { FileReadLine, Toggle, RAWM.config, 1
  63.     FileReadLine, Max, RAWM.config, 2
  64.     FileReadLine, ExitKey, RAWM.config, 3
  65.     FileReadLine, Username1, RAWM.config, 4
  66.     FileReadLine, Password1, RAWM.config, 5
  67.     FileReadLine, Username2, RAWM.config, 6
  68.     FileReadLine, Password2, RAWM.config, 7
  69.     FileReadLine, Username3, RAWM.config, 8
  70.         FileReadLine, Password3, RAWM.config, 9
  71.         FileReadLine, Only1Account, RAWM.config, 10
  72.         FileReadLine, InstallLocation, RAWM.config, 11
  73.         FileReadLine, AutoAccept, RAWM.config, 12
  74.         FileReadLine, DeleteConfig, RAWM.config, 13
  75.     Hotkey, %Toggle%, Main
  76.     Hotkey, %ExitKey%, ButtonAbort!
  77.         Hotkey, %Max%, Max
  78.         Hotkey, %AutoAccept%, AutoAccept
  79.         Hotkey, %DeleteConfig%, DeleteConfig
  80.     goto, rightclickmenu
  81. }  
  82.  
  83. menugui:
  84.  Gui 1: -border hwndGUIHwnd
  85.   Gui 1: Add, Picture, x0 y0, Images\Gui1.png
  86.   Gui 1: Add, Text, x150 y399 cWhite -Theme 0x8000, Check this box if only 1 account
  87.   Gui 1: Add, Checkbox, x320 y400 w23 vOnly1Account
  88.   Gui 1: Add, Text, x175 y426 cWhite -Theme 0x8000, To Start / Re-Start League
  89.   Gui 1: Add, Hotkey, x320 y424 w100 h20 vToggle, F10
  90.   Gui 1: Add, Text, x80 y451 cWhite -Theme 0x8000, To Maximize League (If it opened in the corner)
  91.   Gui 1: Add, Hotkey, x320 y449  w100 h20 vMax, F11
  92.   Gui 1: Add, Text, x218 y476 cWhite -Theme 0x8000, Script Exit Hotkey
  93.   Gui 1: Add, Hotkey, x320 y474 w100 h20 vExitKey, ^!Esc
  94.   Gui 1: Add, Text, x138 y501 cWhite -Theme 0x8000, League of Legends install location:
  95.  Gui 1: Add, Edit, x320 y499 w150 h15 r1 vInstallLocation, C:\Riot Games\League of Legends\
  96.   Gui 1: Add, Text, x206 y527 cWhite -Theme 0x8000, Auto Accept Hotkey
  97.   Gui 1: Add, Hotkey, x320 y525 w100 h20 vAutoAccept, F9
  98.   Gui 1: Add, Text, x182 y553 cWhite -Theme 0x8000, Delete Config File Hotkey
  99.   Gui 1: Add, Hotkey, x320 y551 w100 h20 vDeleteConfig, ^!F5
  100.   Gui 1: Add, Text, x170 y310 cWhite -Theme 0x8000, Username:
  101.  Gui 1: Add, Edit, x230 y305 w90 h15 r1 vUsername1,
  102.   Gui 1: Add, Text, x172 y340 cWhite -Theme 0x8000, Password:
  103.  Gui 1: Add, Edit, x230 y335 w90 h15 r1 vPassword1 +Password,  
  104.   Gui 1: Add, Text, x23 y305 cWhite -Theme 0x8000, Username:
  105.  Gui 1: Add, Edit, x77 y300 w70 h15 r1 vUsername2,
  106.   Gui 1: Add, Text, x25 y335 cWhite -Theme 0x8000, Password:
  107.  Gui 1: Add, Edit, x77 y330 w70 h15 r1 vPassword2 +Password,
  108.   Gui 1: Add, Text, x344 y305 cWhite -Theme 0x8000, Username:
  109.  Gui 1: Add, Edit, x400 y300 w70 h15 r1 vUsername3,
  110.   Gui 1: Add, Text, x346 y335 cWhite -Theme 0x8000, Password:
  111.  Gui 1: Add, Edit, x400 y330 w70 h15 r1 vPassword3 +Password,  
  112.   Gui 1: Add, Button, x375 y660 w80 h25 -Theme 0x8000 gButtonDone, Done
  113.   Gui 1: Add, Button, x275 y660 w80 h25 -Theme 0x8000 gButtonAbort!, Abort!
  114.   Gui 1: Add, Button, x15 y660 w80 h25 -Theme 0x8000 gContactUs, Contact Us
  115.   Gui 1: Color, 232124
  116.   Gui 1: +LastFound +AlwaysOnTop -Caption +ToolWindow
  117.   Gui 1: Show,  w500 h700, Configgui1
  118.   GuiControl 1: +Default, Done
  119.  
  120.  
  121.  
  122. ;===Right-Click Menu==============================================================================
  123. rightclickmenu:
  124. Menu, tray, nostandard
  125. Menu, Tray, add, Menu, MENU
  126. Menu, Tray, add, List of Hotkeys, HOTKEYS
  127. Menu, tray, add, &About, ABOUT
  128. Menu, tray, add
  129. Menu, tray, add, Reload This Script, RELOAD
  130. Menu, tray, add, Pause Script, PAUSE
  131. Menu, tray, add, Exit, EXIT
  132. Menu, tray, Default, MENU
  133. Return
  134.  
  135. MENU:
  136.     Goto, menugui
  137.   Return
  138. RELOAD:
  139.     Reload
  140. Return
  141.  
  142. PAUSE:
  143.     Pause Toggle
  144. Return
  145.  
  146. EXIT:
  147.     ExitApp
  148. Return
  149.  
  150. HOTKEYS:
  151.    ;===Replace special characters in the hotkeys for the message boxes or any other user output
  152.     StringReplace, chrDeleteConfig, DeleteConfig, ^, Ctrl +%A_Space%, All
  153.     StringReplace, chrDeleteConfig, chrDeleteConfig, !, Alt +%A_Space% , All
  154.     StringReplace, chrExitKey, ExitKey, ^, Ctrl +%A_Space%, All
  155.     StringReplace, chrExitKey, chrExitKey, !, Alt +%A_Space%, All
  156.  
  157.     Msgbox,,RAWM v2.3 - Hotkeys, Delete Config File : %chrDeleteConfig%`nAuto Accept : %AutoAccept%`nScript Toggle : %Toggle%`nScript Window Maximize : %Max%`nScript Exit : %chrExitKey%`nLeague Install Location : %InstallLocation%`n
  158. return
  159.  
  160. ABOUT:
  161.  Version=v2.3
  162.   Date=03.04.2014
  163.   Credits=tidbit, Snow_Flake, Latem5, AfterLemon, Tomoe_Uehara and Cappuccino
  164.   MsgBox,, RAWM v2.3 - About, League of Legends Script RAWM v2.3 by Wickster`nVersion:  %Version%`nDate:  %Date%`nCredits: %Credits%
  165. return
  166.  
  167.  
  168. ;===Buttons=======================================================================================
  169. ContactUs:
  170.    Gui 3: -border hwndGUIHwnd
  171.     Gui 3: Add, text, xp+8 yp+25 cBlue gForumLink, http://www.autohotkey.com/board/topic/95636-rawm-v20/
  172.         Gui 3: Add, text, xp   yp+20 cBlue gEmailLink, Email us @ rawm4league@gmail.com
  173.         Gui 3: Add, Button, x160 y70 w100 h25 -Theme 0x8000 gButtonAbort!, Ok
  174.         GuiControl 3: +Default, Ok
  175.         Gui 3: +LastFound +AlwaysOnTop -Caption +ToolWindow
  176.         Gui 3: Show,  w320 h100, Configgui3
  177.         Return
  178.        
  179.        
  180. ForumLink:
  181.    Run http://www.autohotkey.com/board/topic/95636-rawm-v20/
  182.         Exitapp
  183.         Return
  184.    
  185.        
  186. EmailLink:
  187.    clipboard = rawm4league@gmail.com
  188.     msgbox,0x40000,,Email has been copied! Press Crtl+V to paste!
  189.         ExitApp
  190.         Return
  191.        
  192. ButtonAbort!:
  193.         SoundPlay, ButtonNoise.wav, wait
  194.         ExitApp
  195.         return
  196.  
  197. DeleteConfig:
  198.         SoundPlay, FileDeleteNoise.wav, wait
  199.         FileDelete, RAWM.config
  200.         ExitApp
  201.         Return
  202.  
  203. ButtonDone:
  204.  
  205.    
  206.         SoundPlay, ButtonNoise.wav, wait
  207.         Gui 1: Submit, NoHide
  208.         FileDelete, RAWM.config
  209.         FileAppend, %Toggle%`n%Max%`n%ExitKey%`n%Username1%`n%Password1%`n%Username2%`n%Password2%`n%Username3%`n%Password3%`n%Only1Account%`n%InstallLocation%`n%AutoAccept%`n%DeleteConfig%, RAWM.config
  210.         Gui 1: Destroy
  211.  
  212.    ; Msgbox,,RAWM v2.3 - Hotkeys, Delete Config File Hotkey : %chrDeleteConfig%`nAuto Accept Hotkey : %AutoAccept%`nScript Toggle Key : %Toggle%`nScript Window Maximize Key : %Max%`nScript Exit Key : %chrExitKey%`nLeague Install Location : %InstallLocation%`n
  213.     ;SoundPlay, ButtonNoise.wav, wait
  214.  
  215.         If (Only1Account=0)
  216.         { CustomColor = 444444
  217.           Gui 2: Color, %CustomColor%
  218.           WinSet, TransColor, %CustomColor% 255, Configgui2
  219.           Gui 2: Add, Picture, x0 y0 w500 h135, Images\Gui2-2.png
  220.           Gui 2: Add, Picture, x50 y20 w70 h70 gAlternate1, Images\Gui2-Alt1.png
  221.           Gui 2: Add, Picture, x210 y15 w83 h83 gMainAccount, Images\Gui2-Main.png
  222.           Gui 2: Add, Picture, x380 y20 w70 h70 gAlternate2, Images\Gui2-Alt2.png
  223.           Gui 2: Add, Picture, x480 y0 w20 h20 gCancel, Images\Cancel.png
  224.           Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
  225.           Gui 2: Show, w500 h135, Configgui2
  226.           Return
  227.         } Return
  228.  
  229. ;===Main==========================================================================================
  230.  
  231. Main:
  232.  If (Only1Account=0)
  233.   { CustomColor=444444
  234.         Gui 2: Color, %CustomColor%
  235.         WinSet, TransColor, %CustomColor% 255, Configgui2
  236.     Gui 2: Add, Picture, x0 y0 w500 h135, Images\Gui2-2.png
  237.     Gui 2: Add, Picture, x50 y20 w70 h70 gAlternate1, Images\Gui2-Alt1.png
  238.     Gui 2: Add, Picture, x210 y15 w83 h83 gMainAccount, Images\Gui2-Main.png
  239.     Gui 2: Add, Picture, x380 y20 w70 h70 gAlternate2, Images\Gui2-Alt2.png
  240.         Gui 2: Add, Picture, x480 y0 w20 h20 gCancel, Images\Cancel.png
  241.     Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
  242.     Gui 2: Show, w500 h135, Configgui2
  243.     Return
  244.   }
  245.   Login(username1,password1,InstallLocation)
  246.   return
  247.  
  248. ;===MainAccount , Alternate1 and Alternate2======================================================
  249.  
  250. Alternate1:
  251. Login(username2,password2,InstallLocation)
  252. return
  253.  
  254. Alternate2:
  255. Login(username3,password3,InstallLocation)
  256. return
  257.  
  258. MainAccount:
  259. Login(username1,password1,InstallLocation)
  260. return
  261.  
  262.   ;===Login Routine in a function===================================================================
  263.   Login(username, password, installloc)
  264.   {
  265.     global
  266.     SoundPlay, ButtonNoise.wav, wait
  267.     Gui 2: Submit, NoHide
  268.     Gui 2: Destroy
  269.   ;===Kills League of Legends=====================================================================
  270.   IfWinExist, ahk_class ApolloRuntimeContentWindow
  271.   { Runwait, taskkill /f /im LoLLauncher.exe,, Hide
  272.     sleep, 250
  273.     Runwait, taskkill /f /im LolClient.exe,, Hide
  274.     sleep, 250
  275.   } else IfWinExist, ahk_class RADSWindowClass
  276.   { Runwait, taskkill /f /im LoLLauncher.exe,, Hide
  277.     sleep, 250
  278.     Runwait, taskkill /f /im LolClient.exe,, Hide
  279.     sleep, 250
  280.   } else IfWinExist, ahk_class LOLPATCHER
  281.   { Runwait, taskkill /f /im LoLLauncher.exe,, Hide
  282.     sleep, 250
  283.     Runwait, taskkill /f /im LolClient.exe,, Hide
  284.     sleep, 250
  285.   }
  286.  
  287.   ;===Runs League of Legends======================================================================
  288.   Run, lol.launcher.exe,%installloc%
  289.   sleep, 2500
  290.  
  291.   ;===Clicks Play=================================================================================
  292.   WinWaitActive ahk_class LOLPATCHER
  293.   WinGetPos,,, w, h, A
  294.   Sleep 6000
  295.   WinActivate ahk_class LOLPATCHER
  296.   PixelGetColor, c_Play, % Round(704 / (1280 / w)), % Round(16 / (800 / h))
  297.   ; Hover color
  298.     if c_Play = 0x157FE4
  299.     {
  300.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  301.       Goto, Login
  302.     }
  303.     ; NO Hover color
  304.     else if c_Play contains 0x118
  305.     {
  306.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  307.       Goto, Login
  308.     }
  309.     else if c_Play = 0x117DDC
  310.     {
  311.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  312.       Goto, Login
  313.     }
  314.     else if c_Play = 0x0E64B0
  315.     {
  316.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  317.       Goto, Login
  318.     }
  319.   TrayTip,, It seems like that LoL is updating right now.`nPlease focus the LoL window when the update is finished to proceed.`nYou can do something else in the meantime., 17
  320.  
  321.   Loop
  322.   {
  323.     WinWaitActive ahk_class LOLPATCHER
  324.     PixelGetColor, c_Playy, % Round(704 / (1280 / w)), % Round(16 / (800 / h))
  325.     ; Hover color
  326.     if c_Playy = 0x157FE4
  327.     {
  328.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  329.       break
  330.     }
  331.     ; NO Hover color
  332.     else if c_Playy contains 0x116
  333.     {
  334.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  335.       break
  336.     }
  337.     else if c_Playy = 0x117DDC
  338.     {
  339.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  340.       break
  341.     }
  342.     else if c_Playy = 0x0E64B0
  343.     {
  344.       MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
  345.       break
  346.     }
  347.  
  348.    
  349.     PixelGetColor, c_Agree, % Round(860 / (1280 / w)), % Round(166 / (800 / h))
  350.     if c_Agree = 0x261C0B
  351.     {
  352.       MouseClick, left, % Round(514 / (1280 / w)), % Round(631 / (800 / h)),,0
  353.     }
  354.     Sleep 1000
  355.   }
  356.  
  357.   ;===Waits, till the windows is loaded completely==============================================
  358.   Login:
  359.  WinWaitActive ahk_class ApolloRuntimeContentWindow
  360.   WinGetPos,,, w, h, A
  361.   Loop
  362.   {
  363.     WinActivate ahk_class ApolloRuntimeContentWindow
  364.     PixelGetColor, c_User, % Round(79 / (1280 / w)) ,% Round(723 / (800 / h))
  365.     if c_User contains 0x2
  366.     {
  367.       Sleep, 1000
  368.       MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
  369.       MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
  370.       break
  371.     }
  372.     Sleep 1000
  373.     b++
  374.     if b=50
  375.     {
  376.       MsgBox, Something went wrong, please restart the Script and try again.`nIf it also fails the next time, please report that error to Wickster.`nhttp://www.autohotkey.com/board/user/24119-wickster/
  377.       break
  378.     }
  379.   }
  380.   ;===Clicks the Username Area====================================================================
  381.   Sleep, 1000
  382.   MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
  383.   MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
  384.   Sleep, 500
  385.  
  386.   ;===Types the Username==========================================================================
  387.   SetKeyDelay, 5, 5
  388.   Sleep, 1000
  389.   Send, %username%
  390.  
  391.   ;===Clicks the Password Area====================================================================
  392.   WinWaitActive ahk_class ApolloRuntimeContentWindow
  393.   WinGetPos,,, w, h, A
  394.   Sleep, 1000
  395.   MouseClick, left, % Round(147 / (1280 / w)), % Round(382 / (800 / h)),,0
  396.   Sleep, 1000
  397.  
  398.   ;===Types Password==============================================================================
  399.   SetKeyDelay, 5, 5
  400.   Sleep, 100
  401.   Send, %password%
  402.   Sleep, 600
  403.  
  404.   ;===Clicks Login================================================================================
  405.   WinGetPos,,, w, h, A
  406.   MouseClick, Left, % Round(361 / (1280 / w)), % Round(426 / (800 / h)),,0
  407.   Hotkey, %Max%, Max
  408.   Hotkey, %ExitKey%, ButtonAbort!
  409.   Hotkey, %Toggle%, Main
  410.   Hotkey, %AutoAccept%, AutoAccept
  411.   Hotkey, %DeleteConfig%, DeleteConfig
  412.  
  413.   return
  414. }
  415.  
  416. ;===Maximizes League Window======================================================================
  417. Max:
  418.  IfWinExist, ahk_class RiotWindowClass
  419.     Winmaximize, ahk_class RiotWindowClass
  420.   else
  421.   { Hotkey, %Max%, Max
  422.     Hotkey, %ExitKey%, ButtonAbort!
  423.     Hotkey, %Toggle%, Main
  424.     Hotkey, %AutoAccept%, AutoAccept
  425.     Hotkey, %DeleteConfig%, DeleteConfig
  426.   } return
  427.  
  428. ;===Auto Accept===================================================================================
  429. AutoAccept:
  430.  if (MyToggle)
  431.   { TrayTip,, Queue timers stopped
  432.     SetTimer, MatchFound, off
  433.     SetTimer, MatchDodged, off
  434.   } else
  435.   { IfWinExist, ahk_class ApolloRuntimeContentWindow
  436.       WinActivate, ahk_class ApolloRuntimeContentWindow
  437.     TrayTip, Waiting on Queue...., Please Enter a Queue,,17
  438.     SetTimer, MatchFound, 500
  439.     SetTimer, MatchDodged, 500
  440.   }
  441.   MyToggle:=!MyToggle
  442.   Return
  443.  
  444. MatchFound:
  445.  CoordMode,Mouse,Screen
  446.   CoordMode,Pixel,Screen
  447.   ImageSearch,,, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, Images\Found.png
  448.   if not ErrorLevel
  449.   {
  450.     MouseGetPos,mousex, mousey, activewindow
  451.     WinActivate, ahk_class ApolloRuntimeContentWindow
  452.     WinGetPos,,, w, h, A
  453.     CoordMode,Mouse,Window
  454.     CoordMode,Pixel,Window
  455.     Sleep, 1000
  456.     MouseClick,left, % Round(589 / (1280 / w)), % Round(445 / (800 / h))
  457.     WinActivate, ahk_id %activewindow%
  458.     CoordMode,Mouse,Screen
  459.     CoordMode,Pixel,Screen
  460.     MouseMove, %mousex%, %mousey%
  461.     SetTimer, MatchFound, Off
  462.   } Return
  463.  
  464.  
  465. MatchDodged:
  466.  CoordMode,Mouse,Screen
  467.   CoordMode,Pixel,Screen
  468.   ImageSearch,,, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, Images\NotFound.png
  469.   if ErrorLevel
  470.     Goto, MatchFound
  471.   Else
  472.   { if not ErrorLevel
  473.       Goto, MatchFound
  474.     SetTimer, MatchDodged, Off
  475.   } Return
  476.  
  477. ;===Stuff===========================================================================================
  478. GuiMove()
  479. { global GUIHwnd
  480.   PostMessage, 0xA1, 2,,, % "ahk_id " GUIHwnd
  481. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top