[SCRIPT] build.py (updated)

This is my new build script, it's improved and now it can work without problem with any other script such as box, paint, floor, db, dw, wall, etc.
This new version contains registration and login to protect and save the sectors of each user, with this we avoid the grief and trolls users who want to cover or destroy the sectors with box, floor, db, etc.

The format of the database is in JSON and its structure is this:

{
  "<account username>": {
      "shared": ,
      "password": <password>,
      "coordx": <claim_pos_x>,
      "coordy": <claim_pos_y>,
      "ip": <user_ip>
      }
  }

<username>
Here is the account name of the user, it will never be repeated or there will be another like it.

"shared":
Here will be stored users who can destroy and build in a player's sector.

"password": <password>
Here is the account password of the user.

"coordx": <claim_pos_x>
This is the position of the first block on the x axis (with this we avoid putting all the coordinates)

"coordy": <claim_pos_y>
This is the position of the final block on the y axis (with this we avoid putting all the coordinates)

"ip": <user_ip>
Here the IP of the user is saved, with this we avoid that more than one account is created.

Size of the sector per user:
The default size of the sector per user is 30x30 blocks, you can modify this in line # 13 of the build.py script

RANGE_CLAIM = 15
Keep in mind that the value you put there will be multiplied by 2, therefore 15 would be 30 blocks (default)

Commands:

/buildregister <username> <password>
/buildlogin <username> <password>
/share <account username>
/unshare <account username>
/removeclaim <account username>
/buildlogout
/claim
/tpsector

buildregister:
This command allows you to register on the server, you need to put the name of your account and password.

buildlogin:
This command allows you to enter your account, you need to enter the username of your account and your password.

share:
This command allows you to share your sector with another user, you need to place the account name of that user, keep in mind that he will be able to destroy and build in your sector.

unshare:
This command allows you to remove a user from your list of users who can build and destroy in your sector, you need to place the account name of that user.

tpsector:
This command will teleport you to your sector.

claim:
This command allows you to claim a sector, you can only claim 1.

buildlogout:
This command allows you to exit your account.

removeclaim:
This command can only be used by administrators, you need to place account name of that user to whom you want to remove their sector.

Users will not be able to build or destroy anywhere until they register, login and claim a sector.

IMPORTANT:

  • Only administrators can build and destroy on the entire map without having to register, be careful with this.
  • It does not matter if a user has /god, he can only build and destroy in his sector (also in the sectors where he was given the permission to destroy and build).
  • Use a auto savemap script like savemap.py, with this we avoid that some constructions are lost in case your server closes.
  • Put a message in your config.txt saying that to build you need to register, login and claim a sector.
  • Download the build.py file and put it inside your scripts folder.
  • Download the users.json file and put it inside your dist folder.
  • If you change the size of the claim (RANGE_CLAIM) avoid that it is not so big.
  • You can only register once, as a consequence the users can only claim a single sector

A small example of the script working:

In the video I registered with two accounts to show how the script works but this only be done once.

Thanks.


users.json (2 Bytes)

build.py (14.5 KB)