From 08015a8629f99e09686e205db0a95e3750787764 Mon Sep 17 00:00:00 2001 From: Pawel Orzech Date: Thu, 8 Aug 2019 12:19:36 +0100 Subject: [PATCH] added rank_up feature --- __pycache__/commands.cpython-37.pyc | Bin 118102 -> 118348 bytes commands.py | 26 ++++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/__pycache__/commands.cpython-37.pyc b/__pycache__/commands.cpython-37.pyc index 6bb4c2c20203d16983cda82f98cbae7bbc2cfd0d..6f6db9fefa8ea3b36389e40a9e2050d2c61e77c5 100644 GIT binary patch delta 773 zcma)3TS!z<6g}(QduPTw4@VuHu?&?!ddM_bkwgw5YFg$41!JP1xHkF7(eaWtj7>0K zJr%Cbgo){2WMp~4^HYLURANCz36cF6^bwTwVH6RaTSjJo9(%gjiNUJ@)VXng2c;s_!WB_3g=Sk<> zF`_z^48;|vTt;d&MG+;6^&;(~|6}a0xRUv=VAr)KVqk5QOBMgJmiEV5*6)=R(m*!4 zYa+?2O4Ml1%WpJg=%hCyR~!kSXz2)gz21OSw8Q7y8s5yW7O^*|E$!`jYA7!l+L;%T z%0eB@`C46F0qV8yLmo|=a+x&V81B?E69E)!or!h%F6x90PLl;W)I}|j1qWPk!os7B za1h$zZ619p;TKG>5YoNLn9?(bw}{qUBM%rKX4VEK*66{}9J}qHQ7i>7!jkNo##;UQ z#6AJV`pV5Z5smsDeL+Bvp37<_jOd{|i)K8~_unrOu|Yro=$?#vz4k>q#dH1WOP?Q0 zOv}Ir56W4r5HyR9JJ^{*tbm;=!wujEE2zL@5jM8G7b_-oviJ2Up;o_>yGR(;B*Pl3 zYQ#CgJZe;nNU~!Zx$J8bmMHGB#Q>INd}dFZ(IenBt7yRi88LRX8!nr5eL5eRF^EJ? zl+6}mxRi>e%hTX2Pa8o_P>z05a;j}CZP?j$PB_`;4)V_xP< bY@fxT36pH@A!aDPv9ojNr6@|$CusZ$xslks delta 537 zcmXw!Pe>GT6vuzxnc110*_n0QR$cQ?5rIhb2RgNASZk>yv{}Mpe<+xO#17Vg7Q42~ zTnajDOzVUcn-m=)Qu`H8ge=M^&9F$!4jrQ)p+mKGY&P;8-r@7U-|u^G?z*x#tOR!% zhQ_=q{@QzF?UV7~pd;L2PNt*9DYVJQOudSkMionomfs9oYD%DTgspgOL|NMB=~j7u--_R42UtVcIo_V&b@@&R4Z71ey*be8opR<; zsqJ@u4|QXM(^y}thJ+CO(3Ki~+3gmEqQbupCnQAp_Cm9P1V4YTPsAp^JnF%A-t_Q; zh+bYkvCk)8Q5icMb4N3%;};)KD*9vzTq}JH$<4-5%}>3klu*mFGtV{b;ky^Y0$%du z;?^BlqDv8ciwZG=&c#s#^=?5Rf*~4+TnaFEo7;{UYY6u?I;F7UeBObVTWH2IFN| zau4UwkB_vF!#hdNhP{-GyR!!sPNtyJY#wX;$kFE;Xcm>ztG($Ia|h#|zhwk(gD|Lk m3~dUQ=_p}NLyR^)!&Mo#>FFy>3HVMIUSmK&z5C}44*msoO`|{n diff --git a/commands.py b/commands.py index 3af09e1..bb10784 100644 --- a/commands.py +++ b/commands.py @@ -2018,23 +2018,29 @@ def rank_up(): current_rank = int(r.json()['user']['rank']) print('Your current rank is: ' +str(current_rank)) - goal_rank = (input('What rank would you like to achieve? \n')) - print('Ok, farming till rank: ' +(goal_rank)) + goal_rank = int(input('What rank would you like to achieve? \n')) + print('Ok, farming till rank: ' +str(goal_rank)) # just for bugtracking # with open('personal.json', 'w') as json_file: # json.dump(r.json(), json_file) - levels_to_farm = int(goal_rank) - int(r.json()['user']['rank']) - print('Levels to farm: ' +str(levels_to_farm)) + levels_to_farm = goal_rank - current_rank + print(Fore.REDr + Style.BRIGHT + 'Levels to farm: ' +str(levels_to_farm)) - while current_rank < goal_rank: + while int(current_rank) < int(goal_rank): #If your current rank is lower than goal rank we gonna farm. - - - if int(goal_rank) == int(current_rank): - #If your current rank and goal rank are the same we are going to stop farming. - print('It is done. Your rank is: ' +str(goal_rank)) + print('Farming...') + complete_stage('27003', 4) + #test: + #complete_stage('1001', 2) + r = requests.get(url, headers=headers) + current_rank = int(r.json()['user']['rank']) + print('Your current rank is: ' +str(current_rank)) + levels_to_farm = goal_rank - current_rank + print('Still to go: ' +str(levels_to_farm)) + if goal_rank == current_rank: + print(Fore.GREEN + Style.BRIGHT + 'Done!') ####################################################################