Thank you for your reply, and I have tried to make what I want but failed... I need a favor, please.
The trigger below which calls the function "sklist":
^(.*)\s+\: (\d+)(.*)\s+\: (\d+)$
and the match pattern, for example:(the colour part was in bold)
淨化術 Cleanse : 6699 星光杖法 Starlight wand : 3959
The function "sklist":
function sklist(name, line, wildcards, styles)
col_1 = string.find (line, Trim (wildcards[1]))
col_2 = string.find (line, Trim (wildcards[3]))
style_1 = GetStyle (styles, col_1)
style_2 = GetStyle (styles, col_2)
ColourTell (
"RGBColourToName(style_1.textcolour)", "", string.format ("%-28s : ", Trim (wildcards[1])),
"silver", "", string.format ("%4d ",wildcards[2]),
"RGBColourToName(style_2.textcolour)", "", string.format ("%-28s : ", Trim (wildcards[3])),
"silver", "", string.format ("%4d", wildcards[4])
)
end
The error message is:
[string "Script file"]:3: attempt to index local 'wildcards' (a nil value)
stack traceback:
[string "Script file"]:3: in function 'sklist'
[string "Trigger: "]:2: in main chunk
[C]: in function 'Simulate'
[string "Command line"]:1: in main chunk
I'm pretty new in programming, so I have no idea about the script above is feasible or not. |