View Single Post
06-19-23, 04:08 AM   #3
Galseb
A Defias Bandit
Join Date: Jun 2023
Posts: 2
Originally Posted by Dridzt View Post
I fixed the problems visible to the naked eye (no testing)
You need to enable Lua errors from interface options to even see what's happening.
There's no way that code even run.
The output is now working, at least 0 shows, thanks! But it does not count, and shows such script errors, the number of which is growing every second .. Can you tell me how to fix it? Thank you

Code:
Message: ...ace\AddOns\DalaranLoopCounter\DalaranLoopCounter.lua:18: attempt to call field 'GetBestMapForUnit' (a nil value)
Time: 06/19/23 13:00:02
Count: 139
Stack: ...ace\AddOns\DalaranLoopCounter\DalaranLoopCounter.lua:18: in function <...ace\AddOns\DalaranLoopCounter\DalaranLoopCounter.lua:17>

Locals: (*temporary) = nil
(*temporary) = "player"
(*temporary) = "attempt to call field 'GetBestMapForUnit' (a nil value)"
DalaranID = 125
points = <table> {
 A = <table> {
 }
 D = <table> {
 }
 C = <table> {
 }
 B = <table> {
 }
}
currentPoint = "A"
lapCount = 0
Lines 17 and 18 are
Code:
local function CheckPlayerPosition()
    local mapId = C_Map.GetBestMapForUnit("player")
  Reply With Quote