Random Mount TBC

Random Mount TBC

6 Downloads

nothing happens Version 9.2.3

Padparadscha opened this issue ยท 5 comments

commented

If I try to run the macro nothing happens.
I tried to add a simple print statement in the beginning of RnM_Randomize() and this is not called. Macro is from Readme file
Addon is loaded. Version 9.2.3

commented

Are you getting a notification of mounts found when you load into the game?
image

commented

I found the first problem. I use a German client.
I changed Lines
#153 to
if (itype == "Reittier" or itype == "Devices") and C_Item.IsBound(ItemLocation:CreateFromBagAndSlot(bag, slot)) then
and line
#127 to
if data[1] == "Reiten" then

I dont know what Device is in the German Client.
On my lvl 70 Char it works now. With my lvl 31 Char I got a LUA error (riding skill 75, 1 Mount found) when I execute the Macro:

Message: Interface\AddOns\RandomMount\RandomMount.lua:240: attempt to get length of local 'adaptive' (a nil value)
Time: Sun Oct 31 07:51:44 2021
Count: 1
Stack: Interface\AddOns\RandomMount\RandomMount.lua:240: attempt to get length of local 'adaptive' (a nil value)
[string "@interface\AddOns\RandomMount\RandomMount.lua"]:240: in function <Interface\AddOns\RandomMount\RandomMount.lua:239>
[string "@interface\AddOns\RandomMount\RandomMount.lua"]:288: in function RnM_Randomize' [string "RnM_Randomize()"]:1: in main chunk [string "=[C]"]: in function RunScript'
[string "@interface\FrameXML\ChatFrame.lua"]:2160: in function ?' [string "@Interface\FrameXML\ChatFrame.lua"]:4825: in function ChatEdit_ParseText'
[string "@interface\FrameXML\ChatFrame.lua"]:4488: in function ChatEdit_SendText' [string "@Interface\FrameXML\ChatFrame.lua"]:2916: in function <Interface\FrameXML\ChatFrame.lua:2909> [string "=[C]"]: ? [string "=[C]"]: in function UseAction'
[string "@interface\FrameXML\SecureTemplates.lua"]:338: in function handler' [string "@Interface\FrameXML\SecureTemplates.lua"]:616: in function SecureActionButton_OnClick'
[string ":OnClick"]:4: in function <[string ":OnClick"]:1>

Locals: items =

{
1 = "Zaumzeug eines Schecken"
}
spells =
{
}
adaptive = nil
(*temporary) = 1
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to get length of local 'adaptive' (a nil value)"
useSpellMounts = false
RnM_Button = RnM_Button {
0 =
}

commented

Initially I was going to just loop through options for languages and add an array to hold all the variables, but it seems a better solution is to reference the ItemType class and subclass combination to ensure it's a mount/device. I'm refactoring a bit and will test today.

commented

For your third issue with the level 31, I need more information on the expected outcome. What mounts/riding skills can sub 40s acquire in classic? Obviously we can error handle better, but wanted to check on the expect outcome first.

commented

The max riding skill under 40 is 75. I think all slow mounts can be used.

For the Lua error in Line #240 I changed Line #275
if RnM_RandomizeMounts(slowFlyingBagItems, slowFlyingSpellbookSpells) then to
if RnM_RandomizeMounts(slowFlyingBagItems, slowFlyingSpellbookSpells, adaptiveBagItems) then

and Line #288 from
RnM_RandomizeMounts(slowGroundBagItems, slowGroundSpellbookSpells) to
RnM_RandomizeMounts(slowGroundBagItems, slowGroundSpellbookSpells, adaptiveBagItems)
because the Line 240 awaited the adaptiveBagItems

Line #182 I changed also from
elseif itype == "Mount" then
to
elseif itype == "Reittier" then

at the moment it works on all tested chars