Auto Exiva: diferenças entre revisões

Fonte: Wot Wiki
Saltar para a navegação Saltar para a pesquisa
(Criou a página com "<span style="font-size: 18px;">Voltar</span> <div class="mw-custom-box"> '''Script Lua:''' <pre> local panelName = "tcLastExiva" local tcLastExiva = setupUI( ExivaLabel < Label height: 12 background-color: #00000055 opacity: 0.89 anchors.horizontalCenter: parent.horizontalCenter text-auto-resize: true font: verdana-11px-rounded Panel id: msgPanel height: 26 width: 100 anchors.bottom: parent.bottom anchors.horizontalCenter: pare...")
 
Sem resumo de edição
 
(Há uma edição intermédia do mesmo utilizador que não está a ser apresentada)
Linha 136: Linha 136:
[[File:v.png|12px]] Inserir a macro em Tolls > Ingame script editor (Caso possua outros scripts, você deverá rolar a barra até o final, saltar alguns espaços e colar o nome em seguida).
[[File:v.png|12px]] Inserir a macro em Tolls > Ingame script editor (Caso possua outros scripts, você deverá rolar a barra até o final, saltar alguns espaços e colar o nome em seguida).


[[file:Anti Push.png]]
[[file:Exiva.png]]


[[File:v.png|12px]] Ter Gold coins em sua Backpack aberta.
[[File:v.png|12px]] Defina uma hotkey para desativar (F1 por exemplo), ative a macro e exive um jogador.

Edição atual desde as 13h25min de 16 de setembro de 2023

Voltar


Script Lua:

local panelName = "tcLastExiva"
local tcLastExiva = setupUI([[
ExivaLabel < Label
  height: 12
  background-color: #00000055
  opacity: 0.89
  anchors.horizontalCenter: parent.horizontalCenter
  text-auto-resize: true
  font: verdana-11px-rounded

Panel
  id: msgPanel
  height: 26
  width: 100
  anchors.bottom: parent.bottom
  anchors.horizontalCenter: parent.horizontalCenter
  margin-bottom: 20

  ExivaLabel
    id: lblMessage
    color: green
    anchors.bottom: parent.bottom
    !text: 'None.'

  ExivaLabel
    id: lblExiva
    color: orange
    anchors.bottom: prev.top
    !text: 'Last Exiva: None'

]], modules.game_interface.getMapPanel())

local tclastExivaUI = setupUI([[
Panel
  margin: 3
  height: 66
  layout:
    type: verticalBox

  HorizontalSeparator
    id: separator

  Label
    id: title
    text: Last Exiva
    margin-top: 1
    text-align: center
    font: verdana-11px-rounded

  Panel
    id: time
    height: 22
    Label
      !text: 'Time in seconds:'
      anchors.left: parent.left
      anchors.verticalCenter: parent.verticalCenter
      anchors.right: next.left
      text-align: center
      height: 15
      margin-right: 6
      font: verdana-11px-rounded

    BotTextEdit
      id: text
      text: 5
      anchors.right: parent.right
      anchors.verticalCenter: parent.verticalCenter
      margin-left: 5
      height: 17
      width: 55
      font: verdana-11px-rounded

  ]], parent)

if not storage[panelName] then
  storage[panelName] = {
    name = '',
    timer = 5,
  }
end

tclastExivaUI.time.text:setText(storage[panelName].timer)
tclastExivaUI.time.text.onTextChange = function(widget, text)
  storage[panelName].timer = tonumber(text)
end

local lastExiva = ''
lastExiva = storage[panelName].name
tcLastExiva.lblExiva:setText('Last Exiva: ' .. lastExiva)

onTalk(function(name, level, mode, text, channelId, pos)
  if name ~= player:getName() then return end
  text = text:lower()
  -- uncomment the warn below to find the channel mode if this doesn't work
  -- cast exiva and you should see NUMBER :  exiva "name"
  -- warn(mode.. ':'..text)
  if (mode == 34 or mode == 44) and text:find('exiva ') then
   lastExiva = string.match(text, [[exiva "([^"]+)]])
    if lastExiva then
      storage[panelName].name = lastExiva
      tcLastExiva.lblExiva:setText('Last Exiva: ' .. lastExiva)
    end
  end
end)

onTextMessage(function(mode, text)
  if mode ~= 20 then return end
  local regex = "([a-z A-Z]*) is ([a-z -A-Z]*)(?:to the|standing|below|above) ([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)

tclastExivaMacro = macro(100, "Enable", "F1", function()
  if lastExiva:len() > 0 then
    say('exiva "' .. lastExiva)
  end
  delay(tonumber(storage[panelName].timer) * 1000)
end, tclastExivaUI)
UI.Separator(tclastExivaUI)

Para que a macro funcione corretamente, será necessário:

Inserir a macro em Tolls > Ingame script editor (Caso possua outros scripts, você deverá rolar a barra até o final, saltar alguns espaços e colar o nome em seguida).

Defina uma hotkey para desativar (F1 por exemplo), ative a macro e exive um jogador.