Zedna Posted September 2, 2006 Share Posted September 2, 2006 Sleep() must be placed correctly. original: #Include <Misc.au3> HotKeySet("`", "TogglePause") Global $Paused = 1 While 1 If _IsPressed("44") Then Sleep(10) Send("dd") EndIf WEnd Func TogglePause() $Paused =Not $Paused While $Paused Wend EndFuncoÝ÷ Újøu«¢+Ø%¹±Õ±Ðí5¥Í¹ÔÌÐì()!½Ñ-åMÐ ÅÕ½ÐìäØìÅÕ½Ðì°ÅÕ½ÐíQ½±AÕÍÅÕ½Ðì¤()±½°ÀÌØíAÕÍôÄ()]¡¥±Ä(%}%ÍAÉÍÍ ÅÕ½ÐìÐÐÅÕ½Ðì¤Q¡¸M¹ ÅÕ½ÐíÅÕ½Ðì¤(M±À ÄÀ¤)]¹()Õ¹Q½±AÕÍ ¤(ÀÌØíAÕÍõ9½ÐÀÌØíAÕÍ)]¡¥±ÀÌØíAÕÍ(M±À ÄÀ¤)]¹)¹Õ¹ Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
CookieCop Posted September 2, 2006 Author Share Posted September 2, 2006 Alright, I've taken it all in, ran tests, and this is what works. (Zedna, your modification didn't work, so I did another edit on it.) #Include <Misc.au3> HotKeySet("`", "TogglePause") Global $Paused = 1 While 1 If _IsPressed("57") Then Sleep(10) Send("ww") EndIf WEnd Func TogglePause() $Paused =Not $Paused While $Paused Sleep(10) Wend EndFuncoÝ÷ Ù«¢+Ø%¹±Õ±Ðí5¥Í¹ÔÌÐì()!½Ñ-åMÐ ÅÕ½ÐìäØìÅÕ½Ðì°ÅÕ½ÐíQ½±AÕÍÅÕ½Ðì¤()±½°ÀÌØíAÕÍôÄ()]¡¥±Ä)%}%ÍAÉÍÍ ÅÕ½ÐìÔÌÅÕ½Ðì¤Q¡¸(%M±À ÄÀ¤(%M¹ ÅÕ½ÐíÍÌÅÕ½Ðì¤)¹%)]¹()Õ¹Q½±AÕÍ ¤(ÀÌØíAÕÍõ9½ÐÀÌØíAÕÍ)]¡¥±ÀÌØíAÕÍ(M±À ÄÀ¤)]¹)¹Õ¹oÝ÷ Ù«¢+Ø%¹±Õ±Ðí5¥Í¹ÔÌÐì()!½Ñ-åMÐ ÅÕ½ÐìäØìÅÕ½Ðì°ÅÕ½ÐíQ½±AÕÍÅÕ½Ðì¤()±½°ÀÌØíAÕÍôÄ()]¡¥±Ä)%}%ÍAÉÍÍ ÅÕ½ÐìÐÄÅÕ½Ðì¤Q¡¸(%M±À ÄÀ¤(%M¹ ÅÕ½ÐíÅÕ½Ðì¤)¹%)]¹()Õ¹Q½±AÕÍ ¤(ÀÌØíAÕÍõ9½ÐÀÌØíAÕÍ)]¡¥±ÀÌØíAÕÍ(M±À ÄÀ¤)]¹)¹Õ¹oÝ÷ Ù«¢+Ø%¹±Õ±Ðí5¥Í¹ÔÌÐì()!½Ñ-åMÐ ÅÕ½ÐìäØìÅÕ½Ðì°ÅÕ½ÐíQ½±AÕÍÅÕ½Ðì¤()±½°ÀÌØíAÕÍôÄ()]¡¥±Ä)%}%ÍAÉÍÍ ÅÕ½ÐìÐÐÅÕ½Ðì¤Q¡¸(M±À ÄÀ¤(M¹ ÅÕ½ÐíÅÕ½Ðì¤)¹%)]¹()Õ¹Q½±AÕÍ ¤(ÀÌØíAÕÍõ9½ÐÀÌØíAÕÍ)]¡¥±ÀÌØíAÕÍ(M±À ÄÀ¤)]¹)¹Õ¹oÝ÷ Ù«¢+Ø%¹±Õ±Ðí5¥Í¹ÔÌÐì()!½Ñ-åMÐ ÅÕ½ÐìäØìÅÕ½Ðì°ÅÕ½ÐíQ½±AÕÍÅÕ½Ðì¤()±½°ÀÌØíAÕÍôÄ()]¡¥±Ä(%}%ÍAÉÍÍ ÌäìÀÄÌäì¤Q¡¸(M±À Ô¤(M¹ ÅÕ½Ðí|ÅÕ½Ðì¤(¹%)]¹()Õ¹Q½±AÕÍ ¤(ÀÌØíAÕÍõ9½ÐÀÌØíAÕÍ)]¡¥±ÀÌØíAÕÍ(M±À ÄÀ¤)]¹)¹Õ¹ Now, given all of that. Who can put them altogether? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 2, 2006 Moderators Share Posted September 2, 2006 Example: What you have: While 1 If _IsPressed('01') Then Sleep(5) Send("_") EndIf WEndoÝ÷ ÙhZ·ëÊ)àjëh×6While 1 If _IsPressed('01') Then Sleep(100);<<< Note this is 100, so you are not getting it to repeat several times Send("_") EndIf Sleep(10);<<< Note this "inside" the loop not the Conditional "If" statement WEnd The way you had it, it would put unnecessary strain on the CPU. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CookieCop Posted September 3, 2006 Author Share Posted September 3, 2006 The reason I have it the way I do is because I want Send("_") almost instant after I click. Link to comment Share on other sites More sharing options...
Helge Posted September 3, 2006 Share Posted September 3, 2006 (edited) The reason I have it the way I do is because I want Send("_") almost instant after I click.Sigh...but that's not what your script does. It loops as fast as it can, making the CPU-usageclose to 100%, and when you press the key it waits a 10 milliseconds before it sends "xx".Move the Sleep() to the loop instead of inside the If-statement and your CPU-usage will lowerAND it will send "xx" instantly. Mkay !? Read it upside-down, backwards or in a mirror...study the the above text and you will havea working script. Edited September 3, 2006 by Helge Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 3, 2006 Moderators Share Posted September 3, 2006 It won't just send xx more than likely without the sleep(100)... it's more like it will send xxxxxxxx ... put the Sleep(100) after the Send('xx') it's the same effect as the way I put it there. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Helge Posted September 3, 2006 Share Posted September 3, 2006 (edited) It won't just send xx more than likely without the sleep(100)... it's more like it will send xxxxxxxx ... put the Sleep(100) after the Send('xx') it's the same effect as the way I put it there.Damn, I guess it's that time again for me. Ok, so to make it send it instantlyand to not make it spam just add the Sleep after the Send then Edit : typo... I need some Sleep too now I guess. Edited September 3, 2006 by Helge Link to comment Share on other sites More sharing options...
CookieCop Posted September 3, 2006 Author Share Posted September 3, 2006 I knew this I'd get that reply.. Read my post again, ALMOST instantly. I don't want as soon as I click, I want a small delay. And Smoke, I don't care if it repeats and sends xxxxxxxx it doesn't really matter because of the way I'm using the script. No more posts about "It'll lag your CPU". I already stated that I knew that, and I already said what I want done about it, but no-one has done so and is just repeating themselves. All I need now is all those scripts put together. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 3, 2006 Moderators Share Posted September 3, 2006 I knew this I'd get that reply.. Read my post again, ALMOST instantly. I don't want as soon as I click, I want a small delay. And Smoke, I don't care if it repeats and sends xxxxxxxx it doesn't really matter because of the way I'm using the script. No more posts about "It'll lag your CPU". I already stated that I knew that, and I already said what I want done about it, but no-one has done so and is just repeating themselves. All I need now is all those scripts put together.If you don't want "Experienced" advice, then maybe you should figure it out on your own, I for one will never attempt to help you again. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2006 Share Posted September 3, 2006 This also goess for your pause-function, which got Azu's signature all over it..What's that supposed to mean? Link to comment Share on other sites More sharing options...
Helge Posted September 3, 2006 Share Posted September 3, 2006 What's that supposed to mean? Just let me say that I recognized your style. Link to comment Share on other sites More sharing options...
Achilles Posted September 3, 2006 Share Posted September 3, 2006 (edited) Thanks to all who helped, AzKay's code was what I needed. EDIT: Ok so I learnt a bit from AzKay's code and did this: #Include <Misc.au3> HotKeySet("`", "TogglePause") Global $Paused = 1 While 1 If _IsPressed("57") Then Sleep(10) Send("ww") EndIf WEnd Func TogglePause() $Paused =Not $Paused While $Paused Wend EndFunc ;et cetera oÝ÷ Øíz·hx-«Hµë-yÛazf¥«mëëbæ§v+ly鬶Zl¢jnµêÒ ³ 'uêâ"¶¦jYbÚ#ºËu±Êâ¦Ûh¦·¯z{ej(r¥vÊ&zÞ¦ëmé¢êéæ¬{ú®¢×)è¶;¬µ«¢+Ø(%¹±Õ±Ðí5¥Í¹ÔÌÐì)]¡¥±Ä(%%}%ÍAÉÍÍ ÅÕ½ÐìÔÜÅÕ½Ðì¤Q¡¸($%M±À ÄÀ¤($%M¹ ÅÕ½ÐíÝÜÅÕ½Ðì¤($%¹%(%%}%ÍAÉÍÍ ÅÕ½ÐìÔÌÅÕ½Ðì¤Q¡¸($%M±À ÄÀ¤($%M¹ ÅÕ½ÐíÍÌÅÕ½Ðì¤($%¹%(%%}%ÍAÉÍÍ ÅÕ½ÐìÐÄÅÕ½Ðì¤Q¡¸($%M±À ÄÀ¤($%M¹ ÅÕ½ÐíÅÕ½Ðì¤($%¹%(%%}%ÍAÉÍÍ ÅÕ½ÐìÐÐÅÕ½Ðì¤Q¡¸($%M±À ÄÀ¤($%M¹ ÅÕ½ÐíÅÕ½Ðì¤$($%¹%)]¹( With your pause stuff there too, I haven't tried this... Piano_Man Edited September 3, 2006 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2006 Share Posted September 3, 2006 Just let me say that I recognized your style.No. My pause works, and has a sleep in it so it won't eat up the CPU. $paused="" hotkeyset("{pause}","tp") func tp() $paused=not $paused while $paused sleep(50) wend endfunc Link to comment Share on other sites More sharing options...
Helge Posted September 3, 2006 Share Posted September 3, 2006 No.No ? What the heck is that supposed to mean ? Reconfigure your telepathic abilities kid.. Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2006 Share Posted September 3, 2006 No ? What the heck is that supposed to mean ? Reconfigure your telepathic abilities kid.."No" to your implication that the code he posted was my style, followed by an example of how my style of it is, in contrast to his. Link to comment Share on other sites More sharing options...
Golbez Posted September 15, 2006 Share Posted September 15, 2006 btw what are u goen 2 do with all this when u done?? if your tryen 2 make a macro for the game GunZ it dont work.. ive tried it all.. sry 2 let u no xD Link to comment Share on other sites More sharing options...
Azu Posted September 15, 2006 Share Posted September 15, 2006 Yes it does, if you know how to get around the protection. Link to comment Share on other sites More sharing options...
Golbez Posted September 15, 2006 Share Posted September 15, 2006 O.o fill me in maybe ill play it again Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now