################################### # Main # change the main block code from origin pawnee bot #@author : dimas # bittenova@yahoo.com ###################################
begin puts '' puts '++++++++++++++++++++++++++++++++++++++++++++' puts '++++++++++++++++++++++++++++++++++++++++++++' puts '>>>>>>>>>>>>>> BOT START <<<<<<<<<<<<<<<<<<<' puts '>>>>>>>>>>>>>> BOT START <<<<<<<<<<<<<<<<<<<' puts '>>>>>>>>>>>>>> BOT START <<<<<<<<<<<<<<<<<<<' puts '++++++++++++++++++++++++++++++++++++++++++++' puts '++++++++++++++++++++++++++++++++++++++++++++' puts '' #puts 'Build queue is :'+ sBuildQueue.to_s #puts 'CastleId is :'+ sResdId.to_s #puts 'EmbassyId is :'+ sEmbassyId puts '' while true for iBuildId in sBuildQueue begin # add puts '' puts '++++++++++++++++++++++++++++++++++++++++++++' puts 'Upgrade Buildingid : '+iBuildId.to_s puts '++++++++++++++++++++++++++++++++++++++++++++' puts '' if(authorize(http, parser, usrname, passwd)) puts '' puts 'authorize success ...' puts 'try to build ...' res = build(http, parser, iBuildId) else puts '(!!!) Login failure' puts '(!!!) Login retry' retry end sSleep = rand(sSleeptime) puts '' puts '++++++++++++++++++++++++++++++++++++++++++++' puts '(!!!) Will be sleep for '+sSleep.to_s+' seconds' puts '(!!!) Wake up @:' + (Time.new + sSleep).to_s puts '++++++++++++++++++++++++++++++++++++++++++++' puts '' sleep(sSleep) rescue puts '' puts '(!!!) retry ... ' puts '(!!!) reconnect ' puts '' end # add end end rescue #iBuildId = iBuildId.next puts '' puts '++++++++++++++++++++++++++++++++++++++++++++' puts 'last fail buildId : '+iBuildId.to_s puts 'Final code section' puts '++++++++++++++++++++++++++++++++++++++++++++' puts '' retry end