Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Jan 11, 2014
2 parents e8610d5 + 90986fd commit 47919eb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
6 changes: 3 additions & 3 deletions maclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _dopost(self, urikey, postdata = '', usecookie = True, setcookie = True, ext
if self.cfg_delay == 0:
logging.warning('post:NO DELAY!')
else:
logging.debug('post:slow down...')
#logging.debug('post:slow down...')
time.sleep(random.randint(int(0.75 * self.cfg_delay), int(1.25 * self.cfg_delay)))
resp, _dec = self.poster.post(urikey, postdata, usecookie, setcookie, extraheader, noencrypt, savetraffic, no2ndkey)
self.lastposttime = time.time()
Expand Down Expand Up @@ -1285,10 +1285,10 @@ def fairy_floor(f = fairy):
# if fairy.race_type == '12':#找不到
# disc_name = '公会妖精'
hms = lambda x:x >= 3600 and time.strftime('%H:%M:%S', time.localtime(x + 16 * 3600)) or time.strftime('%M:%S', time.localtime(x))
logging.info('妖精:%sLv%d hp:%d 发现者:%s 小伙伴:%d 剩余%s %s%s' % (
logging.info('妖精:%sLv%d hp:%d 发现者:%s 小伙伴:%d 剩余%s%s%s' % (
fairy.name, fairy.lv, fairy.hp, disc_name,
len(f_attackers), hms(fairy.time_limit),
fairy.race_type == '12' and '公会' or '',
fairy.race_type == '12' and ' 公会' or '',
fairy.wake and ' WAKE!' or ''))
if carddeck:
cardd = carddeck
Expand Down
20 changes: 15 additions & 5 deletions plugins/infinite_guild_fairy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# start meta
__plugin_name__ = '狼娘无限舔公会妖'
__author = 'fffonion'
__version__ = 0.2
__version__ = 0.3
__tip__ = '插件已开启,如需关闭请移除plugins下的infinite_guild_fairy'
hooks = {'EXIT__fairy_battle':10}
# extra cmd hook
Expand All @@ -15,6 +15,7 @@ class plugin(plugin_prototype):
def __init__(self):
self.__name__ = __plugin_name__
self.mac_instance = None
self._ori_logfile = ''

def fairy_floor(self,fairy):
paramfl = 'check=1&race_type=%s&serial_id=%s&user_id=%s' % (
Expand All @@ -27,18 +28,27 @@ def fairy_floor(self,fairy):

def EXIT__fairy_battle(self, *args, **kwargs):
self.logger = args[0].logger
if not self._ori_logfile:#不记录
self._ori_logfile = self.logger.logfile
self.logger.setlogfile('.IGF.log')
fairy=args[1]
if fairy.race_type == '12' and fairy.time_limit != '0':
print(du8("工会妖精!"))
print(du8("公会妖精!"))
self.mac_instance = args[0]
self.mac_instance.lastfairytime=0
if self.mac_instance.player.bc['current']>=2:
time.sleep(5)
fairy=self.fairy_floor(fairy)
if fairy.hp == '0':
if fairy.hp == '0' or fairy.time_limit == '0':
#rollback
self.logger.setlogfile(self._ori_logfile)
self._ori_logfile = ''
return
self.mac_instance._fairy_battle(fairy, kwargs)
else:
print(du8("BC<2,两分钟后再战ww"))
time.sleep(120)
if not self.mac_instance.red_tea(silent = True):
print(du8("BC<2,两分钟后再战ww"))
time.sleep(120)
self.mac_instance._fairy_battle(fairy, kwargs)


0 comments on commit 47919eb

Please sign in to comment.