Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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
Posted

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

Posted

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.

Posted

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
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
Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...