User Function Macros

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

User Function Macros

#1 Post by Tooney » Thu Dec 01, 2011 4:44 pm

I'd like to add an in game macro that calls the user function GuildDonate(); So I can just push a button to donate. Is that possible?

I genuinely have searched long and hard but it's not easy with search terms like "macro" and "/script" :)

Thanks for any help.

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: User Function Macros

#2 Post by BillDoorNZ » Thu Dec 01, 2011 5:36 pm

Not sure of the context of what you are trying to do. Are you:

a) Running a bot to harvest a heap of stuff, then manually processing it all, after which you want to trigger an auto-donate
b) Doing something else

????

Off the top of my head, I can see 2 solutions to what you are trying to do if you want to be able to 'trigger' it from in the game itself.

1) Run a timer event that checks something from the game (e.g. the value of a global var you set via a Macro in the game). Then when it detects that this value is correct, execute the GuildDonate() function.
2) Setup a waypoint file to monitor for a specific keypress and then do the same thing when that is pressed.

First option is more useful, in that you can just start the timer in your characters <onLoad> section and you have better control.
Second option means you have to either run 2 instances of MM (if you want to bot as well as have the key monitor) and also be careful not to 'accidentally' hit the key that triggers it all.

Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

Re: User Function Macros

#3 Post by Tooney » Thu Dec 01, 2011 5:56 pm

Thanks for the reply. I have a couple of alts that mail me mats which I collect in a waypoint, process and then donate.
It's just sometimes if I'm not botting I manually collect the mail and want to donate everything in my bag rather than clicking everything.

My question is how do I execute GuildDonate() without running RomBot, then commandline, then GuildDonate()?

I want to assign GuildDonate() to an in game macro (Escape key-Macros) so occassionally I can click the button and run GuildDonate.

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: User Function Macros

#4 Post by BillDoorNZ » Thu Dec 01, 2011 7:33 pm

the short answer is - you don't.

There is no simple API for doing guild donations in Rom. If you take a look at the userfunction_guilddonate.lua script, its non-trivial. It iterates through your bag finding items of the appropriate type and donating them.

The only way you will be able to do what you want (without having t have mm and rombot running) is to write your own addon for rom.

Take a look at what Ultimate Mail Mod has to do to get the same set of data (how it works out what is a rune / herb etc). You could always steal its code and make it work for you, but thats a reasonable job in and of itself.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: User Function Macros

#5 Post by lisa » Thu Dec 01, 2011 7:43 pm

Well you wouldn't be able to call the function from in game.

Best you could do is create a macro that does the donating. It would only be ale to donate all resources, you wouldn't be able to make it filter what to donate. Macros just arn't big enough to have that much coding in them.

you would probably need to use

Code: Select all

local inventoryIndex, icon, name, itemCount, locked, invalid = GetBagItemInfo ( bagIndex )
but this doesn't tell you the type of the item, best you could do is use the name. but like I said macros can't be that big, so you couldn't make a table of names for every resources type.

If you were going to do this you would probably need to create it as an addon and not a macro.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Tooney
Posts: 26
Joined: Fri Oct 07, 2011 12:48 am

Re: User Function Macros

#6 Post by Tooney » Fri Dec 02, 2011 12:45 am

Thanks both of you for taking the time to explain.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest