Ok this is my first post so im not sure exactly where to put this but heres my script
WinWaitActive("LaTale Client")
#include<misc.au3> ;needed to capture keystrokes
While 1
If _IsPressed("11") And _IsPressed("31") Then;This is what I press to start the loop
Send ("{LCTRL down}")
Sleep(18000); I want it to hold down for 18secs
Send ("{LCTRL up}");I want it to lift off the key
Sleep(8000);and hold for 8secs
EndIf
If _IsPressed("11") And _IsPressed("32") Then
ExitLoop;I use this to exit
EndIf
Wend
When i run the script in my game it holds down the ctrl button, but it does it longer than 18secs and it doesnt lift up afterwards. It just goes until the input key time passes. I would like to know how to use the "UP" function properly and also how to loop it back to where i started to repeat the process.
Thanks
Try not use a While 1 loop like that without a sleep, if you notice when you run the above script your CPU can spike between 50/100%
This version should work:
Code:
WinWaitActive("LaTale Client")
While 1
If _IsPressed("11") And _IsPressed("31") Then
Send("{CTRLDOWN}")
Sleep(18000)
Send("{CTRLUP}")
Sleep(8000)
EndIf
If _IsPressed("11") And _IsPressed("32") Then
ExitLoop
EndIf
Sleep(10)
WEnd
Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
; $hexKey must be the value of one of the keys.
; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)
If @error Then Return SetError(@error, @extended, False)
Return BitAND($a_R[0], 0x8000) <> 0
EndFunc ;==>_IsPressed
Ok thanks now it holds dow for the 18 secs but doesnt loop back to the start and reapeat....also what does this mean
$hexKey must be the value of one of the keys.
; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
Was i supposed to change some values somewhere?
Should i chang the $hexKey to "31"?
also can u explain this Func? Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
Autoit work on only one window 08/08/2010 - PW Hacks, Bots, Cheats, Exploits - 4 Replies Hello, anyone knows how I could make a script that runs in a single window defined? For example I want it to work on perfect world, and I want to make MSN the same time ..
Thx
Cant make this autoit script to work 08/15/2009 - Dragonica Hacks, Bots, Cheats & Exploits - 4 Replies Anyone can tell me why this doesn't work? My dragonica window will be active, but it just wont spam the x every second. I have tried messing around with the codes but no luck o.O
;HotKey for terminating the script
#include <file.au3>
Dim $aRecords
;Window title for dragonica should be changed after every patch
$WinTitle = "Dragonica (Client Ver : 0.908.1301)"
Does AutoIT work? 07/01/2008 - General Gaming Discussion - 4 Replies Hey,
can pls someone check if AutoIT works?
Maybe we can develop a bot ;)
Vyn
Did work with AutoIT or Cpp ? 04/26/2008 - Guild Wars - 1 Replies Hallo,
vielleicht kann mir da einer helfen. Es geht um die Simulation einer Maus.
Kann man eine Maus auf einer bestimmten Position oder in irgend einem Fenster z. B (Guild Wars) simulieren? Die normale Maus sollte sich nicht bewegen oder wenn man sie bewegt, dass die simulierte Position nicht verschoben wird?
Ein Beispiel:
In Guild Wars werden die Items auf dem Boden wie "Links" unterstrichen, wenn man mit dem Mauszeiger auf sie drauf geht.
Jetzt will ich aber, dass die richtige maus...