Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[help] "Unexpected token at NaN. Expected logical structure (END), but saw: "

i have a macro to change tooltip(will probably use somehing else later but tooltip is easy to check right now) tosomething from a rollable table depending on conditions using tokenmod and apilogic but keep getting this error, it looks blank and i have no idea what might cause it themacro: !tokenmod {{ --current-page --ids @(speaker.token_id) {& if @(speaker.lck) ~ slodka} {& if (@(speaker.lck) < 5)} {& elseif (@(speaker.lck) < 10)} tooltip|"[[1t[ryba-slodka-normalne]]]" {& elseif (@(speaker.lck) < 15)} tooltip|"[[1t[ryba-slodka-rzadkie]]]" {& elseif (@(speaker.lck) < 20)} tooltip|"[[1t[ryba-slodka-brzadkie]]]" {& else} tooltip|"[[1t[ryba-slodka-brzadkie]]]i[[1t[ryba-slodka-brzadkie]]]" {& end} {& elseif @(speaker.lck) ~ slona} {& if (@(speaker.lck) < 5)} {& elseif (@(speaker.lck) < 10)} tooltip|"[[1t[ryba-slona-normalne]]]" {& elseif (@(speaker.lck) < 15)} tooltip|"[[1t[ryba-slona-rzadkie]]]" {& elseif (@(speaker.lck) < 20)} tooltip|"[[1t[ryba-slona-brzadkie]]]" {& else} tooltip|"[[1t[ryba-slona-brzadkie]]]i[[1t[ryba-slona-brzadkie]]]" {& end} {& elseif @(speaker.lck) ~ toksyczna} {& if (@(speaker.lck) < 5)} {& elseif (@(speaker.lck) < 10)} tooltip|"[[1t[ryba-toksyczna-normalne]]]" {& elseif (@(speaker.lck) < 15)} tooltip|"[[1t[ryba-toksyczna-rzadkie]]]" {& elseif (@(speaker.lck) < 20)} tooltip|"[[1t[ryba-toksyczna-brzadkie]]]" {& else} tooltip|"[[1t[ryba-toksyczna-brzadkie]]]i[[1t[ryba-toksyczna-brzadkie]]]" {& end} {& else} {& if (@(speaker.lck) = 20)} tooltip|"[[1t[ryba-slodka-normalne]]]" {& else} tooltip|"to nie woda pajacu" {& end} }} the full error from output console: "Unexpected token at NaN. Expected logical structure (END), but saw: " "!tokenmod {{({&br-al})--current-page({&br-al})--ids -O6WKEBxB8VsA-slm0tP({&br-al}){& if 20 ~ slodka} ({&br-al}){& if (20 < 5)} ({&br-al}){& elseif (20 < 10)} tooltip|\"$[[0]]\" ({&br-al}){& elseif (20 < 15)} tooltip|\"$[[1]]\" ({&br-al}){& elseif (20 < 20)} tooltip|\"$[[2]]\" ({&br-al}){& else} tooltip|\"$[[3]]i$[[4]]\" ({&br-al}){& end}({&br-al}){& elseif 20 ~ slona} ({&br-al}){& if (20 < 5)} ({&br-al}){& elseif (20 < 10)} tooltip|\"$[[5]]\" ({&br-al}){& elseif (20 < 15)} tooltip|\"$[[6]]\" ({&br-al}){& elseif (20 < 20)} tooltip|\"$[[7]]\" ({&br-al}){& else} tooltip|\"$[[8]]i$[[9]]\" ({&br-al}){& end}({&br-al}){& elseif 20 ~ toksyczna} ({&br-al}){& if (20 < 5)} ({&br-al}){& elseif (20 < 10)} tooltip|\"$[[10]]\" ({&br-al}){& elseif (20 < 15)} tooltip|\"$[[11]]\" ({&br-al}){& elseif (20 < 20)} tooltip|\"$[[12]]\" ({&br-al}){& else} tooltip|\"$[[13]]i$[[14]]\" ({&br-al}){& end}({&br-al}){& else} ({&br-al}){& if (20 = 20)} tooltip|\"$[[15]]\" ({&br-al}){& else} tooltip|\"to nie woda pajacu\"({&br-al}){& end}({&br-al})}}" why does it happen and how do i fix it?
1726753266
timmaugh
Pro
API Scripter
Hi, Adam... that's definitely coming from APILogic, but it's happening because you don't have a closing {&end} tag at the end. If I take your code and add indentations (to show grouping/ownership of each END tag), it looks like this: {& if @(speaker.lck) ~ slodka} {& if (@(speaker.lck) < 5)} {& elseif (@(speaker.lck) < 10)} tooltip|"[[1t[ryba-slodka-normalne]]]" {& elseif (@(speaker.lck) < 15)} tooltip|"[[1t[ryba-slodka-rzadkie]]]" {& elseif (@(speaker.lck) < 20)} tooltip|"[[1t[ryba-slodka-brzadkie]]]" {& else} tooltip|"[[1t[ryba-slodka-brzadkie]]]i[[1t[ryba-slodka-brzadkie]]]" {& end} {& elseif @(speaker.lck) ~ slona} {& if (@(speaker.lck) < 5)} {& elseif (@(speaker.lck) < 10)} tooltip|"[[1t[ryba-slona-normalne]]]" {& elseif (@(speaker.lck) < 15)} tooltip|"[[1t[ryba-slona-rzadkie]]]" {& elseif (@(speaker.lck) < 20)} tooltip|"[[1t[ryba-slona-brzadkie]]]" {& else} tooltip|"[[1t[ryba-slona-brzadkie]]]i[[1t[ryba-slona-brzadkie]]]" {& end} {& elseif @(speaker.lck) ~ toksyczna} {& if (@(speaker.lck) < 5)} {& elseif (@(speaker.lck) < 10)} tooltip|"[[1t[ryba-toksyczna-normalne]]]" {& elseif (@(speaker.lck) < 15)} tooltip|"[[1t[ryba-toksyczna-rzadkie]]]" {& elseif (@(speaker.lck) < 20)} tooltip|"[[1t[ryba-toksyczna-brzadkie]]]" {& else} tooltip|"[[1t[ryba-toksyczna-brzadkie]]]i[[1t[ryba-toksyczna-brzadkie]]]" {& end} {& else} {& if (@(speaker.lck) = 20)} tooltip|"[[1t[ryba-slodka-normalne]]]" {& else} tooltip|"to nie woda pajacu" {& end} You can see that the initial IF block doesn't have an END. And one more line with {& end} in it, and you should be good.