Browse Source

12/26/2022

BradDev
Joe DiPrima 3 years ago
parent
commit
ee766e48b3
  1. 2
      .gitignore
  2. 113
      qmutants.py

2
.gitignore

@ -7,3 +7,5 @@ assassin/
mercenary/ mercenary/
robin-hood/ robin-hood/
doctor/ doctor/
mutant-warrior-1/
mutant-warrior-2/

113
qmutants.py

@ -102,17 +102,17 @@ if choice == 1:
weapon_6 = "Nuclear-Decay" weapon_6 = "Nuclear-Decay"
spell_6 = "dispell" spell_6 = "dispell"
usr_7 = ""
pwrd_7 = ""
usr_7 = "mutant-warrior-1"
pwrd_7 = "gupass"
char_sel_7 = 4 char_sel_7 = 4
weapon_7 = ""
spell_7 = ""
weapon_7 = "nuclear-decay"
spell_7 = "dispell"
usr_8 = ""
pwrd_8 = ""
usr_8 = "mutant-warrior-2"
pwrd_8 = "gupass"
char_sel_8 = 4 char_sel_8 = 4
weapon_8 = ""
spell_8 = ""
weapon_8 = "nuclear-decay"
spell_8 = "dispell"
if choice == 2: if choice == 2:
usr_1 = "Mtron" usr_1 = "Mtron"
@ -125,9 +125,6 @@ if choice == 2:
char_sel_2 = 4 char_sel_2 = 4
weapon_2 = "Nuclear-Decay" weapon_2 = "Nuclear-Decay"
#this is a thing that i wrote #this is a thing that i wrote
#static lists #static lists
convert_list = ["Ion-Pack","Ion-Decay","Cheese","Nuclear-thong","Skull","Bottle-Cap","Cigarette-Butt","Knife","Gas-Grenade","Leather-Vest","Buckler","Bola","Bug-Plate", convert_list = ["Ion-Pack","Ion-Decay","Cheese","Nuclear-thong","Skull","Bottle-Cap","Cigarette-Butt","Knife","Gas-Grenade","Leather-Vest","Buckler","Bola","Bug-Plate",
@ -141,7 +138,7 @@ farm_sell_list = ["Gold-Chunck","Nuclear-Rock","Nuclear-Waste"]
farm_stock_list = ["Nuclear-Decay","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"]
friend_list = ["Epilectrik","ImBait","Mtron","Im","IonJunkies-Merc","Robin-Hood","Doctor","Assassin","Mercenary","Mutant-warrior-1","Mutant-warrior-2"]
help_list = ["$ - Key listener on/off", help_list = ["$ - Key listener on/off",
"8 - North", "8 - North",
@ -489,6 +486,8 @@ class mutant(QWidget):
if (os.path.exists(self.path) == False): if (os.path.exists(self.path) == False):
os.makedirs(self.path) os.makedirs(self.path)
f = open(file, "x") f = open(file, "x")
f.write("done,done\r\n")
f.seek(0)
print("creating "+file) print("creating "+file)
else: else:
print("File Exists") print("File Exists")
@ -539,7 +538,7 @@ class mutant(QWidget):
def heal_trig(self): def heal_trig(self):
if self.heal and self.logged_in and self.in_play: if self.heal and self.logged_in and self.in_play:
self.command_str.emit("heal\r\n") self.command_str.emit("heal\r\n")
# self.mqtt_str_quiet.emit(self.user," is healing." )
#self.mqtt_str_quiet.emit(self.user," is healing." )
#wield timer #wield timer
def wield_trig(self): def wield_trig(self):
@ -1206,27 +1205,23 @@ class mutant(QWidget):
#Monster took off, remove from list #Monster took off, remove from list
if result.find("has just left") != -1: if result.find("has just left") != -1:
try:
end_index = result.index(' has') end_index = result.index(' has')
mon_str = result[:end_index] mon_str = result[:end_index]
mon_str = mon_str.replace(" ","") mon_str = mon_str.replace(" ","")
try:
self.local_monsters.remove(mon_str) self.local_monsters.remove(mon_str)
except: except:
pass pass
#print(mon_str)
#print(self.local_monsters)
#Monster died, remove from list #Monster died, remove from list
if result.find("is crumbling to dust") != -1: if result.find("is crumbling to dust") != -1:
try:
end_index = result.index(' is') end_index = result.index(' is')
mon_str = result[:end_index] mon_str = result[:end_index]
mon_str = mon_str.replace(" ","") mon_str = mon_str.replace(" ","")
try:
self.local_monsters.remove(mon_str) self.local_monsters.remove(mon_str)
except: except:
pass pass
#print(mon_str)
#print(self.local_monsters)
#Someone picked something up, remove from item list #Someone picked something up, remove from item list
if result.find("picked up the") != -1: if result.find("picked up the") != -1:
@ -1239,8 +1234,6 @@ class mutant(QWidget):
self.local_items.remove(item_str) self.local_items.remove(item_str)
except: except:
pass pass
#print(item_str)
#print(self.local_items)
#Dead person dropping stuff, add to local list #Dead person dropping stuff, add to local list
if result.find("is falling from") != -1: if result.find("is falling from") != -1:
@ -1697,28 +1690,83 @@ class MainWindow(QMainWindow):
#buttons #buttons
def n_btn(self): def n_btn(self):
self.m1.command_str.emit("north\r\n")
self.m2.command_str.emit("north\r\n")
self.send_all("north\r\n")
def s_btn(self): def s_btn(self):
self.m1.command_str.emit("south\r\n")
self.m2.command_str.emit("south\r\n")
self.send_all("south\r\n")
def e_btn(self): def e_btn(self):
self.m1.command_str.emit("east\r\n")
self.m2.command_str.emit("east\r\n")
self.send_all("east\r\n")
def w_btn(self): def w_btn(self):
self.m1.command_str.emit("west\r\n")
self.m2.command_str.emit("west\r\n")
self.send_all("west\r\n")
def h_btn(self): def h_btn(self):
try:
self.m1.heal = True self.m1.heal = True
self.m2.heal = True self.m2.heal = True
except:
pass
try:
self.m3.heal = True
self.m4.heal = True
except:
pass
try:
self.m5.heal = True
self.m6.heal = True
except:
pass
try:
self.m7.heal = True
self.m8.heal = True
except:
pass
def c_btn(self): def c_btn(self):
try:
self.m1.combat_start() self.m1.combat_start()
self.m2.combat_start() self.m2.combat_start()
except:
pass
try:
self.m3.combat_start()
self.m4.combat_start()
except:
pass
try:
self.m5.combat_start()
self.m6.combat_start()
except:
pass
try:
self.m7.combat_start()
self.m8.combat_start()
except:
pass
#Button send text #Button send text
def send_str(self): def send_str(self):
self.m1.command_str.emit(self.text_input.text()+"\r\n")
self.m2.command_str.emit(self.text_input.text()+"\r\n")
self.send_all(self.text_input.text())
def send_all(self,out_str):
try:
self.m1.command_str.emit(out_str+"\r\n")
self.m2.command_str.emit(out_str+"\r\n")
except:
pass
try:
self.m3.command_str.emit(out_str+"\r\n")
self.m4.command_str.emit(out_str+"\r\n")
except:
pass
try:
self.m5.command_str.emit(out_str+"\r\n")
self.m6.command_str.emit(out_str+"\r\n")
except:
pass
try:
self.m7.command_str.emit(out_str+"\r\n")
self.m8.command_str.emit(self.text_input.text()+"\r\n")
except:
pass
#Creates the form groupbox #Creates the form groupbox
def createModeGroup(self): def createModeGroup(self):
@ -1744,14 +1792,13 @@ class MainWindow(QMainWindow):
self.setup_mqtt() self.setup_mqtt()
if self.mq_check.isChecked(): if self.mq_check.isChecked():
self.client.publish("mutants/talk", out_str) self.client.publish("mutants/talk", out_str)
#Send mqtt with talking #Send mqtt with talking
def send_mqtt_quiet(self,user,out_str): def send_mqtt_quiet(self,user,out_str):
self.setup_mqtt() self.setup_mqtt()
if self.mq_check.isChecked(): if self.mq_check.isChecked():
self.client.publish("mutants/stat/"+user, out_str) self.client.publish("mutants/stat/"+user, out_str)
if __name__ == "__main__": if __name__ == "__main__":
App = QApplication(sys.argv) App = QApplication(sys.argv)
QApplication.setQuitOnLastWindowClosed(True) QApplication.setQuitOnLastWindowClosed(True)

Loading…
Cancel
Save