Results 121 to 122 of 122

Threaded View

  1. #1
    Xaymar's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    47
    Reputation
    110
    Thanks
    2,556
    My Mood
    Amused

    Trove AutoHotkey Scripts

    I'm here, with another release for the multiplayer hacking scene - this time for Trove, aka Cube World as an MMO. I bring you a little AutoHotkey script that can automate some common tasks for you, like being AFK and fishing. Seriously, who thought fishing like this was a good idea? Even old PlayStation 1 games had better fishing mini-games!

    [ Credits ]
    • taejim for the AutoHotkey bot.
    • AutoHotkey Forum for helping with the toggle-able Hotkey.
    • Fishing List for Trove - looks like it's worth making these bots.


    [ Features ]
    • Modular
      The entire Script is based on one Include-able file, which means that you can easily build your own Hotkeys if you have AutoHotkey installed (It's free and less detectable!).
    • Anti-AFK Logout
      Prevents automatic logout by pressing C to open the character menu. Includes: Anti-Detection Timings, Statistics
    • Automatic Fishing Bot
      Automate your fishing needs with a single Hotkey - just press and do something else. I made over ~120k Glim in one day with this bot. Includes: Anti-Detection Timings, Statistics
    • Utility/Tool: Anti-Detection Timings
      I've measured my own reaction times using custom written software and found that I usually respond within 86 - 111ms of the sound being played (plus driver delays, so actually 116 - 141ms).
    • Utility/Tool: Statistics
      Displays a small Statistics ToolTip at the top-left of the window - useful for anyone needing these.


    [ Source Code ]
    Trove.ahk
    Code:
    AntiAFK_Code(Index, Key, ByRef RunningVar, ByRef StopVar)
    {
        ;- Check if the HotKey is already running.
        if RunningVar
        {
            ; Let's signal the running thread it to stop.
            StopVar := true
            return
        }
        
        ;- Make sure that we actually have a Trove window targeted.
        if not WinActive("Trove")
            return
        
        ;- Signal that we have officially been able to start.
        RunningVar := true
        
        ;- If it's not running, we'll start by grabbing information about the games window.
        WinGet, PID, PID, A
        WinGet, HWND, ID, A
        
        ; Show a tooltip at the windows position.
        CoordMode, ToolTip, Screen
        WinGetPos, winX, winY, winW, winH, ahk_pid %PID%
            
        ;- The actual loop that does our work.
        Timer := 0
        Time_Start := A_TickCount
        Loop
        {
            ; Avoiding AFK is as simple as opening up the Character menu.
            ControlSend, , {c down}, ahk_pid %PID%
            Sleep, 86
            ControlSend, , {c up}, ahk_pid %PID%
    
            ; Sleep in order to not look like a spammer.
            Random, SleepTime, 5, 50
            Loop %SleepTime%
            {
                ; Check if we should stop.
                if StopVar
                    break 2
                
                ; Display AFK time.
                CoordMode, ToolTip, Screen
                WinGetPos, winX, winY, winW, winH, ahk_pid %PID%
                Time := A_TickCount - Time_Start
                ToolTipText =
    (
    Anti-AFK Bot %Index% is running, press %Key% to stop it.
        Total Time: %Time% ms.
    )
                ToolTip, %ToolTipText%, %winX%, %winY%
                
                Random, SleepTime, 86, 111
                Sleep, %SleepTime%
                Timer := Timer + 1
            }
        }
        
        ; Reset state for re-use.
        RunningVar := false
        StopVar := false
        ToolTip, , , , 1
    }
    
    AutoFishing_Code(Index, Key, ByRef RunningVar, ByRef StopVar)
    {
        ;- Check if the HotKey is already running.
        if RunningVar
        {
            ; Let's signal the running thread it to stop.
            StopVar := true
            return
        }
        
        ;- Make sure that we actually have a Trove window targeted.
        if not WinActive("Trove")
            return
        
        ;- Signal that we're running now.
        RunningVar := true
        
        ;- If it's not running, we'll start by grabbing information about the games window.
        WinGet, PID, PID, A
        WinGet, HWND, ID, A
        
        ;- Pointers
        Base := getProcessBaseAddress(HWND)
        WaterAddress := GetAddressWater(PID, Base, 0x009570DC) 
        LavaAddress := GetAddressLava(PID, Base, 0x009570DC) 
        ChocoAddress := GetAddressChoco(PID, Base, 0x009570DC)
        
        ;- Statistics
        Time_Start := A_TickCount
        Time := 0
        Fishing_Start := A_TickCount
        Fishing := 0
        Fish := 0
        
        HumanPressButton(b, ahk_pid %PID%)
        
        
        ; The main loop based on a State-Machine.
        State=0
        Loop
        {
            ; Show a tooltip at the windows position.
            CoordMode, ToolTip, Screen
            WinGetPos, winX, winY, winW, winH, ahk_pid %PID%
            Time := A_TickCount - Time_Start
            ToolTipText=
    (
    Auto-Fishing Bot %Index% is running, press %Key% to stop it.
        Total Time: %Time% ms
        Total Fish Caught: %Fish%
        Fishing Time: %Fishing% ms
        State: %State%/%StateNext%
    )
            ToolTip, %ToolTipText%, %winX%, %winY%, 1s
            
            ;- State-Machine
            If IsLabel("AutoFishing-" . State)
            {
                Loop 1 {
                    Goto AutoFishing-%State%
                    
                    ; State: Anti-AFK
                    AutoFishing-0:
                    AutoFishing-AntiAFK-Init:
                        ControlSend, , {c down}, ahk_pid %PID%
                        
                        ; Advance
                        State=AntiAFK
                        StateTimer=0
                        Break
                    AutoFishing-AntiAFK:
                        ControlSend, , {c up}, ahk_pid %PID%
                        
                        ; Advance
                        State=AntiDetection-Init
                        StateNext=ThrowHook-Init
                        StateTimer=0
                        Break
                    
                    ; State: Throw Hook
                    AutoFishing-2:
                    AutoFishing-ThrowHook-Init:
                        ControlSend, , {f down}, ahk_pid %PID%
                        
                        ; Advance
                        State=ThrowHook
                        StateTimer=0
                        Random, StateMaxTimer, 2, 15
                        Break
                    AutoFishing-ThrowHook:
                        ControlSend, , {f up}, ahk_pid %PID%
                        
                        ; Time Display
                        Fishing_Start := A_TickCount
                        
                        ; Advance
                        State=AntiDetection-Init
                        StateNext=Prepare
                        Break
                    
                    ; State: Prepare for Check
                    AutoFishing-Prepare:
                        ; Update Statistics
                        Fishing := A_TickCount - Fishing_Start
                        
                        ; Read memory to determine if we're in the pool of things (it's 1 until it hits the surface).
                        CaughtWater := ReadMemory(PID, WaterAddress)
                        CaughtLava := ReadMemory(PID, LavaAddress)
                        CaughtChoco := ReadMemory(PID, ChocoAddress)
                        
                        if !(CaughtWater || CaughtLava || CaughtChoco)
                        {
                            State=Check
                        }
                        else {
                            ; If 5 seconds have passed, assume we hit the ground and reset.
                            If (Fishing > 5000)
                                State=0
                        }
                        
                        Break
                    
                    ; State: Check for Fish
                    AutoFishing-Check:
                        ; Update Statistics
                        Fishing := A_TickCount - Fishing_Start
                        
                        ; Read memory to determine if we have something hooked or not.
                        ; (Can we do this without reading memory? This is easily detectable, we'd have to mask it like a virus scanner.)
                        CaughtWater := ReadMemory(PID, WaterAddress)
                        CaughtLava := ReadMemory(PID, LavaAddress)
                        CaughtChoco := ReadMemory(PID, ChocoAddress)
                        
                        if (CaughtWater || CaughtLava || CaughtChoco)
                        {
                            Fish := Fish + 1
                            
                            State=AntiDetection-Init
                            StateNext=ReelIn-Init
                        }
                        else 
                        {
                            ; If 45 seconds have passed, we're bugged so reset.
                            if (Fishing > 45000)
                            {
                                State=AntiDetection-Init
                                StateNext=ReelIn-Init
                            }
                        }
                        Break
                        
                    ; State: Reel In Hook
                    AutoFishing-ReelIn-Init:
                        ControlSend, , {f down}, ahk_pid %PID%
                        
                        State=ReelIn
                        Break
                    AutoFishing-ReelIn:
                        ControlSend, , {f up}, ahk_pid %PID%
                        
                        State=CompleteCycle
                        StateNext=Reset
                        Break
                    
                    ; State: Complete Cycle
                    AutoFishing-CompleteCycle-Init:
                        Random, StateMaxTimer, 8, 16
                        
                        State=CompleteCycle
                        StateTimer=0
                        Break
                    AutoFishing-CompleteCycle:
                        StateTimer := StateTimer + 1
                        if (StateTimer > StateMaxTimer)
                        {
                            State=AntiDetection-Init
                            StateNext=Reset
                        }
                        Break
                    
                    ; Reset State
                    AutoFishing-Reset:
                        State=0
                        StateNext=
                        StateTimer=0
                        StateMaxTimer=0
                        Break
                    
                    ; Utility State: Anti-Detection (wait humane amount of time)
                    AutoFishing-AntiDetection-Init:
                        Random, StateMaxTimer, 8, 16
                        
                        State=AntiDetection
                        StateTimer=0
                        Break
                    AutoFishing-AntiDetection:
                        StateTimer := StateTimer + 1
                        if (StateTimer > StateMaxTimer)
                        {
                            State=%StateNext%
                            StateNext=
                            StateTimer=0
                        }
                        Break
                }
            }
            
            ; Check if we should stop.
            if StopVar
                break
            
            HumanLikeSleep()
        }
        HumanPressButton(b, ahk_pid %PID%)
        
        ; Reset state for re-use.
        RunningVar := false
        StopVar := false
        ToolTip, , , , 1
    }
    
    HumanPressButton(Button, To)
    {
        ControlSend, , {%Button% down}, %To%
        HumanLikeSleep()
        ControlSend, , {%Button% up}, %To%
    }
    
    HumanLikeSleep()
    {
        Random, SleepTime, 66, 122
        Sleep, %SleepTime%
    }
    
    ;- Helpers & Utility
    GetAddressWater(PID, Base, Address)
    {
        pointerBase := base + Address
        y1 := ReadMemory(PID, pointerBase)
        y2 := ReadMemory(PID, y1 + 0x144)
        y3 := ReadMemory(PID, y2 + 0xe4)
        Return WaterAddress := (y3 + 0x70)   
    }
    
    GetAddressLava(PID, Base, Address)
    {
        pointerBase := base + Address
        y1 := ReadMemory(PID, pointerBase)
        y2 := ReadMemory(PID, y1 + 0x144)
        y3 := ReadMemory(PID, y2 + 0xe4)
        Return LavaAddress := (y3 + 0x514) 
    }
    
    GetAddressChoco(PID, Base, Address)
    {
        pointerBase := base + Address
        y1 := ReadMemory(PID, pointerBase)
        y2 := ReadMemory(PID, y1 + 0x144)
        y3 := ReadMemory(PID, y2 + 0xe4)
        Return ChocoAddress := (y3 + 0x2c0) 
    }
    
    getProcessBaseAddress(HWND)
    {
        return DllCall( A_PtrSize = 4
                            ? "GetWindowLong"
                            : "GetWindowLongPtr"
                        , "Ptr", HWND
                        , "Int", -6
                        , "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
        ; If DLL call fails, returned value will = 0
    }   
    
    ReadMemory(PID, MADDRESS)
    {
        VarSetCapacity(MVALUE,4,0)
        ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", PID, "UInt")
        ;DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
        DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
        Loop 4
            result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
        return, result
    }
    Example Use
    Code:
    #Persistent
    #MaxThreadsPerHotKey 3
    #WinActivateForce
    
    ; Client 1: Hotkeys
    ^NumpadDiv::
        AntiAFK_Code(1, "NumpadDiv", Running, Stop)
    return
    
    ^NumpadMult::
        AutoFishing_Code(1, "NumpadMult", Running, Stop)
    return
    
    #Include Trove.ahk
    [ Media ]


    [ Version History ]


    [ Remaining Changes / To Do ]
    • Avoid reading memory if possible - check screen, sniff network?
    <b>Downloadable Files</b> Downloadable Files
    Last edited by maddoggy00; 07-20-2015 at 10:30 AM. Reason: Update 19.07.2015

  2. The Following 153 Users Say Thank You to Xaymar For This Useful Post:

    a1e215df (09-07-2015),AI807 (07-26-2015),Alppad (05-07-2017),Amairin12 (07-20-2015),Amrou (07-25-2015),ano67 (07-19-2015),apbmonkeys (04-20-2018),apox12345612 (07-19-2015),ArmlessWoman (07-21-2015),assault5 (07-19-2015),asxdar (07-26-2015),Bessstooo (09-10-2021),bhum123456 (07-21-2015),biledkid0119 (07-23-2015),biledkid1998 (07-23-2015),blackchampionPT (07-20-2015),bolovancescu (07-22-2015),boskoboskixd (07-20-2015),boyzzblack (07-23-2015),brayanviictor (07-23-2015),BSTi89 (07-23-2015),Cameron9456 (07-22-2015),chipon1 (01-18-2020),cookieheaven (07-21-2015),daadaan (07-21-2015),danishr (07-22-2015),Darkadous (07-20-2015),dawidex122 (07-20-2015),Debusen (07-19-2015),Deki77 (07-23-2015),denny70615 (07-20-2015),dessers (07-20-2015),DevilOns (07-21-2015),drakarhythm (07-26-2015),enriquefolgado (07-20-2015),Enterino (07-20-2015),FadolMiller (07-26-2015),FlamingKatana (07-20-2015),FlippingFox (07-24-2015),forlols (07-23-2015),futtardel (07-19-2015),FzudemiST (07-22-2015),g11andrews (07-20-2015),gigino (07-28-2015),gokujujux (07-24-2015),greno (07-22-2015),guiguifrozem (07-22-2015),guilobo (07-20-2015),Heck07 (07-24-2015),Herofthegalaxy (07-21-2015),hypertun (07-24-2015),hypolo7 (07-22-2015),icykoala (07-21-2015),ignux123 (07-20-2015),IknowimSwag (07-24-2015),Imaniggeriwanttosteal (07-26-2015),jacklaw73 (07-20-2015),jumper3x (07-31-2015),kamijyofok (07-20-2015),Kastl (07-26-2015),keteflips (07-26-2015),khh123 (07-26-2015),kikire1 (07-20-2015),killswitch47 (07-20-2015),kivviz (07-20-2015),KoningLys (12-08-2017),Konng_ (07-20-2015),kucinghax (07-22-2015),kwebber321 (07-20-2015),larche (08-29-2015),Limited (07-22-2015),LosMatthew (08-16-2015),LouisTNT (07-25-2015),lshosinisal (07-27-2015),ludacris661 (07-23-2015),m321m (12-21-2015),majinvegito123 (07-21-2015),mankey (07-20-2015),marcellfaunks (07-23-2015),Martiquet (07-26-2015),Melih45 (07-26-2015),merc280 (07-24-2015),mirakool (07-22-2015),mitev9999 (03-06-2019),mmxxl (07-19-2015),momolol228l (07-17-2020),Monitomen (07-23-2015),MrFrostie (07-20-2015),netsi123 (04-09-2019),nilotaviano (07-19-2015),OnlyPrime223 (07-25-2015),Paradox9022 (07-26-2015),peter50602 (07-22-2015),ploomira (07-20-2015),pohanyx (07-26-2015),Poorloading (07-20-2015),PrisonDash (07-19-2015),ProdigizedDP (07-22-2015),pyons68 (07-23-2015),Quinndle_ (07-19-2015),r0ckar (07-22-2015),RagnarokGaming (07-23-2015),ramramy (07-22-2015),rapidgamer (10-28-2015),reawzaafap (07-26-2015),ronchetta (07-22-2015),RyanMoloney (07-22-2015),samrockandmrbean (07-20-2015),ScaningMonkii (07-20-2015),ShadowHeart24 (07-23-2015),ShadowOps (07-19-2015),siewie12 (07-22-2015),SlaiiZ (07-19-2015),sohzd1234 (07-20-2015),soigrev (07-23-2015),Spadotto (07-23-2015),stephenyctse (07-24-2015),steveman815 (07-27-2015),steven674650 (07-26-2015),stuppud (07-20-2015),subc00kie (07-22-2015),suicun13 (07-19-2015),supernovaDX (07-20-2015),Swaggox (07-25-2015),taejim (07-19-2015),ThatBenderGuy (07-21-2015),TheNapoxd (07-19-2015),TheReafg1000 (07-25-2015),thetechy2 (07-25-2015),TimeFluxMista (07-24-2015),Tobei291 (10-01-2015),tommypu1 (08-20-2015),tony5568 (07-24-2015),ToplelGG (07-21-2015),troyz69888 (07-31-2015),Tryhardguru (07-23-2015),TYamcha (07-25-2015),UrgotShop (07-26-2015),UsbHub (07-22-2015),Usernaemmm (07-19-2015),vioelntplume (07-22-2015),viper1996tat (03-02-2024),vitorloko9 (07-19-2015),Vuqe (07-19-2015),winsonheha (07-25-2015),Wontang (07-23-2015),xcyber115 (07-21-2015),XDragonclaw (07-27-2015),xjedde (07-25-2015),xk86 (07-22-2015),xPham (07-19-2015),YakuzoeGod (07-22-2015),yohol (01-25-2020)

Similar Threads

  1. BO2 Rapid Fire + Antirecoil - UNDETECTED [AutoHotkey Script]
    By digi7al in forum Call of Duty Black Ops 2 Coding, Programming & Source Code
    Replies: 47
    Last Post: 08-14-2014, 05:49 PM
  2. AutoHotKey Scripts
    By joker__4ever in forum All Points Bulletin Reloaded Hacks
    Replies: 9
    Last Post: 01-22-2012, 02:57 PM
  3. Do compiled autohotkey scripts get detected?
    By Unrealer in forum Call of Duty Modern Warfare Help
    Replies: 6
    Last Post: 11-23-2011, 12:06 PM
  4. [Release] Black Ops QuickScope AutoHotkey Script for Sph4ack's Aimbot v1.2
    By 63OR63 in forum Call of Duty 7 - Black Ops Hacks & Cheats
    Replies: 45
    Last Post: 01-18-2011, 06:46 PM
  5. [Release] Black Ops QuickScope AutoHotkey Script for Sph4ack's Aimbot v1.0
    By 63OR63 in forum Call of Duty 7 - Black Ops Hacks & Cheats
    Replies: 19
    Last Post: 01-14-2011, 05:41 PM

Tags for this Thread