Change anything over X to Y

Discussion in 'Bukkit Help' started by The_Punkster, Mar 10, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    Is there any possible solution to change any player who has over 5k+ back to 5k but everyone under it stays the same.

    I can do it manually but that's hundreds of accounts...

    This is a short example of a part of my iConomy

    momisadick balance:20.0 status:0
    simeon123 balance:20.0 status:0
    cdud113 balance:20.0 status:0
    irishminer93 balance:373.8676419279983 status:0
    xgo_gamer balance:20.0 status:0
    tehwill9272 balance:20.0 status:0
    makilla1 balance:20.0 status:0
    mr.pootietang balance:20.0 status:0
    skyreiter balance:20.0 status:0
    theminer10111 balance:10.018880000000008 status:0
    faction-63 balance:550.0 status:0
    miguelop balance:25.82999999999994 status:0
    skill_r_us balance:78453.34325334901 status:0
    juantito balance:23065.599583622636 status:0
    end balance:20.0 status:0
    andrewzheng balance:20.0 status:0
    pixiz balance:20.0 status:0
    kayden365 balance:20.0 status:0
    itsbaileybro balance:20.0 status:0
    thematrizx balance:905.3082799999805 status:0
    paw_99 balance:20.0 status:0
    xxxxbudderxxxx balance:20.0 status:0
    cw balance:20.0 status:0
    cww balance:20.0 status:0
  2. Offline


    you could write a program to do it in seconds :D
  3. Offline


    Unfortunately I do not know how to do it.....

    Hoping someone could help me with that
  4. Offline


    Just delete/rename the file set the default balance to 5k reload/restart leave it like that for a while then set your default balance back
  5. Offline


    I don't thin I understand

    Also, I can't make the default balance 5k, as users start off with $30, and I want that to stay that way.

    And isn't that basically setting everyone to 5K?
  6. Offline


    isnt there a max limit they can have in their account in the config?
    Set it to 5k then start the server and any beyond 5k should be set down to 5k, then just shut down the server and change the max limit back to what it was.

    Sounds easy enough.
    The_Punkster likes this.
  7. Offline


    I tried that but the issue is that when I set the money max back up, their cash goes back to normal, but when max is 5k, it stays 5k.

    I started using the EssentialsEco.
  8. Offline


    Ya, but that is the best thing to do. Or you could go thru the file manually and change it
  9. Offline


    il try something, and tell you back if it works.
    The_Punkster likes this.
  10. Offline


    That would be much appreciated.
  11. Offline


    use strict;
    open (FILE, "<") or die "Can't open file: $!\n";
    while (<FILE>) {
      my ($p, $b, $s) = split /\s+/,$_;
      if ($b =~ /^balance:(.*?)$/) {
        if ($1 > 5000) { $b = "balance:5000"; }
      print "$p $b $s\n";
    close FILE;
    ./ >
    Verify that looks good and then rename it to Be sure to make backups.
    lol768 likes this.
  12. Offline


    you can set essentials max balance, but youd have to keep it on, money in userdata will update when they do a balance action.
  13. Offline


    Yeah that's the issue :S

    I'm setting them to reset at 5k, but I don't want to limit that to their max :S
Thread Status:
Not open for further replies.

Share This Page