Repairing with Simple Repair Hammers on the go.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Wildfire
Posts: 7
Joined: Thu Aug 04, 2011 6:26 pm

Repairing with Simple Repair Hammers on the go.

#1 Post by Wildfire » Tue Aug 23, 2011 9:54 pm

I have spent the past couple of weeks tearing my hair out over this and I stand before you humbly begging assistance. Hell I will even bribe with cookies on this one if I must.

What am I trying to achieve?
While harvesting my dailys I want the bot to use Simple Repair Hammers on main hand weapon when it drops below 100 dura or 90%.

Now believe me I have tried googling for a solution and although the RoMBot wiki provides examples, it doesn't show or explain from the prospective of a... (shall I say it?) noob. ^^
I am aware that I can repair at a vender however sometimes it isn't always possible due to distance or terrain.

This is what I have been able to scape together thus far.

Code: Select all

<onLeaveCombat>
	local dura = inventory:getMainHandDurability();
	printf("Durability:%s\n", dura);
	if( dura < 90 ) then
	inventory:useItem("Simple Repair Hammer");
	end
</onLeaveCombat>
Would someone be kind enough assist me in this simple yet eluding task? or at least point me in the right direction.

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

Re: Repairing with Simple Repair Hammers on the go.

#2 Post by lisa » Tue Aug 23, 2011 10:41 pm

You are pretty close
use this instead of the dura check you use.

Code: Select all

if ( 90 > dura ) then
also you need to target the equipment slot to make it use the hammer, can't think of that code off hand.

Code: Select all

<onLeaveCombat>
   local dura = inventory:getMainHandDurability();
   printf("Durability:%s\n", dura);
   if ( 90 > dura ) then
   inventory:useItem("Simple Repair Hammer");
-- add in click main weapon here
   end
</onLeaveCombat>
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repairing with Simple Repair Hammers on the go.

#3 Post by rock5 » Wed Aug 24, 2011 12:27 am

I think it's UseEquipmentItem or PickupEquipmentItem

Code: Select all

RoMScript("UseEquipmentItem(16)")
or

Code: Select all

RoMScript("PickupEquipmentItem(16)")
I'm not 100% sure it's 16 though. I think it's 15 in the game.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: Repairing with Simple Repair Hammers on the go.

#4 Post by lisa » Wed Aug 24, 2011 12:51 am

I think use would be right click, so that prob wouldnt work. I would go with pickup item.

Would be a good idea to add in a check to make sure icon has changed before using that code, you don't really want to pick up your weapon.
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

Wildfire
Posts: 7
Joined: Thu Aug 04, 2011 6:26 pm

Re: Repairing with Simple Repair Hammers on the go.

#5 Post by Wildfire » Wed Aug 24, 2011 7:01 am

lisa wrote: You are pretty close
use this instead of the dura check you use.

Code: Select all

if ( 90 > dura ) then
also you need to target the equipment slot to make it use the hammer, can't think of that code off hand.

Code: Select all

<onLeaveCombat>
   local dura = inventory:getMainHandDurability();
   printf("Durability:%s\n", dura);
   if ( 90 > dura ) then
   inventory:useItem("Simple Repair Hammer");
-- add in click main weapon here
   end
</onLeaveCombat>
Really? I'm using < and it works just fine.
Using the greater or lesser than symbol directly gives me a phasing profile error. I believe it's due to the fact the greater symbol is being perceived or read as a close/open bracket as in </onLeaveCombat>
lisa wrote: also you need to target the equipment slot to make it use the hammer, can't think of that code off hand.
This is the bit that has been driving me nuts.
lisa wrote: I think use would be right click, so that prob wouldnt work. I would go with pickup item.

Would be a good idea to add in a check to make sure icon has changed before using that code, you don't really want to pick up your weapon.
Already ahead of you on that one. I knew I was close a couple of days ago when I got the mouse icon to change to a repair hammer but then the bot would halt due to my trial by error codng or nothing at all.
rock5 wrote:I think it's UseEquipmentItem or PickupEquipmentItem

Code: Select all

RoMScript("UseEquipmentItem(16)")
or

Code: Select all

RoMScript("PickupEquipmentItem(16)")
I'm not 100% sure it's 16 though. I think it's 15 in the game.
I'll give this a try later and you know how things turn out but your right, it is slot 16 for the mainhand. I believe 17 is the offhand.


Much appreciate both your inputs.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repairing with Simple Repair Hammers on the go.

#6 Post by rock5 » Wed Aug 24, 2011 8:29 am

I think logically you would have to "Use" the hammer and then "Pickup" the mainhand weapon.

You are right, &lt is fine and, yes, you can't normally use '<' in xml files. Most people just find it easier to change

Code: Select all

if a < b
to

Code: Select all

if b > a 
instead of remembering '&lt', me included.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Wildfire
Posts: 7
Joined: Thu Aug 04, 2011 6:26 pm

Re: Repairing with Simple Repair Hammers on the go.

#7 Post by Wildfire » Wed Aug 24, 2011 8:47 am

rock5 wrote:I think logically you would have to "Use" the hammer and then "Pickup" the mainhand weapon.

You are right, &lt is fine and, yes, you can't normally use '<' in xml files. Most people just find it easier to change

Code: Select all

if a < b
to

Code: Select all

if b > a 
instead of remembering '&lt', me included.
It's a html coding habbit for me. But hell, as long as you can understand your own coding either way works :lol:
Oh and it's 15 not 16 for mainhand in-game as you first suspected.

All is working like a charm now.

Lisa, Rock5... my gratitude to you both!

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

Re: Repairing with Simple Repair Hammers on the go.

#8 Post by lisa » Wed Aug 24, 2011 8:50 am

Yeah my post was purely in deciding between the 2 sendmacro rock posted.

Using the weapon would be a right click which you dont want.

Picking up the weapon would be a left click.

So use

Code: Select all

RoMScript("PickupEquipmentItem(16)")
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

newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Re: Repairing with Simple Repair Hammers on the go.

#9 Post by newton666 » Fri Oct 05, 2012 4:20 am

hi did anyone get this to work?

Code: Select all

]]></onLeaveCombat>
   local dura = inventory:getMainHandDurability();
   printf("Durability:%s\n", dura);
   if ( 90 > dura ) then
   inventory:useItem("Simple Repair Hammer");
    RoMScript("PickupEquipmentItem(15)");
   end
]]></onLeaveCombat>
just that it dosnt do anything thing

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repairing with Simple Repair Hammers on the go.

#10 Post by rock5 » Fri Oct 05, 2012 4:59 am

This is an open tag

Code: Select all

<onLeaveCombat>
and this is a close tag

Code: Select all

</onLeaveCombat>
The code goes between. Those other square brackets don't belong there.

So something like this should work.

Code: Select all

<onLeaveCombat>
   local dura = inventory:getMainHandDurability();
   printf("Durability:%s\n", dura);
   if ( 90 > dura ) then
      inventory:useItem("Simple Repair Hammer");
      RoMScript("PickupEquipmentItem(15)");
   end
</onLeaveCombat>
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Re: Repairing with Simple Repair Hammers on the go.

#11 Post by newton666 » Fri Oct 05, 2012 5:37 am

thxs stupid me ;)

newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Re: Repairing with Simple Repair Hammers on the go.

#12 Post by newton666 » Sun Oct 07, 2012 2:20 am

i'm scrathcing my head here trying to make this repair mainhand and offhand at the same time , any clues?
Main weapon repair fine.
i know off hand is 16 but how do you get it to check if it need repair .

thx

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repairing with Simple Repair Hammers on the go.

#13 Post by rock5 » Sun Oct 07, 2012 3:26 am

Well if you look at the getMainHandDurability function in inventory.lua you can see that all it does is return

Code: Select all

equipment:getDurability( 15 )
Yes, there is an equipment class now. So for off hand you would use 16. You can also use

Code: Select all

inventory:getDurability( 16 )
which is there for backward compatibility and points to the same function.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Re: Repairing with Simple Repair Hammers on the go.

#14 Post by newton666 » Sun Oct 07, 2012 4:25 am

you mean i i need ot do is this

Code: Select all

	<onLeaveCombat><![CDATA[
player:lootAll()
  local dura = inventory:getMainHandDurability();
   printf("Durability:%s\n", dura);
   if ( 50> dura ) then
   inventory:useItem("Simple Repair Hammer");
    RoMScript("PickupEquipmentItem(15)");
inventory:useItem("Simple Repair Hammer");
 inventory:getDurability( 16 ):

end

]]></onLeaveCombat>
tried it but just keeps hammering main and not off hand

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repairing with Simple Repair Hammers on the go.

#15 Post by rock5 » Sun Oct 07, 2012 4:40 am

You asked how to get the durability of the off hand. That is what that command does. Using the hammer on the off hand is easy. Just use "RoMScript("PickupEquipmentItem(16)".

To test each hand and repair as necessary it should look like this.

Code: Select all

<onLeaveCombat>
   -- Repair main hand
   local dura = inventory:getMainHandDurability();
   printf("Main hand durability:%s\n", dura);
   if ( 50 > dura ) then
      inventory:useItem("Simple Repair Hammer");
      RoMScript("PickupEquipmentItem(15)");
   end
   -- Repair off hand
   local dura = inventory:getDurability(16);
   printf("Off hand durability:%s\n", dura);
   if ( 50 > dura ) then
      inventory:useItem("Simple Repair Hammer");
      RoMScript("PickupEquipmentItem(16)");
   end
</onLeaveCombat>
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Re: Repairing with Simple Repair Hammers on the go.

#16 Post by newton666 » Sun Oct 07, 2012 5:33 am

you rock rock thanks alot

SpringSun
Posts: 4
Joined: Thu May 24, 2012 9:37 pm

Re: Repairing with Simple Repair Hammers on the go.

#17 Post by SpringSun » Fri Nov 02, 2012 11:11 pm

how to put those things in DIYCE and where i should put the code..

Thanks

abron1
Posts: 162
Joined: Wed Feb 22, 2012 12:43 am

Re: Repairing with Simple Repair Hammers on the go.

#18 Post by abron1 » Sun Nov 04, 2012 2:17 am

hey rock if leveling the skill on a mob how would you use this code if you never leave combat? do you just put it in the onload? and it will check every so often?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repairing with Simple Repair Hammers on the go.

#19 Post by rock5 » Sun Nov 04, 2012 4:49 am

For leveling your weapon skill you would usually have some sort of custom written loop. You would just need add the code in the loop.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: Repairing with Simple Repair Hammers on the go.

#20 Post by rido_knight » Sat Sep 21, 2013 2:20 pm

rock5 wrote:This is an open tag

Code: Select all

<onLeaveCombat>
and this is a close tag

Code: Select all

</onLeaveCombat>
The code goes between. Those other square brackets don't belong there.

So something like this should work.

Code: Select all

<onLeaveCombat>
   local dura = inventory:getMainHandDurability();
   printf("Durability:%s\n", dura);
   if ( 90 > dura ) then
      inventory:useItem("Simple Repair Hammer");
      RoMScript("PickupEquipmentItem(15)");
   end
</onLeaveCombat>
i tried this macro but didnt work :( Macro choose Hammer but not click on Main Hand and continue to kill monster :/

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 12 guests