AutoIt Bot

12/06/2010 17:18 iJonas#1
Hallo, liebe Com
Also ich habe mir einen Bot geschrieben zum automatisch einloggen und ausloggen und halt dazwischen was machen...
Doch ich wieß nicht wies mit Start/Stop Pause/Weiter
Geht wenn ich ihn starte habe ich nichtz er fängt einfach an...
Also habe ich Buttons gemacht mit denen man starten/stoppen & pausieren/weitermnachen kann
Hier das Script:
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("LP-Farm-Bot", 320, 120, 1363, 216)
$Group1 = GUICtrlCreateGroup("Start und Stop", 8, 0, 297, 49)
$Button1 = GUICtrlCreateButton("Bot starten...", 16, 16, 137, 25)
$Button3 = GUICtrlCreateButton("Bot beenden...", 168, 16, 121, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Pause und Weiter", 8, 56, 297, 49)
$Button2 = GUICtrlCreateButton("Pause...", 16, 72, 137, 25)
$Button4 = GUICtrlCreateButton("Weiter...", 168, 72, 121, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            Send
("Beispiel)
        Case 
$Button3
            
        Case 
$Button2

        Case 
$Button4 
Button1= Start
Button3=Stopp(Porgramm schließen (komplett))
Button2=Pausieren bis Button4 gedrückt
Button4=Weitermachen(von der stelle an wo es pausiert wurde)

....Danke für eure ideen..
12/06/2010 17:39 BlackHybrid#2
Versuche mal durch das drücken eines buttens eine Variabele auf true oder sonstiges zu setzen. Dann machst du einfach unten drunter unter der Switch Abfrage aber noch in der While Schleife eine If abfrage in der du abfragst ob die Variable = true ist. da hinten drann kannst du z.B ein kleinen bot schreiben
12/06/2010 17:52 iJonas#3
...?
Mach mal ein Bsp..
12/06/2010 18:15 BlackHybrid#4
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $status = False
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("LP-Farm-Bot", 320, 120, 1363, 216)
$Group1 = GUICtrlCreateGroup("Start und Stop", 8, 0, 297, 49)
$Button1 = GUICtrlCreateButton("Bot starten...", 16, 16, 137, 25)
$Button3 = GUICtrlCreateButton("Bot beenden...", 168, 16, 121, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Pause und Weiter", 8, 56, 297, 49)
$Button2 = GUICtrlCreateButton("Pause...", 16, 72, 137, 25)
$Button4 = GUICtrlCreateButton("Weiter...", 168, 72, 121, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            $status 
= True
        
Case $Button3

        
Case $Button2

        
Case $Button4
    
EndSwitch
    If 
$status = True Then
        Send
("Beispiel")
    EndIf
WEnd 
Geht aber auch besser hab nur grad vergessen wie :D
12/06/2010 18:25 iJonas#5
Und was ist mit den anderen ?!
12/06/2010 18:30 BlackHybrid#6
Als wäre das nicht fast schon klar^^

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $status = False
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("LP-Farm-Bot", 320, 120, 1363, 216)
$Group1 = GUICtrlCreateGroup("Start und Stop", 8, 0, 297, 49)
$Button1 = GUICtrlCreateButton("Bot starten...", 16, 16, 137, 25)
$Button3 = GUICtrlCreateButton("Bot beenden...", 168, 16, 121, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Pause und Weiter", 8, 56, 297, 49)
$Button2 = GUICtrlCreateButton("Pause...", 16, 72, 137, 25)
$Button4 = GUICtrlCreateButton("Weiter...", 168, 72, 121, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            $status 
= True
        
Case $Button2
            $status 
= False
        
Case $Button3
            
Exit
        Case 
$Button4
            $status 
= True
    
EndSwitch
    If 
$status = True Then
        Send
("Beispiel")
    EndIf
WEnd 
12/06/2010 19:03 omer36#7
wozu so viele buttons?

so gehts zb auch:

PHP Code:
Dim $run = False, $button_name[2] = ['Bot starten...', 'Bot pausieren...']
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("LP-Farm-Bot", 310, 50, 1363, 216)
$Group1 = GUICtrlCreateGroup("Start und Stop", 8, 0, 297, 49)
$Button1 = GUICtrlCreateButton("Bot starten...", 16, 16, 137, 25)
$Button2 = GUICtrlCreateButton("Bot beenden...", 168, 16, 121, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case -3
            
Exit
        Case 
$Button1
            $run 
= Not $run
            GUICtrlSetData
($Button1, $button_name[$run])
            If 
$run Then
            Sleep
(2000)
            
Send("beispiel")
            EndIf
        Case 
$Button2
            
Exit
    EndSwitch
WEnd 
12/06/2010 19:05 iJonas#8
Ich nehme trotzdem lieber das von Hybrid..
Gibts irgendwie sowas wie eine WIederholschleife das der das ganz oft wieder holt?
12/08/2010 18:32 puzzlr#9
gibt es. du setzt einfach das, was du immer wiederholen willst in eine Endlosschleife. zb.
Quote:
While 1
MouseClick ("left, 0,0)
Sleep (10)
WEnd
das würde sich zb. immer wiederholen ;).