Einzeinbleth Posted December 24, 2004 Share Posted December 24, 2004 (edited) First off, i'd like to say hello to everybody, im new in here . I'd like to create a Chat-Bot for Diablo II - and i made it but d2 window has to be activated because i used Send("blabla"). Now i want to use ControlSend(). The title of d2 window is "Diablo II Chat Bot" and the code: ControlSend("Diablo II Chat Bot", "", "Diablo II", "blabla") doesn't seem to work any ideas?? or someone maybe created Chat Bot for d2, which uses ControlSend ?? i need only the part which send text to minimalized d2 window... Edited December 24, 2004 by Einzeinbleth Link to comment Share on other sites More sharing options...
DirtyBanditos Posted December 24, 2004 Share Posted December 24, 2004 (edited) First off, i'd like to say hello to everybody, im new in here .I'd like to create a Chat-Bot for Diablo II - and i made it but d2 window has to be activated because i used Send("blabla"). Now i want to use ControlSend(). The title of d2 window is "Diablo II Chat Bot" and the code:ControlSend("Diablo II Chat Bot", "", "Diablo II", "blabla")doesn't seem to work any ideas?? or someone maybe created Chat Bot for d2, which uses ControlSend ?? i need only the part which send text to minimalized d2 window...<{POST_SNAPBACK}> Hi i hope this help you adde this code and create the ini for Spammmessage this code is a simpel exampel! adde your settings dates to this code But this code WÖRKS NoT Minimalized! Or use ScriptWriter ist nice and easy))and check this nice souce code link to Snargs Autoit source for Diablo Boting!Check this link for more info!Snargs Autoit Bot Sources from BlizzhackersAu3 Script codeWinWait("Diablo II")If Not WinActive("DibaloDiablo II") Then WinActivate("Diablo II")WinWaitActive("Diablo II")AdlibEnable("Diablo IICheck")HotKeySet("{F1}", "EndScript")HotKeySet("{F2}", "Pauseon")HotKeySet("{F3}", "Pauseoff"); ---------------------------------------------------------------------------- ; Script Spammesage read from your Spamm.ini ; ----------------------------------------------------------------------------$counter = 1While 1 $Sentences = FileRead('C:\Programme\Diablo II\Dibalo Spammbot.ini', FileGetSize('C:\Programme\Diablo II\Dibalo Spammbot.ini)) ; note StringReplace($Sentences,@CRLF,@LF) by itself does nothing $Sentences = StringReplace($Sentences, @CRLF, @LF,);If it is a standard Dos .txt file that uses @crlf as ; new line chars. otherwise change as needed. ToolTip($Sentences) $Sentences = StringSplit($Sentences, @LF) Send('{Enter}'); Sleep(1000) Send($Sentences[int(Random(1, $Sentences[0] + 1)) ], 1);Write your Message to Spamm Sleep(1000) Send('{Enter}'); Sleep(1100) If $counter = 10 Then Send("{ENTER}{CTRLDOWN}{ALTDOWN}[{CTRLUP}_ {ALTUP}\cffff0090{SHIFTDOWN}h{SHIFTUP}ello_ {SPACE}this{SPACE}is{SPACE}The{SPACE}First{SPACE}_ Spamm{SPACE}Tradebot{SPACE}{SPACE} Not Publick{SPACE}{ENTER}"); $counter = 1 EndIf $counter = $counter + 1WendAdlibDisable(); you turn it off? ; ---------------------------------------------------------------------------- ; Script ende ; ---------------------------------------------------------------------------- Func _togglePause() $Paused = Not $Paused While Not $Paused Sleep(200) WendEndFunc ;==>_togglePauseFunc Pauseon() $on = 1 Sleep(200)EndFunc ;==>Pauseon; Function to exit scriptFunc Pauseoff() $on = 0 Sleep(200)EndFunc ;==>Pauseoff; Function to exit scriptFunc EndScript() ExitEndFunc ;==>EndScriptAdlibDisable(); you turn it off?Ini exampel make a simpel text dokument and adde this Dibalo Spammbot.ini\cff99CCCC I want to kill everyone! \cffff0011 I want to kill everyone! \cff33FF33 You... I hate, die. \cffFFFF33 You are boring, die. \cffff0044 Move along or die. You have to choice. \cffFF9900 MURDER! DEATH! KILL! \cffff0065 Worry not. You'll leave... for going in hell. \cff00FFFF Heavens are awaiting you. Edited December 24, 2004 by DirtyBanditos Link to comment Share on other sites More sharing options...
Insolence Posted December 25, 2004 Share Posted December 25, 2004 I made something similar to this, that does work minimized. Simply use the ControlSendPlus function made by Pekster: expandcollapse popup#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 Use it like so: ControlSendPlus( "Diablo II", "", "", "/join " & $IniChannelList[$j] & "{ENTER}", 0) ControlSendPlus( "Diablo II", "", "", $vSpam & "{ENTER}", 0 ) This function saved my life today, it works great "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. Link to comment Share on other sites More sharing options...
DirtyBanditos Posted December 25, 2004 Share Posted December 25, 2004 I made something similar to this, that does work minimized.Simply use the ControlSendPlus function made by Pekster: expandcollapse popup#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 EndFuncUse it like so:ControlSendPlus( "Diablo II", "", "", "/join " & $IniChannelList[$j] & "{ENTER}", 0) ControlSendPlus( "Diablo II", "", "", $vSpam & "{ENTER}", 0 )This function saved my life today, it works great <{POST_SNAPBACK}> hi Insolence thx for this nice exampel realy nice) Link to comment Share on other sites More sharing options...
Insolence Posted December 25, 2004 Share Posted December 25, 2004 No problem, if you want the entire thing I used that with, PM me. "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. Link to comment Share on other sites More sharing options...
Einzeinbleth Posted December 25, 2004 Author Share Posted December 25, 2004 (edited) Thank you all :] Now i changed all, to be just like i need :] here is the AutoIt code: expandcollapse popup#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("{INSERT}", "StartSpamming") HotKeySet("{DELETE}", "StopSpamming") 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 While (1) sleep(10) wend And the spambot.ini: [text] msg=spam bot test 1 [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 I know this code is ... bad but it work, and do exactly what i wanted Edited December 25, 2004 by Einzeinbleth 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