Browse Source

12/28/2022

BradDev
Joe DiPrima 3 years ago
parent
commit
445e4fc136
  1. 200
      qmutants.py

200
qmutants.py

@ -51,12 +51,12 @@ def player_add(usr,pwd,char_sel,weapon,spell,ac,ai,me,af,hu,ba):
player_list.append(plyr) player_list.append(plyr)
if choice == 1: if choice == 1:
player_add("epilectrik","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False)
player_add("im bait","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False)
player_add("doctor","gupass",2,"Nuclear-Decay","cure poison",True,True,True,True,True,False)
player_add("robin-hood","gupass",1,"Nuclear-Decay","invisibility",True,True,True,True,True,False)
player_add("assassin","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False)
player_add("mercenary","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False)
player_add("epilectrik","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False)
player_add("im bait","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False)
player_add("doctor","gupass",2,"Nuclear-Decay","cure poison",True,True,True,False,True,False)
player_add("robin-hood","gupass",1,"Nuclear-Decay","invisibility",True,True,True,False,True,False)
player_add("assassin","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False)
player_add("mercenary","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False)
player_add("mutant-warrior-1","gupass",4,"Nuclear-Decay","dispell",True,True,False,False,False,False) player_add("mutant-warrior-1","gupass",4,"Nuclear-Decay","dispell",True,True,False,False,False,False)
player_add("mutant-warrior-2","gupass",4,"Nuclear-Decay","dispell",True,True,False,False,False,False) player_add("mutant-warrior-2","gupass",4,"Nuclear-Decay","dispell",True,True,False,False,False,False)
@ -123,6 +123,7 @@ class mutant(QWidget):
self.sell_list = [] self.sell_list = []
self.stock_list = [] self.stock_list = []
self.bank_list = [] self.bank_list = []
self.cmd_buffer = []
#modes #modes
self.heal = False self.heal = False
@ -149,6 +150,8 @@ class mutant(QWidget):
self.weapon = "Nuclear-Decay" self.weapon = "Nuclear-Decay"
self.spell = player.spell self.spell = player.spell
self.watchdog = 0 self.watchdog = 0
self.cmd_watchdog = 0
self.prompt = False
#value tracking #value tracking
self.riblets = 0 self.riblets = 0
@ -205,7 +208,11 @@ class mutant(QWidget):
self.watchdog_timer.setInterval(30000) self.watchdog_timer.setInterval(30000)
self.watchdog_timer.timeout.connect(self.watchdog_t) self.watchdog_timer.timeout.connect(self.watchdog_t)
self.watchdog_timer.start() self.watchdog_timer.start()
#cmd watchdog
self.watchdog_cmd_timer = QTimer()
self.watchdog_cmd_timer.setInterval(100)
self.watchdog_cmd_timer.timeout.connect(self.watchdog_cmd)
self.watchdog_cmd_timer.start()
#layout stuff #layout stuff
self.layout = QVBoxLayout() self.layout = QVBoxLayout()
@ -247,6 +254,17 @@ class mutant(QWidget):
#self.set_color() #self.set_color()
def send_cmd(self,cmd_str):
if self.prompt:
self.command_str.emit(cmd_str)
else:
self.cmd_buffer.append(cmd_str)
def transmit_bfr(self):
while len(self.cmd_buffer)>0:
self.command_str.emit(self.cmd_buffer[0])
self.cmd_buffer.pop(0)
def set_color(self): def set_color(self):
self.setAttribute(Qt.WA_StyledBackground, True) self.setAttribute(Qt.WA_StyledBackground, True)
self.setStyleSheet('background-color: red;') self.setStyleSheet('background-color: red;')
@ -402,16 +420,16 @@ class mutant(QWidget):
#buttons #buttons
def n_btn(self): def n_btn(self):
self.command_str.emit("north\r\n")
self.send_cmd("north\r\n")
def s_btn(self): def s_btn(self):
self.command_str.emit("south\r\n")
self.send_cmd("south\r\n")
def e_btn(self): def e_btn(self):
self.command_str.emit("east\r\n")
self.send_cmd("east\r\n")
def w_btn(self): def w_btn(self):
self.command_str.emit("west\r\n")
self.send_cmd("west\r\n")
def h_btn(self): def h_btn(self):
self.heal = True self.heal = True
@ -423,10 +441,10 @@ class mutant(QWidget):
self.path_step=1 self.path_step=1
def l_btn(self): def l_btn(self):
self.command_str.emit("look\r\n")
self.send_cmd("look\r\n")
def st_btn(self): def st_btn(self):
self.command_str.emit("stat\r\n")
self.send_cmd("stat\r\n")
#load bank file #load bank file
def load_bank_paths(self): def load_bank_paths(self):
@ -450,7 +468,7 @@ class mutant(QWidget):
#Button send text #Button send text
def send_str(self): def send_str(self):
self.command_str.emit(self.text_input.text()+"\r\n")
self.send_cmd(self.text_input.text()+"\r\n")
#auto combat checked #auto combat checked
def ac_checked(self): def ac_checked(self):
@ -485,13 +503,13 @@ class mutant(QWidget):
#heal timer #heal timer
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.send_cmd("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):
if self.in_combat and self.logged_in and self.in_play: if self.in_combat and self.logged_in and self.in_play:
self.command_str.emit("wie "+self.weapon+"\r\n")
self.send_cmd("wie "+self.weapon+"\r\n")
#wander timer #wander timer
def wander_trig(self): def wander_trig(self):
@ -504,7 +522,7 @@ class mutant(QWidget):
#increment no action counter #increment no action counter
self.no_action_cnt = self.no_action_cnt + 1 self.no_action_cnt = self.no_action_cnt + 1
if len(self.direction_list) == 0: if len(self.direction_list) == 0:
self.command_str.emit("look\r\n")
self.send_cmd("look\r\n")
#pick randomly #pick randomly
if len(self.direction_list) > 0: if len(self.direction_list) > 0:
@ -527,15 +545,15 @@ class mutant(QWidget):
except: except:
pass pass
self.command_str.emit(dir_choice+"\r\n")
self.send_cmd(dir_choice+"\r\n")
self.direction_list = [] self.direction_list = []
self.previous_dir = opposite_dir[dir_choice] self.previous_dir = opposite_dir[dir_choice]
#stat timer #stat timer
def stat_trig(self): def stat_trig(self):
if self.logged_in and self.in_play and not self.in_combat and self.path_step == 0: if self.logged_in and self.in_play and not self.in_combat and self.path_step == 0:
self.command_str.emit("stat\r\n")
self.command_str.emit("look\r\n")
self.send_cmd("stat\r\n")
self.send_cmd("look\r\n")
#path timer #path timer
def path_trig(self): def path_trig(self):
@ -554,8 +572,8 @@ class mutant(QWidget):
for item_l in self.local_items: for item_l in self.local_items:
for item in convert_list: for item in convert_list:
if item_l == item: if item_l == item:
self.command_str.emit("get "+item+"\r\n")
self.command_str.emit("con "+item+"\r\n")
self.send_cmd("get "+item+"\r\n")
self.send_cmd("con "+item+"\r\n")
self.mqtt_str_quiet.emit(self.user," converted " + item ) self.mqtt_str_quiet.emit(self.user," converted " + item )
try: try:
self.local_items.remove(item_l) self.local_items.remove(item_l)
@ -567,7 +585,7 @@ class mutant(QWidget):
for item_l in self.local_items: for item_l in self.local_items:
for item in farm_sell_list: for item in farm_sell_list:
if item_l == item: if item_l == item:
self.command_str.emit("get "+item+"\r\n")
self.send_cmd("get "+item+"\r\n")
self.local_items.remove(item_l) self.local_items.remove(item_l)
self.sell_list.append(item_l) self.sell_list.append(item_l)
self.no_action_cnt = 0 self.no_action_cnt = 0
@ -577,7 +595,7 @@ class mutant(QWidget):
for item_l in self.local_items: for item_l in self.local_items:
for item in farm_stock_list: for item in farm_stock_list:
if item_l == item: if item_l == item:
self.command_str.emit("get "+item+"\r\n")
self.send_cmd("get "+item+"\r\n")
self.local_items.remove(item_l) self.local_items.remove(item_l)
self.stock_list.append(item_l) self.stock_list.append(item_l)
self.no_action_cnt = 0 self.no_action_cnt = 0
@ -588,22 +606,27 @@ class mutant(QWidget):
while len(self.sell_list) > 0: while len(self.sell_list) > 0:
item_l=self.sell_list[0] item_l=self.sell_list[0]
self.sell_list.pop(0) self.sell_list.pop(0)
self.command_str.emit("sell "+item_l+"\r\n")
self.send_cmd("sell "+item_l+"\r\n")
time.sleep(.05) time.sleep(.05)
#Stock #Stock
def stock_items(self): def stock_items(self):
print(self.stock_list) print(self.stock_list)
while len(self.stock_list) > 0:
item_l=self.stock_list[0]
self.stock_list.pop(0)
self.command_str.emit("stock "+item_l+"\r\n")
time.sleep(.05)
for item_s in farm_stock_list:
for item in self.stock_list:
if item == item_s:
cnt = self.stock_list.count(item)
if item == self.weapon:
cnt = cnt - 1
for x in range(cnt):
self.send_cmd("stock "+item+"\r\n")
self.stock_list.remove(item)
time.sleep(.05)
#Drop monster baits #Drop monster baits
def drop_baits(self): def drop_baits(self):
while self.stock_list.count("Monster-Bait") > 1: while self.stock_list.count("Monster-Bait") > 1:
self.command_str.emit("drop monster-bait\r\n")
self.send_cmd("drop monster-bait\r\n")
self.stock_list.remove("Monster-Bait") self.stock_list.remove("Monster-Bait")
#Remove friends from monster list #Remove friends from monster list
@ -636,7 +659,7 @@ class mutant(QWidget):
#initiate combat #initiate combat
def combat_start(self): def combat_start(self):
try: try:
self.command_str.emit("combat " + self.local_monsters[0]+"\r\n")
self.send_cmd("combat " + self.local_monsters[0]+"\r\n")
self.mqtt_str_quiet.emit(self.user," is attacking " + self.local_monsters[0] ) self.mqtt_str_quiet.emit(self.user," is attacking " + self.local_monsters[0] )
except: except:
pass pass
@ -678,8 +701,8 @@ class mutant(QWidget):
self.hits = self.hits + 1 self.hits = self.hits + 1
if self.hits == 2: if self.hits == 2:
self.command_str.emit("heal\r\n")
self.command_str.emit("heal\r\n")
self.send_cmd("heal\r\n")
self.send_cmd("heal\r\n")
self.hits = 0 self.hits = 0
if result.find("have slain") != -1 or result.find("has just left") != -1 or result.find("isn't around here!") != -1 or result.find("You're not ready") != -1: if result.find("have slain") != -1 or result.find("has just left") != -1 or result.find("isn't around here!") != -1 or result.find("You're not ready") != -1:
@ -688,7 +711,7 @@ class mutant(QWidget):
except: except:
pass pass
if len(self.local_monsters) > 0: if len(self.local_monsters) > 0:
self.command_str.emit("combat " + self.local_monsters[0]+"\r\n")
self.send_cmd("combat " + self.local_monsters[0]+"\r\n")
else: else:
#print("Area cleared") #print("Area cleared")
self.in_combat = False self.in_combat = False
@ -700,12 +723,12 @@ class mutant(QWidget):
self.farm_year = self.farm_year + 100 self.farm_year = self.farm_year + 100
if self.farm_year > self.year_limit: if self.farm_year > self.year_limit:
self.farm_year = 2000 self.farm_year = 2000
self.command_str.emit("tra "+str(self.farm_year)+"\r\n")
self.send_cmd("tra "+str(self.farm_year)+"\r\n")
self.drop_baits() self.drop_baits()
if self.bait and not self.stock_list.count("Monster-Bait"): if self.bait and not self.stock_list.count("Monster-Bait"):
self.command_str.emit("get Monster-Bait\r\n")
self.send_cmd("get Monster-Bait\r\n")
self.stock_list.append("Monster-Bait") self.stock_list.append("Monster-Bait")
self.command_str.emit("look\r\n")
self.send_cmd("look\r\n")
#process path #process path
def path_process(self): def path_process(self):
@ -714,7 +737,7 @@ class mutant(QWidget):
if path_str[0] == "!": if path_str[0] == "!":
self.script_function(path_str.strip("!").upper()) self.script_function(path_str.strip("!").upper())
else: else:
self.command_str.emit(path_str+"\r\n")
self.send_cmd(path_str+"\r\n")
self.path_step = self.path_step + 1 self.path_step = self.path_step + 1
self.no_action_cnt = 0 self.no_action_cnt = 0
else: else:
@ -723,15 +746,15 @@ class mutant(QWidget):
#handle functions in path script #handle functions in path script
def script_function(self,function): def script_function(self,function):
if function == "DEPOSIT": if function == "DEPOSIT":
self.command_str.emit("deposit "+str(self.riblets)+"\r\n")
self.send_cmd("deposit "+str(self.riblets)+"\r\n")
self.mqtt_str_quiet.emit(self.user," deposited "+str(self.riblets)+" riblets" ) self.mqtt_str_quiet.emit(self.user," deposited "+str(self.riblets)+" riblets" )
self.riblets = 0 self.riblets = 0
if self.ions > 2000000: if self.ions > 2000000:
self.command_str.emit("secure "+str(self.ions-2000000)+"\r\n")
self.send_cmd("secure "+str(self.ions-2000000)+"\r\n")
self.mqtt_str_quiet.emit(self.user," secured "+str(self.ions-2000000)+" ions" ) self.mqtt_str_quiet.emit(self.user," secured "+str(self.ions-2000000)+" ions" )
self.ions = 2000000 self.ions = 2000000
if function == "STOCK":
if function == "STOCK" and self.auto_farm:
self.stock_items() self.stock_items()
if function == "SELL": if function == "SELL":
@ -739,7 +762,7 @@ class mutant(QWidget):
if function == "RETURN": if function == "RETURN":
self.path_step = -1 self.path_step = -1
self.command_str.emit("tra "+str(self.farm_year)+"\r\n")
self.send_cmd("tra "+str(self.farm_year)+"\r\n")
new_path = self.selected_path + 1 new_path = self.selected_path + 1
if new_path == len(self.bank_list): if new_path == len(self.bank_list):
new_path = 0 new_path = 0
@ -762,7 +785,7 @@ class mutant(QWidget):
if i < 3: if i < 3:
self.sell_list.append(item_l) self.sell_list.append(item_l)
else: else:
self.command_str.emit("con "+item_l+"\r\n")
self.send_cmd("con "+item_l+"\r\n")
for item_l in farm_stock_list: for item_l in farm_stock_list:
x = self.status.count(item_l) x = self.status.count(item_l)
@ -770,7 +793,7 @@ class mutant(QWidget):
if i < 3: if i < 3:
self.stock_list.append(item_l) self.stock_list.append(item_l)
else: else:
self.command_str.emit("con "+item_l+"\r\n")
self.send_cmd("con "+item_l+"\r\n")
#HP #HP
if self.status.find("Hit Points :") != -1: if self.status.find("Hit Points :") != -1:
start_index = self.status.index('Hit Points : ') + 15 start_index = self.status.index('Hit Points : ') + 15
@ -1000,6 +1023,14 @@ class mutant(QWidget):
self.watchdog = 0 self.watchdog = 0
else: else:
self.watchdog = self.watchdog + 1 self.watchdog = self.watchdog + 1
def watchdog_cmd(self):
if self.cmd_watchdog > 2:
if len(self.cmd_buffer)>0:
self.transmit_bfr()
self.cmd_watchdog = 0
else:
self.cmd_watchdog = self.cmd_watchdog + 1
#Main game loop #Main game loop
def mutants(self,result): def mutants(self,result):
@ -1021,7 +1052,15 @@ class mutant(QWidget):
self.selected_path = int(self.path_input.text()) self.selected_path = int(self.path_input.text())
except: except:
pass pass
#Detect prompt
if result.find(">") != -1:
self.transmit_bfr()
self.cmd_watchdog = 0
self.prompt = True
else:
self.prompt = False
#Nothing has happened in a while, time jump #Nothing has happened in a while, time jump
if self.no_action_cnt > self.na_thresh: if self.no_action_cnt > self.na_thresh:
self.time_travel() self.time_travel()
@ -1032,9 +1071,9 @@ class mutant(QWidget):
if result.find("Prepare to walk a thousand years!") != -1: if result.find("Prepare to walk a thousand years!") != -1:
self.in_play = True self.in_play = True
#self.player_init() #self.player_init()
self.command_str.emit("blurb\r\n")
self.command_str.emit("deaf\r\n")
self.command_str.emit("memorize "+self.spell+"\r\n")
self.send_cmd("blurb\r\n")
self.send_cmd("deaf\r\n")
self.send_cmd("memorize "+self.spell+"\r\n")
self.tab_color.emit(self.idx,'green') self.tab_color.emit(self.idx,'green')
print("Character in play..") print("Character in play..")
@ -1061,13 +1100,13 @@ class mutant(QWidget):
#too many baits #too many baits
if self.stock_list.count("Monster-Bait") > 3: if self.stock_list.count("Monster-Bait") > 3:
self.command_str.emit("drop Monster-Bait\r\n")
self.send_cmd("drop Monster-Bait\r\n")
self.stock_list.remove("Monster-Bait") self.stock_list.remove("Monster-Bait")
#print(self.stock_list) #print(self.stock_list)
#too many nuclear decays #too many nuclear decays
if self.stock_list.count("Nuclear-Decay") > 3: if self.stock_list.count("Nuclear-Decay") > 3:
self.command_str.emit("con nuclear-decay\r\n")
self.send_cmd("con nuclear-decay\r\n")
self.stock_list.remove("Nuclear-Decay") self.stock_list.remove("Nuclear-Decay")
#print(self.stock_list) #print(self.stock_list)
@ -1080,11 +1119,7 @@ class mutant(QWidget):
#deposit riblets #deposit riblets
if self.riblets > self.riblet_thresh and self.path_step == 0 and self.wander: if self.riblets > self.riblet_thresh and self.path_step == 0 and self.wander:
self.path_step = 1 self.path_step = 1
#auto farm if sold items
if len(self.sell_list) == 0 and self.wander:
self.auto_farm = True
#process wander #process wander
if self.wander and not self.in_combat and self.path_step == 0: if self.wander and not self.in_combat and self.path_step == 0:
self.wander_process(result) self.wander_process(result)
@ -1099,30 +1134,26 @@ class mutant(QWidget):
#ion starvation #ion starvation
if result.find("You're starving for IONS!") != -1: if result.find("You're starving for IONS!") != -1:
self.command_str.emit("con gold-chunck\r\n")
self.send_cmd("con gold-chunck\r\n")
self.auto_combat = True self.auto_combat = True
self.heal = True self.heal = True
#too heavy #too heavy
if self.wander and result.find("The weight of all your items forces you to the ground.") != -1: if self.wander and result.find("The weight of all your items forces you to the ground.") != -1:
self.wander = False self.wander = False
self.command_str.emit("X\r\n")
self.send_cmd("X\r\n")
#dropped your weapon! #dropped your weapon!
if self.auto_farm and result.find("The Nuclear-Decay fell out of your sack!") != -1: if self.auto_farm and result.find("The Nuclear-Decay fell out of your sack!") != -1:
self.time_steps = 0 self.time_steps = 0
self.command_str.emit("con gold-chunck\r\n")
self.command_str.emit("get nuclear-decay\r\n")
#I can't remember why I did this
if self.auto_farm and result.find("You're not carrying a gold-chunck.") != -1:
self.auto_farm = False
self.send_cmd("con gold-chunck\r\n")
self.send_cmd("get nuclear-decay\r\n")
#Dropped the bait, pick it back up #Dropped the bait, pick it back up
if result.find("The Monster-Bait fell out of your sack!") != -1: if result.find("The Monster-Bait fell out of your sack!") != -1:
self.time_steps = 0 self.time_steps = 0
self.command_str.emit("con gold-chunck\r\n")
self.command_str.emit("get monster-bait\r\n")
self.send_cmd("con gold-chunck\r\n")
self.send_cmd("get monster-bait\r\n")
#Detect bait mode, add or remove from stock list #Detect bait mode, add or remove from stock list
if self.bait: if self.bait:
@ -1136,14 +1167,15 @@ class mutant(QWidget):
#Exit game if.. #Exit game if..
if self.in_combat and result.find("You're not carrying a "+self.weapon.lower()) != -1: if self.in_combat and result.find("You're not carrying a "+self.weapon.lower()) != -1:
self.command_str.emit("kick\r\n")
self.send_cmd("kick\r\n")
#self.exit_game() #self.exit_game()
#Lighten #Lighten
if self.wander and (result.find("It's too dark to see anything!") != -1 and self.path_step == 0): if self.wander and (result.find("It's too dark to see anything!") != -1 and self.path_step == 0):
if self.char_sel == 4: if self.char_sel == 4:
self.command_str.emit("cast\r\n")
else time_travel()
self.send_cmd("cast\r\n")
else:
self.time_travel()
#GTFO #GTFO
#if result.find("You're blocked!") != -1 or len(self.local_monsters) > 4: #if result.find("You're blocked!") != -1 or len(self.local_monsters) > 4:
@ -1278,22 +1310,22 @@ class mutant(QWidget):
if key==ord("8"): if key==ord("8"):
self.local_monsters = [] self.local_monsters = []
self.local_items = [] self.local_items = []
self.command_str.emit("north\r\n")
self.send_cmd("north\r\n")
if key==ord("2"): if key==ord("2"):
self.local_monsters = [] self.local_monsters = []
self.local_items = [] self.local_items = []
self.command_str.emit("south\r\n")
self.send_cmd("south\r\n")
if key==ord("4"): if key==ord("4"):
self.local_monsters = [] self.local_monsters = []
self.local_items = [] self.local_items = []
self.command_str.emit("west\r\n")
self.send_cmd("west\r\n")
if key==ord("6"): if key==ord("6"):
self.local_monsters = [] self.local_monsters = []
self.local_items = [] self.local_items = []
self.command_str.emit("east\r\n")
self.send_cmd("east\r\n")
#functions #functions
if key==ord("a"): if key==ord("a"):
@ -1339,7 +1371,7 @@ class mutant(QWidget):
#look around #look around
if key==ord("5"): if key==ord("5"):
self.command_str.emit("look ")
self.send_cmd("look ")
#meander status #meander status
if key==ord("m"): if key==ord("m"):
@ -1349,20 +1381,20 @@ class mutant(QWidget):
else: else:
self.wander = True self.wander = True
print("Meander on") print("Meander on")
self.command_str.emit("look\r\n")
self.send_cmd("look\r\n")
#heal #heal
if key==ord("h"): if key==ord("h"):
self.command_str.emit("heal\r\n")
self.send_cmd("heal\r\n")
self.heal = True self.heal = True
#look around #look around
if key==ord("l"): if key==ord("l"):
self.command_str.emit("look\r\n")
self.send_cmd("look\r\n")
#stats #stats
if key==ord("v"): if key==ord("v"):
self.command_str.emit("stat\r\n")
self.send_cmd("stat\r\n")
#sell items #sell items
if key==ord("s"): if key==ord("s"):
@ -1374,18 +1406,18 @@ class mutant(QWidget):
st = input("Choose path input: ") st = input("Choose path input: ")
self.selected_path = int(st) self.selected_path = int(st)
self.path_step = 1 self.path_step = 1
self.command_str.emit("Starting path..\r\n")
self.send_cmd("Starting path..\r\n")
self.flush_input() self.flush_input()
if key==ord("K") and not self.in_combat: if key==ord("K") and not self.in_combat:
print("working?") print("working?")
st = input("Keyboard input: ") st = input("Keyboard input: ")
self.command_str.emit(st+"\r\n")
self.send_cmd(st+"\r\n")
self.flush_input() self.flush_input()
#wield weapon #wield weapon
if key==ord("w"): if key==ord("w"):
self.command_str.emit("wie "+self.weapon+"\r\n")
self.send_cmd("wie "+self.weapon+"\r\n")
#drop item #drop item
if key==ord("d"): if key==ord("d"):
@ -1393,7 +1425,7 @@ class mutant(QWidget):
#toss = keyboard.read_key() #toss = keyboard.read_key()
st = input("drop item: ") st = input("drop item: ")
drop_item = "drop " + st drop_item = "drop " + st
self.command_str.emit(drop_item+"\r\n")
self.send_cmd(drop_item+"\r\n")
#time travel #time travel
if key==ord("t") and not self.in_combat: if key==ord("t") and not self.in_combat:
@ -1402,7 +1434,7 @@ class mutant(QWidget):
#toss = keyboard.read_key() #toss = keyboard.read_key()
st = input("year: ") st = input("year: ")
year = "travel " + st year = "travel " + st
self.command_str.emit(year+"\r\n")
self.send_cmd(year+"\r\n")
if key==ord("x"): if key==ord("x"):
pass pass

Loading…
Cancel
Save