diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-03-26 19:32:34 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-03-26 19:32:34 -0300 |
commit | 2e21a7dffb85e2c3dd1e2decab5238fdf8dabd12 (patch) | |
tree | 08bbc7fb006deb09ed1c8091fefc7532efa04ca6 /client | |
parent | 05f0e2db6a1cc35a4d3f3855ff4aa4d54a138a6b (diff) | |
download | tools-2e21a7dffb85e2c3dd1e2decab5238fdf8dabd12.tar.gz tools-2e21a7dffb85e2c3dd1e2decab5238fdf8dabd12.tar.bz2 tools-2e21a7dffb85e2c3dd1e2decab5238fdf8dabd12.tar.xz tools-2e21a7dffb85e2c3dd1e2decab5238fdf8dabd12.zip |
make client updated
Diffstat (limited to 'client')
-rwxr-xr-x | client/dailylogin.py | 86 | ||||
-rwxr-xr-x | client/weapons.py | 89 |
2 files changed, 175 insertions, 0 deletions
diff --git a/client/dailylogin.py b/client/dailylogin.py new file mode 100755 index 0000000..fc9296f --- /dev/null +++ b/client/dailylogin.py @@ -0,0 +1,86 @@ +#!/usr/bin/python2.7 + +# Setup +x=y=0 +i=j=0 + +# Functions +def headers(val): + return '\n\t<dialog name="daily_%d" hideText="true">\n\t\t<menu>\n\t\t\t<text x="45" y="0" width="310" height="30" text="##BDaily Login Rewards##b" />\n <button x="157" y="280" name="Claim" value="Ok" />\n\n' % val + +def tail(): + return '\n\t\t</menu>\n\t</dialog>\n' + +def override_check(vl, over, text1, text2): + global j + if not over: + j=0 + return '\t\t\t<image %s image="graphics/images/%s.png" />\n' % (text1, text2) + else: + j+=1 + if (j == vl): + return '\t\t\t<image %s image="graphics/images/done.png" />\n' % (text1) + elif (j < vl): + return '\t\t\t<image %s image="graphics/images/ok.png" />\n' % (text1) + else: + return "" + +def spammer(val, override=False): + bf="" + + bf+=override_check(val, override, 'x="35" y="35"', 'jexp') + bf+=override_check(val, override, 'x="70" y="35"', 'bexp') + bf+=override_check(val, override, 'x="105" y="35"', 'sc') + bf+=override_check(val, override, 'x="140" y="35"', 'jexp') + bf+=override_check(val, override, 'x="175" y="35"', 'bexp') + + bf+=override_check(val, override, 'x="35" y="70"', 'gp') + bf+=override_check(val, override, 'x="70" y="70"', 'sc') + bf+=override_check(val, override, 'x="105" y="70"', 'bexp') + bf+=override_check(val, override, 'x="140" y="70"', 'gp') + bf+=override_check(val, override, 'x="175" y="70"', 'jexp') + + bf+=override_check(val, override, 'x="35" y="105"', 'bexp') + bf+=override_check(val, override, 'x="70" y="105"', 'gp') + bf+=override_check(val, override, 'x="105" y="105"', 'jexp') + bf+=override_check(val, override, 'x="140" y="105"', 'gift') + bf+=override_check(val, override, 'x="175" y="105"', 'gp') + + bf+=override_check(val, override, 'x="35" y="140"', 'jexp') + bf+=override_check(val, override, 'x="70" y="140"', 'bexp') + bf+=override_check(val, override, 'x="105" y="140"', 'gp') + bf+=override_check(val, override, 'x="140" y="140"', 'jexp') + bf+=override_check(val, override, 'x="175" y="140"', 'bexp') + + bf+=override_check(val, override, 'x="35" y="175"', 'gift') + bf+=override_check(val, override, 'x="70" y="175"', 'jexp') + bf+=override_check(val, override, 'x="105" y="175"', 'bexp') + bf+=override_check(val, override, 'x="140" y="175"', 'gp') + bf+=override_check(val, override, 'x="175" y="175"', 'jexp') + + bf+=override_check(val, override, 'x="35" y="210"', 'bexp') + bf+=override_check(val, override, 'x="70" y="210"', 'gp') + bf+=override_check(val, override, 'x="105" y="210"', 'last') + bf+=override_check(val, override, 'x="140" y="210"', 'sc') + bf+=override_check(val, override, 'x="175" y="210"', 'sc') + + bf+=override_check(val, override, 'x="35" y="245"', 'sc') + + return bf + +# Begin +f=open("daily.tmp", "w") + +f.write('<?xml version="1.0" encoding="utf-8"?>\n<!-- This file is generated automatically, editing it will have no effect.\n (C) Jesusalva, 2019 -->\n<dialogs>') + +while (i < 31): + i+=1 + f.write(headers(i)) + f.write(spammer(i, False)) + f.write('\n\t\t\t<image x="245" y="52" image="graphics/images/final.png" />\n\n\t\t\t<!-- Complete -->\n') + f.write(spammer(i, True)) + f.write(tail()) + +f.write('\n</dialogs>') +f.close() + diff --git a/client/weapons.py b/client/weapons.py new file mode 100755 index 0000000..8dc03d7 --- /dev/null +++ b/client/weapons.py @@ -0,0 +1,89 @@ +#!/usr/bin/python2.7 + +class Item: + def __init__(self, xid): + self.id=xid + self.lvl=0 + +a=open("../../client-data/items.xml", "r") + +swords=[] +bows=[] +shields=[] + +gid="0" +rid=0 +ctx=Item(0) +mem=[] + +for l in a: + if "<item id=" in l: + if ctx.id > 0: + mem.append(ctx) + + gid=l.replace('\t', '').replace(' ','').replace('<itemid=', '').replace('"', '').replace("'", "") + rid=0 + if "-" in gid: + gid="0" + continue + try: + rid=int(gid) + except: + print "[CRITICAL] Invalid item ID format: " + l + exit(1) + + ctx=Item(rid) + + if "\tlevel=" in l or " level=" in l: + gid=l.replace('\t', '').replace(' ','').replace('level=', '').replace('"', '').replace("'", "") + try: + rid=int(gid) + except: + print "[CRITICAL] Invalid item level format: " + l + exit(1) + ctx.lvl=0+rid + +mem=sorted(mem, key=lambda xcv: xcv.lvl, reverse=True) + +for r in mem: + rid=r.id + if rid >= 2700 and rid <= 2899: + shields.append(rid) + elif rid >= 3500 and rid <= 3999: + swords.append(rid) + elif rid >= 6000 and rid <= 6499: + bows.append(rid) + +a.close() + +#shields=sorted(shields, reverse=True) +#bows=sorted(bows, reverse=True) +#swords=sorted(swords, reverse=True) + +b=open("weapons.tmp", "w") + +b.write('<?xml version="1.0" encoding="utf-8"?>\n\ +<!-- Author: 4144, Jesusalva\n\ +Copyright (C) 2015 Evol Online\n\ +Copyright (C) 2018 TMW2: Moubootaur Legends\n -->\n\ +\n\ +<weapons>\n') + +b.write(' <swords>\n') + +for i in swords: + b.write(' <item id="%d"/>\n' % i) + +b.write(' </swords>\n <bows>\n') + +for i in bows: + b.write(' <item id="%d"/>\n' % i) + +b.write(' </bows>\n <shields>\n') + +for i in shields: + b.write(' <item id="%d"/>\n' % i) + +b.write(' </shields>\n</weapons>') + +b.close() |