Skip to content

Commit

Permalink
minor fix, cli simple history support
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Jan 27, 2014
1 parent bb216b3 commit d971df2
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 14 deletions.
9 changes: 9 additions & 0 deletions db/boss.jp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@
4247,覚醒アーサー -技巧の場-,81520
4248,ビスクラヴレット,32600
4249,覚醒ビスクラヴレット,81520
4250,レッドドラゴン,45500
4251,覚醒レッドドラゴン,97700
4252,モルゴース,79600
4253,覚醒モルゴース,190850
4254,エレイン,79600
4255,覚醒エレイン,190850
4256,モーガン,79600
4257,覚醒モーガン,190850
4258,1等級ドラゴン,6685000
9000,ルセーブ,22448
9001,ルセーブ,22448
9002,ルセーブ,22448
Expand Down
32 changes: 20 additions & 12 deletions db/card.jp.txt

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion db/item.jp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,7 @@
2068,闇のページ,たくさん集めると・・・
2069,新春和装P,たくさん集めると・・・
2070,プレミアムスタンプ,たくさん集めると・・・
2071,プレミアムスタンプ判定用,交換カウント用
2071,プレミアムスタンプ判定用,交換カウント用
2072,討伐ポイント,たくさん集めると・・・
2073,プレミアムスタンプ,たくさん集めると・・・
2074,プレミアムスタンプ判定用,交換カウント用
2 changes: 1 addition & 1 deletion db/revision.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cn,219,219,219
tw,204,172,172
kr,231,169,169
jp,225,172,172
jp,226,173,173
16 changes: 16 additions & 0 deletions maclient_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def read_proxy():
# auth()
mode = ['普通', '同时在线']
mod = 0
history = []
while True:
print(du8('This is a kingdom\'s junction. Tell me your select.【Mode:%s Server:%s】\n\n1.进入游戏\t\tas.自动配卡\n2.切换模式->%s\te.刷秘境\n3.编辑卡组\t\tfyb.刷妖精\n4.编辑配置\t\tfcb.因子战\n5.更新数据库\t\tf.好友相关\n6.退出\t\t\th.命令列表%s' % (
mode[mod],
Expand All @@ -141,6 +142,21 @@ def read_proxy():
print(' \b')
except KeyboardInterrupt:
maclient1._exit()
#history
if ch.startswith('!'):
if ch == '!!':
ch = '!1'
if(int(ch[1:])>len(history)):
maclient1.logger.warning('历史越界 idx:%s len:%d'%(ch[1:],len(history)))
continue
else:
ch = history[-int(ch[1:])]
print(du8(ch))
else:
if not history or history[-1] != ch:
history.append(ch)
if len(history)>10:
history = history[-10:]
if ch == '1' or ch == '':
try:
dec = maclient1.login()
Expand Down
4 changes: 4 additions & 0 deletions maclient_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ def load_plugins(self):
glob.glob(opath.join(plugin_dir, '*.pyo'))
# mods=[]
modstr = ''
last_mod = ''
for m in mods:
if m.replace('.pyc','py') in mods:#strip .pyc if .py exists
continue
m = opath.splitext(opath.split(m)[1])[0]
if m.startswith('_'):
continue
Expand All @@ -136,6 +139,7 @@ def load_plugins(self):
except AttributeError:
# no plugin() class
self.plugins_instance[m] = None
last_mod = m

def _line_tracer(self):
# originally from http://stackoverflow.com/questions/19227636/decorator-to-log-function-execution-line-by-line
Expand Down

0 comments on commit d971df2

Please sign in to comment.