Code Monkey home page Code Monkey logo

clearplayers's People

clearplayers's Issues

This algorithm should be completely rethinked #2

First, I fell that it's more convenient opening another issue for that, since that editing the first would be confusing.
Not every player without certain items is just useless, MANY times this is because the player was clearing his inventory for doing something else(like selling cobble in my case) and couldn't continue in this day, this algorithm would destroy many players that are not inactive. I have a better sollution for the algorithm that would be easier too.
My solution involves a lua mod and the python program, a lua mod that checks if the player have been inactive and didn't do much progress(the mod I could do) and if the player is, it sets a player attribute like
inactive = "true"
that could be easily detected.
The "part two of the part two" is that read function does not take the line number to read as param, it takes how many bytes to read, so you could use readlines or something instead, that with my solution would be even easier

Known bug: Error opening file

When run, the current script returns an error stating that it is trying to read an unopened file. This IS a known bug and the reason the script is unstable.
Error-causing syntax:
file = open(fullPath, "r")
where fullPath is the path of the player file, for instance
/home/user/.minetest/worlds/testworld/players/archfan
I'm relatively new to Python, and I need help debugging/fixing this.

This algorithm should be completely/partial(just a fix to the error) rethinked

This won't work by the reason that extended attributes are stored at the start of the file, increasing the number of lines making line 18 and 42 not where the inventory respectivily starts and ends. If you want to keep this current algorithm idea(the partial solution) you would have to check from line total_number_of_lines - 32 to total_number_of_lines and 32 could be the "line" var that decreases one each iteration

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.