 
 casper.run ->
   @echo "Completed #{executed}/#{ARGS[2]} quer#{if executed is 1 then 'y' else 'ies'}."
-  if facebookLogin # if there was an offer to log in with a facebook account
+  if facebook # if there was an offer to log in with a facebook account
     @echo 'Earn more points by linking your Facebook account (not done through bot).'
   @exit executed - ARGS[2] # exit with code (-failed)
    userAgent: hexBot.userAgent
)
DASHBOARD = 'http://www.bing.com/rewards/dashboard'
offers = []; executed = 0; facebookLogin = false

argData = [{name:'email'}, {name:'password'}, {name:'queryCount',default:0},
           {name:'minTime',default:20}, {name:'maxTime',default:40}]

            word = word[0].toUpperCase() + word[1..-1] # randomly capitalize word
        # query bing with the word
        @thenOpen "http://www.bing.com/search?scope=web&setmkt=en-US&q=#{word}", (data) ->
          @echo "#{if data['status'] is 200 then ++executed else 'Failed'}#{if gen then '-gen' else ''}) #{word}"

casper.thenOpen DASHBOARD, getTotalPoints = -> # get the number of unused points on the account
  totalPoints = @getElementInfo('#user-status .user-balance .data-value-text').text
