(had this wrote up earlier and forgot to post it, but this is what the trigger code looks like)
Either I don't' understand how the moveCursor() function works, or I'm doing something wrong. Either I break the trigger or it doesn't move the cursor.
Pattern to match:
You have (\d+) experience points. <regex>
To see the lost exp hall of fame, try the 'exp lost' command. (begin of line substring)
Code to run on match:
PracExp=8800000
CurExp=tonumber(matches[2])
NumberPrac=0
moveCursor(0, getLineNumber()+5)
if CurExp>=PracExp then
NumberPrac=CurExp/PracExp
string.format("%1.0f",NumberPrac)
if NumberPrac==1 then
display("You can get 1 practice")
else
display("You should be able to get " .. string.format("%1.0f",NumberPrac) .. " practices")
end
else
ExpNeed=PracExp-CurExp
display("You Need " .. ExpNeed .. " experience till your next practice.")
end
NumberPrac=string.format("%1.0f",NumberPrac)
NextPrac=CurExp-(PracExp*NumberPrac)
display("You have " .. NextPrac .. " till your next practice")
I'm obviously not using it correctly, but with what I read, this:
moveCursor(0, getLineNumber()+5) should move the cursor 5 lines down and then do the rest of the code, but it doesn't.