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

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

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

#1 Post 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!
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

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

#2 Post 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.
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

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

#3 Post 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?
The RoM Bot Online Wiki needs your help!
User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

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

#4 Post by droppen »

d003232 wrote:How can you open the merchant dialog without mouse click?
You attack the merchant ;)
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

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

#5 Post 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!
The RoM Bot Online Wiki needs your help!
Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

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

#6 Post by Glopo »

hello interested too by this function
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

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

#7 Post 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).
The RoM Bot Online Wiki needs your help!
Zilvermoon
Posts: 104
Joined: Mon Jan 05, 2009 8:19 am

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

#8 Post 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
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

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

#9 Post by d003232 »

Thx for your information.
The RoM Bot Online Wiki needs your help!
Post Reply