Sign in to follow this  
Followers 0
Abaddon

Diablo 2 AFK Bot

12 posts in this topic

Hi, I made a D2 AFK bot to send a message every 10 seconds to say that you are afk for trades. I need the user to be able to select what to say without having to edit the script.

HotKeySet( "{ESC}" , "Close" )

Send ( "{ALTDOWN}" )

Send ( "{TAB} " )

Sleep (10000)

Send ( "{ALTUP}" )

Sleep (500)

While 1

Send ( "{ENTER}" )

Sleep (500)

Send ( "Hi I am AFK. Please leave your account name and how many GCs you have and I will get back with you" )

Sleep (500)

Send ( "{ENTER}" )

Sleep (10000)

Wend

Func Close()

Exit

EndFunc

Share this post


Link to post
Share on other sites



The easiest way would probably be to read the entry from an INI file. The most user-friendly way would be to create a GUI. Look in the help file for examples of and help with both.

Share this post


Link to post
Share on other sites

Firstly, I suggest you use WinWaitActive to wait for the D2 window to be active. Second, you can use the following code to get user-input:

$usertext = InputBox(<title>, <prompt>)

The above script can be simplified to this:

HotKeySet( "{ESC}" , "Close" )
Dim $usertext = InputBox("Please enter AFK text", "Please enter the text you wish to spam while AFK")
WinWaitActive("Diablo 2")
While 1
Send($usertext)
Sleep(500)
Send("{ENTER}")
Sleep(10000)
WEnd
Func Close()
Exit
EndFunc

Share this post


Link to post
Share on other sites

HotKeySet( "{ESC}" , "Close" )

Global $usertext = InputBox("Please enter AFK text", "Please enter the text you wish to spam while AFK", IniRead("settings.ini", "Settings", "Text", ""))
If $usertext <> "" Then IniWrite("settings.ini", "Settings", "Text", $usertext)

WinWaitActive("Diablo 2")

While 1
    Send($usertext)
    Sleep(500)
    Send("{ENTER}")
    Sleep(10000)
WEnd

Func Close()
    Exit
EndFunc

Might as well make it save the last entry so that the user doesn't have to input a new one each time. I'm really tired so if there's any errors--and I'm sure there are, as I wrote it in the web-browser without testing it--please excuse them :P

Share this post


Link to post
Share on other sites

Thanks you guys are really awesome

Share this post


Link to post
Share on other sites

Here is the complete script. It works like a freakin charm I love it.

HotKeySet( "{ESC}" , "Close" )

Global $usertext = InputBox("AFK Bot v1.0", "Please enter the text you wish to spam while AFK", IniRead("settings.ini", "Settings", "Text", ""))

If $usertext <> "" Then IniWrite("settings.ini", "Settings", "Text", $usertext)

WinWaitActive("Diablo II")

Sleep(5000)

While 1

Send("{ENTER}")

Sleep(500)

Send($usertext)

Sleep(500)

Send("{ENTER}")

Sleep(20000)

WEnd

Func Close()

Exit

EndFunc

I changed some thing around. Mostly just things you know from playing the game.

P.S. I don't know how to do the code box thing without it lookin all gay LOL.

Share this post


Link to post
Share on other sites

I don't know how to do the code box thing without it lookin all gay LOL.

Define "gay" lol, you just use [ code ] at the start and [ /code ] at the end, without the spaces... If the code you're entering is long, you can use codebox instead of code

Share this post


Link to post
Share on other sites

Please use [ code] or [ autoit]

Anywhy , i am to late to help -.-


-jaenster

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I don't know if the Blizzard bot scanners are still on guard,

but just a safety advise :

If you use sleep() in your code, try to use randomized sleep times :

ex. : Sleep (Random(17000,22000))

That way you are simulating more "human" behaviour. :P

Edited by Gyzmok

D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper

Share this post


Link to post
Share on other sites

Yea good idea ill do that :P

Share this post


Link to post
Share on other sites

I don't know if the Blizzard bot scanners are still on guard,

but just a safety advise :

If you use sleep() in your code, try to use randomized sleep times :

ex. : Sleep (Random(17000,22000))

That way you are simulating more "human" behaviour. :)

The above will not help you in the least as it is not at all how Warden scans.

A little reading goes a long way. Post count means nothing.

Share this post


Link to post
Share on other sites

Ok, I believe all I need to do is set the sleep time longer to avoid being kicked out of the game.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0