Dustio / Gunkolle

This script was originally meant to execute kancolle expeditions but was repurpose for girls frontline (by Ryuuhou https://github.com/Ryuuhou/AHKanColle)
Other
5 stars 3 forks source link

4-6 Data DragDownToUp(500, 675, 350) #7

Closed BobbyDuggart closed 4 years ago

BobbyDuggart commented 4 years ago

Yo, just started using the updated 4-6 Data and it's working well, however, line 310 in Maps.ahk, DragDownToUp(500, 675, 350) does not work for me. I assume this is because I switched everything over to NoxPlayer, however, EchoControl's client supported dragging on Nox, and his code looks the same. Not sure why it's failing to drag for me but the program clicks on 4-4 after the loop because it fails to drag up. Any help is appreciated.

Also note my computer is dogshit so my sleep timers are super long. Also for some reason GFL won't launch using LDPlayer lmao.

Config File

[Do Not Modify]
Busy=0
[Variables]
SortieInterval=1000
MaxRandomWaitS=6000
MinRandomWaitS=3000
MinRandomWait=0
MaxRandomWait=0
WINID=ahk_class Qt5QWindowIcon
PauseHr=9
PauseMn=00
ResumeHr=12
ResumemN=00
Doll1=M4A1
Doll2=AR15
Doll3=ERROR
Doll4=ERROR
WeaponType=AssaultRifle
Enhancement=0
ProductionTdoll=0
ProductionEquipment=0
FriendCollector=0
BatteryCollector=0
AutoBattleResend=0
WorldSwitcher=4_6_data
LastXS=-3
LastYS=173
[GPU]
AMD=0
#For AMD or others GPU's change value 0 to 1. For NVidia value must be 0

#combatsims can be of values 1,2, or 3
CombatSimsData=2

4-6 Script

4_6_data()
{
    Global
    RetirementLoop := 1
    while (RetirementLoop != 0)
    {
        GuiControl,, NB, MapSelect
        sleep 3800
        GuiControl,, NB, Drag
        DragDownToUp(500, 675, 350)
        sleep 1500
        ClickS(750, 625)
        RFindClick("Battle", "rNoxPlayer mc o30 w30000,50")
        Found := FindClick(A_ScriptDir "\pics\CombatTdollEnhancement", "rNoxPlayer mc o30 Count1 n0 w3000,50")
        if(Found == 1)
        {
            Retirement()
            RetirementLoop++
        }
        RetirementLoop--
    }
    Loop, 9
    {
        FindClick(A_ScriptDir "\pics\Turn", "rNoxPlayer mc o50 Count1 n0 w30000,50")
        sleep 3000
        GuiControl,, NB, CommandPost
        ClickS(842, 400)
        sleep 1500
        RFindClick("OK", "rNoxPlayer mc o10 w30000,50 ")
        GuiControl,, NB, Heliport
        sleep 1500
        ClickS(868, 46)
        sleep 1500
        RFindClick("OK", "rNoxPlayer mc o10 w30000,50 ")
        sleep 1500
        RFindClick("StartCombat", "rNoxPlayer mc o25 w3000,10 a1000,620 n3 sleep200")
        sleep 3000
        GuiControl,, NB, Heliport
        sleep 3000
        ClickS(868, 46)
        GuiControl,, NB, Node1
        sleep 1500
        ClickS(858, 109)
        FoundBattle := FindClick(A_ScriptDir "\pics\Maps\4_6\Ambush", "rNoxPlayer mc o40 Count1 n0 w1500")
            if (FoundBattle == true)
                {
                    ClickS(858, 109)
                    sleep 2000
                    TFindClick("\Maps\4_6\CombatPause","\Maps\4_6\CombatUnpause", sleep500)
                    GuiControl,, NB, Withdraw
                    ClickS(426, 66)
                    sleep 1500
                    ClickS(800, 200)
                    sleep 1500
                    TFindClick("Terminate","TerminateRestart")
                    sleep 500
                    ClickTilGone("TerminateRestart", " rNoxPlayer mc o10 w30000,50")
                    continue
                }   
        FoundDrop := FindClick(A_ScriptDir "\pics\Maps\4_6\DollNode", "rNoxPlayer mc o40 Count1 n0")
            if (FoundDrop == true)
                {
                    ClickS(810, 185)
                    sleep 500
                    ClickS(810, 185)
                    ClickTilGone("DollDrop", "rNoxPlayer mc o10 w30000,50 ")
                }
        GuiControl,, NB, Node2
        ClickS(810, 185)
        sleep 1500
        ClickS(810, 185)
        sleep 1500
        GuiControl,, NB, Node3
        ClickS(745, 233)
        FoundBattle := FindClick(A_ScriptDir "\pics\Maps\4_6\Ambush", "rNoxPlayer mc o40 Count1 n0 w1500")
            if (FoundBattle == true)
                {
                    ClickS(745, 233)
                    sleep 2000
                    TFindClick("\Maps\4_6\CombatPause","\Maps\4_6\CombatUnpause", sleep500)
                    GuiControl,, NB, Withdraw
                    ClickS(426, 66)
                    sleep 1500
                    ClickS(800, 200)
                    sleep 1500
                    TFindClick("Terminate","TerminateRestart")
                    sleep 500
                    ClickTilGone("TerminateRestart", " rNoxPlayer mc o10 w30000,50")
                    continue
                }   
        FoundDrop := FindClick(A_ScriptDir "\pics\Maps\4_6\DollNode", "rNoxPlayer mc o40 Count1 n0")
            if (FoundDrop == true)
                {
                    ClickS(818, 260)
                    sleep 500
                    ClickS(818, 260)
                    ClickTilGone("DollDrop", "rNoxPlayer mc o10 w30000,50 ")
                }
        GuiControl,, NB, Node4
        ClickS(818, 260)
        sleep 1500
        ClickS(818, 260)
        FoundBattle := FindClick(A_ScriptDir "\pics\Maps\4_6\Ambush", "rNoxPlayer mc o40 Count1 n0 w1500")
            if (FoundBattle == true)
                {
                    ClickS(818, 260)
                    sleep 2000
                    TFindClick("\Maps\4_6\CombatPause","\Maps\4_6\CombatUnpause", sleep500)
                    GuiControl,, NB, Withdraw
                    ClickS(426, 66)
                    sleep 1500
                    ClickS(800, 200)
                    sleep 1500
                    TFindClick("Terminate","TerminateRestart")
                    sleep 500
                    ClickTilGone("TerminateRestart", " rNoxPlayer mc o10 w30000,50")
                    continue
                }       
        FoundDrop := FindClick(A_ScriptDir "\pics\Maps\4_6\DollNode", "rNoxPlayer mc o40 Count1 n0")
            if (FoundDrop == true)
                {
                    ClickS(818, 260)
                    sleep 500
                    ClickS(818, 260)
                    ClickTilGone("DollDrop", "rNoxPlayer mc o10 w30000,50 ")
                }
        ClickS(320, 180)
        sleep 1500
        TFindClick("Terminate","TerminateRestart")
        sleep 1500
        ClickTilGone("TerminateRestart", " rNoxPlayer mc o10 w30000,50")
    }
    Loop, 1
    {
        GuiControl,, NB, Last reset
        FindClick(A_ScriptDir "\pics\Turn", "rNoxPlayer mc o50 Count1 n0 w30000,50")
        sleep 1500
        GuiControl,, NB, CommandPost
        ClickS(842, 400)
        sleep 1500
        RFindClick("OK", "rNoxPlayer mc o10 w30000,50 ")
        GuiControl,, NB, Heliport
        sleep 1500
        ClickS(868, 46)
        sleep 1500
        RFindClick("OK", "rNoxPlayer mc o10 w30000,50 ")
        sleep 1500
        RFindClick("StartCombat", "rNoxPlayer mc o25 w3000,10 a1000,620 n3 sleep200")
        sleep 3000
        GuiControl,, NB, Heliport
        sleep 2000
        ClickS(868, 46)
        GuiControl,, NB, Node1
        sleep 1500
        ClickS(858, 109)
        FoundBattle := FindClick(A_ScriptDir "\pics\Maps\4_6\Ambush", "rNoxPlayer mc o40 Count1 n0 w1500")
            if (FoundBattle == true)
                {
                    ClickS(858, 109)
                    sleep 2000
                    TFindClick("\Maps\4_6\CombatPause","\Maps\4_6\CombatUnpause", sleep500)
                    GuiControl,, NB, Withdraw
                    ClickS(426, 66)
                    sleep 1500
                    ClickS(800, 200)
                    sleep 1500
                    TFindClick("Terminate","TerminateOK")
                    sleep 500
                    ClickTilGone("TerminateOK", " rNoxPlayer mc o10 w30000,50")
                    continue
                }   
        FoundDrop := FindClick(A_ScriptDir "\pics\Maps\4_6\DollNode", "rNoxPlayer mc o40 Count1 n0")
            if (FoundDrop == true)
                {
                    ClickS(810, 185)
                    sleep 500
                    ClickS(810, 185)
                    ClickTilGone("DollDrop", "rNoxPlayer mc o10 w30000,50 ")
                }
        GuiControl,, NB, Node2
        ClickS(810, 185)
        sleep 1500
        ClickS(810, 185)
        sleep 1500
        GuiControl,, NB, Node3
        ClickS(745, 233)
        FoundBattle := FindClick(A_ScriptDir "\pics\Maps\4_6\Ambush", "rNoxPlayer mc o40 Count1 n0 w1500")
            if (FoundBattle == true)
                {
                    ClickS(745, 233)
                    sleep 2000
                    TFindClick("\Maps\4_6\CombatPause","\Maps\4_6\CombatUnpause", sleep500)
                    GuiControl,, NB, Withdraw
                    ClickS(426, 66)
                    sleep 1500
                    ClickS(800, 200)
                    sleep 1500
                    TFindClick("Terminate","TerminateOK")
                    sleep 500
                    ClickTilGone("TerminateOK", " rNoxPlayer mc o10 w30000,50")
                    continue
                }   
        FoundDrop := FindClick(A_ScriptDir "\pics\Maps\4_6\DollNode", "rNoxPlayer mc o40 Count1 n0")
            if (FoundDrop == true)
                {
                    ClickS(818, 260)
                    sleep 500
                    ClickS(818, 260)
                    ClickTilGone("DollDrop", "rNoxPlayer mc o10 w30000,50 ")
                }
        GuiControl,, NB, Node4
        ClickS(818, 260)
        sleep 1500
        ClickS(818, 260)
        FoundBattle := FindClick(A_ScriptDir "\pics\Maps\4_6\Ambush", "rNoxPlayer mc o40 Count1 n0 w1500")
            if (FoundBattle == true)
                {
                    ClickS(818, 260)
                    sleep 2000
                    TFindClick("\Maps\4_6\CombatPause","\Maps\4_6\CombatUnpause", sleep500)
                    GuiControl,, NB, Withdraw
                    ClickS(426, 66)
                    sleep 1500
                    ClickS(800, 200)
                    sleep 1500
                    TFindClick("Terminate","TerminateOK")
                    sleep 500
                    ClickTilGone("TerminateOK", " rNoxPlayer mc o10 w30000,50")
                    continue
                }       
        FoundDrop := FindClick(A_ScriptDir "\pics\Maps\4_6\DollNode", "rNoxPlayer mc o40 Count1 n0")
            if (FoundDrop == true)
                {
                    ClickS(818, 260)
                    sleep 500
                    ClickS(818, 260)
                    ClickTilGone("DollDrop", "rNoxPlayer mc o10 w30000,50 ")
                }
        ClickS(320, 180)
        sleep 1500
        TFindClick("Terminate","TerminateOK")
        sleep 1500
        ClickTilGone("TerminateOK", " rNoxPlayer mc o10 w30000,50")
    }
    GoHome()
}
Dustio commented 4 years ago

Hey, should be a quick fix. DragUpToDown is part of the Mouse.ahk function, and the HWND needs to be updated for nox, so change line 6.

ControlGet, ld_id, Hwnd, , RenderWindow1, LDPlayer

to

ControlGet, nox_id, Hwnd, , ScreenBoardClassWindow, NoxPlayer

Also might need to replace the global ids to match, hope it helps.

BobbyDuggart commented 4 years ago

Fixed! Thanks for the help and continued support on this project.