bdoap 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tty-prompt'
4
+ require 'rainbow'
5
+
6
+ # asks the questions and fires up the recipe search
7
+ module Utils
8
+ class UserCLI
9
+ attr_accessor :silent
10
+
11
+ def initialize(options)
12
+ @silent = options[:silent]
13
+ @prompt = TTY::Prompt.new
14
+ end
15
+
16
+ def yellow(string)
17
+ Rainbow(string).yellow
18
+ end
19
+
20
+ def orange(string)
21
+ Rainbow(string).orange
22
+ end
23
+
24
+ def red(string)
25
+ Rainbow(string).red
26
+ end
27
+
28
+ def green(string)
29
+ Rainbow(string).green
30
+ end
31
+
32
+ def cyan(string)
33
+ Rainbow(string).cyan
34
+ end
35
+
36
+ # log, but cutely
37
+ def vipiko(string)
38
+ puts string unless @silent
39
+ end
40
+
41
+ def vipiko_overwrite(string)
42
+ print "\033[2K\r#{string}"
43
+ $stdout.flush
44
+ end
45
+
46
+ # log for other stuff
47
+ def log(string)
48
+ puts string
49
+ end
50
+
51
+ def add_menu_info(menu, options)
52
+ menu.enum '.'
53
+ menu.help "use arrow keys or numbers 1-#{options.length} to navigate, press enter to select. type to search."
54
+ end
55
+
56
+ def choose_category
57
+ vipiko "\n♫ hello! oh? you want to sell #{yellow 'potions'} today? that sounds like fun!\n\n"
58
+
59
+ option = @prompt.select('which category shall we try to make today?', { cycle: true, filter: true }) do |menu|
60
+ add_menu_info(menu, CLIConstants::CATEGORY_OPTIONS)
61
+ CLIConstants::CATEGORY_OPTIONS.each do |k, v|
62
+ menu.choice "#{k} #{Rainbow(v).faint.white}", k
63
+ end
64
+ end
65
+
66
+ option.to_s
67
+ end
68
+
69
+ def choose_region
70
+ option = @prompt.select('and where are you in the world?', { cycle: true, filter: true }) do |menu|
71
+ add_menu_info(menu, CLIConstants::REGION_DOMAINS)
72
+ CLIConstants::REGION_DOMAINS.each do |k, v|
73
+ menu.choice "#{k} #{Rainbow(v).faint.white}", k
74
+ end
75
+ end
76
+
77
+ option.to_s
78
+ end
79
+
80
+ def choose_lang
81
+ option = @prompt.select('what language would you like to search bdocodex with?', { cycle: true, filter: true }) do |menu|
82
+ add_menu_info(menu, CLIConstants::REGION_LANGUAGES)
83
+ CLIConstants::REGION_LANGUAGES.each do |k, v|
84
+ menu.choice "#{k} #{Rainbow(v).faint.white}", k
85
+ end
86
+ end
87
+
88
+ option.to_s
89
+ end
90
+
91
+ def choose_aggression
92
+ option = @prompt.select('finally, what aggression level would you like to search for recipes with?', { cycle: true, filter: true }) do |menu|
93
+ add_menu_info(menu, CLIConstants::AGGRESSION_LEVELS)
94
+ CLIConstants::AGGRESSION_LEVELS.each do |k, v|
95
+ menu.choice "#{k} #{Rainbow(v).faint.white}", k
96
+ end
97
+ end
98
+
99
+ option.to_s
100
+ end
101
+
102
+ def end_cli
103
+ vipiko "\nnever mind, let's do some #{yellow 'cooking'} together instead! ♫\n\n"
104
+
105
+ @prompt.keypress('(press any key to exit)')
106
+
107
+ exit
108
+ end
109
+ end
110
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bdoap
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - jpegzilla
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-04-21 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: this script allows you to find alchemy recipes from bdocodex.com, compare
13
+ them with live central market prices, and use that information to determine what
14
+ alchemy recipes are currently profitable.
15
+ email: eris@jpegzilla.com
16
+ executables:
17
+ - bdoap
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/bdoap
22
+ - lib/bdo_alchemy_profits.rb
23
+ - lib/bdo_codex/bdo_codex_searcher.rb
24
+ - lib/central_market/category_search_options.rb
25
+ - lib/central_market/market_searcher.rb
26
+ - lib/utils/array_utils.rb
27
+ - lib/utils/constants.rb
28
+ - lib/utils/hash_cache.rb
29
+ - lib/utils/npc_item_index.rb
30
+ - lib/utils/price_calculator.rb
31
+ - lib/utils/recipe_logger.rb
32
+ - lib/utils/user_cli.rb
33
+ homepage: https://github.com/jpegzilla/bdo-alchemy-profits
34
+ licenses:
35
+ - MIT
36
+ metadata: {}
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 3.1.0
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubygems_version: 3.6.7
52
+ specification_version: 4
53
+ summary: this is a tool used to aggregate price and profit data for black desert alchemists.
54
+ test_files: []