autoIt3 problem

05/03/2009 03:25 Dannydunno#1
Hi everybody,

i was bored with my Choppa today and thought itd be a good idea to just let a bot go level for me, so i checken out autoit and made a real basic bot, very simple and all... Well, i figured it worked out quite nicely for me, ill just post the code i put in the script right here, so u people see what im trying to do. Script is real basic and nothing special, i know.
Quote:

HotKeySet("{F9}", "endthis")

$answer = MsgBox(4, "Choppa Level Bot", "rdy?")
AutoItSetOption ("WinTitleMatchMode",2)

If $answer = 7 Then
MsgBox(0, "Byebye", "cya!")
Exit
EndIf

$count = 0
Do
botFuncChoppa()
Until $count > 0

Exit


Func botFuncChoppa()
WinWaitActive("Warhammer")
Send("{TAB}");
Sleep(1000);
WinWaitActive("Warhammer")
Send("0");
Sleep(1000);
WinWaitActive("Warhammer")
Send("0");
Sleep(1000);
WinWaitActive("Warhammer")
Send("1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("!1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("3");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("{F1}");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("3");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("0");
Sleep(1000);
WinWaitActive("Warhammer")
Send("0");
Sleep(1000);
WinWaitActive("Warhammer")
Send("1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("!1");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("3");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("3");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(1000);
WinWaitActive("Warhammer")
Send("2");
Sleep(15000);
EndFunc

Func endthis()
Exit
EndFunc
So what im basically doing is pressing tab ( next enemy ) and then throw my axe at him... followed by several attacks and so on and so on... Now... i know theres a way to send controls to a minimized window via controlSend() function... but i just couldnt get it to work with my bot right here, its just not doing anything.

Now what i tried looked something like this:
Quote:
$handle = WinGetHandle("Warhammer")
ControlSend($handle,"","","2")
And that like in all kinds of variations i could think of... googled stuff up too, but couldnt get it to work...

So now.. is there anybody out there who could provide me some help right here? I just need some code snippet that works or a little advice :(

thanks in advance
danny
05/03/2009 13:05 felixli93#2
ControlSend ("Warhammer","",$handle,2)

$handle here is the control ID, not the title of the window
05/03/2009 18:19 Dannydunno#3
hmmm ... tried that...

i guess its just not possible with warhammer since the window doesnt react to keystrokes ( real or fake ) if it doesnt have focus...
05/04/2009 10:32 hhan#4
ControlSend doesn't work for WAR. A lot of programmers tried to do a minimized function, but all failed :D

maybe help this:
[Only registered and activated users can see links. Click Here To Register...]