Jump to content

Join our Slack

Talk to other users and have a great time
Slack Server

Welcome to our Community

Click here to get your Exiled Bot license
Donation Store
Sign in to follow this  
zapbrannigan

autostart bot with watchdog ahk

Recommended Posts

; If the script is not elevated, relaunch as administrator and kill current instance:

full_command_line := DllCall("GetCommandLine", "str")

if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
    try ; leads to having the script re-launching itself as administrator
    {
        if A_IsCompiled
            Run *RunAs "%A_ScriptFullPath%" /restart
        else
            Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
    }
    ExitApp
}
SetWorkingDir %A_ScriptDir%
Sleep, 15000
startbot:
loop *.exe
    {
        if(A_LoopFileName!="cports.exe") And (A_LoopFileName!="startbot.exe")
            {
                Run, %A_LoopFileName% --normal, , , ebpid
            }
    }
WinWait ahk_pid %ebpid%
WinActivate ahk_pid %ebpid%
WinGetActiveTitle, ebtitle
SendMessage, 0xB772,,,, %ebtitle%
Loop {
    Process, Exist, %ebpid%
    If ErrorLevel = 0
        {
            Sleep, 10000
            WinGet, ebbpid, PID, ahk_class #32770
            Process, Close, %ebbpid%
            Goto, startbot
        }
}

Save this text to file whatever.ahk and copy to startup folder. Win+r type shell:startup

Script run bot after 15 seconds(for all vpn, proxyfier etc loads)

Script autostart bot with last used profile

Script watch if bot crashed or relaunch and stuck on inject method window then script relaunch bot and autostart it. Check every 10 seconds.

I use it inside my vmware box

Edited by zapbrannigan
  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...