Page 1 of 1

Echoing Changes in Prompt

Posted: Fri Apr 24, 2015 12:06 pm
by imany
I capture all my prompt echoes to the bottom of my screen, which works fine. What I'd like to do is print changes in HP to the buffer as they come in per line. How would I do this?

If it helps, this is my current HP script snippet:

Code: Select all

function convertHP(currentHP, maxHP)
  if currentHP and maxHP then
      currentHP = tonumber(currentHP)
      maxHP = tonumber(maxHP)
      percHP = math.floor(currentHP*100/maxHP)
  end
  if percHP >= 81 then
      HPcolor = "green"
      elseif percHP >= 61 and percHP <=80 then
      HPcolor = "yellow"
      elseif percHP >= 41 and percHP <= 60 then
      HPcolor = "orange"
      elseif percHP <= 40 then
      HPcolor = "red"
  end
HP2:echo(currentHP, HPcolor, "c")
HP4:echo(maxHP, "green", "c")
HP5:echo(percHP, HPcolor, "c")
end