#SingleInstance, force SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SetTitleMatchMode, RegEx DetectHiddenWindows, On CoordMode, Mouse, Screen ;; Author ;; Roxwiki.net ;; Date-Time ;; 20210808-15:31:00 ;; version ;; 1.06 ;Variable ;----------- ;------------------------ percentsign := Chr(37) ;Load Data ;----------- ;------------------------ EmuList = Nox Player|LD Player|BlueStack Player| ;emulator = LDPlayerMainFrame ;Gui Layout ;----------- ;------------------------ Gui, +AlwaysOnTop Gui, Color, FFFFFF Gui, Show, x20 y140 w300 h350, Roxwiki.net v1.07 Gui, Add, GroupBox, w280 h195, Setting Gui, Add, GroupBox, w280 h100, Automation Times Gui, Add, GroupBox, w280 h90, Credit Gui, Add, Button, x5 y20 w80 h40 gButtonR, Record`n(Ctrl+R) Gui, Add, Button, x5 y65 w80 h40 gButtonQ, Train-Push`n(Ctrl+Q) Gui, Add, Text, x90 y65 , Push Training Gui, Add, Button, x5 y110 w80 h40 gButtonW, Train-Pull`n(Ctrl+W) Gui, Add, Text, x90 y110 , Pull Training Gui, Add, Button, x5 y155 w80 h40 gButtonE, Test 1`n(Ctrl+E) Gui, Add, Edit, x80 y205 w29 h19 vLoopValue, 9999 Gui, Add, Button, x5 y225 w80 h40 gButtonA, Start`n(Ctrl+A) Gui, Add, Button, x140 y225 w80 h40 gButtonS, Stop`n(Ctrl+S) Gui, Add, Button, x5 y270 w280 h30 c5DF0BD gButtonExit, End Bot (Ctrl+z) Gui, Add, Link, x15 y332, Supported by ROXWIKI.net return ;Gui Label ;----------- ;------------------------ Butemu: Return Button1: MsgBox, % WINL Return ButtonExit: ExitApp Return Windowselected1: Gui, submit, NoHide Tooltip, % WINL return ;Gui Function ;----------- ;------------------------ ;;Production Hotkey ;;---------------- ButtonR: ^r:: WinGetActiveStats,WindowScreen, Width, Height, X, Y MouseGetPos, xpos, ypos WinGetClass, WindowClass, A widthscreen2 := xpos highscreen2 := ypos MouseMove, %widthscreen2% , %highscreen2% MsgBox, Record mouse position to X%xpos% Y%ypos%. mouse move to x%widthscreen2% , y%highscreen2%. Gui, Add, Text, x90 y20 , %WindowScreen% / %WindowClass% Gui, Add, Text, x90 y34 , Size: %Width%*%Height% /Mouse: X%xpos% Y%ypos% return ButtonQ: ^q:: WinActivate, %WindowScreen% ahk_class %WindowClass% MouseMove, %xpos% , %ypos% PixelGetColor, OpenColor, %xpos% , %ypos% OString := OpenColor StringRight, OOutputVar, String, 6 OOO := "c" OOutputVar Gui, Add, Progress, x90 y79 w15 h15 %OOO%, 100 Gui, Add, Text, x110 y79 , Color: %OpenColor% click return ButtonW: ^w:: WinActivate, %WindowScreen% ahk_class %WindowClass% MouseMove, %xpos% , %ypos% PixelGetColor, CloseColor, %xpos% , %ypos% CString := CloseColor StringRight, COutputVar, String, 6 CCC := "c" COutputVar Gui, Add, Progress, x90 y124 w15 h15 %CCC%, 100 Gui, Add, Text, x110 y124 , Color: %CloseColor% click return ButtonE: ButtonManual: Butt3: ^e:: Pushstatus = 0 Pullstatus = 0 Sleep, 100 WinActivate, %WindowScreen% ahk_class %WindowClass% PixelGetColor, OColor, %xpos% , %ypos% CoordMode, Mouse, Screen SetControlDelay -1 If OColor = %OpenColor% { MouseMove, %xpos% , %ypos% click Pushstatus = 1 Loop, { ; PixelGetColor, CColor, %xpos% , %ypos% If CColor = %CloseColor% { MouseMove, %xpos% , %ypos% click Pullstatus = 1 Break Sleep, 500 } Else { Pullstatus = 0 } } } Else { Pushstatus = 0 } If Pushstatus = 1 { Gui, Add, Text, x90 y155 , Push: Found %OColor% } Else { Gui, Add, Text, x90 y155 , Push: Not found = %OColor% } If Pullstatus = 1 { Gui, Add, Text, x90 y169 , Pull: Found %CColor% } Else { Gui, Add, Text, x90 y169 , Pull: Not found = %CColor% } return ButtonS: ^s:: vbreak = 1 Gui, Add, Text, x230 y215 , Stopped at `n%vTime% Return ^a:: ButtonA: ;Gui, Add, Button, x5 y150 w80 h30 gButtonA, (Ctrl+A = Start) GuiControlGet LoopValue LoopV = %LoopValue% vTime = 0 vbreak = 0 Sleep, 200 Loop, { If (vbreak = 1) { Break } If (LoopV >= vTime) { Sleep, 100 WinActivate, %WindowScreen% ahk_class %WindowClass% PixelGetColor, OColor, %xpos% , %ypos% CoordMode, Mouse, Screen SetControlDelay -1 If OColor = %OpenColor% { ;MouseMove, %xpos% , %ypos% WinActivate, %WindowScreen% ahk_class %WindowClass% MouseMove, %xpos%, %ypos% click ;ControlClick, x%xpos% y%ypos%, %WindowScreen%,,,, NA ;click Loop, { ; PixelGetColor, CColor, %xpos% , %ypos% If CColor = %CloseColor% { vTime := (vTime + 1) ;MouseMove, %xpos% , %ypos% WinActivate, %WindowScreen% ahk_class %WindowClass% MouseMove, %xpos%, %ypos% click ;ControlClick, x%xpos% y%ypos%, %WindowScreen%,,,, NA ;click Sleep, 500 Gui, Add, Text, x95 y215 , Loop `n%vTime% `n / %LoopV% Break } } } } } return ^z:: GuiClose: ExitApp ;2F501F