Skip to content

Commit

Permalink
scroll search fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rcuhljr committed Sep 16, 2016
1 parent a760931 commit 591ce98
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions scroll-search.lic
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ class ScrollSearch
end

# Formatted Scroll listing
echo("|#{' Scroll List '.center(73, '=')}|")
echo("|#{'#'.center(5)}|#{'Scroll Name'.center(20)}|#{'Container'.center(30)}|#{'Type'.center(15)}|")
echo("|#{''.center(73, '=')}|")
respond("|#{' Scroll List '.center(83, '=')}|")
respond("|#{'#'.center(5)}|#{'Scroll Name'.center(30)}|#{'Container'.center(30)}|#{'Type'.center(15)}|")
respond("|#{''.center(83, '=')}|")

# Iterate over scrolls to display
current_scrolls.each do |_container, scroll_array|
Expand All @@ -153,9 +153,9 @@ class ScrollSearch
end
end

echo("|#{''.center(73, ' ')}|")
echo("|#{'(;send <get #> or ;send <transfer # to <container>>)'.center(73, ' ')}|")
echo("|#{''.center(73, '=')}|")
respond("|#{''.center(83, ' ')}|")
respond("|#{'(;send <get #> or ;send <transfer # to <container>>)'.center(83, ' ')}|")
respond("|#{''.center(83, '=')}|")

line = get until line.strip =~ /^get\s+(\d+)$|^tran.+\s+(\d+)\s+to\s+(\w+)$/i

Expand Down Expand Up @@ -192,8 +192,8 @@ class ScrollSearch

ordinal = $ORDINALS[index]

case bput("look #{ordinal} #{scroll} in my #{$container}", 'It is labeled ".*\."', '.* of the \w*\s*\w* spell.', 'three-dimensional shapes cover much of the scroll', 'You see nothing unusual.', 'I could not find what you were referring to')
when 'three-dimensional shapes cover much of the scroll'
case bput("look #{ordinal} #{scroll} in my #{$container}", 'It is labeled ".*\."', '.* of the \w*\s*\w* spell.', 'three-dimensional shapes cover much of the', 'You see nothing unusual.', 'I could not find what you were referring to')
when 'three-dimensional shapes cover much of the'
read_scroll(scroll)
when /It is labeled "(.*)\."/i
spell_name = Regexp.last_match(1).empty? ? 'Undefined' : Regexp.last_match(1)
Expand Down Expand Up @@ -235,6 +235,7 @@ class ScrollSearch
# when 'The writing is too small' then hold_scroll(scroll)
end


def transfer_scroll(index, container)
# Retrieve scroll info
scroll_info = get_scroll_info(index)
Expand Down Expand Up @@ -437,7 +438,7 @@ class ScrollSearch
end

def echo_scroll_list_line(index, name, container, type)
echo("|#{index.to_s.center(5)}|#{name.center(20)}|#{container.center(30)}|#{type.center(15)}|")
respond("|#{index.to_s.center(5)}|#{name.center(30)}|#{container.center(30)}|#{type.center(15)}|")
end

def format_bar(padding, value)
Expand Down

0 comments on commit 591ce98

Please sign in to comment.