HELP WITH BOT

05/16/2010 17:40 User198#1
Hi everybody I'm trying to make a bot for S4 League, but I have some problems, here it is my code:
Code:
HotKeySet("{X}", "Terminate")
Func Terminate()
Exit 0
EndFunc

HotKeySet("{Z}", "Say")
Func Say()
	While 1
	Send ("{ENTER}")
	Send ("Asd")
	Send ("{ENTER}")
	Sleep(10000)
	WEnd
EndFunc

HotKeySet("{C}", "Click")
Func Click()  
	MouseClick("left", 511, 697)
	Sleep(5000)
EndFunc

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Bot v1.0", 210, 74, 302, 218)
GUISetBkColor(0x000000)
$Button1 = GUICtrlCreateButton("Info", 56, 8, 97, 25, $WS_GROUP)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x3399FF)
$Button2 = GUICtrlCreateButton("Esci", 56, 40, 97, 25, $WS_GROUP)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x3399FF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

WHILE 3
$NMSG=GUIGETMSG()
SWITCH $NMSG
CASE $Button1
MsgBox(0,"Info","Bot By User198")
CASE $Button2
Exit
EndSwitch
WEnd
I need that if I Press:
-Z it activare Function Say
-X it close application
-C it clicks the target

But it doesn't work... What's the problem?
05/16/2010 19:35 Σternαl.#2
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

HotKeySet("{X}""Terminate")
HotKeySet("{Z}""Say")
HotKeySet("{C}""Click")

#Region ### START Koda GUI section ### Form=
$Form2 GUICreate("Bot v1.0"21074302218)
GUISetBkColor(0x000000)
$Button1 GUICtrlCreateButton("Info"5689725$WS_GROUP)
GUICtrlSetColor(-10xFFFFFF)
GUICtrlSetBkColor(-10x3399FF)
$Button2 GUICtrlCreateButton("Esci"56409725$WS_GROUP)
GUICtrlSetColor(-10xFFFFFF)
GUICtrlSetBkColor(-10x3399FF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg
=GUIGetMsg()
    Switch = 
$nMsg
        
Case $Button1
            MsgBox
(0,"Info","Bot By User198")
        Case 
$Button2
            
Exit
    EndSwitch
WEnd

Func Terminate
()
    Exit
EndFunc

Func Say
()
    
Send ("{ENTER}")
    
sleep(10)
    
Send ("Asd")
    
sleep(10)
    
Send ("{ENTER}")
    
Sleep(10000)
EndFunc

Func Click
()  
    
MouseClick("left"511697)
    
Sleep(5000)
EndFunc 
€dit: Gewöhn dir mal nen sauberen Programmierstil an ;)
05/16/2010 20:22 User198#3
It doesn't work xD
05/16/2010 20:40 Σternαl.#4
What doesn't work?
The whole programm or just one function or several?