how can i use this Oo ?
AFK Bot
Code:
Outdated
http://www.mpgh.net/forum/273-all-po...afk-bot-5.html
copy and paste all of that into notepad
save the file with the extension .au3.
Go here:
AutoIt Downloads - AutoItScript
Download: AutoIt – Self Extracting Archive (unless you want to install the program)
extract the contents.
Run the Aut2Exe program in the Aut2Exe folder that is the same as your OS Architecture (32/64 bit)
Find the .au3 file you saved with the .au3 browse button
hit compile
Run the bot
Have fun!
I get this after it logs in and runs for 5 minutes
AutoIt Error
Line 540 (File "C:\Users\Administrator\documents\APB Bot.exe
Error: Subscript used with non-Array variable
I also get this when I try to run it without using the auto-login system
Line 453 (File "C:\Users\Administrator\Documents\APB Bot.exe"):
Error: Variable used without being declared
AutoIt Error
Line 540 (File "C:\Users\Administrator\documents\APB Bot.exe
Error: Subscript used with non-Array variable
I also get this when I try to run it without using the auto-login system
Line 453 (File "C:\Users\Administrator\Documents\APB Bot.exe"):
Error: Variable used without being declared
I really hope I'm not bothering you too much with all these bug reports... 
You squashed the other two I reported but now theres another one
It's not clicking in the correct spot to close the premium popup regardless of what res I use/set it to.
Resolutions tried:
1440x900
1024x768

You squashed the other two I reported but now theres another one
It's not clicking in the correct spot to close the premium popup regardless of what res I use/set it to.
Resolutions tried:
1440x900
1024x768
I hate to say it but the last update caused a bug.
When I start the bot regardless if I used the login system or not, it pops up with a blank message that keeps re-appearing everytime you click ok until you stop the bot.
When I start the bot regardless if I used the login system or not, it pops up with a blank message that keeps re-appearing everytime you click ok until you stop the bot.
Fixed. It was a debugging thing i put in and forgot to take out lol
Code:
Opt("MustDeclareVars", 1)
#RequireAdmin
;Bot requires admin to be able to control the "APB Reloaded" process and send data to the window in the form of keyboard and mouse activity.
;This is due to UAC access restrictions where a process must be running as Admin to control any other process that is also running as Admin.
#Region ;ScriptSettings
#Region ;UserSetSettings
Global $Width = InputBox("Game Resolution Width", "Please input your game resolution width", @DesktopWidth)
;Ask for your screen width
Global $Height = InputBox("Game Resolution Height", "Please input your game resolution height", @DesktopHeight)
;Ask for your screen height
Global $UseAutoLogin = Msgbox(4, "Login System", "Would you like to use the bot's automatic login system?" & @LF & @LF & "Note: ONLY WORKS WITH CRIMINALS AS OF RIGHT NOW!")
;Questions you if you want to use the "_LoginSystem" function
If $UseAutoLogin = 6 then
;If you answered yes to the question (Return code 6) then...
Global $Email = InputBox("Email", "Please input your email")
;ask for your email
Global $Password = InputBox("Password", "Please input your password", "", "*")
;ask for your password with the characters displayed as *
Global $Character = InputBox("Character Selection", "Which character slot should be botted?", "1")
;Asks which character slot should be botted. Default is 1 (first slot)
Do
Global $District = StringUpper(InputBox("District Select", "Type WF for waterfront district, or Finan for financial district", "Finan"))
;Asks which district you want to go into...
Until $District == "WF" OR $District == "FINAN"
;until your input matches either WF or FINAN. (Case sensitive so we use a "StringUpper()" function on your input to make sure it's ALWAYS upper case.
EndIf
Global $PauseKey = InputBox("Pause key", "What key should pause the bot?" & @LF & @LF & "Note: Modifier keys alone will not work", "`")
;Asks which key to be used to pause the bot.
;Note: This uses AutoIt syntax.
;http://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm
#EndRegion ;UserSetSettings
#Region ;InternalSettings Note: Will not change after you compile the script!
Global $Sleep1[2] = [5,15]
;Controls first sleep timer, with the timer being a number between the first number and the second number, in seconds
Global $Sleep2[2] = [0,10]
;Controls second sleep timer, with the timer being a number between the first number and the second number, in seconds
Global $Sleep3[2] = [5,15]
;Controls third sleep timer, with the timer being a number between the first number and the second number, in seconds
Global $RandomAddition[2] = [1,3]
;Controls the adder that adds to the "ForceRandomPhrase" variable. It adds a random number between the two values to the $ForceRandomPhrase var.
Global $TriggerNumber = 6
;When the adder makes the "ForceRandomPhrase" variable greater than this number, a random phrase is typed in game.
Global $TimeToMove = 2
;Timer in seconds that the bot should move your character randomly
Global $RandomPhraseEnable = True
;Enables usage of the Random Phrase function
Global $PhrasesFile = "Phrases.txt"
;The file with various phrases to be used by the random phrase function
Global $EnableSound = True
;Enable beeps on pause/unpause of bot
Global $EnableTrayPopup = False
;Enable "Toasts" from notification tray indicating status of bot on pause/unpause
#EndRegion ;InternalSettings Note: Will not change after you compile the script!
#EndRegion ;ScriptSettings
#Region ;Button Coordinate Proportions
Global $LoginEmail[2] = [0.432291666666667,0.482407407407407]
Global $LoginPass[2] = [0.432291666666667,0.528703703703704]
Global $LoginButton[2] = [0.566666666666667,0.570370370370370]
Global $CharacterSlots[2] = [0.089062500000000,0.210185185185185]
Global $CharacterSpacing = 0.0388888888888888
Global $SelectCharacter[2] = [0.942187500000000,0.979629629629630]
Global $FinanDistrict[2] = [0.496354166666667,0.483333333333333]
Global $WFDistrict[2] = [0.632291666666667,0.473148148148148]
Global $JoinDistrict[2] = [0.947916666666667,0.980555555555556]
Global $DoubleB[2] = [0.524479166666667,0.501851851851852]
Global $StregaBloodrose[2] = [0.387500000000000,0.146296296296296]
Global $Suji[2] = [0.258333333333333,0.438888888888889]
Global $ArlonBenjamin[2] = [0.330208333333333,0.485185185185185]
Global $GraysonFell[2] = [0.416145833333333,0.855555555555556]
Global $Javez[2] = [0.252083333333333,0.883333333333333]
Global $VeronikaLee[2] = [0.651562500000000,0.601851851851852]
Global $TerriQuan[2] = [0.171354166666667,0.660185185185185]
Global $TyronSennet[2] = [0.339062500000000,0.656481481481481]
Global $PaganBloodrose[2] = [0.431770833333333,0.579629629629630]
Global $ByronBloodrose[2] = [0.480729166666667,0.469444444444444]
Global $HarmonBenjamin[2] = [0.549479166666667,0.474074074074074]
Global $BritneyBloodrose[2]= [0.621354166666667,0.231481481481481]
Global $PremiumMsg[2] = [0.398958333333333,0.699074074074074]
;The above are the button click points in game. You can get a button click point for any resolution by performing the following calculation.
;Replace X (Width) for Y (Height) when finding Y.
;Button Coordinate X / Screen Width = Proportion
;Proportion * Width Of Any Computer = Click Coordinate on new screen
#EndRegion ;Button Coordinate Proportions
#Region ;Main
Global $Paused
;Creates the global variable for the "_TogglePause" function.
Global $ForceRandomPhrase = 0
;Creates the global var to force a random phrase based on the $TriggerNumber var and $RandomAddition array.
HotkeySet($PauseKey, "_TogglePause")
;Sets the hotkey for pausing the bot.
If $UseAutoLogin = 6 Then _LoginSystem($Email, $Password, $Character, $District, $Height, $Width)
;starts the automatic login system if you answered yes to the autologin question
While 1
While WinActive("APB Reloaded")
_RandomTimer($Sleep1)
Send("k")
Send("b")
_RandomTimer($Sleep2)
Send("{Enter}")
Sleep(2000)
Send("/AbandonMission")
Sleep(2000)
Send("{Enter}")
_RandomTimer($Sleep3)
_MoveCharacter($TimeToMove, Number(Random(1, 4, 1)))
_RandomPhrase($RandomPhraseEnable, $RandomAddition, $TriggerNumber, $PhrasesFile)
_Click($PremiumMsg, $Width, $Height)
Wend
WEnd
;See function region!
#EndRegion ;Main
#Region ;Functions
;_LoginSystem(True/False [On/Off], Login Email, Login Password, Character to Bot, District Selection)
Func _LoginSystem($LE, $LP, $Ch, $DS, $W = @DesktopWidth, $H = @DesktopHeight)
WinSetState("APB Reloaded", "", @SW_MAXIMIZE)
Sleep(10000)
_Click($LoginEmail, $W, $H)
Send("^a" & $LE)
_Click($LoginPass, $W, $H)
Send("^a" & $LP)
_Click($LoginButton, $W, $H)
Sleep(15000)
_CharacterSelect($CharacterSlots, $CharacterSpacing, $Ch, $W, $H)
Sleep(10000)
_Click($SelectCharacter, $W, $H)
Sleep(10000)
If $DS == "FINAN" Then
_Click($FinanDistrict, $W, $H)
_Click($JoinDistrict, $W, $H)
Sleep(60000)
_Click($DoubleB, $W, $H)
ElseIf $DS == "WF" Then
_Click($WFDistrict, $W, $H)
_Click($JoinDistrict, $W, $H)
Sleep(60000)
_Click($PaganBloodrose, $W, $H)
Else
MsgBox(0,"Error", "No district selected")
EndIf
EndFunc
;_Click(Button, Width, Height, Click count)
Func _Click(ByRef $ClickLocation, $W = @DesktopWidth, $H = @DesktopHeight, $Clicks = 1)
MouseClick("Left", $ClickLocation[0] * $Width, $ClickLocation[1] * $H, $Clicks)
EndFunc
;_CharacterSelect(Character Slot 1 Location, Spacing between click points on boxes, Character To Select, Width, Height)
Func _CharacterSelect(ByRef $ClickLocation, $aS, $Character, $W = @DesktopWidth, $H = @DesktopHeight)
MouseClick("Left", $ClickLocation[0] * $W, ($ClickLocation[1] + ($aS * ($Character-1))) * $H, 1)
EndFunc
;_RandomTimer(Sleep Time Array)
Func _RandomTimer(ByRef $SA)
Sleep(Number(Random($SA[0], $SA[1], 1) * 1000))
EndFunc
;_MoveCharacter(Time to move character in seconds, Direction to Move [1 = W | 2 = S | 3 = A | 4 = S])
Func _MoveCharacter($TTM, $Direction)
Opt("SendKeyDownDelay", $TTM * 1000)
Switch $Direction
Case 1
Send("w")
Case 2
Send("d")
Case 3
Send("a")
Case 4
Send("s")
EndSwitch
Opt("SendKeyDownDelay", 5)
EndFunc
;_RandomPhrase(True/False [On/Off], Phrases File, Random Addition Array, Trigger Number)
Func _RandomPhrase($RPE, ByRef $RA, $TN, $PF)
If $RPE Then
Global $PhrasesArray
If Not IsDeclared("FRP") Then
Global $FRP = 0
EndIf
If (Not IsDeclared("PhrasesArray")) Or (Not IsArray($PhrasesArray)) Then
If FileExists($PF) Then
_FileReadToArray($PF, $PhrasesArray)
EndIf
EndIf
$FRP += Number(Random($RA[0], $RA[1]))
If $FRP > Number($TN) Then
Send("{Enter}")
Sleep(2000)
Send("/d " & $PhrasesArray[Random(1, $PhrasesArray[0], 1)])
Sleep(2000)
Send("{Enter}")
$FRP = 0
EndIf
EndIf
EndFunc ;==>_RandomPhrase
;_FileReadToArray(File Path, Array to input read file into)
Func _FileReadToArray($sFilePath, ByRef $aArray)
Local $hFile = FileOpen($sFilePath, 0)
If $hFile = -1 Then Return SetError(1, 0, 0)
Local $aFile = FileRead($hFile, FileGetSize($sFilePath))
If StringRight($aFile, 1) = @LF Then $aFile = StringTrimRight($aFile, 1)
If StringRight($aFile, 1) = @CR Then $aFile = StringTrimRight($aFile, 1)
FileClose($hFile)
If StringInStr($aFile, @LF) Then
$aArray = StringSplit(StringStripCR($aFile), @LF)
ElseIf StringInStr($aFile, @CR) Then
$aArray = StringSplit($aFile, @CR)
Else
If StringLen($aFile) Then
Dim $aArray[2] = [1, $aFile]
Else
Return SetError(2, 0, 0)
EndIf
EndIf
Return 1
EndFunc ;==>_FileReadToArray
;_TogglePause(N/A)
Func _TogglePause()
$Paused = Not $Paused
If $Paused Then
If Number($EnableSound) Then
Beep(300, 100)
Beep(200, 100)
EndIf
If Number($EnableTrayPopup) Then TrayTip("", "AFK Bot has been paused", 1, 16)
Else
If Number($EnableSound) Then
Beep(200, 100)
Beep(300, 100)
EndIf
If Number($EnableTrayPopup) Then TrayTip("", "AFK Bot has been unpaused", 1, 16)
EndIf
While $Paused
ToolTip('AFK Bot is paused', 0, 0)
Sleep(100)
WEnd
ToolTip("")
EndFunc ;==>_TogglePause
#EndRegion ;Functions
I am also getting this error, but apart from that, great coding!!
(EDIT: I have bypassed the error by using the autologin but using an enforcer as my choice, then just click myself through the login process, pausing the bot, then when im in the district i want and im spawned i just unpause and let it run.)
(EDIT: I have bypassed the error by using the autologin but using an enforcer as my choice, then just click myself through the login process, pausing the bot, then when im in the district i want and im spawned i just unpause and let it run.)
A few knowing AHK syntax that I has understood, on it and has asked that it does because having made all in manual has occurred nothing.
Excuse for bad English. Google the translator.
P.S. Than AutoIt it is better AHK?
P.P.S. AutoIt colors understands? Auto prompting on certain color!
Excuse for bad English. Google the translator.
P.S. Than AutoIt it is better AHK?
P.P.S. AutoIt colors understands? Auto prompting on certain color!

AHK is really just a "sub section" of AutoIt's abilities. AHK is really meant to do only Hotkey stuff for bindings. (Which is how a previously made, now banned, Rapid Fire macro was made)
How much was it off?
If you could post a screenie of the premium popup using this tool
http://www.mpgh.net/forum/273-all-po...erbot-ftw.html
it would be really handy.
I have a 1920 width screen resolution, so it's much more precise and easier to click on. The smaller the screen resolution, the more "Guessing" has to be done as to what the proper value actually is, and eventually it will entirely just break the bot.
If you could tell me how many pixels it was off by and your screen resolution, I could just give you the proper "PremiumMsg" array for your screen.
As for making a thread for this, I will when I make a GUI for it.
How much was it off?
If you could post a screenie of the premium popup using this tool
http://www.mpgh.net/forum/273-all-po...erbot-ftw.html
it would be really handy.
I have a 1920 width screen resolution, so it's much more precise and easier to click on. The smaller the screen resolution, the more "Guessing" has to be done as to what the proper value actually is, and eventually it will entirely just break the bot.
If you could tell me how many pixels it was off by and your screen resolution, I could just give you the proper "PremiumMsg" array for your screen.
As for making a thread for this, I will when I make a GUI for it.
For some reason, I keep getting blank screenshots using both print screen and your screenshot tool so I had to use xfire. Do they HAVE to be uploaded or can I just link you it?

Took in a 1440x900 resolution
Direct Link: http://img195.imageshack.us/img195/3...0922180509.png
Cursor is on the exact pixel it sends the cursor to

Took in a 1440x900 resolution
Direct Link: http://img195.imageshack.us/img195/3...0922180509.png
Cursor is on the exact pixel it sends the cursor to
Oh. Forgot to mention if your on Win7/Vista you have to disable desktop composition for APB via compatability.
But thank you for the picture. I'll see what's wrong and edit this post when im finished
Edit:
Replace the $PremiumMsg array variable with this
Global $PremiumMsg[2] = [0.366666666666666,0.459722222222222]
But thank you for the picture. I'll see what's wrong and edit this post when im finished
Edit:
Replace the $PremiumMsg array variable with this
Global $PremiumMsg[2] = [0.366666666666666,0.459722222222222]
This thread is closed for replies.
Similar Threads
Combat Arms Hacks & Cheats💬 [First Post] CA afk bot!
57 Combat Arms Hacks & CheatsEpicPacMan's CA AFK BOT {BETA}
51 Combat Arms Hacks & Cheats💬 EpicPacMan's CA AFK BOT {BETA} 2nd RELEASE!
63 Combat Arms Hacks & Cheats😎 EPICPACMAN's {ULTIMATE AFK BOT}
37 Combat Arms Hacks & CheatsAfk Bot Are StupidTW 26

The bot works great now. The mouse was a hair off on clicking the premium ad but putting the game in windowed positioned it into range. You should really make a thread for this. :P