Großes Script - viel Hilfe benötigt

05/21/2011 10:43 Ludder231#1
Hi,

ich hab hier mal ein für mich etwas größeres projekt angefangen...

ich möchte für das Spiel Diablo II einen Spammbot machen der immer in verschiedene Game-Sessions reingeht und einen Text absendet.

PHP Code:
if _Singleton("Diaspambot.exe",1) = 0 Then ;aktuell halten
    msgbox
(16"Runtime Error""Die exe wird bereits ausgeführt!")
    exit
endif

if 
ProcessExists("Game.exe"Then
Msgbox
(0,"Warnung","Der Process 'Game.exe' existiert bereits und muss beendet werden!" & @CRLF 
""  & @CRLF _
"Diablo II wird automatisch beendet!")
winclose("Diablo II")
if 
not @error Then
    winWaitClose
("Diablo II")
    endif
EndIf    

global 
$Input1Add$Input2Add$Input3Add$listview$radio1$radio2$radio3$radio4$radio5$radio6$radio7$radio8

#RequireAdmin
#include <misc.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\ludder.luca\desktop\diaform.kxf
$Form1 GUICreate("DBot by Ludder"581428, -1, -1)
$Button1 GUICtrlCreateButton("Run"1761925925)
$Tab1 GUICtrlCreateTab(8248561129)
$TabSheet1 GUICtrlCreateTabItem("Common Log")
GUICtrlCreateTabItem("")
$Button2 GUICtrlCreateButton("Stop"2401925925)
$Button3 GUICtrlCreateButton("Add"3041925925)
$Button4 GUICtrlCreateButton("Edit"3681925925)
$Button5 GUICtrlCreateButton("Remove"4321925925)
$Button6 GUICtrlCreateButton("Save"4961925925)
$Group1 GUICtrlCreateGroup("Profile"1616553217)
$listview GUICtrlCreateListView("Profile Names| Runs | Restarts | Status"2440529136)
GUICtrlCreateGroup("", -99, -9911)
$Button7 GUICtrlCreateButton("Exit"4963847525)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
            
        case 
$button2
            winclose
("Diablo II" ,"")
            
        case 
$Button3




#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\ludder.luca\desktop\formadd.kxf
$FormAdd GUICreate("Profile Settings"494349, -1, -1)
$Label1Add GUICtrlCreateLabel("Profile Name:"12126717)
GUICtrlSetFont(-194000"MS Sans Serif")
$Input1Add GUICtrlCreateInput(""88819321)
$Group1 GUICtrlCreateGroup("Loader Settings"1640465113)
$Label1Add GUICtrlCreateLabel("Path:"40852617)
$Input2Add GUICtrlCreateInput(""728026521)
$Button1Add GUICtrlCreateButton("..."344805125)
GUICtrlCreateGroup("", -99, -9911)
$Group2 GUICtrlCreateGroup("Game Settings"16168465121)
$Label1Add GUICtrlCreateLabel("Account Name:"241957517)
GUICtrlSetFont(-194000"MS Sans Serif")
$Input3Add GUICtrlCreateInput(""11219212121)
$Label1 GUICtrlCreateLabel("Position"2481924117)
$Radio1 GUICtrlCreateRadio("1"3041922517)
GUICtrlSetState(-1$GUI_CHECKED)
$Radio2 GUICtrlCreateRadio("2"3361922517)
$Radio3 GUICtrlCreateRadio("3"3042162517)
$Radio4 GUICtrlCreateRadio("4"3362162517)
$Radio5 GUICtrlCreateRadio("5"3042402517)
$Radio6 GUICtrlCreateRadio("6"3362402517)
$Radio7 GUICtrlCreateRadio("7"3042642517)
$Radio8 GUICtrlCreateRadio("8"3362642517)
GUICtrlCreateGroup("", -99, -9911)
$OKAdd GUICtrlCreateButton("OK"4003047525)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
exit
            case 
$OKAdd
                 GUISetState
($FormAdd, @sw_hide)
                
IniWrite(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Path"guictrlread($Input2Add))
                
IniWrite(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Acc"guictrlread($Input3Add))
                
IniWrite(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Profil"guictrlread($Input1Add))
                if 
GUICtrlRead($radio1) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio1))
                ElseIf 
GUICtrlRead($radio2) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio2))
                ElseIf 
GUICtrlRead($radio3) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio3))
                ElseIf 
GUICtrlRead($radio4) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio4))
                ElseIf 
GUICtrlRead($radio5) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio5))
                ElseIf 
GUICtrlRead($radio6) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio6))
                ElseIf 
GUICtrlRead($radio7) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio7))
                ElseIf 
GUICtrlRead($radio8) = $GUI_CHECKED then
                IniWrite
(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Pos"guictrlread($Radio8))
                
$item1 GUICtrlCreateListViewItem(guictrlread($input1add)&"|"&"||"$listview)
                
                
                endif
    EndSwitch
WEnd

            
        


            
            
        
case $button1
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form22 GUICreate("Password Dialog"25193, -1, -1)
$PasswordEdit GUICtrlCreateInput(""83223321)
$ButtonOk GUICtrlCreateButton("OK"86647525$BS_NOTIFY)
$ButtonCancel GUICtrlCreateButton("Cancel"167647525$BS_NOTIFY)
$EnterPassLabel GUICtrlCreateLabel("Enter password"81277170)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        case 
$ButtonOK
            GUISetState
(@sw_hide"Password Dialog")
            
GUISetState(@SW_MINIMIZE"DBot by Ludder")
            
Opt("SendKeyDelay"20)
            
Run(guictrlread($input2add))
            
WinSetState("Diablo II""", @sw_lock)
            
WinWaitActive("Diablo II"
            
sleep(5000)
            
ControlClick("Diablo II""""""Left"1479335)
            
sleep(100)
            
ControlClick("Diablo II""""""Left"1479335)
            
sleep(500)
            
ControlSend("Diablo II"""""Iniread(@WindowsDir&"\DBot.ini"guictrlread($input1add), "Path"guictrlread($Input2Add)))
            
sleep(500)
            
ControlClick("Diablo II""""""Left"1483394)
            
sleep(100)
            
ControlClick("Diablo II""""""Left"1483394)
            
sleep(500)
            
ControlSend("Diablo II"""""guictrlread($passwordEdit))
            
sleep(300)
            
ControlClick("Diablo II""""""Left"1401466)
            
sleep(3500)
            if 
GUICtrlRead($radio1) = $GUI_CHECKED then
                ControlClick
("Diablo II""""""Left"1203148) ;checken
                sleep
(100)
                
ControlClick("Diablo II""""""Left"1203148) ;checken
            
ElseIf GUICtrlRead($radio2) = $GUI_CHECKED then
                ControlClick
("Diablo II""""""Left"1484139) ;checken
                Sleep
(100)
                
ControlClick("Diablo II""""""Left"1484139);checken
            
ElseIf gUICtrlRead($radio3) = $GUI_CHECKED then
                ControlClick
("Diablo II""""""Left"1218243);checken
                Sleep
(100)
                
ControlClick("Diablo II""""""Left"1218243);checken
            
ElseIf gUICtrlRead($radio4) = $GUI_CHECKED then
                ControlClick
("Diablo II""""""Left"1515239);checken
                Sleep
(100)
                
ControlClick("Diablo II""""""Left"1515239);checken
                
;ElseIf gUICtrlRead($radio5) = $GUI_CHECKED then
                
;ControlClick("Diablo II""""""Left"1515239)
                ;
Sleep(100)
                ;
ControlClick("Diablo II""""""Left"1515239);
                
            ;ElseIf 
gUICtrlRead($radio6) = $GUI_CHECKED then
                
;ControlClick("Diablo II""""""Left"1515239)
                ;
Sleep(100)
                ;
ControlClick("Diablo II""""""Left"1515239);
            endif
                
            case 
$buttoncancel
                    
exit
        
            
    EndSwitch
WEnd
            
            
        
EndSwitch
WEnd
func _exit
()
    exit
endfunc 
1. Wie kann ich $FormAdd schließen ohne gleich das ganze srcipt zu schließen
2. Wie kann ich machen, dass bei $listview ein neues Item angelegt wird das den Namen hat von $input1add hat.


3. Wie funktioniert das mit dem Global?(In dem script werden z.B:
if GUICtrlRead($radio1) = $GUI_CHECKED then
ControlClick("Diablo II", "", "", "Left", 1, 203, 148)
sleep(100)
ControlClick("Diablo II", "", "", "Left", 1, 203, 148)

nicht ausgeführt)


4. Hat wer verbesserung Vorschläge?
05/21/2011 11:32 omer36#2
nr3 hab ich nicht ganz verstanden...


PHP Code:
If _Singleton("Diaspambot.exe"1) = 0 Then ;aktuell halten
    MsgBox
(16"Runtime Error""Die exe wird bereits ausgeführt!")
    Exit
EndIf

If 
ProcessExists("Game.exe"Then
    MsgBox
(0"Warnung""Der Process 'Game.exe' existiert bereits und muss beendet werden!" & @CRLF _
            
"" & @CRLF _
            
"Diablo II wird automatisch beendet!")
    
WinClose("Diablo II")
    If 
Not @error Then
        WinWaitClose
("Diablo II")
    EndIf
EndIf

Global 
$Input1Add$Input2Add$Input3Add$listview$radio1$radio2$radio3$radio4$radio5$radio6$radio7$radio8



#RequireAdmin
#include <misc.au3>
#include <ButtonConstants.au3>
#include <GUIListBox.au3>
#include <TabConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>

#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\ludder.luca\desktop\diaform.kxf
$Form1 GUICreate("DBot by Ludder"581428, -1, -1)
$Button1 GUICtrlCreateButton("Run"1761925925)
$Tab1 GUICtrlCreateTab(8248561129)
$TabSheet1 GUICtrlCreateTabItem("Common Log")
GUICtrlCreateTabItem("")
$Button2 GUICtrlCreateButton("Stop"2401925925)
$Button3 GUICtrlCreateButton("Add"3041925925)
$Button4 GUICtrlCreateButton("Edit"3681925925)
$Button5 GUICtrlCreateButton("Remove"4321925925)
$Button6 GUICtrlCreateButton("Save"4961925925)
$Group1 GUICtrlCreateGroup("Profile"1616553217)
$listview GUICtrlCreateListView("Profile Names| Runs | Restarts | Status"2440529136)
GUICtrlCreateGroup("", -99, -9911)
$Button7 GUICtrlCreateButton("Exit"4963847525)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\ludder.luca\desktop\formadd.kxf
$FormAdd GUICreate("Profile Settings"494349, -1, -1)
$Label1Add GUICtrlCreateLabel("Profile Name:"12126717)
GUICtrlSetFont(-194000"MS Sans Serif")
$Input1Add GUICtrlCreateInput(""88819321)
$Group1 GUICtrlCreateGroup("Loader Settings"1640465113)
$Label1Add GUICtrlCreateLabel("Path:"40852617)
$Input2Add GUICtrlCreateInput(""728026521)
$Button1Add GUICtrlCreateButton("..."344805125)
GUICtrlCreateGroup("", -99, -9911)
$Group2 GUICtrlCreateGroup("Game Settings"16168465121)
$Label1Add GUICtrlCreateLabel("Account Name:"241957517)
GUICtrlSetFont(-194000"MS Sans Serif")
$Input3Add GUICtrlCreateInput(""11219212121)
$Label1 GUICtrlCreateLabel("Position"2481924117)
$radio1 GUICtrlCreateRadio("1"3041922517)
GUICtrlSetState(-1$GUI_CHECKED)
$radio2 GUICtrlCreateRadio("2"3361922517)
$radio3 GUICtrlCreateRadio("3"3042162517)
$radio4 GUICtrlCreateRadio("4"3362162517)
$radio5 GUICtrlCreateRadio("5"3042402517)
$radio6 GUICtrlCreateRadio("6"3362402517)
$radio7 GUICtrlCreateRadio("7"3042642517)
$radio8 GUICtrlCreateRadio("8"3362642517)
GUICtrlCreateGroup("", -99, -9911)
$OKAdd GUICtrlCreateButton("OK"4003047525)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###


#Region ### START Koda GUI section ### Form=
$Form22 GUICreate("Password Dialog"25193, -1, -1)
$PasswordEdit GUICtrlCreateInput(""83223321)
$ButtonOk GUICtrlCreateButton("OK"86647525$BS_NOTIFY)
$ButtonCancel GUICtrlCreateButton("Cancel"167647525$BS_NOTIFY)
$EnterPassLabel GUICtrlCreateLabel("Enter password"81277170)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg 
GUIGetMsg(1)
    Switch 
$nMsg[1]
        Case 
$Form1 ;//erste form start
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button1
                    GUISetState
(@SW_HIDE$Form1)
                    
GUISetState(@SW_SHOW$Form22)
                Case 
$Button2
                    WinClose
("Diablo II""")
                Case 
$Button3
                    GUISetState
(@SW_HIDE$Form1)
                    
GUISetState(@SW_SHOW$FormAdd)
                Case 
$Button4
                    
;;
                Case 
$Button5
                    
;;
                Case 
$Button6
                    
;;
                Case 
$Button7
                    
Exit
            EndSwitch ;
//erste form ende
        
Case $Form22 ;//zweite form start
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    GUISetState
(@SW_HIDE$Form22)
                    
GUISetState(@SW_SHOW$Form1)
                Case 
$ButtonOk
                    GUISetState
(@SW_HIDE"Password Dialog")
                    
GUISetState(@SW_MINIMIZE"DBot by Ludder")
                    
Opt("SendKeyDelay"20)
                    
Run(GUICtrlRead($Input2Add))
                    
WinSetState("Diablo II""", @SW_LOCK)
                    
WinWaitActive("Diablo II")
                    
Sleep(5000)
                    
ControlClick("Diablo II""""""Left"1479335)
                    
Sleep(100)
                    
ControlClick("Diablo II""""""Left"1479335)
                    
Sleep(500)
                    
ControlSend("Diablo II"""""IniRead(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Path"GUICtrlRead($Input2Add)))
                    
Sleep(500)
                    
ControlClick("Diablo II""""""Left"1483394)
                    
Sleep(100)
                    
ControlClick("Diablo II""""""Left"1483394)
                    
Sleep(500)
                    
ControlSend("Diablo II"""""GUICtrlRead($PasswordEdit))
                    
Sleep(300)
                    
ControlClick("Diablo II""""""Left"1401466)
                    
Sleep(3500)
                    If 
GUICtrlRead($radio1) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1203148) ;checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1203148) ;checken
                    
ElseIf GUICtrlRead($radio2) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1484139) ;checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1484139);checken
                    
ElseIf GUICtrlRead($radio3) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1218243);checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1218243);checken
                    
ElseIf GUICtrlRead($radio4) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1515239);checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1515239);checken
                        
;ElseIf gUICtrlRead($radio5) = $GUI_CHECKED then
                        
;ControlClick("Diablo II""""""Left"1515239)
                        ;
Sleep(100)
                        ;
ControlClick("Diablo II""""""Left"1515239);

                        ;ElseIf 
gUICtrlRead($radio6) = $GUI_CHECKED then
                        
;ControlClick("Diablo II""""""Left"1515239)
                        ;
Sleep(100)
                        ;
ControlClick("Diablo II""""""Left"1515239);
                    EndIf
                Case 
$ButtonCancel
                    
Exit

            EndSwitch ;
//zweite form ende
        
Case $FormAdd ;//dritte form start
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    GUISetState
(@SW_HIDE$FormAdd)
                    
GUISetState(@SW_SHOW$Form1)
                Case 
$OKAdd
                    GUISetState
(@SW_HIDE$FormAdd)
                    
GUISetState(@SW_SHOW$Form1)
                    
IniWrite(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Path"GUICtrlRead($Input2Add))
                    
IniWrite(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Acc"GUICtrlRead($Input3Add))
                    
IniWrite(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Profil"GUICtrlRead($Input1Add))
                    
$item1 GUICtrlCreateListViewItem(GUICtrlRead($Input1Add) & "|" "||"$listview)
                    If 
GUICtrlRead($radio1) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio1))
                    ElseIf 
GUICtrlRead($radio2) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio2))
                    ElseIf 
GUICtrlRead($radio3) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio3))
                    ElseIf 
GUICtrlRead($radio4) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio4))
                    ElseIf 
GUICtrlRead($radio5) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio5))
                    ElseIf 
GUICtrlRead($radio6) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio6))
                    ElseIf 
GUICtrlRead($radio7) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio7))
                    ElseIf 
GUICtrlRead($radio8) = $GUI_CHECKED Then
                        IniWrite
(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Pos"GUICtrlRead($radio8))
                    EndIf

            EndSwitch ;
//dritte form ende
    
EndSwitch
WEnd



Func _exit
()
    Exit
EndFunc   ;==>_exit 
falls noch was nicht stimmt sag bescheid
05/21/2011 11:47 Ludder231#3
DANKE! für die schnelle und perfekte lösung aller meiner Probleme :D

Bloß wie mach ich das das was in der ini gespeichert wurde jz wieder in Item 1 angezeigt wird wenn man die exe neu startet? Also den Profil name?
05/21/2011 13:46 KDeluxe#4
Input:
PHP Code:
GUICtrlCreateInput(IniRead(), ...) 
;
oder:
GUICtrlSetData($InputIniRead()) 
Radio:
PHP Code:
GUICtrlCreateRadio()
GUICtrlSetState(-1IniRead()) ;"default" 0 oder 4 
05/21/2011 15:29 Ludder231#5
Hier ist jz das script. Es geht :D
PHP Code:
If _Singleton("Diaspambot.exe"1) = 0 Then ;aktuell halten
    MsgBox
(16"Runtime Error""Die exe wird bereits ausgeführt!")
    Exit
EndIf

if 
ProcessExists("Game.exe"Then
    MsgBox
(0"Warnung""Der Process 'Game.exe' existiert bereits und muss beendet werden!" & @CRLF _
            
"" & @CRLF _
            
"Diablo II wird automatisch beendet!")
    
WinClose("Diablo II")
    If 
Not @error Then
        WinWaitClose
("Diablo II")
    EndIf
EndIf

Global 
$Input1Add$Input2Add$Input3Add$listview$radio1$radio2$radio3$radio4$radio5$radio6$radio7$radio8$item1



#RequireAdmin
#Include <File.au3>

#include <misc.au3>
#include <ButtonConstants.au3>
#include <GUIListBox.au3>
#include <TabConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>

#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\ludder.luca\desktop\diaform.kxf
$Form1 GUICreate("DBot by Ludder"581428, -1, -1)
$Button1 GUICtrlCreateButton("Run"1761925925)
$Tab1 GUICtrlCreateTab(8248561129)
$TabSheet1 GUICtrlCreateTabItem("Common Log")
GUICtrlCreateTabItem("")
$Button2 GUICtrlCreateButton("Stop"2401925925)
$Button3 GUICtrlCreateButton("Add"3041925925)
$Button4 GUICtrlCreateButton("Edit"3681925925)
$Button5 GUICtrlCreateButton("Remove"4321925925)
$Button6 GUICtrlCreateButton("Save"4961925925)
$Group1 GUICtrlCreateGroup("Profile"1616553217)
$listview GUICtrlCreateListView("Profile Names| Runs | Restarts | Status"2440529136)
GUICtrlCreateGroup("", -99, -9911)
$Button7 GUICtrlCreateButton("Exit"4963847525)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\ludder.luca\desktop\formadd.kxf
$FormAdd GUICreate("Profile Settings"494349, -1, -1)
$Label1Add GUICtrlCreateLabel("Profile Name:"12126717)
GUICtrlSetFont(-194000"MS Sans Serif")
$Input1Add GUICtrlCreateInput(""88819321)
$Group1 GUICtrlCreateGroup("Loader Settings"1640465113)
$Label1Add GUICtrlCreateLabel("Path:"40852617)
$Input2Add GUICtrlCreateInput(""728026521)
$Button1Add GUICtrlCreateButton("..."344805125)
GUICtrlCreateGroup("", -99, -9911)
$Group2 GUICtrlCreateGroup("Game Settings"16168465121)
$Label1Add GUICtrlCreateLabel("Account Name:"241957517)
GUICtrlSetFont(-194000"MS Sans Serif")
$Input3Add GUICtrlCreateInput(""11219212121)
$Label1 GUICtrlCreateLabel("Position"2481924117)
$radio1 GUICtrlCreateRadio("1"3041922517)
GUICtrlSetState(-1$GUI_CHECKED)
$radio2 GUICtrlCreateRadio("2"3361922517)
$radio3 GUICtrlCreateRadio("3"3042162517)
$radio4 GUICtrlCreateRadio("4"3362162517)
$radio5 GUICtrlCreateRadio("5"3042402517)
$radio6 GUICtrlCreateRadio("6"3362402517)
$radio7 GUICtrlCreateRadio("7"3042642517)
$radio8 GUICtrlCreateRadio("8"3362642517)
GUICtrlCreateGroup("", -99, -9911)
$OKAdd GUICtrlCreateButton("OK"4003047525)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###


#Region ### START Koda GUI section ### Form=
$Form22 GUICreate("Password Dialog"25193, -1, -1)
$PasswordEdit GUICtrlCreateInput(""83223321)
$ButtonOk GUICtrlCreateButton("OK"86647525$BS_NOTIFY)
$ButtonCancel GUICtrlCreateButton("Cancel"167647525$BS_NOTIFY)
$EnterPassLabel GUICtrlCreateLabel("Enter password"81277170)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###



While 1
    $nMsg 
GUIGetMsg(1)
    Switch 
$nMsg[1]
    Case 
$Form1
        
            
Switch $nMsg[0]
                
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button1
                    
                    GUISetState
(@SW_HIDE$Form1)
                    
GUISetState(@SW_SHOW$Form22)
                Case 
$Button2
                    WinClose
("Diablo II""")
                Case 
$Button3
                    GUISetState
(@SW_HIDE$Form1)
                    
GUISetState(@SW_SHOW$FormAdd)
                Case 
$Button4
                    
;;
                Case 
$Button5
                    
;;
                Case 
$Button6
                    
;;
                Case 
$Button7
                    
Exit
                
                    
            EndSwitch 
        Case 
$Form22 
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    GUISetState
(@SW_HIDE$Form22)
                    
GUISetState(@SW_SHOW$Form1)
                Case 
$ButtonOk
                    GUISetState
(@SW_HIDE"Password Dialog")
                    
GUISetState(@SW_MINIMIZE"DBot by Ludder")
                    
Opt("SendKeyDelay"20)
                    
                    
Run(GUICtrlRead($Input2Add)&" -skiptobnet -w")
                    if @
error Then
                        msgbox
(16"""File doesn't exist")
                        endif
                    
WinSetState("Diablo II""", @SW_LOCK)
                    
                    
WinWaitActive("Diablo II")
                    
Sleep(5000)
                    
ControlClick("Diablo II""""""Left"1479335)
                    
Sleep(100)
                    
ControlClick("Diablo II""""""Left"1479335)
                    
Sleep(500)
                    
ControlSend("Diablo II"""""IniRead(@WindowsDir "\DBot.ini"GUICtrlRead($Input1Add), "Acc"GUICtrlRead($Input3Add)))
                    
Sleep(500)
                    
ControlClick("Diablo II""""""Left"1483394)
                    
Sleep(100)
                    
ControlClick("Diablo II""""""Left"1483394)
                    
Sleep(500)
                    
ControlSend("Diablo II"""""GUICtrlRead($PasswordEdit))
                    
Sleep(300)
                    
ControlClick("Diablo II""""""Left"1401466)
                    
Sleep(3500)
                    If 
GUICtrlRead($radio1) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1203148) ;checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1203148) ;checken
                    
ElseIf GUICtrlRead($radio2) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1484139) ;checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1484139);checken
                    
ElseIf GUICtrlRead($radio3) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1218243);checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1218243);checken
                    
ElseIf GUICtrlRead($radio4) = $GUI_CHECKED Then
                        ControlClick
("Diablo II""""""Left"1515239);checken
                        Sleep
(100)
                        
ControlClick("Diablo II""""""Left"1515239);checken
                        
;ElseIf gUICtrlRead($radio5) = $GUI_CHECKED then
                        
;ControlClick("Diablo II""""""Left"1515239)
                        ;
Sleep(100)
                        ;
ControlClick("Diablo II""""""Left"1515239);

                        ;ElseIf 
gUICtrlRead($radio6) = $GUI_CHECKED then
                        
;ControlClick("Diablo II""""""Left"1515239)
                        ;
Sleep(100)
                        ;
ControlClick("Diablo II""""""Left"1515239);
                    EndIf
                    
                    
sleep(1500)
                    
ControlClick("Diablo II""""""Left"191468)
                    for 
$i 1 to 100
                    sleep
(2000)
                    
ControlClick("Diablo II""""""Left"1709463)
                    
sleep(5000)
                    
ControlClick("Diablo II""""""left"1470232)
                    
sleep(100)
                    
ControlClick("Diablo II""""""left"1470232)
                    
sleep(6000)
                    
ControlSend("Diablo II""""""{enter}")
                    
sleep(200)
                    
ControlSend("Diablo II""""""Cxy3.com")
                    
sleep(600)
                    
ControlSend("Diablo II""""""{enter}")
                    
sleep(10000)
                    
ControlSend("Diablo II""""""{ESC}")
                    
sleep(200)
                    
Controlclick("Diablo II""""""Left"1401258)
                    
sleep(60000)
                
Next
                
exit
                    
                    
                Case 
$ButtonCancel
                    
Exit

            EndSwitch 
        Case 
$FormAdd 
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    GUISetState
(@SW_HIDE$FormAdd)
                    
GUISetState(@SW_SHOW$Form1)
                    
                case 
$button1add
                    $fileopen 
FileOpenDialog("Auswählen", @DesktopCommonDir "\", "Diablo II Game.exe(*Game.exe;)", 1 + 4)
                    guictrlsetdata(
$input2add$fileopen)
                Case 
$OKAdd
                    GUISetState(@SW_HIDE, 
$FormAdd)
                    GUISetState(@SW_SHOW, 
$Form1)
                    IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Path", GUICtrlRead($Input2Add))
                    IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Acc", GUICtrlRead($Input3Add))
                    IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Profil", GUICtrlRead($Input1Add))
                    
$item1 = GUICtrlCreateListViewItem(GUICtrlRead($Input1Add) & "|"& "||", $listview) ; runs eintragen lassen...
                    If GUICtrlRead(
$radio1) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio1))
                    ElseIf GUICtrlRead(
$radio2) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio2))
                    ElseIf GUICtrlRead(
$radio3) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio3))
                    ElseIf GUICtrlRead(
$radio4) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio4))
                    ElseIf GUICtrlRead(
$radio5) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio5))
                    ElseIf GUICtrlRead(
$radio6) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio6))
                    ElseIf GUICtrlRead(
$radio7) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio7))
                    ElseIf GUICtrlRead(
$radio8) = $GUI_CHECKED Then
                        IniWrite(@WindowsDir & "
\DBot.ini", GUICtrlRead($Input1Add), "Pos", GUICtrlRead($radio8))
                    EndIf

            EndSwitch 
    EndSwitch
WEnd



Func _exit()
    Exit
EndFunc 
05/22/2011 14:01 Ludder231#6
Quote:
Originally Posted by KillerDeluxe View Post
Input:
PHP Code:
GUICtrlCreateInput(IniRead(), ...) 
;
oder:
GUICtrlSetData($InputIniRead()) 
Radio:
PHP Code:
GUICtrlCreateRadio()
GUICtrlSetState(-1IniRead()) ;"default" 0 oder 4 
Ja aber was ist denn wenn es keinen festen Wert zum asulesen gibt, also wenn der immer anders heißt?

Code:
[1312312] <- soll ausgelesen werden(heißt aber immer anders, je nachdem wie der Profilname heißt den man eingegeben hat)
Path=E:\bla.exe
Acc=Jonny
Profil=1312312
Pos=1
05/22/2011 14:15 KDeluxe#7
IniReadSectionNames()

Den Rest müsstest du mit der Hilfe schaffen.