|
|
|
@ -102,17 +102,17 @@ if choice == 1: |
|
|
|
weapon_6 = "Nuclear-Decay" |
|
|
|
spell_6 = "dispell" |
|
|
|
|
|
|
|
usr_7 = "" |
|
|
|
pwrd_7 = "" |
|
|
|
usr_7 = "mutant-warrior-1" |
|
|
|
pwrd_7 = "gupass" |
|
|
|
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 |
|
|
|
weapon_8 = "" |
|
|
|
spell_8 = "" |
|
|
|
weapon_8 = "nuclear-decay" |
|
|
|
spell_8 = "dispell" |
|
|
|
|
|
|
|
if choice == 2: |
|
|
|
usr_1 = "Mtron" |
|
|
|
@ -125,9 +125,6 @@ if choice == 2: |
|
|
|
char_sel_2 = 4 |
|
|
|
weapon_2 = "Nuclear-Decay" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#this is a thing that i wrote |
|
|
|
#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", |
|
|
|
@ -141,7 +138,7 @@ farm_sell_list = ["Gold-Chunck","Nuclear-Rock","Nuclear-Waste"] |
|
|
|
|
|
|
|
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", |
|
|
|
"8 - North", |
|
|
|
@ -489,6 +486,8 @@ class mutant(QWidget): |
|
|
|
if (os.path.exists(self.path) == False): |
|
|
|
os.makedirs(self.path) |
|
|
|
f = open(file, "x") |
|
|
|
f.write("done,done\r\n") |
|
|
|
f.seek(0) |
|
|
|
print("creating "+file) |
|
|
|
else: |
|
|
|
print("File Exists") |
|
|
|
@ -1206,27 +1205,23 @@ class mutant(QWidget): |
|
|
|
|
|
|
|
#Monster took off, remove from list |
|
|
|
if result.find("has just left") != -1: |
|
|
|
try: |
|
|
|
end_index = result.index(' has') |
|
|
|
mon_str = result[:end_index] |
|
|
|
mon_str = mon_str.replace(" ","") |
|
|
|
try: |
|
|
|
self.local_monsters.remove(mon_str) |
|
|
|
except: |
|
|
|
pass |
|
|
|
#print(mon_str) |
|
|
|
#print(self.local_monsters) |
|
|
|
|
|
|
|
#Monster died, remove from list |
|
|
|
if result.find("is crumbling to dust") != -1: |
|
|
|
try: |
|
|
|
end_index = result.index(' is') |
|
|
|
mon_str = result[:end_index] |
|
|
|
mon_str = mon_str.replace(" ","") |
|
|
|
try: |
|
|
|
self.local_monsters.remove(mon_str) |
|
|
|
except: |
|
|
|
pass |
|
|
|
#print(mon_str) |
|
|
|
#print(self.local_monsters) |
|
|
|
|
|
|
|
#Someone picked something up, remove from item list |
|
|
|
if result.find("picked up the") != -1: |
|
|
|
@ -1239,8 +1234,6 @@ class mutant(QWidget): |
|
|
|
self.local_items.remove(item_str) |
|
|
|
except: |
|
|
|
pass |
|
|
|
#print(item_str) |
|
|
|
#print(self.local_items) |
|
|
|
|
|
|
|
#Dead person dropping stuff, add to local list |
|
|
|
if result.find("is falling from") != -1: |
|
|
|
@ -1697,28 +1690,83 @@ class MainWindow(QMainWindow): |
|
|
|
|
|
|
|
#buttons |
|
|
|
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): |
|
|
|
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): |
|
|
|
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): |
|
|
|
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): |
|
|
|
try: |
|
|
|
self.m1.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): |
|
|
|
try: |
|
|
|
self.m1.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 |
|
|
|
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 |
|
|
|
def createModeGroup(self): |
|
|
|
@ -1744,14 +1792,13 @@ class MainWindow(QMainWindow): |
|
|
|
self.setup_mqtt() |
|
|
|
if self.mq_check.isChecked(): |
|
|
|
self.client.publish("mutants/talk", out_str) |
|
|
|
|
|
|
|
#Send mqtt with talking |
|
|
|
def send_mqtt_quiet(self,user,out_str): |
|
|
|
self.setup_mqtt() |
|
|
|
if self.mq_check.isChecked(): |
|
|
|
self.client.publish("mutants/stat/"+user, out_str) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
App = QApplication(sys.argv) |
|
|
|
QApplication.setQuitOnLastWindowClosed(True) |
|
|
|
|