The LargeList function did not quite suit my requirements. So I tried to build a custom sorted list by using a Lua script to manipulate a record with…
- List of elements sorted in order
- Map containing the scores of the elements
Am very new to the world of Lua scripting, so you need to bear with me.
I’m stuck because I cannot seem to do the simplest task of comparing A) the scores I stored in the map against B) the score of new key I passed into the Lua script.
for val in list.iterator(l) do
i= i+ 1
if (m[l[i]] > score) then
<actionA>
else
<actionB>
end
I know how silly it sounds, but whatever values I try, I cannot get the script to run actionA. For example,
- m[l[i]] is 9 and score is 10 >>> actionB gets triggered
- m[l[i]] is 11 and score is 10 >>> actionB gets triggered