Jump to content

Need help with ControlSend


Recommended Posts

First off, i'd like to say hello to everybody, im new in here :lol:.

I'd like to create a Chat-Bot for Diablo II - and i made it but d2 window has to be activated :D 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 :idiot: 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 by Einzeinbleth
Link to comment
Share on other sites

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 :lol: 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  :idiot:  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}>

:D

Hi i hope this help you adde this code and create the ini for Spammmessage this code is a simpel exampel! :D adde your settings dates to this code :D

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 Blizzhackers

Au3 Script code

WinWait("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 = 1

While 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 + 1

Wend

AdlibDisable(); you turn it off?

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

; Script ende

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

Func _togglePause()

$Paused = Not $Paused

While Not $Paused

Sleep(200)

Wend

EndFunc ;==>_togglePause

Func Pauseon()

$on = 1

Sleep(200)

EndFunc ;==>Pauseon

; Function to exit script

Func Pauseoff()

$on = 0

Sleep(200)

EndFunc ;==>Pauseoff

; Function to exit script

Func EndScript()

Exit

EndFunc ;==>EndScript

AdlibDisable(); you turn it off?

Ini exampel make a simpel text dokument and adde this :D

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 by DirtyBanditos
Link to comment
Share on other sites

I made something similar to this, that does work minimized.

Simply use the ControlSendPlus function made by Pekster:

#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 :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.
Link to comment
Share on other sites

I made something similar to this, that does work minimized.

Simply use the ControlSendPlus function made by Pekster:

#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 :D

<{POST_SNAPBACK}>

:lol: hi Insolence thx for this nice exampel :idiot: realy nice)
Link to comment
Share on other sites

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

Thank you all :] Now i changed all, to be just like i need :] here is the AutoIt code:

#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 :idiot:

Edited by Einzeinbleth
Link to comment
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
 Share

  • Recently Browsing   0 members

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