Giter Site home page Giter Site logo

game-closer's Introduction

Game Closer

Description

Game Closer is a game auto-closing script for Windows. It's designed for people who spend too much time on games and want to stop but have difficulty doing so. Basically, it closes your game after a period of time, so you don't have to force yourself to click on the red cross.

How it works

  1. The script searches for the name of the process you specified and kills it.
  2. If it doesn't find the process, it searches for a window with the process name and closes it.

Prerequisites

You must have python and pip installed on your computer to run the script.

Installation

1. Code downloading

In order to use the script, you have to run the git command:

git clone https://github.com/Sheep-s4n/Game-Closer

Or, you can download it manually:

download github code example

2. Dependencies downloading

Run this pip command in the directory containing the code so as to install all required dependencies:

pip install -r requirements.txt

Usage

1. Arguments

You can change default arguments in the script by changing the variables at the top of the script.

There are 3 arguments that you can provide for running the script:

  • Processes names (name in script: processes) - (default: [""])

    • The processes/games name should be the names of the executables files that makes the games processes, not the game name itself (often they are the same).

    • Each process in the list must be separated by a comma.

    • You can also use the title of the window created by the process in order to close the game.

    • The process/game name isn't case-sensitive, and you can enter only a part of the process name.

      • For instance, if the process name is ARandomGame.exe. You could set the process name to arandomegame.exe, arandomegame or even randomGame.
      • ⚠️ Be careful when shortening process names because it may close unwanted processes ⚠️
  • Time to wait (name in script: time_to_wait) - (default: 30)

    • The time to wait for the script to close the game is in minutes.
  • Optional end message (name in script: optional_end_message) - (default: "Go to work you slacker!")

    • A message that will be printed when the script ends. It can be used for example to display a motivational message to do something other than gaming.

2. Running the script

To run the python script, open a terminal emulator and run the following command:

python main.py

The variable ask_on_run is a boolean that indicates wheter the script should be executed with command line arguments or not. You can set the ask_on_run variable at the top of the script to False if you want to run the script with command line arguments.

In order to display the available command line options(arguments) usages and positions, you can run:

python main.py --help

game-closer's People

Contributors

sheep-s4n avatar anto-napo avatar

Watchers

 avatar

Forkers

anto-napo

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.