From f6da104a2bef77df136283fe58e356fb5e209bdf Mon Sep 17 00:00:00 2001 From: Joe DiPrima Date: Sat, 24 Dec 2022 12:10:36 -0600 Subject: [PATCH] 12/24/2022 --- qmutants.py | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/qmutants.py b/qmutants.py index b4fc11a..e704db1 100644 --- a/qmutants.py +++ b/qmutants.py @@ -81,7 +81,7 @@ convert_list = ["Ion-Pack","Ion-Decay","Cheese","Nuclear-thong","Skull","Bottle- farm_sell_list = ["Gold-Chunck","Nuclear-Rock","Nuclear-Waste"] -farm_stock_list = ["Nuclear-Decay","Troll-Skin","Invisible-Cloth","Eazy-Armor","Hell-Blade"] +farm_stock_list = ["Nuclear-Decay","Eazy-Armor","Hell-Blade"] friend_list = ["Epilectrik","ImBait","Mtron","Im","IonJunkies-Merc","Robin-Hood","Doctor","Assassin","Mercenary"] @@ -735,18 +735,23 @@ class mutant(QWidget): self.status += result if result.find(">") != -1: self.stat_parsed = True - + #Retally items, convert extras if self.stat_parsed and self.status != "": for item_l in farm_sell_list: x = self.status.count(item_l) for i in range(x): - self.sell_list.append(item_l) - + if i < 3: + self.sell_list.append(item_l) + else: + self.command_str.emit("con "+item_l+"\r\n") + for item_l in farm_stock_list: x = self.status.count(item_l) for i in range(x): - self.stock_list.append(item_l) - + if i < 3: + self.stock_list.append(item_l) + else: + self.command_str.emit("con "+item_l+"\r\n") #HP if self.status.find("Hit Points :") != -1: start_index = self.status.index('Hit Points : ') + 15 @@ -838,8 +843,6 @@ class mutant(QWidget): year_str = year_str[:end_index] #print("Year:" + year_str) self.farm_year = int(year_str) - - self.status = "" #index area @@ -904,6 +907,23 @@ class mutant(QWidget): self.area = "" + #drop + def exit_game(self): + self.in_combat=False + self.heal = False + self.wander = False + self.auto_farm = False + self.auto_combat = False + self.in_play = False + self.hunt = False + + self.ac_check.setChecked(False) + self.af_check.setChecked(False) + self.ai_check.setChecked(False) + self.me_check.setChecked(False) + self.ba_check.setChecked(False) + self.hu_check.setChecked(False) + #Main game loop def mutants(self,result): #update farm year text box @@ -993,7 +1013,7 @@ class mutant(QWidget): #scrapers if result.find("(N)onstop, (Q)uit, or (C)ontinue?") != -1: - self.command_str.emit("C\r\n") + self.command_str.emit("C") #ion starvation if result.find("You're starving for IONS!") != -1: @@ -1035,6 +1055,7 @@ class mutant(QWidget): #Exit game if.. if self.in_combat and result.find("You're not carrying a "+self.weapon.lower()) != -1: self.command_str.emit("x\r\n") + self.exit_game() #GTFO if self.wander and (((result.find("It's too dark to see anything!") != -1 and self.path_step == 0) or @@ -1140,16 +1161,7 @@ class mutant(QWidget): self.mqtt_str.emit(self.user+" has died") self.mqtt_str_quiet.emit(self.user," has died") print("MQTT signal emitted") - self.in_combat=False - self.heal = False - self.wander = False - self.auto_farm = False - self.auto_combat = False - self.in_play = False - self.ac_check.setChecked(False) - self.af_check.setChecked(False) - self.ai_check.setChecked(False) - self.me_check.setChecked(False) + self.exit_game() #farm items if len(self.local_items) > 0 and not self.in_combat and not self.path_step: @@ -1325,7 +1337,7 @@ class mutant(QWidget): self.command_str.emit(self.password+"\r\n") if result == "(N)onstop, (Q)uit, or (C)ontinue?": - self.command_str.emit("Q\r\n") + self.command_str.emit("Q") if result == "Make your selection (G,T,F,M,S,? for help, or X to exit): ": self.command_str.emit("G\r\n")