-
grande
- Posts: 261
- Joined: Tue Jun 28, 2011 4:46 pm
#1
Post
by grande » Mon Jun 03, 2013 6:38 pm
Hi folks.. So I use the following to fix my head piece but it isn't working. All the other slot #'s work just fine but not this one:
Code: Select all
local dura = inventory:getDurability(1);
printf("Head durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(1)");
end
This works:
Code: Select all
local dura = inventory:getDurability(2);
printf("Hands durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(2)");
end
I can't see a difference between the two other than slot #. Is "1" not the correct number to use for the head piece?
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#2
Post
by lisa » Mon Jun 03, 2013 11:08 pm
My guess is another game bug, I have an ingame macro I use to repair all items and yes for some reason the head item never gets repaired.
-
wtsiwtf
- Posts: 9
- Joined: Tue Jun 04, 2013 12:47 am
- Location: Unknown
#3
Post
by wtsiwtf » Tue Jun 04, 2013 12:54 am
grande wrote:Is "1" not the correct number to use for the head piece?
0 refers to the head slot and
1 is the hands (gloves)...
hth
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#4
Post
by lisa » Tue Jun 04, 2013 2:17 am
Rcok might need to have a look at it, slot 0 returns empty even when there is something in that slot.
Code: Select all
Command> for i = 0,29 do local hat = CEquipmentItem(i) print(i..": "..hat.Id.." "..hat.Name) end
0: 0 <EMPTY>
1: 225498 Cloth Gloves of the Void
2: 225237 Holy Source Boots
3: 225235 Holy Source Robe
4: 220427 Leggings of Meditation
5: 225799 Labyrinth Cloak of Rebirth
6: 224923 Aker Girdle
7: 225300 Elemental Flame Shoulder Guards
8: 229297 Rufa Necklace
9: 0 <EMPTY>
10: 0 <EMPTY>
11: 229293 Rufa Ring
12: 228580 Icy Indigo Ring
13: 229289 Rufa Earring
14: 228591 Poem of Sealing
15: 212248 Void Long Staff
16: 0 <EMPTY>
17: 0 <EMPTY>
18: 0 <EMPTY>
19: 0 <EMPTY>
20: 0 <EMPTY>
21: 224988 Wings of the Flaming Inferno
That char has holy source hat on, I still say it's a game bug and it never repairs hat (my macro does all slots and hat still isn't repaired), yes it should have been 0 for hat but the fact still remains the hat slot is still bugged in game.
-
wtsiwtf
- Posts: 9
- Joined: Tue Jun 04, 2013 12:47 am
- Location: Unknown
#5
Post
by wtsiwtf » Tue Jun 04, 2013 7:40 am
c.f. RoM API GetInventorySlotInfo()
The naming convention is a tad liberal there...
slotID, backgroundTexture =
GetInventorySlotInfo(
slotName)
slotNamecan have one of the values -
- HeadSlot
HandsSlot
FeetSlot
ChestSlot
LegsSlot
BackSlot
WaistSlot
ShoulderSlot
NecklaceSlot
AmmoSlot
RangedSlot
Ring0Slot
Ring1Slot
Earring0Slot
Earring1Slot
MainHandSlot
SecondaryHandSlot
UtensilSlot
Talisman0Slot
Talisman1Slot
Talisman2Slot
AdornmentSlot
hth
a polar bear is a rectangular bear after a coordinate transform
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#6
Post
by lisa » Tue Jun 04, 2013 7:30 pm
wtsiwtf wrote:c.f. RoM API GetInventorySlotInfo()
I wrote half of the RoM wiki (functions)
which is pretty much why less than half the functions are explained as I got bored of doing it.
-
grande
- Posts: 261
- Joined: Tue Jun 28, 2011 4:46 pm
#7
Post
by grande » Tue Jun 04, 2013 7:41 pm
Thank you, both. Do you know how I call that function in game to tell me what the slots are? Just throw a "/script" or "/run" in front? Of course not... if it were that easy, I'd not be posting this.
Okay so... I can discern by comparison maybe:
slotID, backgroundTexture = GetInventorySlotInfo(HeadSlot)
compared to:
/script x, y = GetPlayerWorldMapPos (); SendWarningMsg ("WorldMapPos" .. "\ NX =" .. x .. "\ NY = ".. y) --which prints x and y coords in game
and my feeble effort produces:
/script slotID = GetInventorySlotInfo (HeadSlot); SendWarningMsg ("SlotInfo" .. "\ NX =" .. slotID)
which of course, fails miserably. I assume I'm screwing up somewhere in the NX or NY department? heck...
-
wtsiwtf
- Posts: 9
- Joined: Tue Jun 04, 2013 12:47 am
- Location: Unknown
#8
Post
by wtsiwtf » Tue Jun 04, 2013 10:28 pm
To get the slotId, eg. for the HeadSlot you might want to try -
Code: Select all
/script slotID, _ = GetInventorySlotInfo ("HeadSlot"); DEFAULT_CHAT_FRAME:AddMessage("SlotId = " .. slotID)
or SendWarningMsg() or something
lisa wrote:wtsiwtf wrote:
I wrote half of the RoM wiki (functions)
which is pretty much why less than half the functions are explained as I got bored of doing it.
Thats certainly quite an effort and very helpful for newbies like myself...
a polar bear is a rectangular bear after a coordinate transform
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#9
Post
by lisa » Tue Jun 04, 2013 11:02 pm
Since you only want the first returned result you can make it easier for yourself
Code: Select all
SendSystemChat(GetInventorySlotInfo("HeadSlot"))
Obviously you can add in any text you want before it.
Code: Select all
SendSystemChat("SlotId = "..GetInventorySlotInfo("HeadSlot"))
-
grande
- Posts: 261
- Joined: Tue Jun 28, 2011 4:46 pm
#10
Post
by grande » Wed Jun 05, 2013 7:25 am
Works great, thx!!!
Who is online
Users browsing this forum: Bing [Bot] and 0 guests