Porblem

01/05/2010 11:15 [-Lee-]#1
Hi E*pvp ich habe vor 3 tage mal angefangen mit AutoIT und habe mich mal an meinem eigenen Spammbot versucht .... klappt so weit auch alles aber nun möchte ich 1 Weitern Button hinzufügen
Also das er starten und Stoppen kann
Währe nett von euch wenn mir jemand das so ändern würde das der stop butten auch den bot dan wirklich stopt.
Starten button hat eine funktion aber das mit stop bekomm ich nicht richtig hin


Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\león\desktop\Übergeordnet\bilder\s.kxf
$Form1_1 = GUICreate("SpammBotV2", 609, 426, 176, 124)
GUICtrlCreateLabel("SpammBotV2 by ®oTTe® from Elitepvpers", 200, 8, 205, 17)
$Button1 = GUICtrlCreateButton("Start", 48, 96, 225, 57)
$Button2 = GUICtrlCreateButton("Stop", 360, 96, 225, 57)
$Pic1 = GUICtrlCreatePic("C:\Users\león\Desktop\ÜberGeordnet\Bilder\pic_6583801_1232969536.bmp", 40, 184, 537, 225)
$Edit = GUICtrlCreateEdit("", 88, 32, 441, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Edit
			Sleep(3000)
			Send("{Enter}")
			Sleep(2000)
			While 1
				Send (GUICtrlRead($Edit))
				Send("{Enter}")
				Sleep (3000)
			WEnd
	EndSwitch
WEnd
Danke schonmal
01/05/2010 11:43 eXcalibur93#2
PHP Code:
Global $Pause
HotKeySet 
"{NUMPAD9}""TogglePause" ) ;geht auch eine andere Taste

Func TogglePause 
()
    
$Pause Not $Pause
    
While $Pause
        Sleep 
500 )
    
WEnd
EndFunc 
01/05/2010 11:58 [-Lee-]#3
Ich will ja kein hotkey ich möchte das der button Pause den bot paussirt so wie der button start ihn startet
01/05/2010 12:11 eXcalibur93#4
ja dann so:
PHP Code:
$Global $Pause
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\león\desktop\Übergeordnet\bilder\s.kxf
$Form1_1 GUICreate("SpammBotV2"609426176124)
GUICtrlCreateLabel("SpammBotV2 by ®oTTe® from Elitepvpers"200820517)
$Button1 GUICtrlCreateButton("Start/Stop"489622557) ;;; Also ich würde dann nur ein Button machenmit 2 wirds kompliziert
$Pic1 
GUICtrlCreatePic("C:\Users\león\Desktop\ÜberGeordnet\Bilder\pic_6583801_1232969536.bmp"40184537225)
$Edit GUICtrlCreateEdit(""883244149)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $Button1 ;hier wird durch den Button die Funktion aufgerufen und das Skript pausiert
            TogglePause
()
        Case 
$GUI_EVENT_CLOSE
            
Exit
        Case 
$Edit
            Sleep
(3000)
            
Send("{Enter}")
            
Sleep(2000)
            While 
1
                Send 
(GUICtrlRead($Edit))
                
Send("{Enter}")
                
Sleep (3000)
            
WEnd
    
EndSwitch
WEnd

Func TogglePause 
()
    
$Pause Not $Pause
    
While $Pause
        Sleep 
500 )
    
WEnd
EndFunc 
01/05/2010 12:19 [-Lee-]#5
Nope geht nicht

Folgende Meldung:

$Glovel $Pause
$Global^ERROR

Error: expected 1 "=" operator in assignment statement
01/05/2010 12:23 eXcalibur93#6
ja sry vertippt, des Global is keine Variable, also des $ davor weg :D
01/05/2010 12:35 [-Lee-]#7
habe ich gemacht ... jetzt hat das zwar nur noch 1 button aber trozdem funzt von dem auch nur die start funktion
01/05/2010 12:50 Kazaaa#8
Quote:
Originally Posted by eXcalibur93 View Post
PHP Code:
Func TogglePause ()
    
$Pause Not $Pause
    
While $Pause
        Sleep 
500 )
    
WEnd
EndFunc 
Und dann eben
PHP Code:
Case $Button2
func TogglePause 
() 
01/05/2010 12:53 eXcalibur93#9
Ah ok^^
01/05/2010 12:55 [-Lee-]#10
hehe sorry ich habe mich damit ech noch nicht lange beschäftigt wo kommt das nun rein?

Könntest den ganze code so posten wie er richtig währe?:confused:
01/05/2010 13:03 eXcalibur93#11
PHP Code:
Global $Pause
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\león\desktop\Übergeordnet\bilder\s.kxf
$Form1_1 GUICreate("SpammBotV2"609426176124)
GUICtrlCreateLabel("SpammBotV2 by ®oTTe® from Elitepvpers"200820517)
$Button1 GUICtrlCreateButton("Start"489622557)
$Button2 GUICtrlCreateButton("Stop"3609622557)
$Pic1 GUICtrlCreatePic("C:\Users\león\Desktop\ÜberGeordnet\Bilder\pic_6583801_1232969536.bmp"40184537225)
$Edit GUICtrlCreateEdit(""883244149)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $Button1 ;hier wird durch den Button die Funktion aufgerufen und das Skript pausiert
            TogglePause
()
        Case 
$Botton2
            TogglePause
()
        Case 
$GUI_EVENT_CLOSE
            
Exit
        Case 
$Edit
            Sleep
(3000)
            
Send("{Enter}")
            
Sleep(2000)
            While 
1
                Send 
(GUICtrlRead($Edit))
                
Send("{Enter}")
                
Sleep (3000)
            
WEnd
    
EndSwitch
WEnd

Func TogglePause 
()
    
$Pause Not $Pause
    
While $Pause
        Sleep 
500 )
    
WEnd
EndFunc 

€geht au net hab ich bemerkt, da wenn man in der While 1 schleife ist, nichts passiert, wenn der button gedrückt wird...
01/05/2010 13:08 Kazaaa#12
Ich schaus mir grad mal an, editier gleich die Lösung

Edit

PHP Code:
Global $Paused
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\león\desktop\Übergeordnet\bilder\s.kxf
$Form1_1 GUICreate("SpammBotV2"609426176124)
GUICtrlCreateLabel("SpammBotV2 by ®oTTe® from Elitepvpers"200820517)
$Button1 GUICtrlCreateButton("Start"489622557)
$Button2 GUICtrlCreateButton("Stop"3609622557)
$Pic1 GUICtrlCreatePic("C:\Users\león\Desktop\ÜberGeordnet\Bilder\pic_6583801_1232969536.bmp"40184537225)
$Edit GUICtrlCreateEdit(""883244149)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Edit
            Sleep
(3000)
            
Send("{Enter}")
            
Sleep(2000)
        Case 
$Button1 ;Startfunktion musst noch rein machen
            Sleep
(100)
        Case 
$Button2 ;pausiert dein Skript
            TogglePause
()
        EndSwitch
WEnd


Func TogglePause
()
    
$Paused NOT $Paused
    
While $Paused
        sleep
(100)
    
WEnd
EndFunc 
Edit2: Bei Case $Edit musst noch die restliche Funktion hin schreiben, die hab ich ausversehn gelöscht
01/05/2010 13:13 [-Lee-]#13
-.- Ahhh würg ich bekomm gleich so ein anfall ich renn kurz gegen eine Wand >.<
Menschens kinder wie zum teufel ging die scheis start funktion oh mein gott

ey sorry wenn ich euch grade nerve aber wie gesagt habe damit keinerlei erfahrung bzw nur wenig
01/05/2010 13:18 Kazaaa#14
Achja, ansonsten einfach mal "Tidy" benutzen um Fehler zu finden (einfach STRG+T drücken wenn dein AutoIt-Script (also der Code) offen ist)

Edit: Keine Ahnung was dein Script starten soll, steht ja auch nicht im Anfangspost.
01/05/2010 13:57 eXcalibur93#15
Ich denke es ist eher gemeint, das Skript zu starten, nicht mit dem Skript etwas zu starten ;)