If not A_IsAdmin { DLLCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath, str, """" .A_ScriptFullPath . """", str, A_WorkingDir, int, 1) ExitApp } #Persistent CoordMode, Pixel, Relative SetControlDelay, 100 Gui 1:+AlwaysOnTop Gui 1:Color, B7A991 IfWinExist, Droid4X 0.8.0 Beta { WinActivate AppVer = Droid4X 0.8.0 Beta } IfWinExist, Droid4X 0.8.1 Beta { WinActivate AppVer = Droid4X 0.8.1 Beta } IfWinExist, Droid4X 0.8.3 Beta { WinActivate AppVer = Droid4X 0.8.3 Beta } OpenChests := 0 toggleCm := false SelectCombineTab = MaterialsMenu CombineFinish := 0 Gui 1:Add, Button, x10 y10 w50 gCombineToggle, Combine Gui 1:Add, Button, x70 y10 w50 gChestToggle, Chests Gui 1:Add, Button, x130 y10 w50 gPause, Pause Gui 1:Add, Button, x190 y10 w50 gReload, Reload Gui 1:Add, Button, x250 y10 w50 gGui1Close, Quit Gui 1:font, c422B1D Gui 1:font, bold Gui 1:font, s10 Gui 1:Add, Text, x10 y40 w290 0x10 Gui 1:Add, Radio, x10 y50 altsubmit gCombineTabSelect vSelectCombineTab, Cores Gui 1:Add, Radio, x75 y50 altsubmit gCombineTabSelect, Pieces Gui 1:Add, Radio, x147 y50 altsubmit gCombineTabSelect, Gems Gui 1:Add, Radio, checked x212 y50 altsubmit gCombineTabSelect, Materials Gui 1:Submit, nohide Gui 1:Show, x100 y200 w310 h75, Open Chest / Combine, AlwaysOnTop Esc::ExitApp Gui1Close: ExitApp Return Pause: IfWinExist, %AppVer% WinActivate Pause, Toggle, 1 return Reload: Reload Sleep 2000 return RandomWait: Random, n, 2000, 4000 n = %sleep% sleep, %sleep% return resize: gosub, RandomWait IfWinExist, %AppVer% WinActivate WinGetPos,X,Y,W,H,A If w != 460 { WinMove,A,,,,460,730 gosub, RandomWait goto, resize return } gosub, RandomWait return CityScreen: IfWinExist, %AppVer% WinActivate WinGetPos,X,Y,W,H,A If w != 460 { gosub, resize sleep, 3000 goto, CityScreen return } PixelSearch, Px, Py, 78, 73, 78, 73, 0xFFFFFF, 0, Fast ;Facebook If ErrorLevel = 0 { ControlClick, x78 y73, %AppVer% sleep, 3000 goto, CityScreen return } PixelSearch, Px, Py, 411, 79, 411, 79, 0xDCDCDC, 0, Fast ;GoW Facebook Splash If ErrorLevel = 0 { ControlClick, x411 y79, %AppVer% sleep, 3000 goto, CityScreen return } PixelSearch, Px, Py, 220, 350, 220, 350, 0x030839, 0, Fast If ErrorLevel = 0 { ControlClick, x220 y350, %AppVer% ;City Menu sleep, 3000 goto, CityScreen return } PixelSearch, Px, Py, 200, 550, 200, 550, 0x474100, 0, Fast If ErrorLevel = 0 { ControlClick, x200 y550, %AppVer% ;City Menu sleep, 3000 goto, CityScreen return } PixelSearch, Px, Py, 150, 50, 150, 50, 0x101427, 50, Fast If ErrorLevel = 0 { ControlClick, x100 y700, %AppVer% ;City Menu sleep, 3000 goto, CityScreen return } PixelSearch, Px, Py, 416, 35, 450, 58, 0xDCDCDC, 10, Fast If ErrorLevel = 0 { ControlClick, x435 y50, %AppVer% ;Get Gold Splash Close sleep, 3000 goto, CityScreen return } return MoreMenu: IfWinExist, %AppVer% WinActivate sleep, 2000 PixelSearch, Px, Py, 310, 220, 320, 230, 0x4AA722, 10, Fast ; Green "MZ Logo" on More Menu If ErrorLevel != 0 { ControlClick, x425 y700, %AppVer% ;More Menu Icon Location sleep, 1000 goto, MoreMenu return } return ItemsMenu: If (toggleCh = false) { return } gosub, RandomWait PixelSearch, Px, Py, 375, 50, 375, 50, 0x010427, 5, Fast If ErrorLevel = 0 { ControlClick, x430 y50, %AppVer% ;select Items sleep, 2000 goto, ItemsMenu } PixelSearch, Px, Py, 80, 165, 435, 165, 0x90A8B6, 5, Fast If ErrorLevel != 0 { ControlClick, x230 y700, %AppVer% ;select Items gosub, RandomWait goto, ItemsMenu } return MyItemsMenu: If (toggleCh = false) { return } gosub, RandomWait PixelSearch, Px, Py, 375, 50, 375, 50, 0x010427, 5, Fast If ErrorLevel = 0 { ControlClick, x430 y50, %AppVer% ;select Items sleep, 2000 gosub, ItemsMenu sleep, 2000 goto, MyItemsMenu } PixelSearch, Px, Py, 300, 175, 300, 175, 0xFFFFFF, 5, Fast If ErrorLevel = 0 { gosub, ItemsMenu sleep, 2000 goto, MyItemsMenu } PixelSearch, Px, Py, 300, 175, 300, 175, 0x8FA7B5, 5, Fast If ErrorLevel = 0 { return } PixelSearch, Px, Py, 300, 175, 300, 175, 0x8FA7B5, 5, Fast If ErrorLevel = 0 { return } PixelSearch, Px, Py, 300, 175, 300, 175, 0x8FA7B5, 5, Fast If ErrorLevel != 0 { ControlClick, x300 y175, %AppVer% ;select My Items gosub, RandomWait goto, MyItemsMenu } return TreasureItemsMenu: If (toggleCh = false) { return } gosub, RandomWait PixelSearch, Px, Py, 430, 235, 430, 235, 0x07096A, 3, Fast If ErrorLevel = 0 { return } PixelSearch, Px, Py, 430, 235, 430, 235, 0x07096A, 3, Fast If ErrorLevel != 0 { ControlClick, x430 y225, %AppVer% ;select Treasures gosub, RandomWait goto, TreasureItemsMenu } return ForgeMenu: IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CityScreen return } sleep, 2000 PixelSearch, Px, Py, 330, 540, 330, 540, 0x474100, 0, Fast ;More Information Button Forge screen If ErrorLevel != 0 { ControlClick, x405 y405, %AppVer% ;Train Menu Icon location in More Menu sleep, 1000 goto, ForgeMenu return } return CombineMenu: IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CityScreen return } sleep, 2000 PixelSearch, Px, Py, 180, 580, 180, 580, 0x474100, 0, Fast ;Information Button Combine screen If ErrorLevel != 0 { ControlClick, x105 y330, %AppVer% ;Train Menu Icon location in More Menu sleep, 1000 goto, CombineMenu return } return CoresTab: IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CityScreen return } sleep, 2000 PixelSearch, Px, Py, 145, 220, 145, 220, 0x90A8B6, 10, Fast ;Cores Tab Combine screen If ErrorLevel != 0 { ControlClick, x145 y220, %AppVer% ;Cores Tab sleep, 1000 goto, CoresTab return } return PiecesTab: IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CityScreen return } sleep, 2000 PixelSearch, Px, Py, 245, 220, 245, 220, 0x90A8B6, 10, Fast ;Pieces Tab Combine screen If ErrorLevel != 0 { ControlClick, x245 y220, %AppVer% ;Pieces Tab sleep, 1000 goto, PiecesTab return } return GemsTab: IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CityScreen return } sleep, 2000 PixelSearch, Px, Py, 341, 220, 341, 220, 0x90A8B6, 10, Fast ;Gems Tab Combine screen If ErrorLevel != 0 { ControlClick, x341 y220, %AppVer% ;Gems Tab sleep, 1000 goto, GemsTab return } return MaterialsTab: IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CityScreen return } sleep, 2000 PixelSearch, Px, Py, 435, 220, 435, 220, 0x90A8B6, 10, Fast ;Materials Tab Combine screen If ErrorLevel != 0 { ControlClick, x435 y220, %AppVer% ;Materials Tab sleep, 1000 goto, MaterialsTab return } return ;------Open Chests ChestToggle: IfWinExist, %AppVer% WinActivate sleep, 1000 If(OpenChests = 0) { OpenChests := 1 goto, InventoryChests } If(OpenChests = 1) { OpenChests := 0 goto, StopChests } return InventoryChests: IfWinExist, %AppVer% WinActivate If(OpenChests = 0) { goto, StopChests return } If(OpenChests = 1) { gosub, resize gosub, RandomWait gosub, ItemsMenu gosub, RandomWait gosub, MyItemsMenu gosub, RandomWait gosub, TreasureItemsMenu gosub, RandomWait gosub, OpenChests } return StopChests: OpenChests := 0 PixelSearch, Px, Py, 400, 215, 415, 235, 0xDCDCDC, 2, Fast If ErrorLevel = 0 { ControlClick, x%Px% y%Py%, %AppVer% ;Select Close gosub, Randomwait } PixelSearch, Px, Py, 400, 215, 415, 235, 0x05052D, 2, Fast If ErrorLevel = 0 { ControlClick, x%Px% y%Py%, %AppVer% ;Select Close gosub, Randomwait } SetTimer, OpenChests1, off SetTimer, OpenChests2, off gosub, RandomWait gosub, CityScreen return OpenChests: IfWinExist, %AppVer% WinActivate If(OpenChests = 0) { goto, StopChests return } PixelGetColor, color, 400, 200, %AppVer% If Color = 0x002C00 { gosub, OpenChests2 SetTimer, OpenChests2, 500 } else { gosub, OpenChests1 SetTimer, OpenChests1, 500 } return OpenChests1: If(OpenChests = 0) { goto, StopChests return } gosub, RandomWait PixelGetColor, color, 365, 390, %AppVer% If Color = 0x002C00 { ControlClick, x365 y390, %AppVer% ;select First Icon return } PixelGetColor, color, 365, 523, %AppVer% If Color = 0x002C00 { ControlClick, x365 y523, %AppVer% ;select Second Icon return } PixelSearch, Px, Py, 400, 215, 415, 235, 0xDCDCDC, 2, Fast If ErrorLevel = 0 { ControlClick, x%Px% y%Py%, %AppVer% ;Select Close return } PixelSearch, Px, Py, 400, 215, 415, 235, 0x05052D, 2, Fast If ErrorLevel = 0 { ControlClick, x%Px% y%Py%, %AppVer% ;Select Close return } PixelSearch, Px, Py, 420, 325, 420, 325, 0x282828, 10, Fast If ErrorLevel = 0 { goto, ChestCheck return } return ChestCheck: PixelGetColor, color, 420, 475, %AppVer% If Color = 0x002C00 return Else goto, StopChests return OpenChests2: If(OpenChests = 0) { goto, StopChests return } gosub, RandomWait PixelGetColor, color, 365, 250, %AppVer% If Color = 0x424447 { gosub, RandomWait return } PixelGetColor, color, 365, 250, %AppVer% If Color = 0x002C00 { ControlClick, x365 y250, %AppVer% ;select First Icon return } PixelGetColor, color, 365, 375, %AppVer% If Color = 0x002C00 { ControlClick, x365 y375, %AppVer% ;select Second Icon return } PixelGetColor, color, 365, 500, %AppVer% If Color = 0x002C00 { ControlClick, x365 y500, %AppVer% ;select Third Icon return } return ;------Combine CombineToggle: IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { toggleCm := 1 goto, BeginCombine return } If (toggleCm = 1) { toggleCm := 0 goto, CombineDone return } BeginCombine: IfWinExist, %AppVer% WinActivate gosub, CombineTabSelect Gui 1:Submit, NoHide GuiControlGet, CombineTabSelect, 1: sleep, 1000 gosub, Resize sleep, 1000 PixelSearch, Px, Py, 180, 580, 180, 580, 0x474100, 0, Fast ;Information Button Combine screen If ErrorLevel != 0 { PixelSearch, Px, Py, 440, 580, 440, 580, 0x474100, 0, Fast ;Information Button Combine screen If ErrorLevel != 0 { gosub, CityScreen sleep, 1000 gosub, MoreMenu sleep, 1000 gosub, ForgeMenu sleep, 1000 gosub, CombineMenu sleep, 1000 } } If (SelectCombineTab = 1) { gosub, CoresTab } If (SelectCombineTab = 2) { gosub, PiecesTab } If (SelectCombineTab = 3) { gosub, GemsTab } If (SelectCombineTab = 4) { gosub, MaterialsTab } sleep, 1000 gosub, CombineMoveUp sleep, 500 SetTimer, Slot4R3, 3000 return CombineMoveUp: SetDefaultMouseSpeed, 25 IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CityScreen return } SendEvent {Click 370, 475, down} gosub, RandomWait SendEvent {click 370, 100, up} PixelSearch, Px, Py, 125, 500, 125, 500, 0x121212, 3, Fast ;Black background at bottom of combine If ErrorLevel = 0 { PixelSearch, Px, Py, 425, 510, 425, 510, 0x121212, 3, Fast ;Black background at bottom of combine If ErrorLevel = 0 { gosub, RandomWait goto, CombineMoveDown return } } gosub, RandomWait goto, CombineMoveUp return CombineMoveDown: SetDefaultMouseSpeed, 25 IfWinExist, %AppVer% WinActivate If (toggleCm = 0) { goto, CombineDone return } SendEvent {click 370, 300, down} gosub, RandomWait SendEvent {Click 370, 380, up} gosub, RandomWait return CombineTabSelect: If (CombineTab = 1) { SelectCombineTab = CoresTab } If (CombineTab = 2) { SelectCombineTab = PiecesTab } If (CombineTab = 3) { SelectCombineTab = GemsTab } If (CombineTab = 4) { SelectCombineTab = MaterialsTab } Gui 1:Submit, nohide return CombineDone: IfWinExist, %AppVer% WinActivate toggleCm := 0 SetTimer, Slot4R3, off sleep, 500 goto, CityScreen return CombineCheck: If (toggleCm = 0) { goto, CombineDone return } sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x474100 { ControlClick, x300 y580, %AppVer% goto, CombineCheck return } PixelGetColor, color, 230, 270, %AppVer% If Color = 0x474100 { ControlClick, x230 y270, %AppVer% goto, CombineCheck return } PixelGetColor, color, 230, 340, %AppVer% If Color = 0x474100 { ControlClick, x230 y340, %AppVer% goto, CombineCheck return } PixelGetColor, color, 230, 315, %AppVer% If Color = 0x474100 { ControlClick, x230 y315, %AppVer% goto, CombineCheck return } PixelGetColor, color, 345, 590, %AppVer% If Color = 0x424447 { sleep, 500 CombineFinish := 0 goto, CombineCheck return } CombineFinish := 0 goto, CombineCheck2 return CombineCheck2: If (toggleCm = 0) { goto, CombineDone return } sleep, 1000 PixelGetColor, color, 345, 590, %AppVer% If Color = 0x424447 { sleep, 500 goto, CombineCheck2 return } PixelGetColor, color, 230, 340, %AppVer% If Color = 0x474100 { ControlClick, x230 y340, %AppVer% goto, CombineCheck2 return } PixelSearch, Px, Py, 410, 210, 410, 210, 0xD9D9D9, 50, Fast If ErrorLevel = 0 { ControlClick, x410 y210, %AppVer% ;Select Close goto, CombineCheck2 return } PixelSearch, Px, Py, 410, 225, 410, 225, 0xD9D9D9, 50, Fast If ErrorLevel = 0 { ControlClick, x410 y225, %AppVer% ;Select Close goto, CombineCheck2 return } sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 return ;Row 3 Slot4R3: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x400 y500, %AppVer% ;Slot4 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot3R3 If Color != 0x424447 goto, CombineCheck return Slot3R3: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x300 y500, %AppVer% ;Slot3 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot2R3 If Color != 0x424447 goto, CombineCheck return Slot2R3: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x200 y500, %AppVer% ;Slot2 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot1R3 If Color != 0x424447 goto, CombineCheck return Slot1R3: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x100 y500, %AppVer% ;Slot1 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot4R2 If Color != 0x424447 goto, CombineCheck return ;Row2 Slot4R2: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x400 y400, %AppVer% ;Slot4 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot3R2 If Color != 0x424447 goto, CombineCheck return Slot3R2: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x300 y400, %AppVer% ;Slot3 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot2R2 If Color != 0x424447 goto, CombineCheck return Slot2R2: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x200 y400, %AppVer% ;Slot2 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot1R2 If Color != 0x424447 goto, CombineCheck return Slot1R2: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x100 y400, %AppVer% ;Slot1 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot4R1 If Color != 0x424447 goto, CombineCheck return ;Row 1 Slot4R1: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x400 y300, %AppVer% ;Slot4 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot3R1 If Color != 0x424447 goto, CombineCheck return Slot3R1: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x300 y300, %AppVer% ;Slot3 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot2R1 If Color != 0x424447 goto, CombineCheck return Slot2R1: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x200 y300, %AppVer% ;Slot2 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, Slot1R1 If Color != 0x424447 goto, CombineCheck return Slot1R1: If (toggleCm = 0) { goto, CombineDone return } ControlClick, x100 y300, %AppVer% ;Slot1 sleep, 1000 PixelGetColor, color, 300, 580, %AppVer% If Color = 0x424447 goto, MoveMouse If Color != 0x424447 goto, CombineCheck return MoveMouse: If (toggleCm = 0) { goto, CombineDone return } IfWinExist, %AppVer% WinActivate SetDefaultMouseSpeed, 10 SendEvent {Click 100, 300, down} sleep, 1000 SendEvent {click 100, 500, up} PixelSearch, Px, Py, 166, 282, 166, 282, 0x121212, 2, Fast ;Black background at top of combine If ErrorLevel = 0 { PixelSearch, Px, Py, 166, 285, 166, 285, 0x121212, 2, Fast ;Black background at top of combine If ErrorLevel = 0 { CombineFinish++ If (CombineFinish >= 2) { CombineFinish := 0 goto, CombineDone return } } } return
Game of War (GoW) Open Chests / Combine
Started by
Malechite
, Aug 02 2015 09:17 PM
2 replies to this topic
#1
-
Posted 02 August 2015 - 09:17 PM
Now with new VIP benefits the script does not know what to press. New buttons for use or use all pop up when multiples of single chest type are available. I am not a code writer or I would attempt to change/manipulate. Any and all help appreciated.
Thanks
Danno
#2
-
Posted 19 September 2015 - 05:31 AM
I got everything to work fine with this script, Open the Driod X client.....login manually and start the script it does everything for you....
but honestly it is alot of unneeded script in there
you just need the color detector
#3
-
Posted 17 October 2015 - 01:20 PM