Jump to content

Newbie need helps to Dll making!


DirtyBanditos
 Share

Recommended Posts

Hi all Members :)

i will start wis Autoit3 dll Making but i have no idea to find the right way to learn it out :)

I will convert my bot to a Dll and load it wis a exe to my prog :lmao:

have any a good link to all coments for dll making or can any help me out to convert my Script to my first dll! o:)

I have Microsoft Visual C++ 6.0 !

Thx to help me any out :)

;===============================================================================
; ----------------------------------------------------------------------------
; Set up our defaults
; ----------------------------------------------------------------------------
;AutoItSetOption("MustDeclareVars", 1)
;AutoItSetOption("MouseCoordMode", 0)
;AutoItSetOption("PixelCoordMode", 0)
;AutoItSetOption("RunErrorsFatal", 1)
;AutoItSetOption("TrayIconDebug", 1)
;AutoItSetOption("WinTitleMatchMode", 4)
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------

; Setup some useful options that you may want to turn on - see the helpfile for details.

; Expand all types of variables inside strings
;Opt("ExpandEnvStrings", 1)
;Opt("ExpandVarStrings", 1)

; Require that variables are declared (Dim) before use (helps to eliminate silly mistakes)
;Opt("MustDeclareVars", 1)


; ----------------------------------------------------------------------------
; Script Start - Add your code below here
; ----------------------------------------------------------------------------
#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("{f10}", "GameExit")
HotKeySet("{f6}", "GameMakeTp")
HotKeySet("{f4}", "StartSpamming")
HotKeySet("{f5}", "StopSpamming")
HotKeySet("{f9}", "ActivateDiablo")

Func ActivateDiablo()
WinWait ( 'D2Loader v1.10b14 Build On Oct 29 2003' )
WinActivate ( 'D2Loader v1.10b14 Build On Oct 29 2003' )
Sleep ( 500 )
WinMove ( 'D2Loader v1.10b14 Build On Oct 29 2003', '', 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( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl2", "Error" )
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl3", "Error" )
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl4", "Error" )
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", $SpamMsg & "{ENTER}", 0 )

$ChnlName=IniRead ( $sFile, 'channels', "chnl5", "Error" )
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", "/join " & $ChnlName & "{ENTER}", 0)
ControlSendPlus( "D2Loader v1.10b14 Build On Oct 29 2003", "", "", $SpamMsg & "{ENTER}", 0 )

wend
EndFunc

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

Func GameExit()
Send("{f10}")
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
Link to comment
Share on other sites

AutoitX3.dll is already created and compiled.

Have a look in... Program Files\AutoIt3\AutoItX  :)

I assume you did not know this?

<{POST_SNAPBACK}>

Hi Mhz o:) sorry i have look and you have right ,but i will look to make my own Main.Cpp wis my Spammbot code :)

Hm thx i found the help.chm löl :)

But i found not on the help files to use the contolsendplus func from Autoit3.gif this now way on the dll.call to use the ControlSendPlus func=?

Thx for any questen :whistle:

I found this! :lmao:

ControlSend "title", "text", "controlID", "string" [, flag]

#include <Windows.h>
#include "AutoIt3.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR   lpCmdLine,
                     int       nCmdShow)
{
    // You can now call AutoIt commands, e.g. to send the keystrokes "hello"
    AU3_Sleep(1000);
    AU3_Run("notepad.exe", "", 1);
    AU3_WinWaitActive("Untitled -", "", 0);
    AU3_Send("Hello{!}", 0);

    // Get the text in the status bar
    //char szText[1000];
    //AU3_StatusbarGetText("Untitled -", "", 2, szText, 1000);
    //MessageBox(NULL, szText, "Text:", MB_OK);

    return 0;
}
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...