melancholytron 3 years ago
parent
commit
cd9f006322
  1. 46
      qmutants.py

46
qmutants.py

@ -123,7 +123,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"]
@ -777,18 +777,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):
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):
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
@ -880,8 +885,6 @@ class mutant(QWidget):
year_str = year_str[:end_index]
#print("Year:" + year_str)
self.farm_year = int(year_str)
self.status = ""
#index area
@ -946,6 +949,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
@ -1035,7 +1055,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:
@ -1077,6 +1097,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
@ -1182,16 +1203,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:
@ -1367,7 +1379,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")

Loading…
Cancel
Save