Jump to content

Troubleshooting HotKeySet


litlmike
 Share

Recommended Posts

Oh sorry, I didn't understand what you meant earlier about providing the script. Sorry to be a bother to you as well, its not my intention to be a burden on these forums.

The reason I haven't included the script already, is because it has a lot of sensitive material related to work. Passwords, URLs, etc. I'll see if I can make a dummy version of the script without the sensitive info. It will take some time to go through all the scripts.

Thanks Again.

The shortest possible script that demonstrates the problem would be best.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

So we are going to start the guessing game? Why must the question always be asked of where is the script that has the issue... Personally I find it a waiste of time to just guess at things, then you read it, and hours later you respond whether it works or not, when it doesn't, the process starts again...

Here smoke, maybe this will help http://www.autoitscript.com/fileman/users/gafrost/crystallball_emoticon.gif

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • 2 weeks later...

Success! For anyone that wants to know the end result of this here was the answer. (Remind me to shoot myself). After a lot of PMs from Vollyman we figured it out, he was very helpful and all credit goes to him.

The problem was:

A While loop in some other child script I had #included. It was declared outside of a function. How stupid that I missed that.

Process to Get the Answer:

1) Compiled Script independtly that I wanted to call and made it a Func that did Run (vollyman's idea)

2) When that did NOT work, I knew something else was jacked up.

3) Went one-by-one and ; every #include until the HotKey Worked

4) Looked at the #include child file to see what was wrong

5) Deleted While loop

6) Punched myself in face

What I learned:

1) Loops are evil if not used perfectly.

2) Hotkeys can be declared in child script and don't have to be called in Parent script.

3) Multiple While (in a giant script) loops are okay, ONLY if they are declared INSIDE a function.

4) I am not as smart as I would like to be

5) Vollyman is very patient

6) Vollyman is very kind

7) Vollyman is very helpful

Thanks for everyone's help.

Link to comment
Share on other sites

2 things come to mind here.

1. Remember that once a script starts, it registers the hotkey so to speak. Meaning, if you had 2 scripts with the same hotkey, only the first one executed is going to work with that hotkey. (I think I've proven this to myself before :ph34r: )

That was interesting, 'cause I thought the last program to set the HotKey would replace the previous ones. So I compiled the following twice, as TestOne.exe and TestTwo.exe:

HotKeySet("{PAUSE}", "_Paused")

While 1
    Sleep(100)
WEnd

Func _Paused()
    MsgBox(64, "HotKeySet Test", "PAUSE button hit and seen by: " & @ScriptName)
EndFunc   ;==>_Paused

Ran each alone to see that they worked, then ran TestOne and TestTwo at the same time. The first one run held the HotKey every time. If the first to execute was stopped, the second did not gain control (since the HotKeySet() is not looped in the second script). That was informative, SmOke_N!

:lmao:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...