function Addon:GetPetTip(id) if (not id) or id=='ignored' then return ' ' end if string.sub(id,1,6)=='random' then return format([[|TInterface\AddOns\Rematch\Textures\levelingicon:20|t %s]], L.LEVELING_FIELD), HIGHLIGHT_FONT_COLOR:GetRGB() end --print(id) local _, customName, _, _, _, _, _, name, icon, petType = C_PetJournal.GetPetInfoByPetID(id) if not name then return ' ' end local health, maxHealth, power, speed, rarity = C_PetJournal.GetPetStats(id)
return format('|T%s:20|t %s%s|r', icon, ITEM_QUALITY_COLORS[rarity-1].hex, customName or name) end
replace line 140 with this cluster in UI.lua:
local left=script:GetLeft() local right=button:GetRight() if left and right then button.Name:SetPoint('TOPRIGHT', left - right , -4) end
Hello, I am frequently recieving this error, maybe you understand the error report (because I don't):
Message: Interface\AddOns\tdBattlePetScript_Rematch\UI.lua:140: attempt to perform arithmetic on a nil value Time: Mon Jan 18 14:28:14 2021 Count: 1 Stack: Interface\AddOns\tdBattlePetScript_Rematch\UI.lua:140: attempt to perform arithmetic on a nil value [string "@Interface\AddOns\tdBattlePetScript_Rematch\UI.lua"]:140: in function <Interface\AddOns\tdBattlePetScript_Rematch\UI.lua:123> [string "=(tail call)"]: ? [string "=[C]"]: in function `callback' [string "@Interface\AddOns\Rematch\Widgets\AutoScrollFrame.lua"]:204: in function `Update' [string "@Interface\AddOns\Rematch\Panels\TeamPanel.lua"]:57: in function `Update' [string "@Interface\AddOns\Rematch\Panels\TeamPanel.lua"]:478: in function `Resize' [string "@Interface\AddOns\Rematch\Frames\Journal.lua"]:251: in function <Interface\AddOns\Rematch\Frames\Journal.lua:180> [string "=[C]"]: ? [string "=[C]"]: in function `Show' [string "@Interface\FrameXML\UIParent.lua"]:2910: in function `SetUIPanel' [string "@Interface\FrameXML\UIParent.lua"]:2755: in function `ShowUIPanel' [string "@Interface\FrameXML\UIParent.lua"]:2623: in function <Interface\FrameXML\UIParent.lua:2619> [string "=[C]"]: in function `SetAttribute' [string "@Interface\FrameXML\UIParent.lua"]:3468: in function <Interface\FrameXML\UIParent.lua:3447> [string "=[C]"]: in function `ShowUIPanel' [string "@Interface\FrameXML\UIParent.lua"]:1093: in function `SetCollectionsJournalShown' [string "@Interface\FrameXML\UIParent.lua"]:1081: in function `ToggleCollectionsJournal' [string "TOGGLECOLLECTIONS"]:1: in function <[string "TOGGLECOLLECTIONS"]:1>
1x tdBattlePetScript_Rematch\Addon.lua:40: Usage: GetPetInfoByID(petGUID) [string "=[C]"]: in function `GetPetInfoByPetID' [string "@tdBattlePetScript_Rematch\Addon.lua"]:40: in function `GetPetTip' [string "@tdBattlePetScript_Rematch\Addon.lua"]:59: in function `tipFormatting' [string "@tdBattlePetScript\UI\UI.lua"]:31: in function <tdBattlePetScript\UI\UI.lua:17> [string "=(tail call)"]: ? [string "@tdBattlePetScript\UI\MainPanel.lua"]:148: in function <tdBattlePetScript\UI\MainPanel.lua:147>
Getting basically the same error but with a few more error lines. Thanks.
3x tdBattlePetScript_Rematch\Addon.lua:40: Usage: GetPetInfoByID(petGUID) [string "=[C]"]: in function `GetPetInfoByPetID' [string "@tdBattlePetScript_Rematch\Addon.lua"]:40: in function `GetPetTip' [string "@tdBattlePetScript_Rematch\Addon.lua"]:59: in function `tipFormatting' [string "@tdBattlePetScript\UI\Import.lua"]:248: in function `tooltipMore' [string "@tdBattlePetScript\Libs\tdGUI\Widget\DropMenu.lua"]:281: in function <...Ons\tdBattlePetScript\Libs\tdGUI\Widget\DropMenu.lua:257> [string "=[C]"]: ? [string "@tdBattlePetScript\Libs\tdGUI\Libs\LibClass-2.0-9\Class-2.0.lua"]:37: in function <...PetScript\Libs\tdGUI\Libs\LibClass-2.0\Class-2.0.lua:35> [string "@tdBattlePetScript\Libs\tdGUI\Libs\LibClass-2.0-9\Class-2.0.lua"]:138: in function `Fire' [string "@tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua"]:28: in function `FireHandler' [string "@tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua"]:59: in function <...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:57>
Message: Interface\AddOns\tdBattlePetScript\UI\MainPanel.lua:502: attempt to index field 'MainPanel' (a nil value) Time: Fri Oct 16 12:17:19 2020 Count: 12 Stack: Interface\AddOns\tdBattlePetScript\UI\MainPanel.lua:502: attempt to index field 'MainPanel' (a nil value)
1x tdBattlePetScript_Rematch\Addon.lua:46: Usage: GetPetInfoByID(petGUID) [C]: in function `GetPetInfoByPetID' tdBattlePetScript_Rematch\Addon.lua:46: in function `GetPetTip' tdBattlePetScript_Rematch\Addon.lua:65: in function `tipFormatting' tdBattlePetScript\UI\UI.lua:28: in function `OpenScriptTooltip' tdBattlePetScript\UI\MainPanel.lua:147: in function <tdBattlePetScript\UI\MainPanel.lua:146>
I have no idea what I'm supposed to be doing here. I read through the script creation, had only the import option, so used that, but then there's no save option, not even if I try it on one of the sample scripts. Is there some beginning/ending command I'm missing?
Rollback Post to RevisionRollback
To post a comment, please login or register a new account.
Hello, I am frequently recieving this error, maybe you understand the error report (because I don't):
Message: Interface\AddOns\tdBattlePetScript_Rematch\UI.lua:140: attempt to perform arithmetic on a nil value
Time: Mon Jan 18 14:28:14 2021
Count: 1
Stack: Interface\AddOns\tdBattlePetScript_Rematch\UI.lua:140: attempt to perform arithmetic on a nil value
[string "@Interface\AddOns\tdBattlePetScript_Rematch\UI.lua"]:140: in function <Interface\AddOns\tdBattlePetScript_Rematch\UI.lua:123>
[string "=(tail call)"]: ?
[string "=[C]"]: in function `callback'
[string "@Interface\AddOns\Rematch\Widgets\AutoScrollFrame.lua"]:204: in function `Update'
[string "@Interface\AddOns\Rematch\Panels\TeamPanel.lua"]:57: in function `Update'
[string "@Interface\AddOns\Rematch\Panels\TeamPanel.lua"]:478: in function `Resize'
[string "@Interface\AddOns\Rematch\Frames\Journal.lua"]:251: in function <Interface\AddOns\Rematch\Frames\Journal.lua:180>
[string "=[C]"]: ?
[string "=[C]"]: in function `Show'
[string "@Interface\FrameXML\UIParent.lua"]:2910: in function `SetUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2755: in function `ShowUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2623: in function <Interface\FrameXML\UIParent.lua:2619>
[string "=[C]"]: in function `SetAttribute'
[string "@Interface\FrameXML\UIParent.lua"]:3468: in function <Interface\FrameXML\UIParent.lua:3447>
[string "=[C]"]: in function `ShowUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:1093: in function `SetCollectionsJournalShown'
[string "@Interface\FrameXML\UIParent.lua"]:1081: in function `ToggleCollectionsJournal'
[string "TOGGLECOLLECTIONS"]:1: in function <[string "TOGGLECOLLECTIONS"]:1>
Locals: button = <unnamed> {
0 = <userdata>
Notes = <unnamed> {
}
WinRecordText = <unnamed> {
}
SubName = <unnamed> {
}
key = 173303
Border = <unnamed> {
}
Back = <unnamed> {
}
Pets = <table> {
}
WinRecordBack = <unnamed> {
}
Name = <unnamed> {
}
Preferences = <unnamed> {
}
index = 25
HasFocus = <function> defined @Interface\AddOns\Rematch\Widgets\CompositeButton.lua:62
Favorite = <unnamed> {
}
SetTextureScript = <function> defined @Interface\AddOns\Rematch\Widgets\CompositeButton.lua:51
}
key = 173303
script = <unnamed> {
0 = <userdata>
key = 173303
}
relative = nil
(*temporary) = <function> defined =[C]:-1
(*temporary) = <unnamed> {
0 = <userdata>
}
(*temporary) = "TOPRIGHT"
(*temporary) = nil
(*temporary) = nil
(*temporary) = <unnamed> {
0 = <userdata>
Notes = <unnamed> {
}
WinRecordText = <unnamed> {
}
SubName = <unnamed> {
}
key = 173303
Border = <unnamed> {
}
Back = <unnamed> {
}
Pets = <table> {
}
WinRecordBack = <unnamed> {
}
Name = <unnamed> {
}
Preferences = <unnamed> {
}
index = 25
HasFocus = <function> defined @Interface\AddOns\Rematch\Widgets\CompositeButton.lua:62
Favorite = <unnamed> {
}
SetTextureScript = <function> defined @Interface\AddOns\Rematch\Widgets\CompositeButton.lua:51
}
(*temporary) = nil
(*temporary) = "attempt to perform arithmetic on a nil value"
scriptButtons = <table> {
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
= <unnamed> {
}
}
self = <table> {
SetDefaultModuleLibraries = <function> defined @Interface\AddOns\Bartender4\libs\AceAddon-3.0\AceAddon-3.0.lua:367
Enable = <function> defined @Interface\AddOns\Bartender4\libs\AceAddon-3.0\AceAddon-3.0.lua:294
NewModule = <function> defined @Interface\AddOns\Bartender4\libs\AceAddon-3.0\AceAddon-3.0.lua:235
EnableModule = <function> defined @Interface\AddOns\Bartender4\libs\AceAddon-3.0\AceAddon-3.0.lua:332
modules = <table> {
}
GetModule = <function> defined @Interface\AddOns\Bartender4\libs\AceAddon-3.0\AceAddon-3.0.lua:210
IterateEmbeds = <function> defined @Interface\AddOns\Bartender4\libs\AceAddon-3.0\AceAddon-3.0.lua:442
SecureHook = <function> defined @Interface\AddOns\Bartender4\libs\AceHook-3.0\AceHook-3.0.lua:336
defaultModuleLibrarie
.
These are the Battle Pet addons I'm using:
Battle Pet BreedID
Pokemon Trainer
Pokemon Trainer Loader
Rematch
tdBattlePetScript
tdBattlePetScript Rematch
The error keeps popping up every time I open the Pet Journal until I reload UI.
1x tdBattlePetScript_Rematch\Addon.lua:40: Usage: GetPetInfoByID(petGUID)
[string "=[C]"]: in function `GetPetInfoByPetID'
[string "@tdBattlePetScript_Rematch\Addon.lua"]:40: in function `GetPetTip'
[string "@tdBattlePetScript_Rematch\Addon.lua"]:59: in function `tipFormatting'
[string "@tdBattlePetScript\UI\UI.lua"]:31: in function <tdBattlePetScript\UI\UI.lua:17>
[string "=(tail call)"]: ?
[string "@tdBattlePetScript\UI\MainPanel.lua"]:148: in function <tdBattlePetScript\UI\MainPanel.lua:147>
Locals:
(*temporary) = "random:0"
Addon Version 80100.01
In reply to waroflocks:
Getting basically the same error but with a few more error lines. Thanks.
3x tdBattlePetScript_Rematch\Addon.lua:40: Usage: GetPetInfoByID(petGUID)
[string "=[C]"]: in function `GetPetInfoByPetID'
[string "@tdBattlePetScript_Rematch\Addon.lua"]:40: in function `GetPetTip'
[string "@tdBattlePetScript_Rematch\Addon.lua"]:59: in function `tipFormatting'
[string "@tdBattlePetScript\UI\Import.lua"]:248: in function `tooltipMore'
[string "@tdBattlePetScript\Libs\tdGUI\Widget\DropMenu.lua"]:281: in function <...Ons\tdBattlePetScript\Libs\tdGUI\Widget\DropMenu.lua:257>
[string "=[C]"]: ?
[string "@tdBattlePetScript\Libs\tdGUI\Libs\LibClass-2.0-9\Class-2.0.lua"]:37: in function <...PetScript\Libs\tdGUI\Libs\LibClass-2.0\Class-2.0.lua:35>
[string "@tdBattlePetScript\Libs\tdGUI\Libs\LibClass-2.0-9\Class-2.0.lua"]:138: in function `Fire'
[string "@tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua"]:28: in function `FireHandler'
[string "@tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua"]:59: in function <...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:57>
update for 2.0.2 ?
Will there be a new version for Shadowlands?
Has anyone fixed this, locally? So to share the code?
Any word on an update?
I use this addon together with WEAKAURA. Doesn't confirm combat dialogue.
I also hope an update for shadowlands will be there soon! This addon is by far the one I miss most when it doesn't work.
Using existing scripts works, but importing new ones doesn't.
Good luck developing an update, hope you'll be willing to do so!
In reply to manon141414:
Im having the same issue.
Are we likely to see an update for Shadowlands?
Currently cannot import scripts into Rematch:
Message: Interface\AddOns\tdBattlePetScript\UI\MainPanel.lua:502: attempt to index field 'MainPanel' (a nil value)
Time: Fri Oct 16 12:17:19 2020
Count: 12
Stack: Interface\AddOns\tdBattlePetScript\UI\MainPanel.lua:502: attempt to index field 'MainPanel' (a nil value)
Locals:
An ability to back up each of the written scripts would be fantastic.
I'm going to keep a document with all the scripts I have per battle for now, but some kinda integration like Kaminaris said would be amazing.
Any chance we get one-paste integration to import both team and td script at once?
Still happening with Patch 8.2.5:
Date: 2019-10-15 11:42:28
ID: 8
Error occured in: Global
Count: 1
Message: ..\AddOns\tdBattlePetScript_Rematch\Addon.lua line 40:
Usage: GetPetInfoByID(petGUID)
Debug:
(tail call): ?
[C]: GetPetInfoByPetID()
tdBattlePetScript_Rematch\Addon.lua:40: GetPetTip()
tdBattlePetScript_Rematch\Addon.lua:59: tipFormatting()
tdBattlePetScript\UI\UI.lua:31:
tdBattlePetScript\UI\UI.lua:17
(tail call): ?
tdBattlePetScript\UI\PetBattle.lua:180:
tdBattlePetScript\UI\PetBattle.lua:178
(tail call): ?
[C]: ?
[string "safecall Dispatcher[3]"]:9:
[string "safecall Dispatcher[3]"]:5
(tail call): ?
...PetScript\Libs\tdGUI\Libs\LibClass-2.0\Class-2.0.lua:156: Fire()
...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:28: FireHandler()
...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:59:
...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:57
Locals:
None
When you open the menu and mousever the things in the script selector:
Date: 2018-12-20 21:08:42
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\tdBattlePetScript_Rematch\Addon.lua line 40:
Usage: GetPetInfoByID(petGUID)
Debug:
[C]: GetPetInfoByPetID()
tdBattlePetScript_Rematch\Addon.lua:40: GetPetTip()
tdBattlePetScript_Rematch\Addon.lua:59: tipFormatting()
tdBattlePetScript\UI\UI.lua:31:
tdBattlePetScript\UI\UI.lua:17
(tail call): ?
tdBattlePetScript\UI\PetBattle.lua:180:
tdBattlePetScript\UI\PetBattle.lua:178
(tail call): ?
[C]: ?
[string "safecall Dispatcher[3]"]:9:
[string "safecall Dispatcher[3]"]:5
(tail call): ?
...PetScript\Libs\tdGUI\Libs\LibClass-2.0\Class-2.0.lua:156: Fire()
...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:28: FireHandler()
...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:59:
...Ons\tdBattlePetScript\Libs\tdGUI\Widget\ViewItem.lua:57
Locals:
None
After 8.1:
Date: 2018-12-11 17:49:41
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\tdBattlePetScript_Rematch\v4.lua line 78:
Usage: SecureHook([object], method, [handler]): Attempting to hook a non existing target
After updating Rematch to 4.8.10-exp-06, I get the following LUA error on login:
Message: ..\AddOns\tdBattlePetScript_Rematch\v3.lua line 22:
attempt to index field 'menu' (a nil value)
Debug:
tdBattlePetScript_Rematch\v3.lua:22:
tdBattlePetScript_Rematch\v3.lua:21
[C]: ?
Ace3\AceAddon-3.0\AceAddon-3.0.lua:70:
Ace3\AceAddon-3.0\AceAddon-3.0.lua:65
Ace3\AceAddon-3.0\AceAddon-3.0.lua:527:
Ace3\AceAddon-3.0\AceAddon-3.0.lua:520
(tail call): ?
...Ons\tdBattlePetScript\Core\Manager\PluginManager.lua:161: LoadPlugins()
...Ons\tdBattlePetScript\Core\Manager\PluginManager.lua:33:
...Ons\tdBattlePetScript\Core\Manager\PluginManager.lua:32
1x tdBattlePetScript_Rematch\Addon.lua:46: Usage: GetPetInfoByID(petGUID)
[C]: in function `GetPetInfoByPetID'
tdBattlePetScript_Rematch\Addon.lua:46: in function `GetPetTip'
tdBattlePetScript_Rematch\Addon.lua:65: in function `tipFormatting'
tdBattlePetScript\UI\UI.lua:28: in function `OpenScriptTooltip'
tdBattlePetScript\UI\MainPanel.lua:147: in function <tdBattlePetScript\UI\MainPanel.lua:146>
Locals:
(*temporary) = "random:8"
I have no idea what I'm supposed to be doing here. I read through the script creation, had only the import option, so used that, but then there's no save option, not even if I try it on one of the sample scripts. Is there some beginning/ending command I'm missing?