Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
239
Last Exiva #68
This will cast Exiva on the last person you exiva'd as long as the chat can be read.
You will need to replace the mode values with your servers values.
I will not be supporting/updating this. - so do not even ask.
1.85kb | 69 lines.
local tcLastExiva = setupUI([[
Panel
  id: msgPanel
  height: 26
  anchors.bottom: parent.bottom
  anchors.left: parent.left
  anchors.right: parent.right
  margin-bottom: 20
  anchors.horizontalCenter: parent.horizontalCenter
  text-align: center

  Label
    id: lblMessage
    color: green
    height: 12
    font: verdana-11px-rounded
    background-color: #00000055
    opacity: 0.87
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.bottom: parent.bottom
    text-auto-resize: true
    text-align: center
    text: None.

  Label
    id: lblExiva
    color: orange
    font: verdana-11px-rounded
    height: 12
    background-color: #00000055
    opacity: 0.87
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.bottom: prev.top
    text-auto-resize: true
    text-align: center
    Last Exiva: None

]], modules.game_interface.getMapPanel())

local lastExiva = ''
onTalk(function(name, level, mode, text, channelId, pos)
    if name ~= player:getName() then return end
    text = text:lower()
    --warn(mode.. ':'..text) -- uncomment to find the channel mode.
    if mode == 34 or mode == 44 and text:find('exiva ') then
        lastExiva = string.match(text, [[exiva "([^"]+)]])
        tcLastExiva.lblExiva:setText('Last Exiva: ' .. lastExiva)
    end
end)

onTextMessage(function(mode, text)
    if mode == 20 then
        local regex = "([a-z A-Z]*) is ([a-z -A-Z]*)to the ([a-z -A-Z]*)."
        local data = regexMatch(text, regex)[1]
        if data and data[2] and data[3] then
            schedule(10, function()
                tcLastExiva.lblMessage:setText(text)
            end)
        end
    end
end)

UI.Separator()
tclastExivaMacro = macro(5000, "Last Exiva", "F1", function()
    if lastExiva:len() > 0 then
        say('exiva "' .. lastExiva)
    end
end)
UI.Separator()

09 Nov 2021