Anyway, I may have stumbled upon a bug, or I'm simply staring at an overly obvious problem. I've tried with both tonumber() (which I will be using, I was just testing without) and the player.x variables are initialized and work in other code. Anyway, here's the code:
Code: Select all
-- Capture player's stats from score
-- First Line
player.health = multimatches[1][2]
player.healthMax = multimatches[1][3]
player.endurance = multimatches[1][4]
player.enduranceMax = multimatches[1][5]
player.reserves = multimatches[1][6]
-- Second Line
player.mana = multimatches[2][2]
player.manaMax = multimatches[2][3]
status.willpower = multimatches[2][4]
player.willpowerMax = multimatches[2][5]
player.power = multimatches[2][6]
-- Third Line
player.ego = multimatches[3][2]
player.egoMax = multimatches[3][3]
player.mindset = multimatches[3][4]
player.esteem = multimatches[3][5]
Code: Select all
^\|\s+Health\s+:\s+(\d+)/(\d+)\s+Endurance\s+:\s+(\d+)/(\d+)\s+Power\s+:\s+(\d+)p\s+\|$
^\|\s+Mana\s+:\s+(\d+)/(\d+)\s+Willpower\s+:\s+(\d+)/(\d+)\s+Reserves\s+:\s+(\d+)%\s+\|$
^\|\s+Ego\s+: (\d+)/(\d+)\s+Mindset\s+:\s+(\w+)\s+Esteem\s+:\s+(\d+)%\s+\|$
This results in the following output from the debug window:
Code: Select all
name=Score(^\|\s+Health\s+:\s+(\d+)/(\d+)\s+Endurance\s+:\s+(\d+)/(\d+)\s+Power\s+:\s+(\d+)p\s+\|$)
matched.
capture group #1 = <| Health : 5625/5625 Endurance : 20180/20180 Power : 10p |>
capture group #2 = <5625>
capture group #3 = <5625>
capture group #4 = <20180>
capture group #5 = <20180>
capture group #6 = <10>
match state 1/1 condition #0=true (0/3)
regex=^\|\s+Health\s+:\s+(\d+)/(\d+)\s+Endurance\s+:\s+(\d+)/(\d+)\s+Power\s+:\s+(\d+)p\s+\|$
new line arrived:| Mana : 6321/5659 Willpower : 21560/21560 Reserves : 100% |
Trigger
name=Score(^\|\s+Mana\s+:\s+(\d+)/(\d+)\s+Willpower\s+:\s+(\d+)/(\d+)\s+Reserves\s+:\s+(\d+)%\s+\|$)
matched.
capture group #1 = <| Mana : 6321/5659 Willpower : 21560/21560 Reserves : 100% |>
capture group #2 = <6321>
capture group #3 = <5659>
capture group #4 = <21560>
capture group #5 = <21560>
capture group #6 = <100>
match state 1/1 condition #1=true (1/3)
regex=^\|\s+Mana\s+:\s+(\d+)/(\d+)\s+Willpower\s+:\s+(\d+)/(\d+)\s+Reserves\s+:\s+(\d+)%\s+\|$
new line arrived:| Ego : 5659/5659 Mindset : Pedantic Esteem : 0% |
Trigger name=Score(^\|\s+Ego\s+: (\d+)/(\d+)\s+Mindset\s+:\s+(\w+)\s+Esteem\s+:\s+(\d+)%\s+\|$)
matched.
capture group #1 = <| Ego : 5659/5659 Mindset : Pedantic Esteem : 0% |>
capture group #2 = <5659>
capture group #3 = <5659>
capture group #4 = <Pedantic>
capture group #5 = <0>
match state 1/1 condition #2=true (2/3) regex=^\|\s+Ego\s+:
(\d+)/(\d+)\s+Mindset\s+:\s+(\w+)\s+Esteem\s+:\s+(\d+)%\s+\|$
multiline trigger name=Score *FIRES* all conditons are fullfilled. Executing script.
LUA OK script Score (Trigger387) ran without errors
removing condition from conditon table.
new line arrived:|------------------------------------------------------------------- KARMA|
LUA: ERROR running script Score (Trigger387) ERROR:Lua error:[string "function Trigger387()..."]:5:
attempt to index field '?' (a nil value)
new line arrived:| Karma : 18% |
LUA: ERROR running script Score (Trigger387) ERROR:Lua error:[string "function Trigger387()..."]:5:
attempt to index field '?' (a nil value)
new line arrived:| The karmic blessing of life : 3 hours 21 minutes |
LUA: ERROR running script Score (Trigger387) ERROR:Lua error:[string "function Trigger387()..."]:5:
attempt to index field '?' (a nil value)
new line arrived:|---------------------------------------------------------------- RANKINGS|