Abaddon Posted December 15, 2006 Share Posted December 15, 2006 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 1Send ( "{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)WendFunc Close() ExitEndFunc Link to comment Share on other sites More sharing options...
Outshynd Posted December 15, 2006 Share Posted December 15, 2006 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. Link to comment Share on other sites More sharing options...
Hollinar Posted December 15, 2006 Share Posted December 15, 2006 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 Link to comment Share on other sites More sharing options...
Outshynd Posted December 15, 2006 Share Posted December 15, 2006 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 Link to comment Share on other sites More sharing options...
Abaddon Posted December 15, 2006 Author Share Posted December 15, 2006 Thanks you guys are really awesome Link to comment Share on other sites More sharing options...
Abaddon Posted December 15, 2006 Author Share Posted December 15, 2006 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. Link to comment Share on other sites More sharing options...
Hollinar Posted December 15, 2006 Share Posted December 15, 2006 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 Link to comment Share on other sites More sharing options...
jaenster Posted December 15, 2006 Share Posted December 15, 2006 Please use [ code] or [ autoit] Anywhy , i am to late to help -.- -jaenster Link to comment Share on other sites More sharing options...
Gyzmok Posted December 15, 2006 Share Posted December 15, 2006 (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. Edited December 15, 2006 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 Link to comment Share on other sites More sharing options...
Abaddon Posted December 15, 2006 Author Share Posted December 15, 2006 Yea good idea ill do that Link to comment Share on other sites More sharing options...
Snarg Posted December 16, 2006 Share Posted December 16, 2006 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. Link to comment Share on other sites More sharing options...
Abaddon Posted December 17, 2006 Author Share Posted December 17, 2006 Ok, I believe all I need to do is set the sleep time longer to avoid being kicked out of the game. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now