Page 1 of 1

keyboardType("This is an example! ;)");

Posted: Wed Aug 12, 2009 2:52 pm
by droppen
I'm trying to make a auto repair on rom to not need any mouseclicks, because i usually like to do something else while i bot, so i noticed that rom api has a TargetNearestFriendly function, but you cant execute it from macro's, but you can type it so that it works.

so, i need to type

keyboardPress( key.VK_ENTER );
keyboardType("/script TargetNearestFriendly();");
keyboardPress( key.VK_ENTER );

but it has no shifts! so it looks like 7targetnearestfriendly89, i've tried with

keyboardHold( key.VK_SHIFT );
yrest(100);
keyboardType("t");
yrest(100);
keyboardRelease( key.VK_SHIFT );

and


keyboardHold( key.VK_LALT );
yrest(100);
keyboardPress(key.VK_NUMPAD4 );
yrest(100);
keyboardPress(key.VK_NUMPAD7 );
yrest(100);
keyboardRelease( key.VK_LALT );

with no luck, please help!

Re: keyboardType("This is an example! ;)");

Posted: Wed Aug 12, 2009 3:07 pm
by Administrator
There will need to be internal changes to MicroMacro to allow for modifier keys (SHIFT, ALT, CTRL). However, you could try wrapping it in a function inside of an addon. That might work. Just something like this:

Code: Select all

function targetFriendly()
    TargetNearestFriendly()
end
And then call targetFriendly() inside a macro.

Re: keyboardType("This is an example! ;)");

Posted: Wed Aug 12, 2009 5:31 pm
by d003232
droppen wrote:I'm trying to make a auto repair on rom to not need any mouseclicks, because i usually like to do something else while i bot, so i noticed that rom api has a TargetNearestFriendly function, but you cant execute it from macro's, but you can type it so that it works.
How can you open the merchant dialog without mouse click?

Re: keyboardType("This is an example! ;)");

Posted: Wed Aug 12, 2009 9:49 pm
by droppen
d003232 wrote:How can you open the merchant dialog without mouse click?
You attack the merchant ;)

Re: keyboardType("This is an example! ;)");

Posted: Thu Aug 13, 2009 1:27 am
by d003232
droppen wrote:
d003232 wrote:How can you open the merchant dialog without mouse click?
You attack the merchant ;)
Thx. That's a good informatin!

Re: keyboardType("This is an example! ;)");

Posted: Thu Aug 13, 2009 9:06 pm
by Glopo
hello interested too by this function

Re: keyboardType("This is an example! ;)");

Posted: Fri Aug 14, 2009 7:19 pm
by d003232
There is a new function:

Code: Select all

player:target_NPC( npc_name_searchstring );
in the SVN. It will look for a given NPC by searchstring with the hotkey targetnearestfriend. After the bot found the given NPC, he will open the dialog window. The RoM window don't have to be in the foreground for doing that.

Caution: You still can't use any modifiers! So please change your standard ingame settings for targeting nearest friend from CTRL+TAB to 'J' (that's the default in settings.xml).

Re: keyboardType("This is an example! ;)");

Posted: Wed Oct 28, 2009 2:42 am
by Zilvermoon
Just thought i would let you guys know how to do this ... the sendning of "/" to chat ...

Code: Select all

		keyboardPress( key.VK_ENTER );
		yrest(100);
		keyboardPress( key.VK_DIVIDE );
		yrest(100);
**		keyboardType("script TargetNearestFriendly();");
		yrest(100);
		keyboardPress( key.VK_ENTER );
** = The rest of the command

Hope this helps someone out :)

Zilvermoon

Re: keyboardType("This is an example! ;)");

Posted: Wed Oct 28, 2009 2:46 am
by d003232
Thx for your information.