Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- custom_require.call(%w[common common-items])
- no_pause_all
- no_kill_all
- start_script('afk') if !Script.running?('afk')
- start_script('log') if !Script.running?('log')
- class AutoLog
- include DRC
- include DRCI
- def initialize
- @time_in = Time.now
- @time_limit = variable[1]*60 # Convert minutes to seconds
- message('Beginning Autolog. Exiting in ' + args.timer.to_s + ' minutes.')
- main_loop
- shutdown
- end
- def main_loop
- elapsed_time = 0
- time_remaining = 0
- counter = 0
- while ( (@time_in + @time_limit) < Time.now ) )
- pause(30)
- counter += 1
- elapsed_time = counter*30 #already in seconds
- time_remaining = @time_limit - elapsed_time
- # convert counter to minutes
- # ex. 1 iteration; 30/60 = .5, half a minute
- message("AUTOLOG:: Elapsed: #{elapsed_time/60} min Remaining: #{time_remaining} min")
- end
- end
- def shutdown
- stow_hands
- result = ''
- until result =~ /Stow what?/i
- bput('stow feet', 'Stow what?', /^You/i)
- end
- fput('exit')
- end
- end
- before_dying do
- echo 'AutoLog closing...'
- end
- AutoLog.new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement