hanyuone / Ways-to-NOT-make-money

A basic Python (2.x/3.x) incremental game.
8 stars 3 forks source link

Updating thing needs to update for V0.7.0 #75

Closed hanyuone closed 8 years ago

hanyuone commented 8 years ago

Error:

Traceback (most recent call last):
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 1536, in __call__
    return self.func(*args)
  File "C:/Users/hyli.DERP-A-TRON3000/Desktop/V0.7.0/game.py", line 88, in verifysignin
    game_state = game_model.GameState(g2)
  File "C:\Users\hyli.DERP-A-TRON3000\Desktop\V0.7.0\game_model.py", line 27, in __init__
    self.totalclicks = int(self.data[43])
IndexError: list index out of range

This is probably caused by the auto-update thing not including V0.7.0.

ghost commented 8 years ago

I included it in the save_and_load!

ghost commented 8 years ago

Fixed or not?

hanyuone commented 8 years ago

Nope, it's not in save_and_load either - as far as I know, the functions are the same in save_and_load and game, and I tested the game one, which doesn't work.

ghost commented 8 years ago

Hint 1:

def encode_and_save(username, data):
    if data is None:
        data = ["auto", 0, "print", 0, "counter", 0, "shares", 0, "bank", 0, "upg1h1", 0, "upg1h2", 0,
                    "upg2h1", 0, "upg2h2", 0, "upg3", 0, "upg4", 0, "upg5", 0, "cupg1", 0, "cupg2", 0,
                    "money", 0.0, "time", 0, "clicks", 0, 'lotto', 100]

    encoded_data = ("_".join(str(v) for v in data)).encode("hex") + ";"

    filename = "savefile_" + username + ".txt"
    with open(filename, "w") as f:
        f.write(encoded_data)

len(["auto", 0, "print", 0, "counter", 0, "shares", 0, "bank", 0, "upg1h1", 0, "upg1h2", 0, "upg2h1", 0, "upg2h2", 0, "upg3", 0, "upg4", 0, "upg5", 0, "cupg1", 0, "cupg2", 0, "money", 0.0, "time", 0, "clicks", 0, 'lotto', 100]) = 36.

36 - 1 = 35. So maximum index is 35.

ghost commented 8 years ago

Hint 2:

def savegame():
    global game_state
    data = ["auto", game_state.get_autoclick2(), "print", game_state.get_printmoney2(),
            "counter", game_state.get_counterfeit2(), "shares", game_state.get_sharecrash2(),
            "bank", game_state.get_bankheist2(), "upg1h1", game_state.get_upgcheck1h1(),
            "upg1h2", game_state.get_upgcheck1h2(), "upg2h1", game_state.get_upgcheck2h1(),
            "upg2h2", game_state.get_upgcheck2h2(), "upg3", game_state.get_upgcheck3(),
            "upg4", game_state.get_upgcheck4(), "upg5", game_state.get_upgcheck5(),
            "cupg1", game_state.get_clickupgcheck1(), "cupg2", game_state.get_clickupgcheck2(),
            "money", float(str(game_state.get_money())[-8:]), "time", game_state.get_timeplay(),
            "clicks", game_state.get_total_clicks(), "lotto", game_state.get_lotto()]

    save_and_load.encode_and_save(username, data)

    toplevel = Toplevel()
    msg = Message(toplevel, text="Game saved!")
    msg.pack()

len( ["auto", game_state.get_autoclick2(), "print", game_state.get_printmoney2(), "counter", game_state.get_counterfeit2(), "shares", game_state.get_sharecrash2(), "bank", game_state.get_bankheist2(), "upg1h1", game_state.get_upgcheck1h1(), "upg1h2", game_state.get_upgcheck1h2(), "upg2h1", game_state.get_upgcheck2h1(), "upg2h2", game_state.get_upgcheck2h2(), "upg3", game_state.get_upgcheck3(), "upg4", game_state.get_upgcheck4(), "upg5", game_state.get_upgcheck5(), "cupg1", game_state.get_clickupgcheck1(), "cupg2", game_state.get_clickupgcheck2(), "money", float(str(game_state.get_money())[-8:]), "time", game_state.get_timeplay(), "clicks", game_state.get_total_clicks(), "lotto", game_state.get_lotto()]) = 36.

36-1 = 35, in agreement with Hint 1.

ghost commented 8 years ago

Hint 3:

        self.data = [] if data is None else data

        self.check = 0
        self.upgbuttoncheck = False
        self.goldcheck = False
        self.statscheck = False

        self.animate = 0
        self.clickcolourcheck = 1

        self.upgcheck1h1 = int(self.data[11])
        self.upgcheck1h2 = int(self.data[13])
        self.upgcheck2h1 = int(self.data[15])
        self.upgcheck2h2 = int(self.data[17])
        self.upgcheck3 = int(self.data[19])
        self.upgcheck4 = int(self.data[21])
        self.upgcheck5 = int(self.data[23])
        self.clickupgcheck1 = int(self.data[25])
        self.clickupgcheck2 = int(self.data[27])

        self.timeplay = int(self.data[41])
        self.totalclicks = int(self.data[43])

        self.money = float(self.data[29])

        self.autoclick2 = int(self.data[1])
        self.autoclick = self.autoclick2 * 18 * self.upgcheck1h2 + self.autoclick2 * 2 * self.upgcheck1h1 + \
                         self.autoclick2
        self.autoprice = int(20 * math.pow(1.15, self.autoclick2))

        self.printmoney2 = int(self.data[3])
        self.printmoney = self.printmoney2* 18 * self.upgcheck2h2 + self.printmoney2 * 2 * self.upgcheck2h1 + \
                          self.printmoney2
        self.printprice = int(375 * math.pow(1.25, self.printmoney2))

        self.counterfeit2 = int(self.data[5])
        self.counterfeit = self.counterfeit2 * 2 * self.upgcheck3 + self.counterfeit2
        self.counterfeitprice = int(9001 * math.pow(1.3, self.counterfeit2))

        self.sharecrash2 = int(self.data[7])
        self.sharecrash = self.sharecrash2 * 2 * self.upgcheck4 + self.sharecrash2
        self.shareprice = int(42000 * math.pow(1.4, self.sharecrash2))

        self.bankheist2 = int(self.data[7])
        self.bankheist = self.bankheist2 * 2 * self.upgcheck4 + self.bankheist2
        self.bankprice = int(175000 * math.pow(1.1, self.bankheist2))

        self.lottoprice = int(self.data[45])

        self.mps = self.autoclick2 + 15 * self.printmoney2 + 321 * self.counterfeit2 + 969 * self.sharecrash2
        self.inc = 1 + self.clickupgcheck1 * 2 + self.clickupgcheck2 * self.mps / 10

        self.multiplier = 1

41 -> 31. 43 -> 33. 45 -> 35

hanyuone commented 8 years ago

Ah. So that's where the bug is... I think. We probably have to change the timeplay, totalclicks and lottoprice.

hanyuone commented 8 years ago

Hangonaminute, was there Bank Heist in the lotto update? I think that's where the bug might be. Also, why does your encode_and_save not have quintillions, quadrillions, and so-forth?

ghost commented 8 years ago

I don't know-ask @joshgit

hanyuone commented 8 years ago

@joshgit is probs gone. No worries, I found where the bug is.

Will close the issue when I get rid of those lines extra unnecessary lines in the game_state thing.

ghost commented 8 years ago

@DerpfacePython ???? _HELLLOOOOOOOO? Is this dead or NOT?_

bortkiewicz commented 8 years ago

Is this fixed, @DerpfacePython ?

hanyuone commented 8 years ago

Yeah, this is fixed.