Update PlayerInfoWindow.xml

Few minor changes, fine tweaking.
master
AardCrowley 1 year ago committed by GitHub
parent 27e0656c14
commit e3209d3f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,7 +15,7 @@
save_state="y" save_state="y"
date_written="2023-07-06 10:02:24" date_written="2023-07-06 10:02:24"
requires="5.07" requires="5.07"
version="1.7" version="1.8"
> >
</plugin> </plugin>
@ -25,7 +25,7 @@
<aliases> <aliases>
<alias <alias
match="^((?:(?:fing(?:e|er)?|whois?)(?:.*)?)|sc(?:o|or|ore)?)$" match="^((?:(?:fing(?:e|er)?|whois?|sc(?:o|or|ore|a|an)?)(?:.*)?))$"
enabled="y" enabled="y"
regexp="y" regexp="y"
script="onInfoRequest" script="onInfoRequest"
@ -106,8 +106,8 @@ function addToWindow(lines)
for indexStart, v in ipairs(lines) do for indexStart, v in ipairs(lines) do
local vText = v[1].text local vText = v[1].text
if vText:find("%-+") or vText:find("There is no player with that name%.") or vText:find("You found nobody online with the name '%w+'%.") then if vText:find("%-+") or vText:find("There is no player with that name%.") or vText:find("You found nobody online with the name '%w+'%.") or vText == "{scan}" then
foundStartIdx = indexStart foundStartIdx = (vText ~= "{scan}" and indexStart or indexStart + 1)
break break
end end
end end
@ -116,9 +116,10 @@ function addToWindow(lines)
for indexEnd = #lines, 1, -1 do for indexEnd = #lines, 1, -1 do
vText = lines[indexEnd][1].text vText = lines[indexEnd][1].text
if vText:find("%-+") or vText:find("There is no player with that name%.") or vText:find("You found nobody online with the name '%w+'%.") then if vText:find("%-+") or vText:find("There is no player with that name%.") or vText:find("You found nobody online with the name '%w+'%.") or vText == "{/scan}" then
table.move(lines, foundStartIdx, indexEnd, 1) foundEndIdx = (vText ~= "{/scan}" and indexEnd or indexEnd - 1)
local len = indexEnd - foundStartIdx + 1 table.move(lines, foundStartIdx, foundEndIdx, 1)
local len = foundEndIdx - foundStartIdx + 1
table.move(lines, #lines + 1, #lines * 2 - len, len + 1) table.move(lines, #lines + 1, #lines * 2 - len, len + 1)
break break
end end

Loading…
Cancel
Save