Jump to content
AC Tool Forums
  • Sign Up
Sign in to follow this  
lucas478781997

Help: Two keys in contains

Recommended Posts

Hey guys, so my question is pretty simple, I just want to press two keys to do a certain action.

Ex:

Primary Code

// This line is necessary to select the proper window
SetActiveWindow Asheron's Call
ClearGlobalKeys 
While 1=1  
    Delay 500  
    If {globalkeys} contains 065  //  "A" key  
        ClearGlobalKeys
        Keys WORKED !!!!!!!!!  
    end
end

//Pressing key "A" appears "WORKED"

As i would like

// This line is necessary to select the proper window
SetActiveWindow Asheron's Call
ClearGlobalKeys 
While 1=1  
    Delay 500  
    If {globalkeys} contains 065 + 066 //  "A" + "B" key  
        ClearGlobalKeys
        Keys WORKED !!!!!!!!!  
    end
end

//Pressing key "A" + "B" appears "WORKED"

 

EDIT by The WABBIT: Moved the Topic to the proper forum to ask the question. And edited the topic to remove the Color from the code for our Sight challenged members to read it. Placed the code within code blocks with no syntax highlighting.

Share this post


Link to post
Share on other sites

First you are not telling us what game you are creating the script for.  But, I'm going to assume based solely the code that it might be Asheron's Call. And you are not telling us what your problem is. With the code that you have posted. I don't see any problem at all.

So, you need to give use more details of what you are trying to do in the game. And what your script is actually doing.

Share this post


Link to post
Share on other sites

Since I don't know what you are trying to do, except by the code. I tried to change what you had posted to work. I don't know if it will work or not. but it wouldn't hurt to try it. If if doesn't work, then what you need to do is use a TimeStamp to display the contents of the {GlobalKeys} to see how the keys are stored in it.

TimeStamp GlobalKeys: {GlobalKeys}

But, give this a try:

constants
	KeySearch =
end

// This line is necessary to select the proper window
SetActiveWindow Asheron's Call
ClearGlobalKeys 
set KeySearch = 065,066,
While 1=1  
    Delay 500  
    If {globalkeys} contains $KeySearch //  "A" + "B" key  
        ClearGlobalKeys
        Keys WORKED !!!!!!!!!  
    end
end

//Pressing key "A" + "B" appears "WORKED"

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.