lib/travian_bot/application.rb in travian_bot-0.2.3 vs lib/travian_bot/application.rb in travian_bot-0.2.4

- old
+ new

@@ -14,17 +14,18 @@ # Is executed by the travinbot shell script. def run!(*arguments) h1('Welcome to your TravianBot') @game = login - h2('Your avaible actions') - #command = gets - #self.send(command) current_building_queue current_troop_movements current_avaible_buildings - start_closest_adventure @game + + h2('Custom actions actions') + text 'closest_adventure' + command = gets + start_closest_adventure @game if command == 'closest_adventure' @game.quit return 1 end @@ -32,42 +33,42 @@ @game ||= login h2 'Avaible buildings' buildings = avaible_buildings(@game) buildings.each do |building| - puts building.to_s + text building.to_s end new_line end def current_building_queue @game ||= login h2('Current building queue') buildings = building_queue(@game) if buildings.empty? - text 'nothing building' + warning 'nothing building' else buildings.each do |building| - puts building.to_s + text building.to_s end - new_line - end + end + new_line end def current_troop_movements @game ||= login h2('Current troop movement') troops = troop_movement(@game) if troops.empty? - text 'No troops movement' + warning 'No troops movement' else troops.each do |troop| - puts troop.to_s + text troop.to_s end - new_line end + new_line end end end end