You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

handsonic

Beginner

  • "handsonic" started this thread

Posts: 9

Location: Ontario

Mood: Squint

  • Send private message

1

Monday, January 30th 2012, 12:01am

Put on weapons macro?

I want to make a macro to equip 1 of my daggers to my offhand slot and another dagger to main hand slot, can anyone show this macro if it exists?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

2

Monday, January 30th 2012, 12:54am

Quoted from "handsonic;506202"

I want to make a macro to equip 1 of my daggers to my offhand slot and another dagger to main hand slot, can anyone show this macro if it exists?


What you ask for is possible, but it is one of those things that is more complex than it would seem. (I can't test anything so the following may not work as is)

To equip/unequip an item to/from a specific inventory slot, you need to use the EquipItem function. This requires an inventory slot number and if equipping, also needs a bag slot index for the item you want to equip. To get the bag slot index, you will need to use the GetBagItemInfo function. This function will also be used to search through your bags to find the correct item as well. To search through all your bags, you will need to use a third function called GetBagCount since the number of slots you have may change if you rent bag space.

So knowing all this, the following should do the trick (if it isn't too long for a single macro)

Source code

1
2
3
/run EquipItem(16) EquipItem(17) mh,offh = nil,nil
/run _,_,ts=GetBagCount() for i=1,ts do ii,_,n=GetBagItemInfo(i) if n=="offhand" then offh=ii elseif n=="mainhand" then mh = ii end end
/run EquipItem(16, mh) EquipItem(17, offh)


The above should work, replace offhand with the name of the offhand weapon you want and replace mainhand with the name of the weapon for your mainhand. Names are case sensitive.

As the macro is fairly long, you don't have much room to put long item names in there.

The whole thing would work better as a custom slash command though.
2013... The year from hell....

handsonic

Beginner

  • "handsonic" started this thread

Posts: 9

Location: Ontario

Mood: Squint

  • Send private message

3

Monday, January 30th 2012, 2:51am

Quoted from "Peryl;506214"

What you ask for is possible, but it is one of those things that is more complex than it would seem. (I can't test anything so the following may not work as is)

To equip/unequip an item to/from a specific inventory slot, you need to use the EquipItem function. This requires an inventory slot number and if equipping, also needs a bag slot index for the item you want to equip. To get the bag slot index, you will need to use the GetBagItemInfo function. This function will also be used to search through your bags to find the correct item as well. To search through all your bags, you will need to use a third function called GetBagCount since the number of slots you have may change if you rent bag space.

So knowing all this, the following should do the trick (if it isn't too long for a single macro)

Source code

1
2
3
/run EquipItem(16) EquipItem(17) mh,offh = nil,nil
/run _,_,ts=GetBagCount() for i=1,ts do ii,_,n=GetBagItemInfo(i) if n=="offhand" then offh=ii elseif n=="mainhand" then mh = ii end end
/run EquipItem(16, mh) EquipItem(17, offh)


The above should work, replace offhand with the name of the offhand weapon you want and replace mainhand with the name of the weapon for your mainhand. Names are case sensitive.

As the macro is fairly long, you don't have much room to put long item names in there.

The whole thing would work better as a custom slash command though.


It only equips1 weapon, then if i click again it equipsthe other.

handsonic

Beginner

  • "handsonic" started this thread

Posts: 9

Location: Ontario

Mood: Squint

  • Send private message

4

Monday, January 30th 2012, 3:34am

Okay, it works when i have no weapons on. Is there a macro to unequip both my weapons before the macro to put on the other 2?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

5

Monday, January 30th 2012, 3:39am

That's part of what the first line is supposed to do (the first two EquipItem() calls).
May need a /wait right after that line.
2013... The year from hell....

handsonic

Beginner

  • "handsonic" started this thread

Posts: 9

Location: Ontario

Mood: Squint

  • Send private message

6

Monday, January 30th 2012, 3:26pm

Okay, I put a wait .5 under the first line and it works perfectly now. thanks :)