Useful macros

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

Useful macros

#1 Post by droppen » Sun Aug 30, 2009 7:54 pm

Here's a lot of useful macros, a lot of you don't even know that this is possible with a macro.

Use the worst healing potion you have. Please help me finish the list, and make a list for mana potions too

Code: Select all

/script UseItemByName("Simple First Aid Potion");
/script UseItemByName("Basic First Aid Potion");

With these 2, you don't need streamline addon to auto repair

When talking to NPC, this function brings up the screen where you can repair or buy.

Code: Select all

/script ChoiceOption(1);
This is a cool function too

Code: Select all

/script ClickRepairAllButton();

Okay then, lets see.. What else could you do while chatting with an NPC. Buy potions?
Well, first we need to make some space for them, if our inventory is full.
The number inside () is your bag slot. 1=first bag first slot.

Code: Select all

/script PickupBagItem(GetBagItemInfo(1)); 
/script DeleteCursorItem();
Pick it up, then delete from cursor.

Then, we might want to buy some potions.

Code: Select all

/script StoreBuyItem(1)
Buy 1 of the first item that the merchant has.


Therefore, we can do this

Code: Select all

/script local bag, icon, name, count = GetBagItemInfo(1) for i=1, 10, 1 do if GetStoreSellItemInfo(i) == icon then for a=98, count, -1 do StoreBuyItem(i) end end end
This macro buys a full stack of the item that you have on your first slot in your first bag. You need to have at least 1 Health Potion or Mana Potion on that slot to have it buy.



Imagine what we could do if we could edit macros with mircomacro.

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: Useful macros

#2 Post by Glopo » Sun Aug 30, 2009 8:43 pm

thanks

User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

Re: Useful macros

#3 Post by droppen » Sun Aug 30, 2009 8:48 pm

droppen wrote:Imagine what we could do if we could edit macros with mircomacro.
Omfg, 033B0110 is the address for the first macro text, and it is a static address, so you can write anything from 033B0110 to 033B0210 as text and press it! This makes everything a lot easier!

I'm all w00ted out.

off to write a
function RoMScript(script)
end

This is important for me that the function's name will be RoMScript

master121
Posts: 45
Joined: Mon Dec 29, 2008 10:40 am

Re: Useful macros

#4 Post by master121 » Wed Sep 02, 2009 10:37 am

This macro is for when your throwing weapons are low....

Code: Select all

local count = RoMScript('GetInventoryItemCount("player",9)');
if( count > 20 ) then
         
else
    load_paths("repair.xml");
end
This macro is for when your potions are low
itemName = "Regenerationsmixtur" // this is the name of your potion

Code: Select all

local itemTotal = 0;
itemName = "Regenerationsmixtur"
for k = 1, 60, 1 do
    local bagid, icon, name, itemCount = RoMScript("GetBagItemInfo("..k..");");
    if (itemName == name) then
       itemTotal = itemTotal + itemCount;
    end
end
if( itemTotal > 20 ) then
       
else
    load_paths("repair.xml");
end
This macro is for when your weapons durability is low

Code: Select all

local durab , durabmax = RoMScript("GetInventoryItemDurable('player', 15);");
a = durab/durabmax
if( a >= 0.51 ) then
         
else
     load_paths("repair.xml");
end
Enjoy botting :)

S3v3n11
Posts: 91
Joined: Thu Jul 09, 2009 7:37 am

Re: Useful macros

#5 Post by S3v3n11 » Tue Sep 22, 2009 11:43 am

droppen wrote:
droppen wrote:Imagine what we could do if we could edit macros with mircomacro.
Omfg, 033B0110 is the address for the first macro text, and it is a static address, so you can write anything from 033B0110 to 033B0210 as text and press it! This makes everything a lot easier!

I'm all w00ted out.

off to write a
function RoMScript(script)
end

This is important for me that the function's name will be RoMScript
This ever go anywhere? Seems like an awesome idea!

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Useful macros

#6 Post by d003232 » Tue Sep 22, 2009 3:17 pm

S3v3n11 wrote:This ever go anywhere? Seems like an awesome idea!
Yes. He did the work! The actual bot is using that new function for all the inventory stuff and much more.
The RoM Bot Online Wiki needs your help!

ToreDeLoro
Posts: 12
Joined: Thu Sep 24, 2009 7:18 pm

Re: Useful macros

#7 Post by ToreDeLoro » Thu Sep 24, 2009 7:23 pm

master121 wrote: This macro is for when your weapons durability is low

Code: Select all

local durab , durabmax = RoMScript("GetInventoryItemDurable('player', 15);");
a = durab/durabmax
if( a >= 0.51 ) then
         
else
     load_paths("repair.xml");
end
Enjoy botting :)
thank you
but i'm a noob with this :P



where i have to use it exactly?, in the waipoint file? in a macro? if it is a macro from rom... how i use it from micromacro?

thanks


P.D. sorry for my bad english :P

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Useful macros

#8 Post by raff » Fri Oct 23, 2009 2:37 am

Hi,

Code: Select all

GetInventoryItemDurable('player', 10);
is for ranged weapons, maybe it can be added to the inventory functions? there is only a function for mainhand weapons in there

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Useful macros

#9 Post by d003232 » Mon Oct 26, 2009 1:21 am

raff wrote:Hi,

Code: Select all

GetInventoryItemDurable('player', 10);
is for ranged weapons, maybe it can be added to the inventory functions? there is only a function for mainhand weapons in there
In SVN 379 your can use

Code: Select all

inventory:getDurability(_slot)
to get values back for any slot. Return value is in percentages from 0 - 100.
The RoM Bot Online Wiki needs your help!

User avatar
VoiD
Posts: 11
Joined: Fri Jan 22, 2010 7:44 pm
Location: Deep space

Re: Useful macros

#10 Post by VoiD » Sat Jan 23, 2010 10:20 pm

Hi I'm new to the forums, but I've been haunting them for a while now and experimenting with the bot ! :P

So, is it be possible to manipulate strings in the bots waypoint files ? Like using the GetBagItemInfo(1), then put it into a table and use something like the strcmp function from string.h (in C) ?
My guess is that xml and lua manipulates strings kinda differently then C or C++... :/

Would be useful for things like:
if(--the strings match) then
--do stuff with that item
end

Also, is there a good way to move items in inventory and from the inventory ? I was thinking of picking up an item (probably with PickupBagItem()) and then drop in either somewhere else in the inventory or into the Transmutor or into the mail.

Well basically I'm interested in moving an item into the Transmutor (but I think ill stick with the Fusion addon since its more reliable for stones) and mailing stuff to my alts w/o having to use left mouse clicks and sending keyboard letters 1 by 1 for the recipients name... I don't suppose the rom guys are as good as to give us a SendMail(recipient, subject, body_text, COD_or_normal, item, money) command right ? :P
(since like 90% of those commands look like they where made for bots)

Also, I've seen ways to detect item count in the inventory, but is there one for the gold quantity ? :S

PS: Just a taught since I'm too lazy to find a thread about this, it would be awesome if the bot could change characters... (for lvl 10 farming) I would make an AutoIt script that does that, but sadly the game doesn't recognise clicks and keyboard keys from autoit... the only way would be to write in memory (what the bot already does)... but I'm a bit noob to do that w/o any help... any suggestions ? :P
~(。◕‿‿◕。)~

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

Re: Useful macros

#11 Post by Administrator » Sat Jan 23, 2010 10:35 pm

VoiD wrote: So, is it be possible to manipulate strings in the bots waypoint files ? Like using the GetBagItemInfo(1), then put it into a table and use something like the strcmp function from string.h (in C) ?
My guess is that xml and lua manipulates strings kinda differently then C or C++... :/

Would be useful for things like:
if(--the strings match) then
--do stuff with that item
end
See here. For simple equality checks, just use string1 == string2.

See here for RoM's API functions to move items or get the player's money count.
PS: Just a taught since I'm too lazy to find a thread about this, it would be awesome if the bot could change characters... (for lvl 10 farming) I would make an AutoIt script that does that, but sadly the game doesn't recognise clicks and keyboard keys from autoit... the only way would be to write in memory (what the bot already does)... but I'm a bit noob to do that w/o any help... any suggestions ? :P
People have done it by having a script position the mouse above each character's button on the right side of the screen, causing a left click, and then clicking the "Start Game" button. It's around the forum somewhere, but I don't recall the thread title offhand.

User avatar
VoiD
Posts: 11
Joined: Fri Jan 22, 2010 7:44 pm
Location: Deep space

Re: Useful macros

#12 Post by VoiD » Sat Jan 23, 2010 10:57 pm

Thanks for the lua link, will come in handy ! :P
I've already been to the RoM functions wiki... but they have waaaaaay too many undocumented functions... :/
Administrator wrote:People have done it by having a script position the mouse above each character's button on the right side of the screen, causing a left click, and then clicking the "Start Game" button. It's around the forum somewhere, but I don't recall the thread title offhand.
Ok I see... I bet they just used char A for botting then made the bot (at a certain waypoint) logout from char A, then clicked on a new character (char B) and then start game and then loaded a new waypoint file for char B.... but wont there be any problems with the profile file since the character name changed, maybe also the class (different skills)... :/
Or is it possible to use "profile:profile_name" inside a waypoint file ? xD
~(。◕‿‿◕。)~

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

Re: Useful macros

#13 Post by Administrator » Sun Jan 24, 2010 12:31 am

VoiD wrote: Ok I see... I bet they just used char A for botting then made the bot (at a certain waypoint) logout from char A, then clicked on a new character (char B) and then start game and then loaded a new waypoint file for char B.... but wont there be any problems with the profile file since the character name changed, maybe also the class (different skills)... :/
Or is it possible to use "profile:profile_name" inside a waypoint file ? xD

Code: Select all

<waypoint x="x" z="z">
  -- do the logout/switch character/log back in sequence here

  -- reload information
  settings.loadProfile("profile_name");
  player:update();
  __WPL:load("waypoints_name");
</waypoint>

User avatar
VoiD
Posts: 11
Joined: Fri Jan 22, 2010 7:44 pm
Location: Deep space

Re: Useful macros

#14 Post by VoiD » Sun Jan 24, 2010 8:08 am

Hmmm... yeah that is nice... one step closer to full automation ! :P
I might even make him change accounts ! xD

Just one thing, I always use loadPaths("waypoint_file_name"), how different is it from __WPL:load("waypoints_name") ? Is it just the fact that we can specify the folder of our choice with: __WPL:load(getExecutionPath() .. "/waypoints/waypoint_name.xml") or something else ? :S
~(。◕‿‿◕。)~

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Useful macros

#15 Post by Exempt » Sun Jan 24, 2010 1:18 pm

Is there anyway to get a list of all the functions?

User avatar
VoiD
Posts: 11
Joined: Fri Jan 22, 2010 7:44 pm
Location: Deep space

Re: Useful macros

#16 Post by VoiD » Sun Jan 24, 2010 4:58 pm

The RoM API or the BOT functions ? :S

RoM API -> http://theromwiki.com/index.php/List_of_Functions
BOT -> open the file (...)interface/addons/micromacro/rom/functions.lua or the RoM BOT Wiki (or some place else ? :S)

As for what they do, that's a bit more tricky... if u don't know what a bot function does, just search it on the forums, if its not there then post a thread about it...

As for RoM API functions, its harder... not all the functions on the wiki are explained and there are TOO MANY of them... so u could also search the forums and see if ppl have used that function b4 or you could get also post a thread... :P
~(。◕‿‿◕。)~

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Useful macros

#17 Post by Exempt » Sun Jan 24, 2010 8:11 pm

Thanks for the info. :)

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

Re: Useful macros

#18 Post by Administrator » Sun Jan 24, 2010 10:26 pm

VoiD wrote:Hmmm... yeah that is nice... one step closer to full automation ! :P
I might even make him change accounts ! xD

Just one thing, I always use loadPaths("waypoint_file_name"), how different is it from __WPL:load("waypoints_name") ? Is it just the fact that we can specify the folder of our choice with: __WPL:load(getExecutionPath() .. "/waypoints/waypoint_name.xml") or something else ? :S
That's pretty much it, yeah. loadPaths() should also print out some information to the console.
Is there anyway to get a list of all the functions?
Well, no, there really isn't a central location where you can find all functions. There really are a ton of undocumented functions as-is, and it would take a lot of work to get it completed. It would certainly be nice if people would donate a little bit of time by adding missing functions here.

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests