Cerb
Member!
This guide is not like Starfish's old one. This guide is for an AutoIt v3 spambot. AutoIt v3 is a completely different language, and it is much more powerful.
Ok, in this guide, I'll briefly explain how to write your very own bot using AutoIt v3, which can be found here (Just download AutoItv3Setup.exe file)
Now that you have AutoIt installed, assuming you don't need a guide to install this program, let's begin.
Right click somewhere in windows and choose to make a new AutoIt v3 file.
Now, let's say you created it in C:\Program Files\aSpamBot, create a .ini file, let's say config.ini, in the same directory.
Config.ini
This is your main config file. *Note* You can add many more options once you learn more about AutoIt v3.
Ok, now the main AutoIt script.
Start off with this
Also add this, right after the IniRead lines.
The variable $cChan, which you'll use later, is equal to zero.
What this does, is to get the entries from the config.ini file, and stores it into variables (i.e.: $vAccount)
The syntax is the following
IniRead("filename", "section", "key", "default")
Parameters
filename The filename of the .ini file.
section The section name in the .ini file.
key The key name in the in the .ini file.
default The default value to return if the requested key is not found.
Now we have all the values from config.ini stored into variables.
Let's keep going.
If you want to verify if D2 is always loaded/maximized/(has the focus), use this
right after the IniRead() lines, then this at the end
This simple script will check if D2 is running, if not, it will asks for confirmation on when to give it back the focus.
Right before the Func D2Check(), use this
Ok now, on the main code. Let's run the game.
Add this right before AdlibEnable("D2Check")
and this after the Func D2Check()
This function loads Diablo in windowed mode, then waits 15 seconds (15000 miliseconds), then simulates 3 clicks anywhere on the screen with an inbetween delay of 1000 miliseconds aka 1 second to get rid of the "Blizzard North" screens and such.
So now, your code should look like this.
mybot.aut
Ok now, let's make the functions to connect to battle.net and pick the right character.
Add this after the Func loadDiablo()
This simulates a click on the Conenct to Battle.net button assuming the right gateway is already chosen, and waits 6 seconds.
Right after that function, add
This sends a TAB key to switch to the Account field, sets the account variable to clipboard, pastes it, sends a TAB key to switch back to the password field, then adds the password info, simulates an ENTER key to log in, then waits 6 seconds.
Right after this, your "pickChar" function
Pretty self-explanatory. Sends the Down and Right keys to get the right char, then simulates an Enter key, and waits 8 seconds.
Now, we need to get rid of that new lobby, and enter the chat.
Simulates a click on the enter chat button and waits 2 seconds.
Add the calls to functions right after the AdlibEnable("D2Check") line.
Your code should now look like this
mybot.aut
Ok, in this guide, I'll briefly explain how to write your very own bot using AutoIt v3, which can be found here (Just download AutoItv3Setup.exe file)
Now that you have AutoIt installed, assuming you don't need a guide to install this program, let's begin.
Right click somewhere in windows and choose to make a new AutoIt v3 file.
Now, let's say you created it in C:\Program Files\aSpamBot, create a .ini file, let's say config.ini, in the same directory.
Config.ini
Code:
[Account]
account=Myaccount
password=mypassword
charlocation=1
[Spam]
channelStart=1
channelEnd=5
channel=LoD Trading USEast-
spamMsg=My Spam
Ok, now the main AutoIt script.
Start off with this
Code:
$vAccount = IniRead("config.ini", "Account", "account", "account Key Not Found")
$vPassword = IniRead("config.ini", "Account", "password", "password Key Not Found")
$vCharLocation = IniRead("config.ini", "Account", "charlocation", "charlocation Key Not Found")
$vSpamMsg = IniRead("config.ini", "Spam", "spamMsg", "spamMsg Key Not Found")
$vChannel = IniRead("config.ini", "Spam", "channel", "channel Key Not Found")
$vChannelStart = IniRead("config.ini", "Spam", "channelStart", "channelStart Key Not Found")
$vChannelEnd = IniRead("config.ini", "Spam", "channelEnd", "channelEnd Key Not Found")
Code:
$cChan = 0
What this does, is to get the entries from the config.ini file, and stores it into variables (i.e.: $vAccount)
The syntax is the following
IniRead("filename", "section", "key", "default")
Parameters
filename The filename of the .ini file.
section The section name in the .ini file.
key The key name in the in the .ini file.
default The default value to return if the requested key is not found.
Now we have all the values from config.ini stored into variables.
Let's keep going.
If you want to verify if D2 is always loaded/maximized/(has the focus), use this
Code:
AdlibEnable("d2Check")
Code:
Func d2Check()
If WinExists("Diablo II") == 0 Then
MsgBox(0,"My Spam Bot","You need Diablo II to run, and the window is not present in memory.")
Exit
EndIf
If WinActive("Diablo II") == 0 Then
$msgActive = MsgBox(4,"My Spam Bot","Diablo II is not active and should be. The script is now paused. Click YES if you want to unpause the script, or NO if you want to stop its execution.")
Select
Case $msgActive = 6
WinActivate("Diablo II")
Case $msgActive = 7
Exit
EndSelect
EndIf
EndFunc
Right before the Func D2Check(), use this
Code:
AdlibDisable()
Ok now, on the main code. Let's run the game.
Add this right before AdlibEnable("D2Check")
Code:
loadDiablo()
Code:
Func loadDiablo()
MouseSetMode(0)
Run("C:\Program Files\Diablo II\Game.exe -w")
Sleep(15000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
EndFunc
So now, your code should look like this.
mybot.aut
Code:
$vAccount = IniRead("config.ini", "Account", "account", "account Key Not Found")
$vPassword = IniRead("config.ini", "Account", "password", "password Key Not Found")
$vCharLocation = IniRead("config.ini", "Account", "charlocation", "charlocation Key Not Found")
$vSpamMsg = IniRead("config.ini", "Spam", "spamMsg", "spamMsg Key Not Found")
$vChannel = IniRead("config.ini", "Spam", "channel", "channel Key Not Found")
$vChannelStart = IniRead("config.ini", "Spam", "channelStart", "channelStart Key Not Found")
$vChannelEnd = IniRead("config.ini", "Spam", "channelEnd", "channelEnd Key Not Found")
$cChan = 0
loadDiablo()
AdlibEnable("d2Check")
AdlibDisable()
Func d2Check()
If WinExists("Diablo II") == 0 Then
MsgBox(0,"My Spam Bot","You need Diablo II to run, and the window is not present in memory.")
Exit
EndIf
If WinActive("Diablo II") == 0 Then
$msgActive = MsgBox(4,"My Spam Bot","Diablo II is not active and should be. The script is now paused. Click YES if you want to unpause the script, or NO if you want to stop its execution.")
Select
Case $msgActive = 6
WinActivate("Diablo II")
Case $msgActive = 7
Exit
EndSelect
EndIf
EndFunc
Func loadDiablo()
MouseSetMode(0)
Run("C:\Program Files\Diablo II\Game.exe -w")
Sleep(15000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
EndFunc
Ok now, let's make the functions to connect to battle.net and pick the right character.
Add this after the Func loadDiablo()
Code:
Func bnConnect()
MouseSetMode(0)
MouseMove(394,380,0)
MouseClick("left")
Sleep(6000)
EndFunc
Right after that function, add
Code:
Func accLogin()
Send("{TAB}")
Sleep(250)
ClipPut($vAccount)
Send("^v")
Send("{TAB}")
Sleep(250)
ClipPut($vPassword)
Send("^v")
Sleep(250)
Send("{ENTER}")
Sleep(6000)
EndFunc
Right after this, your "pickChar" function
Code:
Func pickChar()
Select
Case $vCharLocation = 1
Send("{ENTER}")
Case $vCharLocation = 2
Send("{RIGHT}{ENTER}")
Case $vCharLocation = 3
Send("{DOWN}{ENTER}")
Case $vCharLocation = 4
Send("{DOWN}{RIGHT}{ENTER}")
Case $vCharLocation = 5
Send("{DOWN}{DOWN}{ENTER}")
Case $vCharLocation = 6
Send("{DOWN}{DOWN}{RIGHT}{ENTER}")
Case $vCharLocation = 7
Send("{DOWN}{DOWN}{DOWN}{ENTER}")
Case $vCharLocation = 8
Send("{DOWN}{DOWN}{DOWN}{RIGHT}{ENTER}")
EndSelect
Sleep(8000)
EndFunc
Now, we need to get rid of that new lobby, and enter the chat.
Code:
Func lobby()
MouseSetMode(0)
MouseMove(87,501,0)
MouseClick("left")
Sleep(2000)
EndFunc
Add the calls to functions right after the AdlibEnable("D2Check") line.
Code:
bnConnect()
accLogin()
pickChar()
lobby()
mybot.aut
Code:
$vAccount = IniRead("config.ini", "Account", "account", "account Key Not Found")
$vPassword = IniRead("config.ini", "Account", "password", "password Key Not Found")
$vCharLocation = IniRead("config.ini", "Account", "charlocation", "charlocation Key Not Found")
$vSpamMsg = IniRead("config.ini", "Spam", "spamMsg", "spamMsg Key Not Found")
$vChannel = IniRead("config.ini", "Spam", "channel", "channel Key Not Found")
$vChannelStart = IniRead("config.ini", "Spam", "channelStart", "channelStart Key Not Found")
$vChannelEnd = IniRead("config.ini", "Spam", "channelEnd", "channelEnd Key Not Found")
$cChan = 0
loadDiablo()
AdlibEnable("d2Check")
bnConnect()
accLogin()
pickChar()
lobby()
AdlibDisable()
Func d2Check()
If WinExists("Diablo II") == 0 Then
MsgBox(0,"My Spam Bot","You need Diablo II to run, and the window is not present in memory.")
Exit
EndIf
If WinActive("Diablo II") == 0 Then
$msgActive = MsgBox(4,"My Spam Bot","Diablo II is not active and should be. The script is now paused. Click YES if you want to unpause the script, or NO if you want to stop its execution.")
Select
Case $msgActive = 6
WinActivate("Diablo II")
Case $msgActive = 7
Exit
EndSelect
EndIf
EndFunc
Func loadDiablo()
MouseSetMode(0)
Run("C:\Program Files\Diablo II\Game.exe -w")
Sleep(15000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
MouseMove(407,76,0)
MouseClick("left")
Sleep(1000)
EndFunc
Func bnConnect()
MouseSetMode(0)
MouseMove(394,380,0)
MouseClick("left")
Sleep(6000)
EndFunc
Func accLogin()
Send("{TAB}")
Sleep(250)
ClipPut($vAccount)
Send("^v")
Send("{TAB}")
Sleep(250)
ClipPut($vPassword)
Send("^v")
Sleep(250)
Send("{ENTER}")
Sleep(6000)
EndFunc