Rule for keyboardHold and key.VK_ALT

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Rule for keyboardHold and key.VK_ALT

#1 Post by el_dios85 »

Hello,

I want to ask, when we do a multiclient, multiclient1 and multiclient2, multiclient1 have the function keyboardHold(key.VK_ALT), and then we switch to multiclient2, why the function keyboardHold(key.VK_ALT) dont work. If we go back to multiclient1 it works. I assume keyboardHold(key.VK_ALT) only work on active window. Is it true? Is there any way to make the function work in unactive window?

Thanks
User avatar
Administrator
Site Admin
Posts: 5351
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rule for keyboardHold and key.VK_ALT

#2 Post by Administrator »

You send it as the modifier to a key press.

Code: Select all

keyboardPress(key.VK_SOMETHING, key.VK_ALT);
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Rule for keyboardHold and key.VK_ALT

#3 Post by el_dios85 »

I try keyboardPress(key.VK_1, key.VK_ALT);
and keyboardPress(key.VK_ALT, key.VK_1);
the error is the same.
182: Wrong number of parameters supplied to keyboardPress().

this is my code before
--keyboardHold(key.VK_ALT); -- The A key will be held down
--yrest(50);
--keyboardPress(key.VK_1);
--yrest(50);
--keyboardRelease(key.VK_ALT); -- The A key is now released
--keyboardBufferClear();
User avatar
Administrator
Site Admin
Posts: 5351
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rule for keyboardHold and key.VK_ALT

#4 Post by Administrator »

You're using an outdated version, then. Redownload.
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Rule for keyboardHold and key.VK_ALT

#5 Post by el_dios85 »

Now I use micromacro v.1.0
It didnt work.

I have try
---------------
keyboardPress(key.VK_1, key.VK_ALT);
---------------
keyboardSetDelay(100);
keyboardPress( key.VK_V, key.VK_CTRL );
--In my game (Perfect World), it only write v on chat box, I already copy "0" so it must paste "0"
---------------

Is there any clue?

Thanks
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Rule for keyboardHold and key.VK_ALT

#6 Post by el_dios85 »

I have try
---------------
keyboardPress(key.VK_ALT, key.VK_1);
---------------
keyboardPress(key.VK_1, key.VK_ALT);
---------------
keyboardSetDelay(100);
keyboardPress( key.VK_V, key.VK_CTRL );
--Still write "v"
---------------
User avatar
Administrator
Site Admin
Posts: 5351
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rule for keyboardHold and key.VK_ALT

#7 Post by Administrator »

Code: Select all

keyboardPress(key.VK_V, key.VK_CONTROL)
This should do it. If not, then it's a problem with the way the game was programmed, I think.
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Rule for keyboardHold and key.VK_ALT

#8 Post by el_dios85 »

keyboardPress(key.VK_V, key.VK_CONTROL); --This work but
keyboardPress(key.VK_V, key.VK_ALT) -- dont work
keyboardPress(key.VK_V, key.VK_LALT) -- dont work
keyboardPress(key.VK_V, key.VK_RALT) -- dont work

so the function keyboardHold is active on active window only and not active on multiclient that unactive?
Is that right?
User avatar
Administrator
Site Admin
Posts: 5351
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rule for keyboardHold and key.VK_ALT

#9 Post by Administrator »

keyboardHold() works in attached mode, but not with modifiers. You can hold VK_CONTROL, VK_ALT, and VK_SHIFT, but it doesn't always work with key combinations. That is, holding VK_ALT and pressing A will not necessarily result in ALT+A. This entirely depends on how the game's input handler was programmed.

What is ALT+V supposed to do, anyways? Have you tried using VK_MENU instead of VK_ALT?
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Rule for keyboardHold and key.VK_ALT

#10 Post by el_dios85 »

I'm sory I mean keyboardPress(key.VK_1, key.VK_ALT).

ALT + 1 is the shortcut for attack monster.

thanks
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Rule for keyboardHold and key.VK_ALT

#11 Post by el_dios85 »

Hello, may I ask again?
In my game the function
=====================================================
--code1
keyboardHold(key.VK_ALT); -- The A key will be held down
yrest(50);
keyboardPress(key.VK_1);
yrest(50);
keyboardRelease(key.VK_ALT); -- The A key is now released
keyboardBufferClear();
===================================================== work
--code2
keyboardPress(key.VK_1, key.VK_ALT); -- didnt work
--code3
keyboardPress( key.VK_V, key.VK_CTRL ); -- work

Is there any possiblilities code1 work and code2 didnt work?
User avatar
Administrator
Site Admin
Posts: 5351
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rule for keyboardHold and key.VK_ALT

#12 Post by Administrator »

That is entirely because of the way the game reads input. Holding ALT and then using keyboardPress() does not generate a ALT+key message as only the key was sent (while the ALT hold was separate). There's nothing that can be done about that.

In the second example, try using key.VK_MENU instead of key.VK_ALT with the attached executable.
Attachments
micromacro1.01.experimental.zip
(161.02 KiB) Downloaded 199 times
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Rule for keyboardHold and key.VK_ALT

#13 Post by el_dios85 »

Thank you, I have try VK_MENU and it didnt work. But I think the problem is from the game. I want to start a new topic about Mouse Control. see you
Post Reply