Hilfe: GUI mit Bot verbinden

07/24/2010 00:20 Attention!#1
Hallo.

Ich habe gerade eine Oberfläche für einen ganz "einfachen" Bot gemacht, doch da ich noch Anfänger bin habe ich eine unlösbare Aufgabe, ich hoffe ihr könnt mir weiterhelfen:

Oberfläche: [Only registered and activated users can see links. Click Here To Register...]
Bot1: [Only registered and activated users can see links. Click Here To Register...]
Bot2: [Only registered and activated users can see links. Click Here To Register...]

Also, ich habe folgendes vor:
-Wenn man "RSB-75 and SAB-50" (Oberfläche) auswählt wird Bot2 ausgewählt.
-Wenn man "RSB-75 and UCB-100" (Oberfläche) auswählt wird Bot1 ausgewählt.
-Durch den Button "Run RSB Shooter!" (Oberfläche) wird dann der ausgewählte Bot gestartet. Kann bitte jemand dem Button auch ein Hotkey zuweisen, dass wenn ich auf F1 drücke der Bot startet?
-Die beiden Bots sollen wenn sie gestartet wurden solange wiederholt werden bis der Bot beendet wird -> Schleife?
-Durch irgendeine Taste soll der Bot gestoppt werden.

Ich habe mich hier im Forum schon umgesehen, hab auch viele Videos bei YouTube angesehen und hab AutoIt Tutorials überflogen, doch ich konnte dazu leider nicht viel finden. Bitte helft mir dabei, die 5 Punkte oben zu lösen =)

Gruß Attention!

Oberfläche:
Quote:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=oberfläche.kxf
$Form2 = GUICreate("RSB Shooter by SLK Attention", 278, 132, 305, 169)
$Tab1 = GUICtrlCreateTab(8, 8, 265, 121)
$TabSheet1 = GUICtrlCreateTabItem("Information")
$Label2 = GUICtrlCreateLabel("version 0.1", 205, 105, 62, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Calibri")
$Label1 = GUICtrlCreateLabel("This bot is created by att3nti0n", 48, 72, 172, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Calibri")
$Label3 = GUICtrlCreateLabel("", 32, 64, 4, 4)
$TabSheet2 = GUICtrlCreateTabItem("Run RSB Shooter!")
GUICtrlSetState(-1,$GUI_SHOW)
$Label4 = GUICtrlCreateLabel("Choose your ammunition combination:", 32, 34, 215, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Calibri")
$Radio3 = GUICtrlCreateRadio("RSB-75 and SAB-50", 60, 49, 153, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Calibri")
$Radio4 = GUICtrlCreateRadio("RSB-75 and UCB-100 ", 60, 65, 129, 25)
GUICtrlSetFont(-1, 9, 400, 0, "Calibri")
$Button2 = GUICtrlCreateButton("Run RSB Shooter!", 62, 96, 129, 25)
GUICtrlSetFont(-1, 10, 400, 0, "Calibri")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Label4
EndSwitch
WEnd
Bot1:
Quote:
; x4 Munition schießen
; Shoot x4 ammunition
Send ("4")

; 3 Sekunden Pause
; 3 Secons Break
Sleep (3000)

; x6 Munition schießen
; Shoot x6 ammunition
Send ("6")

; 0.05 Sekunden Pause
; 0.05 Seconds Break
Sleep (50)
Bot2:
Quote:
; x4 Munition schießen
; Shoot x4 ammunition
Send ("5")

; 3 Sekunden Pause
; 3 Secons Break
Sleep (3000)

; x6 Munition schießen
; Shoot x6 ammunition
Send ("6")

; 0.05 Sekunden Pause
; 0.05 Seconds Break
Sleep (50)
07/24/2010 00:25 omer36#2
erstmal, poste die surce hier rein.
weil wir es nicht extra downloaden wollen -.-
07/24/2010 01:42 Syst3m Down#3
SUFU benutzen wurde von mir gestern gefragt

#closerrequest
07/24/2010 01:54 omer36#4
Quote:
Originally Posted by MaroX59 View Post
SUFU benutzen wurde von mir gestern gefragt

#closerrequest
o.O motz dich mal nicht so auf,
jeder fängt mal klein an, und wenigstens hatt er es geschaft überhaupt ein bot zu schreiben, nur weiss er ebend noch nciht wie man den in die gui einbaut...
07/24/2010 02:10 Syst3m Down#5
motzen? ich meine nur das es beantwortet wurde desweiteren bin ich selbst erst am anfang
07/24/2010 09:52 Attention!#6
Hallo.

Ich habe nun oben die Codes hinzugefügt, ich hoffe nun kann mir einer helfen =)
07/24/2010 10:13 Shadow992#7
Hier:

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=oberfläche.kxf
$Form2 GUICreate("RSB Shooter by SLK Attention"278132305169)
$Tab1 GUICtrlCreateTab(88265121)
$TabSheet1 GUICtrlCreateTabItem("Information")
$Label2 GUICtrlCreateLabel("version 0.1"2051056218)
GUICtrlSetFont(-194000"Calibri")
$Label1 GUICtrlCreateLabel("This bot is created by att3nti0n"487217218)
GUICtrlSetFont(-194000"Calibri")
$Label3 GUICtrlCreateLabel(""326444)
$TabSheet2 GUICtrlCreateTabItem("Run RSB Shooter!")
GUICtrlSetState(-1$GUI_SHOW)
$Label4 GUICtrlCreateLabel("Choose your ammunition combination:"323421518)
GUICtrlSetFont(-194000"Calibri")
$Radio3 GUICtrlCreateRadio("RSB-75 and SAB-50"604915317)
GUICtrlSetFont(-194000"Calibri")
$Radio4 GUICtrlCreateRadio("RSB-75 and UCB-100 "606512925)
GUICtrlSetFont(-194000"Calibri")
$Button2 GUICtrlCreateButton("Run RSB Shooter!"629612925)
GUICtrlSetFont(-1104000"Calibri")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button2
            
If GUICtrlRead($Radio3) = 1 Then
                Bot
(1)
            ElseIf 
GUICtrlRead($Radio4) = 1 Then
                Bot
(2)
            EndIf
    EndSwitch
WEnd


Func Bot
($botNr)
    ; 
x4 Munition schießen
    
Shoot x4 ammunition
    
If $botNr 1 Then
        Send
("5")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    ElseIf 
$botNr 2 Then
        
x4 Munition schießen
        
Shoot x4 ammunition
        Send
("4")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    EndIf
EndFunc   ;==>Bot 
07/24/2010 11:27 Attention!#8
Danke!

Kann mir nun noch jemand helfen den Bot durch Hotkeys ein bisschen einfacher zu gestalten?

Also, der Bot ist gedacht um in einem Browsergame immer die Munition im Kampf selbstständig zu wechseln, denn die Munition die man auf "6" erreicht kann man nur alle 3 Sekunden schießen. In den 3 Sekunden schießt man dann eine andere Munition, die man auf "4" oder "5" erreichen kann.

Aber mein Bot, den ich mit eurer Hilfe erstellt habe, macht diesen Schritt nur ein mal. Er soll "bot1" oder "bot2" aber solange wiederholen, bis ich den Bot pausiere.

Außerdem ist es zur Zeit noch recht aufwendig, im Kampf jedes mal den Bot über die Maus zu starten. Ist es möglich, per Tastendruck den Bot zu starten und stoppen? Und wenn ja, wie?

Gruß Attention, und danke nochmal für eure Hilfe!

So sieht er momentan aus:
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=oberfläche.kxf
$Form2 GUICreate("RSB Shooter by SLK Attention"278132305169)
$Tab1 GUICtrlCreateTab(88265121)
$TabSheet1 GUICtrlCreateTabItem("Information")
$Label2 GUICtrlCreateLabel("version 0.1"2051056218)
GUICtrlSetFont(-194000"Calibri")
$Label1 GUICtrlCreateLabel("This bot is created by att3nti0n"487217218)
GUICtrlSetFont(-194000"Calibri")
$Label3 GUICtrlCreateLabel(""326444)
$TabSheet2 GUICtrlCreateTabItem("Run RSB Shooter!")
GUICtrlSetState(-1$GUI_SHOW)
$Label4 GUICtrlCreateLabel("Choose your ammunition combination:"323421518)
GUICtrlSetFont(-194000"Calibri")
$Radio3 GUICtrlCreateRadio("RSB-75 and SAB-50"604915317)
GUICtrlSetFont(-194000"Calibri")
$Radio4 GUICtrlCreateRadio("RSB-75 and UCB-100 "606512925)
GUICtrlSetFont(-194000"Calibri")
$Button2 GUICtrlCreateButton("Run RSB Shooter!"629612925)
GUICtrlSetFont(-1104000"Calibri")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button2
            
If GUICtrlRead($Radio3) = 1 Then
                Bot
(1)
            ElseIf 
GUICtrlRead($Radio4) = 1 Then
                Bot
(2)
            EndIf
    EndSwitch
WEnd


Func Bot
($botNr)
    ; 
x4 Munition schießen
    
Shoot x4 ammunition
    
If $botNr 1 Then
        Send
("5")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    ElseIf 
$botNr 2 Then
        
x4 Munition schießen
        
Shoot x4 ammunition
        Send
("4")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    EndIf
EndFunc   ;==>Bot 
07/24/2010 11:50 Shadow992#9
Quote:
Originally Posted by Attention! View Post
Danke!

Kann mir nun noch jemand helfen den Bot durch Hotkeys ein bisschen einfacher zu gestalten?

Also, der Bot ist gedacht um in einem Browsergame immer die Munition im Kampf selbstständig zu wechseln, denn die Munition die man auf "6" erreicht kann man nur alle 3 Sekunden schießen. In den 3 Sekunden schießt man dann eine andere Munition, die man auf "4" oder "5" erreichen kann.

Aber mein Bot, den ich mit eurer Hilfe erstellt habe, macht diesen Schritt nur ein mal. Er soll "bot1" oder "bot2" aber solange wiederholen, bis ich den Bot pausiere.

Außerdem ist es zur Zeit noch recht aufwendig, im Kampf jedes mal den Bot über die Maus zu starten. Ist es möglich, per Tastendruck den Bot zu starten und stoppen? Und wenn ja, wie?

Gruß Attention, und danke nochmal für eure Hilfe!

So sieht er momentan aus:
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=oberfläche.kxf
$Form2 GUICreate("RSB Shooter by SLK Attention"278132305169)
$Tab1 GUICtrlCreateTab(88265121)
$TabSheet1 GUICtrlCreateTabItem("Information")
$Label2 GUICtrlCreateLabel("version 0.1"2051056218)
GUICtrlSetFont(-194000"Calibri")
$Label1 GUICtrlCreateLabel("This bot is created by att3nti0n"487217218)
GUICtrlSetFont(-194000"Calibri")
$Label3 GUICtrlCreateLabel(""326444)
$TabSheet2 GUICtrlCreateTabItem("Run RSB Shooter!")
GUICtrlSetState(-1$GUI_SHOW)
$Label4 GUICtrlCreateLabel("Choose your ammunition combination:"323421518)
GUICtrlSetFont(-194000"Calibri")
$Radio3 GUICtrlCreateRadio("RSB-75 and SAB-50"604915317)
GUICtrlSetFont(-194000"Calibri")
$Radio4 GUICtrlCreateRadio("RSB-75 and UCB-100 "606512925)
GUICtrlSetFont(-194000"Calibri")
$Button2 GUICtrlCreateButton("Run RSB Shooter!"629612925)
GUICtrlSetFont(-1104000"Calibri")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button2
            
If GUICtrlRead($Radio3) = 1 Then
                Bot
(1)
            ElseIf 
GUICtrlRead($Radio4) = 1 Then
                Bot
(2)
            EndIf
    EndSwitch
WEnd


Func Bot
($botNr)
    ; 
x4 Munition schießen
    
Shoot x4 ammunition
    
If $botNr 1 Then
        Send
("5")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    ElseIf 
$botNr 2 Then
        
x4 Munition schießen
        
Shoot x4 ammunition
        Send
("4")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    EndIf
EndFunc   ;==>Bot 
Du solltest dir die Grundlagen echt nocheinmal anschauen:
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>

HotKeySet("s","StartBot")
HotKeySet("n","NextWeapon")
HotKeySet("p","Pause")

$start=0

#region ### START Koda GUI section ### Form=oberfläche.kxf
$Form2 GUICreate("RSB Shooter by SLK Attention"278132305169)
$Tab1 GUICtrlCreateTab(88265121)
$TabSheet1 GUICtrlCreateTabItem("Information")
$Label2 GUICtrlCreateLabel("version 0.1"2051056218)
GUICtrlSetFont(-194000"Calibri")
$Label1 GUICtrlCreateLabel("This bot is created by att3nti0n"487217218)
GUICtrlSetFont(-194000"Calibri")
$Label3 GUICtrlCreateLabel(""326444)
$TabSheet2 GUICtrlCreateTabItem("Run RSB Shooter!")
GUICtrlSetState(-1$GUI_SHOW)
$Label4 GUICtrlCreateLabel("Choose your ammunition combination:"323421518)
GUICtrlSetFont(-194000"Calibri")
$Radio3 GUICtrlCreateRadio("RSB-75 and SAB-50"604915317)
GUICtrlSetFont(-194000"Calibri")
$Radio4 GUICtrlCreateRadio("RSB-75 and UCB-100 "606512925)
GUICtrlSetFont(-194000"Calibri")
$Button2 GUICtrlCreateButton("Run RSB Shooter!"629612925)
GUICtrlSetFont(-1104000"Calibri")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button2
            StartBot
()
    EndSwitch
    if 
$start=1 then StartBot()
WEnd

Func StartBot
()
    
$start=1
    ToolTip
("")
    If 
GUICtrlRead($Radio3) = 1 Then
        Bot
(1)
    ElseIf 
GUICtrlRead($Radio4) = 1 Then
        Bot
(2)
    EndIf
EndFunc

Func NextWeapon
()
    If 
GUICtrlRead($Radio3) = 1 Then
        GUICtrlSetState
($Radio4,1)
        
GUICtrlSetState($Radio3,4)
        
ToolTip("RSB-75 and UCB-100 ausgewählt")
    ElseIf 
GUICtrlRead($Radio4) = 1 Then
        GUICtrlSetState
($Radio4,4)
        
GUICtrlSetState($Radio3,1)
        
ToolTip("RSB-75 and SAB-50 ausgewählt")
    Else
        
GUICtrlSetState($Radio4,4)
        
GUICtrlSetState($Radio3,1)
        
ToolTip("RSB-75 and SAB-50 ausgewählt")
    EndIf
endfunc

Func Pause
()
    
$start=0
EndFunc

Func Bot
($botNr)
    ; 
x4 Munition schießen
    
Shoot x4 ammunition
    
If $botNr 1 Then
        Send
("5")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    ElseIf 
$botNr 2 Then
        
x4 Munition schießen
        
Shoot x4 ammunition
        Send
("4")

        ; 
3 Sekunden Pause
        
3 Secons Break
        
Sleep(3000)

        ; 
x6 Munition schießen
        
Shoot x6 ammunition
        Send
("6")

        ; 
0.05 Sekunden Pause
        
0.05 Seconds Break
        
Sleep(50)
    EndIf
EndFunc   ;==>Bot 
07/24/2010 12:34 Attention!#10
Danke! Das mit den Hotkeys und der Endlosschleife habe ich jetzt verstanden, der Bot funktioniert super. Ich werde in den nächsten Tagen mal ein Video hochladen, bis dahin muss ich den Bot noch optimieren (Die Sleepzeit auf das Minimum kürzen, ...).

Gruß Attention!