Guest User

updated demonnic.chat:append

a guest
Sep 24th, 2014
294
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function demonnic.chat:append(chat)
  2.   local r = demonnic.chat.config.windowColors.r
  3.   local g = demonnic.chat.config.windowColors.g
  4.   local b = demonnic.chat.config.windowColors.b
  5.   selectCurrentLine()
  6.   local ofr,ofg,ofb = getFgColor()
  7.   local obr,obg,obb = getBgColor()
  8.   if demonnic.chat.config.preserveBackground then
  9.     setBgColor(r,g,b)
  10.   end
  11.   copy()
  12.   local curLine = getCurrentLine()
  13.   if demonnic.chat.config.timestamp then
  14.     local timestamp = getTime(true, demonnic.chat.config.timestamp)
  15.     local tsfg = {}
  16.     local tsbg = {}
  17.     local colorLeader = ""
  18.     if demonnic.chat.config.timestampCustomColor then
  19.       if type(demonnic.chat.config.timestampFG) == "string" then
  20.         tsfg = color_table[demonnic.chat.config.timestampFG]
  21.       else
  22.         tsfg = demonnic.chat.config.timestampFG
  23.       end
  24.       if type(demonnic.chat.config.timestampBG) == "string" then
  25.         tsbg = color_table[demonnic.chat.config.timestampBG]
  26.       else
  27.         tsbg = demonnic.chat.config.timestampBG
  28.       end
  29.       colorLeader = string.format("<%s,%s,%s:%s,%s,%s>",tsfg[1],tsfg[2],tsfg[3],tsbg[1],tsbg[2],tsbg[3])
  30.     else
  31.       colorLeader = string.format("<%s,%s,%s:%s,%s,%s>",ofr,ofg,ofb,obr,obg,obb)
  32.     end
  33.     local fullstamp = string.format("%s%s",colorLeader,timestamp)
  34.       demonnic.chat.windows[chat]:decho(fullstamp)
  35.       demonnic.chat.windows[chat]:echo(" ")
  36.       demonnic.chat.windows[chat]:decho(string.format("<%s,%s,%s:%s,%s,%s>",ofr,ofg,ofb,obr,obg,obb) .. curLine .. "\n")
  37.       if demonnic.chat.config.Alltab then
  38.         demonnic.chat.windows[demonnic.chat.config.Alltab]:decho(fullstamp)
  39.         demonnic.chat.windows[demonnic.chat.config.Alltab]:echo(" ")
  40.         demonnic.chat.windows[demonnic.chat.config.Alltab]:decho(string.format("<%s,%s,%s:%s,%s,%s>",ofr,ofg,ofb,obr,obg,obb) .. curLine .. "\n")
  41.       end
  42.   end
  43.   --demonnic.chat.windows[chat]:append()
  44.   if demonnic.chat.config.gag then
  45.     deleteLine()
  46.     tempLineTrigger(1,1, [[if isPrompt() then deleteLine() end]])
  47.   end
  48.   if demonnic.chat.config.Alltab then
  49.     --appendBuffer(string.format("win%s", demonnic.chat.config.Alltab))
  50.   end
  51.   if demonnic.chat.config.blink and chat ~= demonnic.chat.currentTab then
  52.     if (demonnic.chat.config.Alltab == demonnic.chat.currentTab) and not demonnic.chat.config.blinkOnAll then
  53.       return
  54.     else
  55.       demonnic.chat.tabsToBlink[chat] = true
  56.     end
  57.   end
  58. end
RAW Paste Data