-
Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
#1
Post
by Bill D Cat » Sun Jul 26, 2015 5:13 pm
Using this code to test something out, and it seems that the head slot is not accounted for in the equipment class. Slot 0 is shown as unused and I'm not sure where slot 20 is pointing to. Am I missing something? Should I be using a different class to figure out the equipment durability?
Code: Select all
function checkDurability()
--[[ This is what the slots seem to relate to. None report stats for the Head slot.
Slot 1: Hands Slot 6: Belt Slot 11: Ring 1 Slot 16: Off Hand Slot 21: Wings
Slot 2: Feet Slot 7: Shoulders Slot 12: Ring 2 Slot 17: Amulet
Slot 3: Upper Body Slot 8: Necklace Slot 13: Earring 1 Slot 18: Amulet
Slot 4: Lower Body Slot 9: Ammunition Slot 14: Earring 2 Slot 19: Amulet
Slot 5: Cape Slot 10: Ranged Weapon Slot 15: Main Hand Slot 20: ???
]]--
for loop = 0, 21 do
printf("Slot [%d]: %s (%d/%d)\n", loop, equipment.BagSlot[loop].Name, equipment.BagSlot[loop].Durability, equipment.BagSlot[loop].MaxDurability)
end
end
Last edited by
Bill D Cat on Sun Jul 26, 2015 6:09 pm, edited 1 time in total.
-
Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
#2
Post
by Bill D Cat » Sun Jul 26, 2015 6:08 pm
Narrowed it down to the EquipmentItem class.
Changed this function as shown, and I can get the information for the head slot.
Code: Select all
CEquipmentItem = class(CItem,
function( self, slot )
self.Location = "equipment"
self.SlotNumber = slot
self.BagId = slot
-- if ( self.SlotNumber ~= nil and self.SlotNumber ~= 0 ) then -- Changed this line to read as below.
if ( self.SlotNumber ~= nil ) then
self:update();
end;
end
);
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#3
Post
by lisa » Sun Jul 26, 2015 8:38 pm
I did your code and got exact same results as you, then I did this and it printed hat info.
I think there is an update missing as doing update before your code it worked fine.
Code: Select all
Command> equipment:update() checkdura()
Slot [0]: Tabokake's Mask (111/83)
Slot [1]: Salioca Vengeance Gloves (118/88)
Slot [2]: Yinajo's Wave (108/112)
Slot [3]: Yinajo's Conch (107/111)
Slot [4]: Salioca Vengeance Leather Pants (119/89)
Slot [5]: Salioca Vengeance Cloak (71/75)
Slot [6]: Energy Boost Belt (155/115)
Slot [7]: Lava Shoulder Armor of Glittering (102/106)
Slot [8]: Forgotten Necklace (148/100)
Slot [9]: Tooth Arrow (100/100)
Slot [10]: Cross of Desperation (99/75)
Slot [11]: Water Fire Ring (119/89)
Slot [12]: <EMPTY> (0/0)
Slot [13]: Lekani Earring (105/79)
Slot [14]: Tinc Earring (101/76)
Slot [15]: Bulwark of Death (101/105)
Slot [16]: Dagger of Invasion (101/105)
Slot [17]: <EMPTY> (0/0)
Slot [18]: <EMPTY> (0/0)
Slot [19]: <EMPTY> (0/0)
Slot [20]: <EMPTY> (0/0)
Slot [21]: Little Devil's Wings (134/100)
-
Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
#4
Post
by Bill D Cat » Sun Jul 26, 2015 9:08 pm
Okay, so adding an
equipment:update() ahead of the loop prints out the head slot information. But that just plays back to my second post where the bot function does NOT issue the update if the slot is 0. So my fix would probably be correct, because in the case of any other slot, the update is run.
EquipmentItem.lua line 9:
Code: Select all
if ( self.SlotNumber ~= nil and self.SlotNumber ~= 0 ) then
That's the culprit right there. Adding an equipment:update() to my function would just be a work around.
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#5
Post
by lisa » Sun Jul 26, 2015 11:20 pm
To be honest your post wasn't on my screen when I did mine, my comment about the update wasn't aimed at your code but at the fact there must be an update missing somewhere.
It seems what you pointed out is that the bot was deliberately made to not update the hat slot (0), I have no idea why it was set up like that but there must have been a reason to deliberately add it in.
Maybe Rock knows about it.
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#6
Post
by rock5 » Mon Jul 27, 2015 3:21 am
Maybe there was a reason for it but it's definitely a bug. I'll change it. If anything crops up we'll deal with it then.
Edit: It may just have been a copy and paste issue. Other item classes start at slot 1.
- 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.”
-
Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
#7
Post
by Bill D Cat » Mon Jul 27, 2015 6:55 am
rock5 wrote:Edit: It may just have been a copy and paste issue. Other item classes start at slot 1.
Which is interesting, considering the in-game function for RoM macros also starts with 1 for the equipment slots. I guess at some time in the development of the bot it was decided to start these at 0 instead. Changing it now might break existing scripts, especially those that equip or repair items.
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#8
Post
by rock5 » Mon Jul 27, 2015 9:00 am
I think they started at 0 because that was the values found in memory. It probably should have originally had 1 added to it. I think that was before my time though.
- 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.”
Who is online
Users browsing this forum: No registered users and 8 guests