Skip to content

Commit

Permalink
Merge branch 'staging' into dr_active_spells
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored Oct 28, 2024
2 parents 67574ed + 1d057a7 commit 1b7e219
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
10 changes: 8 additions & 2 deletions lib/xmlparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class XMLParser

def initialize
@buffer = String.new
@unescape = { 'lt' => '<', 'gt' => '>', 'quot' => '"', 'apos' => "'", 'amp' => '&' }
# @unescape = { 'lt' => '<', 'gt' => '>', 'quot' => '"', 'apos' => "'", 'amp' => '&' }
@bold = false
@active_tags = Array.new
@active_ids = Array.new
Expand Down Expand Up @@ -194,7 +194,6 @@ def make_scar_gsl
end

# def parse(line)
# Lich.log(line)
# @buffer.concat(line)
# loop {
# if (str = @buffer.slice!(/^[^<]+/))
Expand Down Expand Up @@ -233,6 +232,8 @@ def parse_psm3_progressbar(kind, attributes)
PSM_3_DIALOG_IDS = ["Buffs", "Active Spells", "Debuffs", "Cooldowns"]

def tag_start(name, attributes)
# This is called once per element by REXML in games.rb
# https://ruby-doc.org/stdlib-2.6.1/libdoc/rexml/rdoc/REXML/StreamListener.html
begin
@active_tags.push(name)
@active_ids.push(attributes['id'].to_s)
Expand Down Expand Up @@ -628,6 +629,8 @@ def tag_start(name, attributes)
end

def text(text_string)
# This is called once per element with text in it by REXML in games.rb
# https://ruby-doc.org/stdlib-2.6.1/libdoc/rexml/rdoc/REXML/StreamListener.html
begin
# fixme: /<stream id="Spells">.*?<\/stream>/m
# $_CLIENT_.write(text_string) unless ($frontend != 'suks') or (@current_stream =~ /^(?:spellfront|inv|bounty|society)$/) or @active_tags.any? { |tag| tag =~ /^(?:compDef|inv|component|right|left|spell)$/ } or (@active_tags.include?('stream') and @active_ids.include?('Spells')) or (text_string == "\n" and (@last_tag =~ /^(?:popStream|prompt|compDef|dialogData|openDialog|switchQuickBar|component)$/))
Expand Down Expand Up @@ -845,6 +848,9 @@ def text(text_string)
end

def tag_end(name)
# This is called once per element by REXML in games.rb
# https://ruby-doc.org/stdlib-2.6.1/libdoc/rexml/rdoc/REXML/StreamListener.html

begin
if @game =~ /^DR/
if name == 'compass' and $nav_seen
Expand Down
20 changes: 13 additions & 7 deletions lich.rbw
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ for arg in ARGV
end
end

require 'time'
require 'socket'
require 'base64'
require 'digest/md5'
require 'digest/sha1'
require 'drb/drb'
require 'json'
require 'monitor'
require 'net/http'
require 'ostruct'
require 'resolv'
require 'rexml/document'
require 'rexml/streamlistener'
require 'socket'
require 'stringio'
require 'zlib'
require 'drb/drb'
require 'resolv'
require 'digest/md5'
require 'json'
require 'terminal-table'
require 'time'
require 'yaml'
require 'zlib'

# TODO: Move all local requires to top of file
if defined? LIB_DIR
Expand Down

0 comments on commit 1b7e219

Please sign in to comment.