|
|
|
@ -30,11 +30,14 @@ class player(): |
|
|
|
self.auto_farm = False |
|
|
|
self.hunt = False |
|
|
|
self.bait = False |
|
|
|
self.start_year = 2000 |
|
|
|
self.end_year = 2500 |
|
|
|
self.no_action = 50 |
|
|
|
|
|
|
|
choice = int(sys.argv[1]) |
|
|
|
print("choice:"+sys.argv[1]) |
|
|
|
|
|
|
|
def player_add(usr,pwd,char_sel,weapon,spell,ac,ai,me,af,hu,ba): |
|
|
|
def player_add(usr,pwd,char_sel,weapon,spell,ac,ai,me,af,hu,ba,start_year,end_year,no_action): |
|
|
|
plyr = player() |
|
|
|
plyr.usr = usr |
|
|
|
plyr.pwrd = pwd |
|
|
|
@ -49,23 +52,27 @@ def player_add(usr,pwd,char_sel,weapon,spell,ac,ai,me,af,hu,ba): |
|
|
|
plyr.hunt = hu |
|
|
|
plyr.bait = ba |
|
|
|
|
|
|
|
plyr.start_year = start_year |
|
|
|
plyr.end_year = end_year |
|
|
|
plyr.no_action = no_action |
|
|
|
|
|
|
|
player_list.append(plyr) |
|
|
|
|
|
|
|
if choice == 1: |
|
|
|
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,True,False,True,False) |
|
|
|
player_add("mutant-warrior-2","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False) |
|
|
|
player_add("epilectrik","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False,2500,3800,50) |
|
|
|
player_add("im bait","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False,2500,3800,50) |
|
|
|
player_add("doctor","gupass",2,"Nuclear-Decay","cure poison",True,True,True,False,True,False,2000,2500,50) |
|
|
|
player_add("robin-hood","gupass",1,"Nuclear-Decay","invisibility",True,True,True,False,True,False,2000,2500,50) |
|
|
|
player_add("assassin","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False,2000,2500,50) |
|
|
|
player_add("mercenary","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False,2000,2500,50) |
|
|
|
player_add("mutant-warrior-1","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False,2000,2500,50) |
|
|
|
player_add("mutant-warrior-2","gupass",4,"Nuclear-Decay","dispell",True,True,True,False,True,False,2000,2500,50) |
|
|
|
|
|
|
|
if choice == 2: |
|
|
|
player_add("Mtron","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False) |
|
|
|
player_add("IonJunkies-Merc","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False) |
|
|
|
player_add("Ionjunkies-priest-1","gupass",2,"Nuclear-Decay","cure poison",True,True,True,False,True,False) |
|
|
|
player_add("Ionjunkies-thief-1","gupass",1,"Nuclear-Decay","invisibility",True,True,True,False,True,False) |
|
|
|
player_add("Mtron","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False,2000,2500,50) |
|
|
|
player_add("IonJunkies-Merc","gupass",4,"Nuclear-Decay","dispell",True,True,True,True,True,False,2000,2500,50) |
|
|
|
player_add("Ionjunkies-priest-1","gupass",2,"Nuclear-Decay","cure poison",True,True,True,False,True,False,2000,2500,50) |
|
|
|
player_add("Ionjunkies-thief-1","gupass",1,"Nuclear-Decay","invisibility",True,True,True,False,True,False,2000,2500,50) |
|
|
|
|
|
|
|
#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", |
|
|
|
@ -161,6 +168,8 @@ class mutant(QWidget): |
|
|
|
self.prompt = False |
|
|
|
self.poisoned = False |
|
|
|
self.current_path = "" |
|
|
|
self.year_limit_high=player.end_year |
|
|
|
self.year_limit_low=player.start_year |
|
|
|
|
|
|
|
#value tracking |
|
|
|
self.riblets = 0 |
|
|
|
@ -171,10 +180,10 @@ class mutant(QWidget): |
|
|
|
self.level = 0 |
|
|
|
self.riblet_thresh = 200000 |
|
|
|
self.ion_thresh = 2000000 |
|
|
|
self.farm_year=2000 |
|
|
|
self.year_limit=2500 |
|
|
|
self.present_year=player.start_year |
|
|
|
|
|
|
|
self.no_action_cnt = 0 |
|
|
|
self.na_thresh = 150 |
|
|
|
self.na_thresh = player.no_action |
|
|
|
self.status = "" |
|
|
|
self.area = "" |
|
|
|
self.console_lines = 0 |
|
|
|
@ -246,7 +255,11 @@ class mutant(QWidget): |
|
|
|
self.text_input = QLineEdit() |
|
|
|
self.text_button = QPushButton("Send") |
|
|
|
self.text_button.clicked.connect(self.send_str) |
|
|
|
self.text_input_2 = QLineEdit() |
|
|
|
self.text_button_2 = QPushButton("Send") |
|
|
|
self.text_button_2.clicked.connect(self.send_str_2) |
|
|
|
self.formGroupBox.addRow(self.text_button,self.text_input) |
|
|
|
self.formGroupBox.addRow(self.text_button_2,self.text_input_2) |
|
|
|
self.layout.addLayout(self.formGroupBox) |
|
|
|
|
|
|
|
#stat group |
|
|
|
@ -259,7 +272,7 @@ class mutant(QWidget): |
|
|
|
|
|
|
|
#settings group |
|
|
|
self.createSettingsGroup() |
|
|
|
self.layout.addLayout(self.settingsGroupBox) |
|
|
|
self.layout.addLayout(self.settings_layout) |
|
|
|
self.weapon_input.setText(player.weapon) |
|
|
|
self.setLayout(self.layout) |
|
|
|
self.load_bank_paths() |
|
|
|
@ -432,18 +445,25 @@ class mutant(QWidget): |
|
|
|
self.stat_layout.addLayout(hbox2) |
|
|
|
|
|
|
|
#Text inputs |
|
|
|
def createSettingsGroup(self): |
|
|
|
def createSettingsGroup(self): |
|
|
|
self.settings_layout = QHBoxLayout() |
|
|
|
self.settingsGroupBox = QFormLayout() |
|
|
|
self.settingsGroupBox_2 = QFormLayout() |
|
|
|
self.weapon_input = QLineEdit("Nuclear-Decay") |
|
|
|
self.na_input = QLineEdit("150") |
|
|
|
self.yl_input = QLineEdit("2500") |
|
|
|
self.na_input = QLineEdit(str(self.na_thresh)) |
|
|
|
self.yl_start_input = QLineEdit(str(self.year_limit_low)) |
|
|
|
self.yl_end_input = QLineEdit(str(self.year_limit_high)) |
|
|
|
self.path_input = QLineEdit("0") |
|
|
|
|
|
|
|
self.settingsGroupBox.addRow(QLabel("Weapon:"),self.weapon_input) |
|
|
|
self.settingsGroupBox.addRow(QLabel("No Action:"),self.na_input) |
|
|
|
self.settingsGroupBox.addRow(QLabel("Year Limit:"),self.yl_input) |
|
|
|
self.settingsGroupBox.addRow(QLabel("Path:"),self.path_input) |
|
|
|
|
|
|
|
self.settingsGroupBox.addRow(QLabel("No Action:"),self.na_input) |
|
|
|
self.settingsGroupBox.addRow(QLabel("Year Limit Start:"),self.yl_start_input) |
|
|
|
self.settingsGroupBox_2.addRow(QLabel("Year Limit End:"),self.yl_end_input) |
|
|
|
self.settingsGroupBox_2.addRow(QLabel("Path:"),self.path_input) |
|
|
|
|
|
|
|
self.settings_layout.addLayout(self.settingsGroupBox) |
|
|
|
self.settings_layout.addLayout(self.settingsGroupBox_2) |
|
|
|
|
|
|
|
#buttons |
|
|
|
def n_btn(self): |
|
|
|
self.send_cmd("north\r\n") |
|
|
|
@ -498,6 +518,8 @@ class mutant(QWidget): |
|
|
|
#Button send text |
|
|
|
def send_str(self): |
|
|
|
self.send_cmd(self.text_input.text()+"\r\n") |
|
|
|
def send_str_2(self): |
|
|
|
self.send_cmd(self.text_input_2.text()+"\r\n") |
|
|
|
|
|
|
|
#auto combat checked |
|
|
|
def ac_checked(self): |
|
|
|
@ -658,7 +680,15 @@ class mutant(QWidget): |
|
|
|
self.send_cmd("stock "+item+"\r\n") |
|
|
|
self.stock_list.remove(item) |
|
|
|
time.sleep(.05) |
|
|
|
|
|
|
|
|
|
|
|
#Add to convert list |
|
|
|
def add_convert(self): |
|
|
|
temp_list = farm_sell_list + farm_stock_list + convert_list |
|
|
|
for item in self.local_items: |
|
|
|
if not temp_list.count(item): |
|
|
|
convert_list.append(item) |
|
|
|
print("Convert Item Added: " + item) |
|
|
|
|
|
|
|
#Drop monster baits |
|
|
|
def drop_baits(self): |
|
|
|
while self.stock_list.count("Monster-Bait") > 1: |
|
|
|
@ -756,10 +786,10 @@ class mutant(QWidget): |
|
|
|
def time_travel(self): |
|
|
|
self.local_items = [] |
|
|
|
self.location = [0,0] |
|
|
|
self.farm_year = self.farm_year + 100 |
|
|
|
if self.farm_year > self.year_limit: |
|
|
|
self.farm_year = 2000 |
|
|
|
self.send_cmd("tra "+str(self.farm_year)+"\r\n") |
|
|
|
self.present_year = self.present_year + 100 |
|
|
|
if self.present_year > self.year_limit_high: |
|
|
|
self.present_year = self.year_limit_low |
|
|
|
self.send_cmd("tra "+str(self.present_year)+"\r\n") |
|
|
|
self.drop_baits() |
|
|
|
if self.bait and not self.stock_list.count("Monster-Bait"): |
|
|
|
self.send_cmd("get Monster-Bait\r\n") |
|
|
|
@ -802,7 +832,7 @@ class mutant(QWidget): |
|
|
|
|
|
|
|
if function == "RETURN": |
|
|
|
self.path_step = -1 |
|
|
|
self.send_cmd("tra "+str(self.farm_year)+"\r\n") |
|
|
|
self.send_cmd("tra "+str(self.present_year)+"\r\n") |
|
|
|
new_path = self.selected_path + 1 |
|
|
|
if new_path == len(self.bank_list): |
|
|
|
new_path = 0 |
|
|
|
@ -810,7 +840,7 @@ class mutant(QWidget): |
|
|
|
self.tab_color.emit(self.idx,'green') |
|
|
|
|
|
|
|
if function == "POISON": |
|
|
|
request = ['poison',str(self.farm_year),self.user] |
|
|
|
request = ['poison',str(self.present_year),self.user] |
|
|
|
self.broadcast.emit(request) |
|
|
|
|
|
|
|
#process stats |
|
|
|
@ -940,10 +970,10 @@ class mutant(QWidget): |
|
|
|
try: |
|
|
|
current_year = int(year_str) |
|
|
|
if not self.wander: |
|
|
|
self.farm_year = current_year |
|
|
|
self.present_year = current_year |
|
|
|
else: |
|
|
|
if current_year != self.farm_year: |
|
|
|
self.send_cmd("tra "+str(self.farm_year)+"\r\n") |
|
|
|
if current_year != self.present_year: |
|
|
|
self.send_cmd("tra "+str(self.present_year)+"\r\n") |
|
|
|
except: |
|
|
|
pass |
|
|
|
self.status = "" |
|
|
|
@ -1107,7 +1137,7 @@ class mutant(QWidget): |
|
|
|
self.userLabel.setText(self.user) |
|
|
|
self.expLabel.setText(str(self.exp)) |
|
|
|
self.levelLabel.setText(str(self.level)) |
|
|
|
self.yearLabel.setText(str(self.farm_year)) |
|
|
|
self.yearLabel.setText(str(self.present_year)) |
|
|
|
|
|
|
|
self.locationLabel.setText(str(self.location)) |
|
|
|
self.hpLabel.setText(str(self.hp)) |
|
|
|
@ -1116,7 +1146,8 @@ class mutant(QWidget): |
|
|
|
|
|
|
|
self.weapon = self.weapon_input.text() |
|
|
|
self.na_thresh = int(self.na_input.text()) |
|
|
|
self.year_limit = int(self.yl_input.text()) |
|
|
|
self.year_limit_low = int(self.yl_start_input.text()) |
|
|
|
self.year_limit_high = int(self.yl_end_input.text()) |
|
|
|
self.selected_path = int(self.path_input.text()) |
|
|
|
except: |
|
|
|
pass |
|
|
|
@ -1227,7 +1258,7 @@ class mutant(QWidget): |
|
|
|
#if result.find("You're blocked!") != -1 or len(self.local_monsters) > 4: |
|
|
|
# self.heal = True |
|
|
|
# local_monsters = [] |
|
|
|
# self.command_str.emit("tra "+str(self.farm_year)+"\r\n") |
|
|
|
# self.command_str.emit("tra "+str(self.present_year)+"\r\n") |
|
|
|
# self.in_combat = False |
|
|
|
|
|
|
|
#Sell the loot |
|
|
|
@ -1260,16 +1291,18 @@ class mutant(QWidget): |
|
|
|
#self.change_meander_state(False) |
|
|
|
#self.change_hunt_state(False) |
|
|
|
#self.poisoned = True |
|
|
|
self.mqtt_str.emit(self.user+" is poisoned") |
|
|
|
self.tab_color.emit(self.idx,'Yellow') |
|
|
|
self.send_cmd("heal\r\n") |
|
|
|
self.send_cmd("heal\r\n") |
|
|
|
self.change_meander_state(False) |
|
|
|
cure_path = ['done','tra '+str(self.farm_year),'!poison','done'] |
|
|
|
cure_path = ['done','tra '+str(self.present_year),'!poison','done'] |
|
|
|
self.current_path = cure_path |
|
|
|
self.path_step = 1 |
|
|
|
|
|
|
|
#Poison cured |
|
|
|
if result.find("has just cured your poison!") != -1: |
|
|
|
self.mqtt_str.emit(self.user+" is cured") |
|
|
|
self.tab_color.emit(self.idx,'Green') |
|
|
|
self.change_meander_state(True) |
|
|
|
|
|
|
|
@ -1354,11 +1387,12 @@ class mutant(QWidget): |
|
|
|
farm_zero = False |
|
|
|
if not self.wander: |
|
|
|
farm_zero = True |
|
|
|
|
|
|
|
|
|
|
|
if self.auto_farm and farm_zero: |
|
|
|
self.farm_sell_items() |
|
|
|
self.farm_stock_items() |
|
|
|
if self.auto_ion: |
|
|
|
self.add_convert() |
|
|
|
self.convert_items() |
|
|
|
#push("convert") |
|
|
|
|
|
|
|
@ -1428,7 +1462,7 @@ class mutant(QWidget): |
|
|
|
if key==ord("y"): |
|
|
|
self.flush_input() |
|
|
|
st = input("Year limit: ") |
|
|
|
self.year_limit = int(st) |
|
|
|
self.year_limit_high = int(st) |
|
|
|
|
|
|
|
#No action threshhold |
|
|
|
if key==ord("n"): |
|
|
|
|