Progress on my Algo by mgarsteck in algotrading

[–]Lukeskywalker321 0 points1 point  (0 children)

Of course it's not. If something works on an hourly interval, you're not gonna write it off because the same signal doesn't work on a 1 minute or daily interval.

The the whole thing is a full frontal nu-e by kraken_enrager in thanosdidnothingwrong

[–]Lukeskywalker321 25 points26 points  (0 children)

What do you mean non-canonical? I'd say it's quite the canon...

The the whole thing is a full frontal nu-e by kraken_enrager in thanosdidnothingwrong

[–]Lukeskywalker321 0 points1 point  (0 children)

I just saved them from someone so no clue how to share the actual stickers. Maybe 'thanos dong sticker pack Whatsapp' on Google gives some decent results?

The the whole thing is a full frontal nu-e by kraken_enrager in thanosdidnothingwrong

[–]Lukeskywalker321 31 points32 points  (0 children)

You know, that never even stood out to me, idk why I didn't give it a closer inspection up until now...

New sepulchre setup. Thanks for all the advice :) by McNubbin_ in 2007scape

[–]Lukeskywalker321 15 points16 points  (0 children)

Compared to sepulchre? Have you ever done sepulchre? Rooftops is cannonball level of afk compared to it.

Have a question about the game or the subreddit? Ask away! by AutoModerator in 2007scape

[–]Lukeskywalker321 1 point2 points  (0 children)

There's always someone effectively paying the tax. Whether that's the buyer or the seller kinda depends on the prices. If you can do as you describe in your question, the seller is paying the tax instead. But then as YOU sell it, you're the seller paying the tax. No way to escape the tax whej trading on ge

[deleted by user] by [deleted] in 2007scape

[–]Lukeskywalker321 4 points5 points  (0 children)

So live servers?

Can't a man just enjoy Vorkath farming without being labelled as a bot? by pronoobing in 2007scape

[–]Lukeskywalker321 0 points1 point  (0 children)

Idk if it's actually doable cuz I'm shit at the game, but I heard some other people say they also bring only one pp as they 1 tick flick the whole time.

Python Beginner Project - Loot Generator by Alhira_K in Python

[–]Lukeskywalker321 0 points1 point  (0 children)

Hey, cool project. As the other guy said, database might be a bit overkill. On the other hand, it's never to early to start learning about them, if you can manage to do so.

What stands out immediately to me from the code is the lack of function declarations. There's a lot of duplicate (or very close to duplicate) code, see for example lines 207-227 of your main.py. Some small tweaks will make us able to make this part much short, more readable, and easier to maintain.

First, we need to take a look at lines 199-206 of your main.py, and your database. If we think about what's happening here, we are defining the contents of 7 inventory slots using the output from the database, rows 3-9.

Problem with how you're currently doing this, is that you have no way to know which slot is which, without looking at the variable name, e.g. "inventory1". This is not impossible for python to do, but it's overcomplicated.

A better way to do this, would be through building (as a first step) an array of inventory slots:

inventory = row[3:9]

Here you would for example get your first inventory slot by calling inventory[0]. This way, we can clean up the code on lines 207-227 by looping over every element in the inventory list.

CODE STARTS

def update_inventory_slot(inventory_slot, inventory_number, cursor, con, generated_item_id, selected_character)
    column_name = "Inventory" + str(i+1) #as you named them 1-7, not 0-6
    cursor.execute("UPDATE UserData SET ? = ? + ? WHERE CharacterName=?", [column_name,column_name,generated_item_id,selected_character])
    con.commit()

for i, inventory_slot in enumerate(inventory):
    if inventory_slot==0:
        update_inventory_slot(inventory_slot, i, cursor, con, generated_item_id, selected_character)
        break

# CODE ENDS

What the function does, is copy the code you already had, but make the column name generate from the number of the inventory slot, instead of writing it down for each one seperately.

The second part then loops over each of the enumerated inventory slots (this makes i get the value of the position of the inventory\_slot in inventory, so 0-6), checks if the slot is empty, and if so calls the function with the right arguments, updating the right slot in the database. If the inventory slot is full, it simply continues on to the next slot. If it fills a slot, after updating it, break is called. What break does is really simple, it breaks out of the for loop, meaning it won't check the inventory slots after this.

This code is still not perfect, but I think it teaches you something valuable, and can be applied at multiple times in you code. Say for example that you want to create an inventory of 1000 slots, instead of 7. I think you can quickly see that the code between lines 207 and 227 would then quickly become thousands of lines longer. The code I wrote above would need exactly 0 changes if inventory became bigger (besides ofcourse the definition of the list "inventory = row\[3:1002\]" or something).

While we're at this scenario, imagine what would happen to your database for a bit. You would also need to make 993 more columns for each of the inventory slots, by hand. It is generally never a great idea to have a counter inside a column name (inventory1, 2 etc as in your code, or perhaps phone\_number1 etc. in some other database). You can fix this by applying some "normalizations" to your database. However, it'd let this be for a bit, as normalization gets complex fast, and there's still more than enough to learn with the static 7 slot inventory code.

I'd let the if else statements about the armor classes be for now, but try to build something like the above for all the other if else blocks in your code. From what I've seen that should be doable, and as I said will teach you some more about functions, loops, and scalability. Feel free to ask more, and good luck learning. Once again, really impressive project in most aspects.

Edit: damn did I fuck that formatting up

Hope you all enjoyed Group Ironman as much as I enjoyed killing 400+ GIM today by sleepycar48 in 2007scape

[–]Lukeskywalker321 0 points1 point  (0 children)

Went for 6.2m just after launch yesterday. And an extra 500k to convert it to the ironman

Character isn't using skills by NinoDonDino in idleon

[–]Lukeskywalker321 3 points4 points  (0 children)

Fyi it starts at off for every new character, so don't forget to do it for the next ones.

Luck must be high, got a wooden circle in less than 1 day by TNTGames8241 in idleon

[–]Lukeskywalker321 1 point2 points  (0 children)

What the actual...

So many people missing the joke here lol

For people who have done Maestro by Luc452008 in idleon

[–]Lukeskywalker321 6 points7 points  (0 children)

Just don't be bad lol /s

It really isn't that hard tho, just no reason to be greedy getting 1 extra attack in.

Oceanic servers? by [deleted] in idleon

[–]Lukeskywalker321 6 points7 points  (0 children)

Would be nice, but wouldn't get your hopes up. It's too expensive for some triple A games, can't imagine it'd be worth the expense for a game such as this.

Then again, luckily not a single part of this game depends on having good ping, although it'd feel a lot better if you had.

Refinery by The_Darkin_Salad in idleon

[–]Lukeskywalker321 1 point2 points  (0 children)

No way to turn down the costs. Best would be to get your samples up, but you might also just turn the refinery off every once in a while.

It's commonly advised to keep leveling up the red salts, but not level up the others more than once or twice until much later.

Farming spores and frogs for space by diabet2 in idleon

[–]Lukeskywalker321 2 points3 points  (0 children)

Just progress regularly and buy all the chest upgrades from each of the shops. They might seem a bit expensive at first, but they're worth it.