[AutoIT-Frage]

03/29/2009 21:24 voiD Art's#1
Hallo, da ich noch relativ neu in AutoIT bin hab ich gleich mal meine erste Frage:
Ich habe probiert ein AFK Script für Steam zu schreiben. Leider will es nicht wirklich funktionieren...
Hier ist der Code:

while HotKeySet ==1
HotKeySet ("{right}", "afk")
Func afk ()
WInwaitactive (" - Chat")
Send ("Hallo,ich bin gerade beschäftigt!")
send ("{enter}")
sleep (100)
Send ("Ich werde sobald ich Zeit hab antworten!")
Send ("{enter}")
Sleep (100)
EndFunc
WEnd

Hoffe ihr könnt mir helfen.

MfG FlaVeR
03/29/2009 22:13 DamageBreaker#2
Code:
HotKeySet ("{right}", "afk")
Func afk ()
while 1
WInwaitactive (" - Chat")
Send ("Hallo,ich bin gerade beschäftigt!")
send ("{enter}")
sleep (100)
Send ("Ich werde sobald ich Zeit hab antworten!")
Send ("{enter}")
Sleep (100)
EndFunc 
Wend

versuchs ma damit
03/29/2009 22:19 voiD Art's#3
Funzt leider nicht ich bekomm folgenden Error:

"While" statement has no matching "Wend" statement

MfG FlaVeR
03/29/2009 22:50 DamageBreaker#4
fuck falschrum

Quote:
HotKeySet ("{right}", "afk")
Func afk ()
while 1
WInwaitactive (" - Chat")
Send ("Hallo,ich bin gerade beschäftigt!")
send ("{enter}")
sleep (100)
Send ("Ich werde sobald ich Zeit hab antworten!")
Send ("{enter}")
Sleep (100)
Wend
EndFunc

jetz muss es gehen^^
03/29/2009 23:59 Normal111#5
Hi,

hier einmal wo das Ding dauernd während es im AFK-Modus ist deinen Text spamt:

PHP Code:
Global $AFK
$Chatfenstertitel 
"- Chat"
HotKeySet("{right}""ToggleAFK")

While 
1
    Sleep
(100)
WEnd

Func ToggleAFK
()
    
$AFK Not $AFK
    
While $AFK
        ToolTip
('AFK'00)
        If 
WinActive($ChatfenstertitelThen
            spam_chat
()
        Else
            
WinActivate($Chatfenstertitel)
            
WinWaitActive($Chatfenstertitel)
            
spam_chat()
        EndIf
    
WEnd
    ToolTip
("")
EndFunc   ;==>ToggleAFK

Func spam_chat
()
    
Send("Hallo,ich bin gerade beschäftigt!")
    
Send("{ENTER}")
    
Sleep(1000)
    
Send("Ich werde sobald ich Zeit hab antworten!")
    
Send("{ENTER}")
    
Sleep(1000)
EndFunc   ;==>spam_chat 
Oder als einfachere Version, wo es nur einmal bei Tastendruck den Text spamt:

PHP Code:
$Chatfenstertitel "- Chat"
HotKeySet("{right}""AFK")

While 
1
    Sleep
(100)
WEnd

Func AFK
()
    If 
WinActive($ChatfenstertitelThen
        spam_chat
()
    Else
        
WinActivate($Chatfenstertitel)
        
WinWaitActive($Chatfenstertitel)
        
spam_chat()
    EndIf
EndFunc   ;==>AFK

Func spam_chat
()
    
Send("Hallo,ich bin gerade beschäftigt!")
    
Send("{ENTER}")
    
Sleep(1000)
    
Send("Ich werde sobald ich Zeit hab antworten!")
    
Send("{ENTER}")
    
Sleep(1000)
EndFunc   ;==>spam_chat 
Als Anregung für weitere Skripts :-)