Class: TravianBot::Application
- Inherits:
-
Object
- Object
- TravianBot::Application
- Extended by:
- Buildings, Connection, Display, Queue
- Defined in:
- lib/travian_bot/application.rb,
lib/travian_bot/application/queue.rb,
lib/travian_bot/application/display.rb,
lib/travian_bot/application/buildings.rb,
lib/travian_bot/application/connection.rb,
lib/travian_bot/application/navigation.rb
Defined Under Namespace
Modules: Buildings, Connection, Display, Navigation, Queue
Class Method Summary collapse
- .current_avaible_buildings ⇒ Object
- .current_building_queue ⇒ Object
- .current_troop_movements ⇒ Object
-
.run!(*arguments) ⇒ Object
Is executed by the travinbot shell script.
Methods included from Buildings
Methods included from Navigation
#to_map_page, #to_reports_page, #to_resources_page, #to_stats_page, #to_village_page
Methods included from Display
Methods included from Queue
building_queue, troop_movement
Methods included from Connection
Class Method Details
.current_avaible_buildings ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/travian_bot/application.rb', line 27 def current_avaible_buildings h2 'Avaible buildings' buildings = avaible_buildings(@game) buildings.each do |building| puts building.to_s end new_line end |
.current_building_queue ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/travian_bot/application.rb', line 37 def current_building_queue h2('Current building queue') buildings = building_queue(@game) if buildings.empty? text 'nothing building' else buildings.each do |building| puts building.to_s end new_line end end |
.current_troop_movements ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/travian_bot/application.rb', line 51 def current_troop_movements h2('Current troop movement') troops = troop_movement(@game) if troops.empty? text 'No troops movement' else troops.each do |troop| puts troop.to_s end new_line end end |
.run!(*arguments) ⇒ Object
Is executed by the travinbot shell script.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/travian_bot/application.rb', line 14 def run!(*arguments) h1('Welcome to your TravianBot') @game = login current_building_queue current_troop_movements current_avaible_buildings @game.quit return 1 end |