-
grande
- Posts: 261
- Joined: Tue Jun 28, 2011 4:46 pm
#1
Post
by grande » Sat Mar 24, 2012 11:17 am
Greetings. I have this macro to equip my mainhand and offhand from my bag items. Can anyone tell me how to integrate it to the code below?
This is the macro:
Code: Select all
/run EquipItem(16) EquipItem(17) mh,offh = nil,nil
/run _,_,ts=GetBagCount() for i=1,ts do ii,_,n=GetBagItemInfo(i) if n=="Name of Offhand goes here" then offh=ii elseif n=="Name of Mainhand goes here" then mh = ii end end
/run EquipItem(16, mh) EquipItem(17, offh)
This is my WP I want the macro to work in:
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
--== User Option ==--
startGMDetect()
__WPL:setWaypointIndex(1);
</onLoad>
<!-- # 1 --><waypoint x="-xxxx" z="xxxx" y="xxx">
repeat
player:target_Object("Mailbox"); yrest(1000); -- mailbox
until RoMScript("SpeakFrame:IsVisible()")
repeat
sendMacro("ChoiceOption(1);"); yrest(1000);
until RoMScript("MailFrame:IsVisible()")
UMM_TakeMail ();
yrest(2000);
RoMScript("UMMFrame:Hide()");
yrest(300);
inventory:useItem("Name of Bow")
inventory:useItem("Name of Leggings")
inventory:useItem("Name of Chest Armor")
-- hoping to insert equip offhand/mainhand macro here
</waypoint>
<!-- # 2 --><waypoint x="xxxx" z="xxxx" y="-xx"> </waypoint>
<!-- # 3 --><waypoint x="xxxx" z="xxxx" y="xxx"> </waypoint>
<!-- # 4 --><waypoint x="xxxx" z="xxxx" y="xxx"> loadPaths("Name of Path")
</waypoint>
</waypoints>
Thanks
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#3
Post
by lisa » Sun Mar 25, 2012 8:54 pm
So you just want to equip an item??
or
Code: Select all
inventory:useItem("Rune Catapult")
if you want to use those in game functions then use RoMScript
Code: Select all
RoMScript("EquipItem(16)")
yrest(500)
RoMScript("EquipItem(17)")
-
grande
- Posts: 261
- Joined: Tue Jun 28, 2011 4:46 pm
#4
Post
by grande » Sun Mar 25, 2012 9:00 pm
Lisa the problem with that your suggestion is it doesn't consider offhand vs mainhand therefore only the mainhand would ever wield a weapon. The nice thing about the macro is that it equips both. My problem is that I can't figure out how to make the bot do it. I thought about and tried several variations of /romscript but I don't get the syntax.
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#5
Post
by lisa » Sun Mar 25, 2012 9:18 pm
Code: Select all
RoMScript("EquipItem(16)")
yrest(500)
RoMScript("EquipItem(17)")
local mhitem = inventory:findItem(itemNameOrId)
local ohitem = inventory:findItem(itemNameOrId)
RoMScript("EquipItem(16, "..mhitem.SlotNumber..")")
yrest(500)
RoMScript("EquipItem(17, "..ohitem.SlotNumber..")")
Just change the itemNameOrId to what item you want to use for each.
mhitem is obviously main hand
ohitem is obviously offhand
-
grande
- Posts: 261
- Joined: Tue Jun 28, 2011 4:46 pm
#6
Post
by grande » Sun Mar 25, 2012 9:42 pm
You're awesome Lisa. That will save me a lot of ass pain later on so I don't have to make macros and set them up for each character. Thx again!
-
grande
- Posts: 261
- Joined: Tue Jun 28, 2011 4:46 pm
#7
Post
by grande » Sun Apr 01, 2012 5:21 pm
Lisa, it wasn't working with the code you gave so I did more looking around and it turns out I need "BagID" instead of "SlotNumber"
This worked:
Code: Select all
RoMScript("EquipItem(16)");
yrest(500);
RoMScript("EquipItem(17)");
yrest(500);
local mhitem = inventory:findItem("Name-Of My MH item");
RoMScript("EquipItem(16,"..mhitem.BagId..")");
yrest(800);
local ohitem = inventory:findItem("Name-Of OH item");
RoMScript("EquipItem(17,"..ohitem.BagId..")");
yrest(800);
Who is online
Users browsing this forum: Ahrefs [Bot] and 31 guests