Sure move the thread. ;)
The problem definitely seems to have its origins in that it of code. However.. This is still a problem though and it makes no sense>
Triggering lines are all like:
HP: [300/1295] CONC: [1220/1400] OPPONENT: Wounded
Fixed function:
function GetHBCol()
dim line, test, temp, output
line = world.getlinesinbuffercount
'** Should be the total number, including the trigger line.
do
'** Retrieve the full contents of the current (line).
temp = world.getlineinfo(line,1)
'** Should be 0 if not found or 1 or more if it is, i.e. TRUE is found.
test = instr(temp,"HP: [")
'** line should increment 'only' if the test is 0 i.e. false (this seems to be working).
line = line - abs(test = 0)
'** The fixed loop (note that if getlinesinbuffercount was accurate and included
'** the trigger line, it should never reach 0).
loop until test > 0 or line = 0
if line = 0 then
output = "#C0C0C0,#000000"
else
temp = world.getstyleinfo(line,1,14)
output = world.RGBColourToName(temp)
temp = world.getstyleinfo(line,1,15)
output = "," & world.RGBColourToName(temp)
end if
GetHBCol = output
end function
The only thing I can think of it that the fact that the plugin gags the line it somehow effect whether the current line matches the instr function. If so, then it is still a problem. However if things where working right then either the 'current' or 'current - 1' line should be the trigger line. It will btw never actually wrap, so I should technically not need to look backward through the list. I have to do so, because when I tried to simply get the last line in the buffer and return it's colors (supposedly the line doing the triggering) I got "#C0C0C0,#000000", when the color should have been "Cyan,Black" on for my character. As far as I can tell it isn't returning the number of the line that is triggering and while I haven't checked the number returned by my search routine above, I suspect it must be doing the same thing each time, thus returning an earlier line that 'is' in the buffer. It simply should not have even tried to searched backwards if it was finding the current line where you say it should be.
Obviously for some reason you statement that "The triggered line should be the last, or second-last one in the output buffer.." is not true in this case. :p |