gamerman2360 Posted October 17, 2005 Posted October 17, 2005 (edited) Yesterday my computer froze while playing World of Warcraft(actually I left it on all night and when I woke up it was stuck) and I was able to get TaskMgr going but I couldn't see it. Everything I tried was failing so I decided to make this after I hard booted. Anyone could make this just wanted to save time. I'm going to make it a wrapper to the game I play so I never have that problem again! HotKeySet("^!+{ESC}", "Kill");CTRL(^) + ALT(!) + SHIFT(+) + ESC While 1 Sleep(562949953421312);Idle 2^49 WEnd Func Kill() WinKill("") EndFunc I hope it works. PS: Is there a better way to idle? I made the number big so it wouldn't have to activate sleep every 100ms. Edit: PPS: Speeking of hard booting, I've been having to do that plenty lately because my computer isn't shutting down... When it tries I leaves my mouse on the screen(I can move it and everything) and stops doing everything. Edited October 17, 2005 by gamerman2360
jdickens Posted October 18, 2005 Posted October 18, 2005 Your time period is almost 18 million years. If your computer is still running after that long, give me a call. Ha! (Just having fun). Sounds like your computer is sick. Take action before it croaks. J If I am too verbose, just say so. You don't need to run on and on.
Valuater Posted October 18, 2005 Posted October 18, 2005 (edited) 1 While 1 Sleep(562949953421312);Idle 2^49 WEnd will not work because it sleeps so much it will not react to the hot key ( or thing else for a long time ) While 1 Sleep(500);Idle WEnd is more than sufficient 2 If you need to clean-up your computer then try the free *XPClean Menu* Below( Win Xp Only ) 8) Edited October 18, 2005 by Valuater
CyberSlug Posted October 18, 2005 Posted October 18, 2005 Valuater, the long sleep WILL work due to the way HotKeySet functions.... However, that long sleep statement maxes out my CPU?!? Sleep of 100 or 500 is better. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
LxP Posted October 18, 2005 Posted October 18, 2005 (edited) PS: Is there a better way to idle? I made the number big so it wouldn't have to activate sleep every 100ms.Good observation -- not many people realise that larger Sleep() values mean less unnecessary CPU usage, especially when the only purpose of the script at that point is to wait for hotkeys.So you're on the right track, however because the Sleep() function doesn't accept a value larger than 0x7FFFFFFF (or 2,147,483,647 for the decimally adept) your Sleep() line is in fact not sleeping. Try replacing it with this:Sleep(0x7FFFFFFF) Edited October 18, 2005 by LxP
Valik Posted October 18, 2005 Posted October 18, 2005 (edited) So you're on the right track, however because the Sleep() function doesn't accept a value larger than 0x7FFFFFFF (or 2,147,483,647 for the decimally adept)Ahem.Hmm, that's strange, you're right. I suspect that AutoIt stores the value internally as a signed int, even though it should be unsigned, hence the maximum sleep supported is only the maximum int value. I would almost call this a bug. Edited October 18, 2005 by Valik
/dev/null Posted October 18, 2005 Posted October 18, 2005 Ahem.Hmm, that's strange, you're right. I suspect that AutoIt stores the value internally as a signed int, even though it should be unsigned, hence the maximum sleep supported is only the maximum int value. I would almost call this a bug.Yep, I would also call it a bug. It should definitely be possible to pause a script for more than ~ 24,86 days!! You never know when you're going to need this ....CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Valik Posted October 18, 2005 Posted October 18, 2005 Yep, I would also call it a bug. It should definitely be possible to pause a script for more than ~ 24,86 days!! You never know when you're going to need this ....CheersKurtAutoIt's Sleep() looks identical to the Windows API function so it's not unreasonable to take a first guess that AutoIt just uses the underlying API call which means it should at least support the maximum value the API function should. While this is not true, it's irrelevant since AutoIt uses a custom method for handling sleep times and can support times much larger. AutoIt claims to support 64-bit (signed) integers and Sleep() would be a perfect example of where one could be used. However, AutoIt's Sleep() doesn't even support an 32-bit unsigned integer because internally it uses a 32-bit signed integer and more or less destroys the value passed to it. This makes the Sleep function incongruent with both the Windows API function it mimics as well as with the maximum numerical value AutoIt supports. Did I also mention that its undocumented as to what or why the maximum supported sleep time is what it is?Even though you may not encounter or in fact ever need this functionality, the current functionality is either wrong or at least needs documented.Also, I'll point out that LxP consistently uses 0x7FFFFFFF as the value to pass to Sleep() when nothing needs done in the idle loop. I'll cite this as an example that people can and will use obscenely large numbers in Sleep() and so it should at least support up to 0xFFFFFFFF like the API influence (if not supporting 64-bit integers). At any rate, the maximum value should be documented since it is obviously different than what AutoIt states maximum supported numerical values are.
gamerman2360 Posted October 18, 2005 Author Posted October 18, 2005 Your time period is almost 18 million years. If your computer is still running after that long, give me a call.Ha! (Just having fun).Sounds like your computer is sick. Take action before it croaks.JActually I think it was something in WOW, I was using out of date addons so that could have added to the problem...Good observation -- not many people realise that larger Sleep() values mean less unnecessary CPU usage, especially when the only purpose of the script at that point is to wait for hotkeys.So you're on the right track, however because the Sleep() function doesn't accept a value larger than 0x7FFFFFFF (or 2,147,483,647 for the decimally adept) your Sleep() line is in fact not sleeping. Try replacing it with this:Sleep(0x7FFFFFFF) I've even heard something like it's faster if you use decimal, I think. If it is I think it was at http://www.autoitscript.com/forum/index.php?showtopic=14936. Anyway, I want to ask is it better to use Sleep() or something like GUIGetMsg() or TrayGetMsg() to idle time? If TrayGetMsg() then I could add a bunch of Tray options, relevent or irrelevent to the script.
/dev/null Posted October 19, 2005 Posted October 19, 2005 integers). At any rate, the maximum value should be documented since it is obviously different than what AutoIt states maximum supported numerical values are.You're right, it should be documented. However, from a users point of view it makes no difference. In my eyes it's insane to pause a script that long. Even if one would need such a long break he could always call sleep() in a loop.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
jdickens Posted October 25, 2005 Posted October 25, 2005 To clarify, the max sleep value is in the help (quote): Remarks Maximum sleep time is 2147483647 milliseconds (24 days). IMHO if the user needs a longer period, they should be prepared to research the issue and then toss Sleep(x) into a loop. That unlikely scenario is better than anyone wasting time redoing the Sleep fn. J If I am too verbose, just say so. You don't need to run on and on.
Laughing Man Posted October 26, 2005 Posted October 26, 2005 What's this script do exactly? Looks to me like it just kills whatever program is currently the focus. Not sure what the sleep is for. "I thought what I'd do is I'd pretend I was one of those deaf-mutes" ~ Laughing Man ~ GITS : SAC
wowbotmaker Posted November 4, 2005 Posted November 4, 2005 is this a grinding bot for world of warcraft?
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