Jump to content
Sign in to follow this  
Einzeinbleth

Diablo Utility Bot :)

Recommended Posts

Einzeinbleth

Now, when i can send text to minimized d2 window, i've almost finished my first script for diablo II [greeeat game :D ]

hotkeys:

Insert - start spamming

Delete - stop spamming

Home - make tp [has to be bind on F8]

End - fast leave current game

Page up - activate diablo II

#include-once
Func ControlSendPlus($title, $text, $className, $string, $flag)
;VERSION 2.0.3 (06/13/2004)
 Local $ctrl=0,$alt=0,$upper,$start,$end,$i,$char,$and,$Chr5Index,$isUpper,$ret
 If $flag = 2 OR $flag = 3 Then $ctrl = 1
 If $flag = 2 OR $flag = 4 Then $alt = 1
 If $flag <> 1 Then $flag = 0;set the flag to the default function style
 $upper = StringSplit('~!@#$%^&*()_+|{}:"<>?ABCDEFGHIJKLMNOPQRSTUVWXYZ', "")

 If $flag <> 1 Then;don't replace special chars if it's raw mode
 ;replace {{} and {}} with +[ and +] so they will be displayed properly
   $string = StringReplace($string, "{{}", "+[")
   $string = StringReplace($string, "{}}", "+]")
 ;replace all special chars with Chr(5)
 ;add the special char to an array.  each Chr(5) corresponds with an element
   Local $Chr5[StringLen($string) / 2 + 1]
   For $i = 1 To StringLen($string)
     $start = StringInStr($string, "{")
     If $start = 0 Then ExitLoop;no more open braces, so no more special chars
     $end = StringInStr($string, "}")
     If $end = 0 Then ExitLoop;no more close braces, so no more special chars
   ;parse inside of braces:
     $Chr5[$i] = StringMid($string, $start, $end - $start + 1)
   ;replace with Chr(5) leaving the rest of the string:
     $string = StringMid($string, 1, $start - 1) & Chr(5) &_
      StringMid($string, $end + 1, StringLen($string))
   Next
 ;take out any "!", "^", or "+" characters
 ;add them to the $Modifiers array to be used durring key sending
   Local $Modifiers[StringLen($string) + 1]
   For $i = 1 To StringLen($string)
     $char = StringMid($string, $i, 1)
     $and = 0
     If $char = "+" Then
       $and = 1
     ElseIf $char = "^" Then
       $and = 2
     ElseIf $char = "!" Then
       $and = 4
     ElseIf $char = "" Then
       ExitLoop
     EndIf
     If $and <> 0 Then
       $Modifiers[$i] = BitOR($Modifiers[$i], $and)
       $string = StringMid($string, 1, $i - 1) &_
        StringMid($string, $i + 1, StringLen($string))
       $i = $i - 1
     EndIf
   Next
 Else;it is raw mode, so set up an all-0 modifier array
   Local $Modifiers[StringLen($string) + 1]
 EndIf

;now send the chars
 $Chr5Index = 1
 For $i = 1 To StringLen($string)
   $char = StringMid($string, $i, 1)
   If $char = Chr(5) Then
     $char = $Chr5[$Chr5Index]
     $Chr5Index = $Chr5Index + 1
   EndIf
   $isUpper = 0
   For $j = 1 To UBound($upper) - 1
     If $char == $upper[$j] Then $isUpper = 1
   Next
 ;1 SHIFT, 2 CTRL, 4 ALT (programmer note to keep the bits straight)
   If $isUpper = 1 OR BitAND($Modifiers[$i], 1) = 1 Then Send("{SHIFTDOWN}")
   If BitAND($Modifiers[$i], 4) = 4 AND NOT $alt Then $char = "!" & $char
   If BitAND($Modifiers[$i], 2) = 2 AND NOT $ctrl Then $char = "^" & $char
   If BitAND($Modifiers[$i], 4) = 4 AND $alt Then Send("{ALTDOWN}")
   If BitAND($Modifiers[$i], 2) = 2 AND $ctrl Then Send("{CTRLDOWN}")
   $ret = ControlSend($title, $text, $className, $char, $flag)
   If BitAND($Modifiers[$i], 4) = 4 AND $alt Then Send("{ALTUP}")
   If BitAND($Modifiers[$i], 2) = 2 AND $ctrl Then Send("{CTRLUP}")
   If $isUpper = 1 OR BitAND($Modifiers[$i], 1) = 1 Then Send("{SHIFTUP}")
   If NOT $ret Then return 0;window or control not found
 Next
 return 1
EndFunc


;--------------------------------------------------

HotKeySet("{END}", "GameExit")
HotKeySet("{HOME}", "GameMakeTp")
HotKeySet("{INSERT}", "StartSpamming")
HotKeySet("{DELETE}", "StopSpamming")
HotKeySet("{PGUP}", "ActivateDiablo")

Func ActivateDiablo()
WinWait ( 'Diablo II' )
WinActivate ( 'Diablo II' )
Sleep ( 500 )
WinMove ( 'Diablo II', '', 0, -20 )
Sleep ( 500 )
EndFunc

Func StartSpamming()

While (1)

$sFile= @SCRIPTDIR & '\spambot.ini'

$SpamMsg=IniRead ( $sFile, 'text', "msg", "Error" )
$ChnlName=IniRead ( $sFile, 'channels', "chnl1", "Error" )
ControlSendPlus( "Diablo II", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "Diablo II", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl2", "Error" )
ControlSendPlus( "Diablo II", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "Diablo II", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl3", "Error" )
ControlSendPlus( "Diablo II", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "Diablo II", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl4", "Error" )
ControlSendPlus( "Diablo II", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "Diablo II", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl5", "Error" )
ControlSendPlus( "Diablo II", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "Diablo II", "", "", $SpamMsg & "{ENTER}", 0 )

wend
EndFunc

Func StopSpamming()
while (1)
sleep(10)
wend
EndFunc

Func GameExit()
Send("{ESC}")
MouseMove(410, 265, 1)
MouseClick("left")


EndFunc

Func GameMakeTp()
MouseMove(400, 260, 1)
Send("{F8}")
MouseClick("right")
MouseMove(390, 260, 1)
Sleep(1000)
MouseClick("left")

EndFunc


while (1)
sleep(1)
wend

it works perfect [except for tp ...] for my screen screen 800x600, and game in 800x600

i'm still working on it :]

oh, and spambot.ini:

[text]
msg=blablabla

[channels]
chnl1=Diablo II Europe-POL-1
chnl2=Diablo II Europe-POL-2
chnl3=Diablo II Europe-POL-3
chnl4=Diablo II Europe-POL-4
chnl5=Diablo II Europe-POL-5

Share this post


Link to post
Share on other sites
Insolence

Nice, I'm making something very similar to this :idiot:


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
themax90

I suggest that the Mods remove this information, this is the type of immature people that use your programming language to spam, terrorize others, and other ILLEGAL and UNWANTED things. Please Moderators remove this code and warn him. I ahve said what I wanted.

Agent Smith

Share this post


Link to post
Share on other sites
Insolence

Smith, you fruit.

This bot will help you TRADE ITEMS FOR THE GAME, a very teedious task.

I made a bot similar to this it, it spams one channel at a time. It doesn't do anything annoying, anything ANYONE could do with copy + paste.

Please, ANY language can be used malicously(sp) but this is just to help people get through the more teedious parts of the game.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
Einzeinbleth

Cool, but i made it for ME, i have realy big lags [slow computer] and some things realy help, i need them, but 99% others doesnt. Fast leave game - when im on mephisto run, and im surrounded with milions of monsters, it cause BIG LAGS and i die without my bot , with what i can simple press END. Spam bot is just toy for it, some peoples need it. Making tp is.. dunno how to name it. i created everything except for spam bot part, and because im learning with reading source codes, so i want to MY projects be awaiable. Do you want to destroy gun factory, because peoples can die because of gun created here?? so i'd like to please Moderators: dont remove the code. Its for fun, not

terrorize

-------

I'd like to sorry everybody, but i dont know English as well, and i'm still making mistakes. Sorry everyone...

-------

Edited by Einzeinbleth

Share this post


Link to post
Share on other sites
themax90

Maybe you dont relize that some people HATE spam. It does not help trade unless you are saying an item discription. I am sorry if I was being rude but I meant those Spam bots that join each game and use colored messages to try adnget people to go to there site. In an average Ball run I see at least 3 spam bots trying to get me to buy items frmo THIS site or THAT SITE. Sorry, but as long as this is used for legit purposes then I'm fine with it.

Edited by Agent Smith

Share this post


Link to post
Share on other sites
Insolence

Wow.

Way to ruin what argument you had left by saying

It does not help trade unless you are saying an item discription.

That's what the entire POINT of it is... this bot does not join games, simply spams channels. It is used for legit purposes, you might as well read the code before you throw an a fist at it.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
Einzeinbleth

Here's something new: http://www.wroclaw.mm.pl/~einzeinbleth/d2utility.zip with full source code.

its [not finished yet] module starter ... for now it need autoit to be installed on system [can i copy with scripts AutoIt3.exe ??]. The modules are just.. Auto It scripts :] tomorrow futher information - good night :]

Share this post


Link to post
Share on other sites
Crome_BAD

Smith, if u havent been in the Diablo II Tragin channels, u dont understand, lol sorry, but ive been playing since it came out, and its hard enough to copy and paste all the text u want.

So, for my advice, Great Job Einzeinbleth

(Made a similar one, but for open bnet, when a character joins ur game, and is either messed up, or character file is to big, it locks ur cp up. Lol, i made a little program just to close the d2 process without having to restart your cp. If youd like to take a look let me kno.)

Peace,

Crome_BAD

Share this post


Link to post
Share on other sites
Insolence

If you right click on .au3 files you can compile them so you don't need AutoIT arround to run them.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
themax90

I have been playing Diablo 2 since the Original came out and switched to expansion the day it came out. i have been to the tradin channels. And Insolence, I wouldn't talk or be mean if I were you, it was a misunderstanding. I know it's had to copy all the test. But I SAID THAT I AM FINE WITH IT IF IT IS NOT TO SPAM ADVERTISMENT FOR A SITE. Ok insolence, did you get that, Huh?? Selective hearing eh???? No not flame me for a misunderstanding unless you read theENTIRE post. Do you understand? I could see this easily becoming a bot that people use to join a game, spam for a site a few times then leave. Just a note to Einzein that when the program loads add a Splash Text that says something like By using this product you in agreement that should you use it to spam maliciously then you cannot hold the creator, (your name), responsible for your actions.

P.S. To insolence, I already said sorry you little jackass, now I believe u that your $$$king satement was unnesscessary.

  Wow.

Way to ruin what argument you had left by saying

That's what the entire POINT of it is... this bot does not join games, simply spams channels. It is used for legit purposes, you might as well read the code before you throw an a fist at it.

When you said SPAMS it made me think of those damn bots that join games and truly do spam. If you set it up for a normal chat to advertise, it is SPAM. But I don't care if it was for sending a one time message. I believe the miscommunication was on YOUR part.

Edited by Agent Smith

Share this post


Link to post
Share on other sites
Insolence

I don't have to apologize for you being inconsiderate enough not to even look at his code before you flamed him. I was simply holding his side, no reason to lash out at me.

Ofcourse you realize you are/were wrong, now please don't threaten me.

I wouldn't talk or be mean if I were you


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
themax90

Ok dude I said if I was in your shoes, I would not be flaming a guy for a misunderstanding and I did not flame the creator of this topic, I merely suggested that it be removed because It is a spamming program, later to find outit's not a SPAMMING program but merely a program that repeats trading messages INSTEAd of unwanted advertisments.

P.S. and oh BTW look above your last post.

Edited by Agent Smith

Share this post


Link to post
Share on other sites
Insolence

Fact is you didn't check in the first place... you assumed, okay?

It is actually spamming, but it's a REASONABLE amount of spam. Stop trying to back it up.

I'm done, I don't want to further slap the 'Diablo II AutoIT' community in the face by being arrogant.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
themax90

I did check, and I thought it COULD be used to spam, but now I know that the INTENSIONS for release are NOT to spam, then I stated I am alright with it. I read the source. Get that part into your skull. It is not spam it is an statement of trade in my terms but you may have different ones.

Now, I am no longer going to post at this topic to you. You oviously aren't understanding like the author did. Do you know English Insolence? Because the author barely knows any and he understood me!

Peace(Good job and Happy scripting to Einzeinbleth)

Agent Smith

Share this post


Link to post
Share on other sites
Valik

AgentSmith, piece of advice. Enough with the telling the mods what to do. There are 2 mods, Jon and Larry. I think both of them are quite competent at running this place without your help and input as far as what needs moderated and what doesn't.

Share this post


Link to post
Share on other sites
themax90

Valik can we just drop the subject? I was stating my opinion and thats that. Next time I will just PM them if need be. Now problem resolved. Lets both move on and put this behind us. Thank you.

Agent Smith

Share this post


Link to post
Share on other sites
KnowledgeSponge

This board has really turned into something that it didn't used to be. That's not a good thing. This is not in regards to the original poster.

Share this post


Link to post
Share on other sites
Insolence

I can only apologize.

I really think people get a bad impression of D2 folks, and I can agree with most of it. I'm just trying to stand up for the author. Although I'm flaunting my own arrogance I'm usually fairly polite.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
themax90

I dont think bad of D2, I know there are always 2 sides. I play it all the time but am trying to sell my account with like 4 high lvl chars cause I am tired of playing. Theres the legit folks, the folks that spam all the F***ing time, the folks that ALWAYS use cheats, and the folks that use cheats but not massive ones like the tele scam and dupe, but only the Maphack only when it's hard to find a Throne of Destruction Entrance.

Don't worry Insolence i don't hold this against you, just please next time drop it. An mistake is never an error, unless you refuse to fix it. In this case you fixed it, I fixed mine and it's good. I am sorry for this jumbly topic(meant to go to author) I know your intensions on this topic were for this script and not bickering.

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  

×