X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yoweb-scrape;h=b43e5a2ea728379e9d2fea85243b415fd3e23bb3;hb=8a8bfb9e7cea82cc9d3f73aad297cbacea7719e5;hp=270c09243a9d863d2c24ae570eb29dc7f7894c39;hpb=0a9410eb192a51310353f1d4ca0d28dccdb7a50d;p=ypp-sc-tools.web-live.git diff --git a/yoweb-scrape b/yoweb-scrape index 270c092..b43e5a2 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -43,6 +43,7 @@ import re as regexp import random import curses import termios +import random from optparse import OptionParser from StringIO import StringIO @@ -68,7 +69,7 @@ duty_puzzles = ([ 'Navigating', 'Battle Navigation' ] + core_duty_puzzles + [ 'Treasure Haul' ]) -standingvals = ('Able/Distinguished/Respected/Master'+ +standingvals = ('Able/Proficient/Distinguished/Respected/Master'+ '/Renowned/Grand-Master/Legendary/Ultimate').split('/') standing_limit = len(standingvals) @@ -142,12 +143,14 @@ class Fetcher: min_age = 1 need_wait = 0 for age in ages: - if age < min_age and age < 300: + if age < min_age and age <= 5: debug('Fetcher morewait min=%d age=%d' % (min_age, age)) need_wait = max(need_wait, min_age - age) min_age += 3 min_age *= 1.25 + if need_wait > 0: + need_wait += random.random() - 0.5 return need_wait def _rate_limit_cache_clean(self, now): @@ -476,7 +479,7 @@ class PirateAboard: return pa.pi debug('PirateAboard refresh %d > %d %s' % ( age, guide, pa.name)) - imaginary = [2,6] + imaginary = [2,4] else: imaginary = [1] wait = fetcher.need_wait(now, imaginary) @@ -1213,8 +1216,7 @@ actions: display modes (for --display) apply to ship-aid: --display=dumb just print new information, scrolling the screen - --display=overwrite use cursor motion, selective clear, etc. to redraw at top -''') + --display=overwrite use cursor motion, selective clear, etc. to redraw at top''') ao = pa.add_option ao('-O','--ocean',dest='ocean', metavar='OCEAN', default=None, help='select ocean OCEAN')