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.
User Function Macros
-
- Posts: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: User Function Macros
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.
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.
Re: User Function Macros
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.
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.
-
- Posts: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: User Function Macros
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.
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.
Re: User Function Macros
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
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.
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 )
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: User Function Macros
Thanks both of you for taking the time to explain.
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest