• 0

    posted a message on CM Wizard: Autohotkey saved my life
    realized there is no reason to spam keys so much. can do a pixel check to see whether a key is in cooldown.
    the below script is for my resolution, 1680x1050. my laptop is 1920x1080, i'll work it out later. change the coords for your res.
    example:
    note that 2,3,4 are not spammed insanely when they are on cooldown.

    #SingleInstance force
    SendMode Input
    
    hotkeyEnabled:= 1
    armorEnabled:= 1
    SetTimer, RefreshArmor, 10000 ; setup initial armor refresh to happen in 10s
    
    #IfWinActive ahk_class D3 Main Window Class ; only use these hotkeys if D3 is active
    
        ; 3 is the hotkey to engage CM sequence
        $*3::
            if (hotkeyEnabled) { ; do CM sequence
                Click, down
                while GetKeyState("3", "P") {
                    PixelSearch, , , 741, 973, 741, 973, 0x181E19, 5, Fast
                    if !ErrorLevel
                        Send, {Blind}4
                    PixelSearch, , , 676, 973, 676, 973, 0x181E19, 5, Fast
                    if !ErrorLevel
                        Send, {Blind}3
                    PixelSearch, , , 611, 973, 611, 973, 0x181E19, 5, Fast
                    if !ErrorLevel
                        Send, {Blind}2
                    RandomSleep(100, 200)
                }
                Click, up
            } else { ; just send 3 if hotkeys are disabled
                Send, {Blind}3
            }
            return
    
        ; F12 toggles whether all hotkey functionality is enabled or disabled
        F12::
            hotkeyEnabled := !hotkeyEnabled
            if(hotkeyEnabled && armorEnabled)
                Gosub, RefreshArmor
            else
                SetTimer, RefreshArmor, off
            SplashMessage("Hotkeys " ((hotkeyEnabled) ? "enabled" : "disabled"))
            return
    
        ; F11 toggles auto-refresh of armor
        F11::
            armorEnabled := !armorEnabled
            if(hotkeyEnabled && armorEnabled)
                Gosub, RefreshArmor
            else
                SetTimer, RefreshArmor, off
            SplashMessage("Armor refresh " ((armorEnabled) ? "enabled" : "disabled"))
            return
    
    ; timer event that occurs for armor refresh
    RefreshArmor:
        WinWaitActive, ahk_class D3 Main Window Class, , 1 ; don't do this if D3 isn't active
        if (hotkeyEnabled && armorEnabled && !ErrorLevel) {
            SetTimer, RefreshArmor, off
            Send, 1 ; 1 = armor
            Random armorTimer, 105000, 118000 ; setup the next refresh to be in 105-125s
            SetTimer, RefreshArmor, %armorTimer%
        }
        return
    
    ; function to sleep a random amount of time
    RandomSleep(min, max) {
        Random, rand, %min%, %max%
        Sleep %rand%
    }
    
    ; function to splash a message
    SplashMessage(msg) {
        SplashTextOn, , , %msg%
        Sleep, 800
        SplashTextOff
    }


    fwiw, you can do really insane stuff with similar code. you can pixel check mana level, determine percentages, and calculate when to throw the meteors and when to stop. not including that to keep this simple.
    Posted in: Wizard: The Ancient Repositories
  • 0

    posted a message on need guidance for fields of misery, mp10, leg race competition
    i believe you can get a checkpoint up where you first meet the scoundrel. then hug wall, whichever direction, and spiral.
    Posted in: Wizard: The Ancient Repositories
  • 0

    posted a message on CM Wizard: Autohotkey saved my life
    i mostly lurk. but i like to code. took a look at this and got a few ideas. the below script will randomly time the CM sequence. i basically coded up a little app that timed how fast i could cycle 432 and shaved a bit off.

    i'm a bit weird, i like '3' as the hotkey. also note this uses the {Blind} modifier which will pass on any ctrl/alt/shift modifier if you want to be stationary.

    F12 will enable/disable everything

    it can optionally refresh armor every 105-250s. F11 toggles this

    it can optionally randomly click the right mouse button (in case you have meteor or teleport-safe passage). F10 toggles this. F9 modifies the chance between ~3-50%

    it's a fun academic exercise. do take into account all warnings Loroese has mentioned, use at your own risk
    #SingleInstance force
    
    hotkeyEnabled = 1
    armorEnabled = 1
    rbuttonEnabled = 0
    rbuttonModifier = 2
    
    SetTimer, RefreshArmor, 10000 ; setup initial armor refresh to happen in 10s
    
    #IfWinActive ahk_class D3 Main Window Class ; only use these hotkeys if D3 is active
        ; 3 is the hotkey to engage CM sequence - {Blind} resends with any mod keys (shift/ctrl/alt) to allow stationary
        $*3::
            if (hotkeyEnabled) { ; do CM sequence
                Click, down
                while GetKeyState("3", "P") {
                    Send, {Blind}4 ; diamond skin
                    RandomSleep(20, 40) ; randomness helps prevent detection
                    Send, {Blind}3 ; frost nova
                    RandomSleep(40, 80) ; randomness helps prevent detection
                    Send, {Blind}2 ; eb:cr
                    RandomSleep(80, 120) ; randomness helps prevent detection
                    if (rbuttonEnabled) {
                        Random, rbuttonRoll, 1.0, 100.0
                        rbuttonChance:= 100.0 / rbuttonModifier / 2.0
                        if (rbuttonRoll <= rbuttonChance or rbuttonRoll >= (100.0 - rbuttonChance))
                            Click, right
                    }
                }
                Click, up
            } else { ; just send 3 if hotkeys are disabled
                Send, {Blind}3
            }
            return
    
        ; F12 toggles whether all hotkey functionality is enabled or disabled
        F12::
            hotkeyEnabled := !hotkeyEnabled
            if(hotkeyEnabled && armorEnabled)
                SetTimer, RefreshArmor, 1000
            else
                SetTimer, RefreshArmor, off
            SplashMessage("Hotkeys " ((hotkeyEnabled) ? "enabled" : "disabled"))
            return
    
        ; F11 toggles auto-refresh of armor
        F11::
            armorEnabled := !armorEnabled
            if(hotkeyEnabled && armorEnabled)
                SetTimer, RefreshArmor, 1000
            else
                SetTimer, RefreshArmor, off
            SplashMessage("Armor refresh " ((armorEnabled) ? "enabled" : "disabled"))
            return
    
        ; F10 toggles whether whatever ability is on right mouse button is randomly used in CM sequence
        ; Ex: if meteors are on right button, meteors will be randomly thrown
        ;     teleport-safe passage is another possibility, becomes very easy to keep the 30% damage reduction up
        F10::
            rbuttonEnabled := !rbuttonEnabled
            SplashMessage("Random chance " ((rbuttonEnabled) ? "enabled" : "disabled"))
            return
    
        ; F9 cycles the actual random chance
        F9::
            rbuttonModifier *= 2
            if (rbuttonModifier > 32)
                rbuttonModifier = 2
            SplashMessage("Random chance is now " (100.0 / rbuttonModifier))
            return
    
    ; timer event that occurs for armor refresh
    RefreshArmor:
        WinWaitActive, ahk_class D3 Main Window Class, , 1 ; don't do this if D3 isn't active
        if (hotkeyEnabled && armorEnabled && !ErrorLevel) {
            SetTimer, RefreshArmor, off
            Send, 1 ; 1 = armor
            Random armorTimer, 105000, 125000 ; setup the next refresh to be in 105-125s - randomness helps prevent detection
            SetTimer, RefreshArmor, %armorTimer%
        }
        return
    
    ; function to sleep a random amount of time
    RandomSleep(min, max) {
        Random, rand, %min%, %max%
        Sleep %rand%
    }
    
    ; function to splash a message for 1s
    SplashMessage(msg) {
        SplashTextOn, , , %msg%
        Sleep, 1000
        SplashTextOff
    }
    Posted in: Wizard: The Ancient Repositories
  • To post a comment, please or register a new account.