Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- #Persistent
- #SingleInstance, force
- #InstallKeybdHook
- #UseHook
- SetBatchLines, -1
- SendMode, Input
- CoordMode,Mouse,Window
- CoordMode,Pixel,Window
- SetWorkingDir, %A_ScriptDir%
- OnMessage(0x201,"GuiMove")
- Menu, Tray, Icon, Images\Rawm.ico
- Menu, Tray, Tip, Rawm v2.3.7`nMade by Wickster
- Version = v2.3.7
- Date = 11.26.2015
- Credits=tidbit, Snow_Flake, Latem5, AfterLemon, Tomoe_Uehara and Cappuccino
- if not A_IsAdmin
- Run *RunAs "%A_ScriptFullPath%"
- MyToggle:=FALSE
- ;=========================================================================================================================================================
- ;===Variables=============================================================================================================================================
- ;=========================================================================================================================================================
- ;Variables that are dependent of the Resolution
- ;Clicks Play
- x1 := % Round(701 / (800 / w))
- y1 := % Round(533 / (600 / h))
- ;Clicks Username
- x2 := % Round(188 / (1280 / w))
- y2 := % Round(321 / (800 / h))
- ;Clicks Password
- x3 := % Round(147 / (1280 / w))
- y3 := % Round(382 / (800 / h))
- ;Clicks Login
- x4 := % Round(361 / (1280 / w))
- y4 := % Round(426 / (800 / h))
- ;AutoAccept
- x5 := % Round(538 / (1280 / w))
- y5 := % Round(447 / (800 / h))
- ;Check coordinates ready to click play
- x6 := % Round(690 / (800 / w))
- y6 := % Round(505 / (600 / h))
- ;Check coordinates for username
- x7 := % Round(79 / (1280 / w))
- y7 := % Round(723 / (800 / h))
- ;=================================================================================================
- ;===GUI1==========================================================================================
- IfNotExist, RAWM.config
- {
- goto, menugui
- } else
- { FileReadLine, Toggle, RAWM.config, 1
- FileReadLine, Max, RAWM.config, 2
- FileReadLine, ExitKey, RAWM.config, 3
- FileReadLine, Username1, RAWM.config, 4
- FileReadLine, Password1, RAWM.config, 5
- FileReadLine, Username2, RAWM.config, 6
- FileReadLine, Password2, RAWM.config, 7
- FileReadLine, Username3, RAWM.config, 8
- FileReadLine, Password3, RAWM.config, 9
- FileReadLine, Only1Account, RAWM.config, 10
- FileReadLine, InstallLocation, RAWM.config, 11
- FileReadLine, AutoAccept, RAWM.config, 12
- FileReadLine, DeleteConfig, RAWM.config, 13
- Hotkey, %Toggle%, Main
- Hotkey, %ExitKey%, ButtonAbort!
- Hotkey, %Max%, Max
- Hotkey, %AutoAccept%, AutoAccept
- Hotkey, %DeleteConfig%, DeleteConfig
- goto, rightclickmenu
- }
- menugui:
- Gui 1: -border hwndGUIHwnd
- Gui 1: Add, Picture, x0 y0, Images\Gui1.png
- Gui 1: Add, Text, x150 y399 cWhite -Theme 0x8000, Check this box if only 1 account
- Gui 1: Add, Checkbox, x320 y400 w23 vOnly1Account
- Gui 1: Add, Text, x175 y426 cWhite -Theme 0x8000, To Start / Re-Start League
- Gui 1: Add, Hotkey, x320 y424 w100 h20 vToggle, F10
- Gui 1: Add, Text, x80 y451 cWhite -Theme 0x8000, To Maximize League (If it opened in the corner)
- Gui 1: Add, Hotkey, x320 y449 w100 h20 vMax, F11
- Gui 1: Add, Text, x218 y476 cWhite -Theme 0x8000, Script Exit Hotkey
- Gui 1: Add, Hotkey, x320 y474 w100 h20 vExitKey, ^!Esc
- Gui 1: Add, Text, x138 y501 cWhite -Theme 0x8000, League of Legends install location:
- Gui 1: Add, Edit, x320 y499 w150 h15 r1 vInstallLocation, C:\Riot Games\League of Legends\
- Gui 1: Add, Text, x206 y527 cWhite -Theme 0x8000, Auto Accept Hotkey
- Gui 1: Add, Hotkey, x320 y525 w100 h20 vAutoAccept, F9
- Gui 1: Add, Text, x182 y553 cWhite -Theme 0x8000, Delete Config File Hotkey
- Gui 1: Add, Hotkey, x320 y551 w100 h20 vDeleteConfig, ^!F5
- Gui 1: Add, Text, x170 y310 cWhite -Theme 0x8000, Username:
- Gui 1: Add, Edit, x230 y305 w90 h15 r1 vUsername1,
- Gui 1: Add, Text, x172 y340 cWhite -Theme 0x8000, Password:
- Gui 1: Add, Edit, x230 y335 w90 h15 r1 vPassword1 +Password,
- Gui 1: Add, Text, x23 y305 cWhite -Theme 0x8000, Username:
- Gui 1: Add, Edit, x77 y300 w70 h15 r1 vUsername2,
- Gui 1: Add, Text, x25 y335 cWhite -Theme 0x8000, Password:
- Gui 1: Add, Edit, x77 y330 w70 h15 r1 vPassword2 +Password,
- Gui 1: Add, Text, x344 y305 cWhite -Theme 0x8000, Username:
- Gui 1: Add, Edit, x400 y300 w70 h15 r1 vUsername3,
- Gui 1: Add, Text, x346 y335 cWhite -Theme 0x8000, Password:
- Gui 1: Add, Edit, x400 y330 w70 h15 r1 vPassword3 +Password,
- Gui 1: Add, Button, x375 y660 w80 h25 -Theme 0x8000 gButtonDone, Done
- Gui 1: Add, Button, x275 y660 w80 h25 -Theme 0x8000 gButtonAbort!, Abort!
- Gui 1: Add, Button, x15 y660 w80 h25 -Theme 0x8000 gContactUs, Contact Us
- Gui 1: Color, 232124
- Gui 1: +LastFound +AlwaysOnTop -Caption +ToolWindow
- Gui 1: Show, w500 h700, Configgui1
- GuiControl 1: +Default, Done
- ;===Right-Click Menu==============================================================================
- rightclickmenu:
- Menu, tray, nostandard
- Menu, Tray, add, Menu, MENU
- Menu, Tray, add, List of Hotkeys, HOTKEYS
- Menu, tray, add, &About, ABOUT
- Menu, tray, add
- Menu, tray, add, Reload This Script, RELOAD
- Menu, tray, add, Pause Script, PAUSE
- Menu, tray, add, Exit, EXIT
- Menu, tray, Default, MENU
- Return
- MENU:
- Goto, menugui
- Return
- RELOAD:
- Reload
- Return
- PAUSE:
- Pause Toggle
- Return
- EXIT:
- ExitApp
- Return
- HOTKEYS:
- ;===Replace special characters in the hotkeys for the message boxes or any other user output
- StringReplace, chrDeleteConfig, DeleteConfig, ^, Ctrl +%A_Space%, All
- StringReplace, chrDeleteConfig, chrDeleteConfig, !, Alt +%A_Space% , All
- StringReplace, chrExitKey, ExitKey, ^, Ctrl +%A_Space%, All
- StringReplace, chrExitKey, chrExitKey, !, Alt +%A_Space%, All
- 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
- return
- ABOUT:
- Version=v2.3
- Date=03.04.2014
- Credits=tidbit, Snow_Flake, Latem5, AfterLemon, Tomoe_Uehara and Cappuccino
- MsgBox,, RAWM v2.3 - About, League of Legends Script RAWM v2.3 by Wickster`nVersion: %Version%`nDate: %Date%`nCredits: %Credits%
- return
- ;===Buttons=======================================================================================
- ContactUs:
- Gui 3: -border hwndGUIHwnd
- Gui 3: Add, text, xp+8 yp+25 cBlue gForumLink, http://www.autohotkey.com/board/topic/95636-rawm-v20/
- Gui 3: Add, text, xp yp+20 cBlue gEmailLink, Email us @ rawm4league@gmail.com
- Gui 3: Add, Button, x160 y70 w100 h25 -Theme 0x8000 gButtonAbort!, Ok
- GuiControl 3: +Default, Ok
- Gui 3: +LastFound +AlwaysOnTop -Caption +ToolWindow
- Gui 3: Show, w320 h100, Configgui3
- Return
- ForumLink:
- Run http://www.autohotkey.com/board/topic/95636-rawm-v20/
- Exitapp
- Return
- EmailLink:
- clipboard = rawm4league@gmail.com
- msgbox,0x40000,,Email has been copied! Press Crtl+V to paste!
- ExitApp
- Return
- ButtonAbort!:
- SoundPlay, ButtonNoise.wav, wait
- ExitApp
- return
- DeleteConfig:
- SoundPlay, FileDeleteNoise.wav, wait
- FileDelete, RAWM.config
- ExitApp
- Return
- ButtonDone:
- SoundPlay, ButtonNoise.wav, wait
- Gui 1: Submit, NoHide
- FileDelete, RAWM.config
- 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
- Gui 1: Destroy
- ; 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
- ;SoundPlay, ButtonNoise.wav, wait
- If (Only1Account=0)
- { CustomColor = 444444
- Gui 2: Color, %CustomColor%
- WinSet, TransColor, %CustomColor% 255, Configgui2
- Gui 2: Add, Picture, x0 y0 w500 h135, Images\Gui2-2.png
- Gui 2: Add, Picture, x50 y20 w70 h70 gAlternate1, Images\Gui2-Alt1.png
- Gui 2: Add, Picture, x210 y15 w83 h83 gMainAccount, Images\Gui2-Main.png
- Gui 2: Add, Picture, x380 y20 w70 h70 gAlternate2, Images\Gui2-Alt2.png
- Gui 2: Add, Picture, x480 y0 w20 h20 gCancel, Images\Cancel.png
- Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
- Gui 2: Show, w500 h135, Configgui2
- Return
- } Return
- ;===Main==========================================================================================
- Main:
- If (Only1Account=0)
- { CustomColor=444444
- Gui 2: Color, %CustomColor%
- WinSet, TransColor, %CustomColor% 255, Configgui2
- Gui 2: Add, Picture, x0 y0 w500 h135, Images\Gui2-2.png
- Gui 2: Add, Picture, x50 y20 w70 h70 gAlternate1, Images\Gui2-Alt1.png
- Gui 2: Add, Picture, x210 y15 w83 h83 gMainAccount, Images\Gui2-Main.png
- Gui 2: Add, Picture, x380 y20 w70 h70 gAlternate2, Images\Gui2-Alt2.png
- Gui 2: Add, Picture, x480 y0 w20 h20 gCancel, Images\Cancel.png
- Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
- Gui 2: Show, w500 h135, Configgui2
- Return
- }
- Login(username1,password1,InstallLocation)
- return
- ;===MainAccount , Alternate1 and Alternate2======================================================
- Alternate1:
- Login(username2,password2,InstallLocation)
- return
- Alternate2:
- Login(username3,password3,InstallLocation)
- return
- MainAccount:
- Login(username1,password1,InstallLocation)
- return
- ;===Login Routine in a function===================================================================
- Login(username, password, installloc)
- {
- global
- SoundPlay, ButtonNoise.wav, wait
- Gui 2: Submit, NoHide
- Gui 2: Destroy
- ;===Kills League of Legends=====================================================================
- IfWinExist, ahk_class ApolloRuntimeContentWindow
- { Runwait, taskkill /f /im LoLLauncher.exe,, Hide
- sleep, 250
- Runwait, taskkill /f /im LolClient.exe,, Hide
- sleep, 250
- } else IfWinExist, ahk_class RADSWindowClass
- { Runwait, taskkill /f /im LoLLauncher.exe,, Hide
- sleep, 250
- Runwait, taskkill /f /im LolClient.exe,, Hide
- sleep, 250
- } else IfWinExist, ahk_class LOLPATCHER
- { Runwait, taskkill /f /im LoLLauncher.exe,, Hide
- sleep, 250
- Runwait, taskkill /f /im LolClient.exe,, Hide
- sleep, 250
- }
- ;===Runs League of Legends======================================================================
- Run, lol.launcher.exe,%installloc%
- sleep, 2500
- ;===Clicks Play=================================================================================
- WinWaitActive ahk_class LOLPATCHER
- WinGetPos,,, w, h, A
- Sleep 6000
- WinActivate ahk_class LOLPATCHER
- PixelGetColor, c_Play, % Round(704 / (1280 / w)), % Round(16 / (800 / h))
- ; Hover color
- if c_Play = 0x157FE4
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- Goto, Login
- }
- ; NO Hover color
- else if c_Play contains 0x118
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- Goto, Login
- }
- else if c_Play = 0x117DDC
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- Goto, Login
- }
- else if c_Play = 0x0E64B0
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- Goto, Login
- }
- 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
- Loop
- {
- WinWaitActive ahk_class LOLPATCHER
- PixelGetColor, c_Playy, % Round(704 / (1280 / w)), % Round(16 / (800 / h))
- ; Hover color
- if c_Playy = 0x157FE4
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- break
- }
- ; NO Hover color
- else if c_Playy contains 0x116
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- break
- }
- else if c_Playy = 0x117DDC
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- break
- }
- else if c_Playy = 0x0E64B0
- {
- MouseClick, left, % Round(638 / (1280 / w)), % Round(36 / (800 / h)),,0
- break
- }
- PixelGetColor, c_Agree, % Round(860 / (1280 / w)), % Round(166 / (800 / h))
- if c_Agree = 0x261C0B
- {
- MouseClick, left, % Round(514 / (1280 / w)), % Round(631 / (800 / h)),,0
- }
- Sleep 1000
- }
- ;===Waits, till the windows is loaded completely==============================================
- Login:
- WinWaitActive ahk_class ApolloRuntimeContentWindow
- WinGetPos,,, w, h, A
- Loop
- {
- WinActivate ahk_class ApolloRuntimeContentWindow
- PixelGetColor, c_User, % Round(79 / (1280 / w)) ,% Round(723 / (800 / h))
- if c_User contains 0x2
- {
- Sleep, 1000
- MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
- MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
- break
- }
- Sleep 1000
- b++
- if b=50
- {
- 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/
- break
- }
- }
- ;===Clicks the Username Area====================================================================
- Sleep, 1000
- MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
- MouseClick, Left, % Round(188 / (1280 / w)), % Round(321 / (800 / h))
- Sleep, 500
- ;===Types the Username==========================================================================
- SetKeyDelay, 5, 5
- Sleep, 1000
- Send, %username%
- ;===Clicks the Password Area====================================================================
- WinWaitActive ahk_class ApolloRuntimeContentWindow
- WinGetPos,,, w, h, A
- Sleep, 1000
- MouseClick, left, % Round(147 / (1280 / w)), % Round(382 / (800 / h)),,0
- Sleep, 1000
- ;===Types Password==============================================================================
- SetKeyDelay, 5, 5
- Sleep, 100
- Send, %password%
- Sleep, 600
- ;===Clicks Login================================================================================
- WinGetPos,,, w, h, A
- MouseClick, Left, % Round(361 / (1280 / w)), % Round(426 / (800 / h)),,0
- Hotkey, %Max%, Max
- Hotkey, %ExitKey%, ButtonAbort!
- Hotkey, %Toggle%, Main
- Hotkey, %AutoAccept%, AutoAccept
- Hotkey, %DeleteConfig%, DeleteConfig
- return
- }
- ;===Maximizes League Window======================================================================
- Max:
- IfWinExist, ahk_class RiotWindowClass
- Winmaximize, ahk_class RiotWindowClass
- else
- { Hotkey, %Max%, Max
- Hotkey, %ExitKey%, ButtonAbort!
- Hotkey, %Toggle%, Main
- Hotkey, %AutoAccept%, AutoAccept
- Hotkey, %DeleteConfig%, DeleteConfig
- } return
- ;===Auto Accept===================================================================================
- AutoAccept:
- if (MyToggle)
- { TrayTip,, Queue timers stopped
- SetTimer, MatchFound, off
- SetTimer, MatchDodged, off
- } else
- { IfWinExist, ahk_class ApolloRuntimeContentWindow
- WinActivate, ahk_class ApolloRuntimeContentWindow
- TrayTip, Waiting on Queue...., Please Enter a Queue,,17
- SetTimer, MatchFound, 500
- SetTimer, MatchDodged, 500
- }
- MyToggle:=!MyToggle
- Return
- MatchFound:
- CoordMode,Mouse,Screen
- CoordMode,Pixel,Screen
- ImageSearch,,, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, Images\Found.png
- if not ErrorLevel
- {
- MouseGetPos,mousex, mousey, activewindow
- WinActivate, ahk_class ApolloRuntimeContentWindow
- WinGetPos,,, w, h, A
- CoordMode,Mouse,Window
- CoordMode,Pixel,Window
- Sleep, 1000
- MouseClick,left, % Round(589 / (1280 / w)), % Round(445 / (800 / h))
- WinActivate, ahk_id %activewindow%
- CoordMode,Mouse,Screen
- CoordMode,Pixel,Screen
- MouseMove, %mousex%, %mousey%
- SetTimer, MatchFound, Off
- } Return
- MatchDodged:
- CoordMode,Mouse,Screen
- CoordMode,Pixel,Screen
- ImageSearch,,, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, Images\NotFound.png
- if ErrorLevel
- Goto, MatchFound
- Else
- { if not ErrorLevel
- Goto, MatchFound
- SetTimer, MatchDodged, Off
- } Return
- ;===Stuff===========================================================================================
- GuiMove()
- { global GUIHwnd
- PostMessage, 0xA1, 2,,, % "ahk_id " GUIHwnd
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement