Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ;Set to match Windows titles exactly
- SetTitleMatchMode, 3
- ;Loops around and closes continuum and injector process until none exist
- While 1{
- Sleep, 200
- Process, Exist, Continuum.exe
- if (!ErrorLevel = 0){
- RunWait, taskkill /f /t /im Continuum.exe
- }
- if (ErrorLevel = 0){
- break
- }
- }
- While 1{
- Sleep, 200
- Process, Exist, Injector.exe
- if (!ErrorLevel = 0){
- Process, Close, Injector.exe
- }
- if (ErrorLevel = 0){
- break
- }
- }
- ;The main loop that cycles through each bot
- While 1{
- ;BOT 9 ------------------------------------------------------------------------------------------------------------------------------
- ;This starts the bot if it isnt running, and restarts it if disconected from server
- FileRead, Read, C:\Program Files (x86)\Continuum\Logs\bot9.log
- Sleep, 5000
- if (RegExMatch(Read, "m)^ WARNING: ") or !WinExist("9")){
- WinClose, 9
- WinWait, Continuum 0.40,, 5
- WinClose, Continuum 0.40
- Sleep, 1000
- ;Keep the log file small, and another thing
- FileDelete, C:\Program Files (x86)\Continuum\logs\bot9.log
- ;Before starting continuum check and close any continuum menus
- While 1{
- Sleep, 200
- if (WinExist("Continuum 0.40")){
- WinClose, Continuum 0.40
- }
- if (!WinExist("Continuum 0.40")){
- break
- }
- }
- ;Starts continnum and checks if the window exists
- Run, C:\Users\Jon\Desktop\Marvin Run Folder\multicont
- WinWait, Continuum 0.40,, 5
- While 1{
- Sleep, 200
- if (!WinExist("Continuum 0.40")){
- Run, C:\Users\Jon\Desktop\Marvin Run Folder\multicont
- WinWait, Continuum 0.40,, 5
- }
- if (WinExist("Continuum 0.40")){
- break
- }
- }
- ;give the active window a handle, this handle doesnt need to be unique
- Menu := WinActive()
- ;This sends keys to open the profile menu, it loops to make sure the menu opened, this loop is definetly needed
- ControlSend,, ^p, ahk_id %Menu%
- WinWait, Select/Edit Profile,, 1
- While 1{
- Sleep, 200
- if (!WinExist("Select/Edit Profile")){
- ControlSend,, ^p, ahk_id %Menu%
- WinWait, Select/Edit Profile,, 1
- }
- if (WinExist("Select/Edit Profile")){
- break
- }
- }
- Profile := WinActive()
- ;Send keys to select a profile, loops to make sure the profile menu closed, probably not needed
- ControlSend,, {PGUP}{PGUP}{PGUP}{PGUP}{PGUP}{ENTER}, ahk_id %Profile%
- Sleep, 200
- While 1{
- Sleep, 200
- if (WinExist(%Profile%)){
- ControlSend,, {ENTER}, ahk_id %Profile%
- }
- if (!WinExist(%Profile%)){
- break
- }
- }
- ;Login
- ControlSend,, {ENTER}, ahk_id %Menu%
- ;Wait 35 Seconds, if there is no connection, the client will timeout
- WinWait, Continuum,,35
- ;If the client times out try again, if it connects to the game, the log file previously deleted will be created
- While 1{
- Sleep, 200
- if (WinExist("Information")){
- WinClose, Information
- Sleep, 1000
- ControlSend,, {ENTER}, ahk_id %Menu%
- WinWait, Continuum,, 35
- }
- if (FileExist("C:\Program Files (x86)\Continuum\Logs\bot9.log")){
- Bot9 := WinActive()
- break
- }
- }
- ;Press ESC too early and it will exit back to the menu
- Sleep, 3000
- ;Marvin will default to Warbird if the client is not in a ship
- ControlSend,, {ESC}, ahk_id %Bot9%
- Sleep, 1000
- ControlSend,, 1, ahk_id %Bot9%
- ;Without this sleep timer the game will minimize before the player enters the ship
- Sleep, 1000
- WinMinimize, ahk_id %bot9%
- Sleep, 1000
- ;Before starting marvin check and close any continuum menus and injectors
- While 1{
- Sleep, 200
- if (WinExist("Continuum 0.40")){
- WinClose, Continuum 0.40
- }
- if (WinExist("Injector")){
- WinClose, Injector
- }
- if (!WinExist("Continuum 0.40" and !WinExist("Injector"))){
- break
- }
- }
- ;This starts injector and uses a regex to select the first unloaded process
- While 1{
- Sleep, 100
- if (!WinExist("Continuum (enabled)")){
- Run, C:\Users\Jon\Desktop\Marvin Run Folder\Injector
- WinWait, Injector,, 5
- While 1{
- Sleep, 200
- if (!WinExist("Injector")){
- Run, C:\Users\Jon\Desktop\Marvin Run Folder\Injector
- WinWait, Injector,, 5
- }
- if (WinExist("Injector")){
- break
- }
- }
- Injector := WinActive()
- Sleep, 200
- ;Check if the text copied correctly
- Text = 0
- While 1{
- Sleep, 200
- if (!RegExMatch(Text, "^1: ")){
- ControlSend,, ^a, ahk_id %Injector%
- Sleep, 200
- ControlSend,, {ENTER}, ahk_id %Injector%
- Text := Clipboard
- }
- if (RegExMatch(Text, "^1: ")){
- break
- }
- }
- RegExMatch(Text, "m)^(\d+):.+?\)$", Match)
- ControlSend,, %Match1%, ahk_id %Injector%
- Sleep, 100
- ControlSend,, {ENTER}, ahk_id %Injector%
- Sleep, 1000
- }
- if (WinExist("Continuum (enabled)")){
- WinSetTitle, ahk_id %bot9%,, 9
- break
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement