[Server Scripting] TheUnknownOne's Server Script

Discussion in 'Server and Client Scripting' started by TheUnknownOne, Aug 24, 2011.

?

Should /info be in a table?

Poll closed Sep 20, 2011.
  1. Yes

    100.0%
  2. No

    0 vote(s)
    0.0%
  1. Dezhovator

    Dezhovator Member

    Joined:
    Jul 21, 2012
    Messages:
    33
    Likes Received:
    0
    Sorry but where will I type it in script?
     
  2. Ethan

    Ethan Member

    Joined:
    Nov 6, 2011
    Messages:
    238
    Likes Received:
    0
    If you have the scripts loaded, you'd need to use /eval sys.tier(src, 0); when you're logged on to the server (where you type a chat message).
     
  3. Dezhovator

    Dezhovator Member

    Joined:
    Jul 21, 2012
    Messages:
    33
    Likes Received:
    0
    Yeah when I type /eval sys.tier(src, 0); , server.exe crashes.
     
  4. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Related to my bug report then. Post there I guess (so the bug gets more priority)?
     
  5. kazzaluis

    kazzaluis Member

    Joined:
    Jun 15, 2012
    Messages:
    93
    Likes Received:
    0
    The server crash when i try to see a user team with showteam command :/

    and tier filter isn't work and i'm using the same tiers on lamperi server tools

    but isn't change tiers and with the script of lamperi it's works the tierchek.js
     
  6. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    I have just uploaded the new version (still 2.2.55 though).

    It has plenty of bug fixes(/(show)team as well!), readability improvements, other small improvements, and some code has been rewritten (almost 20k characters removed!).
    Not everything is done though!

    Next update will probably feature a rewritten style/rankicon system which will feature more styles/icons available along with possible bug fixes and maybe even more!

    You can always help me by finding bugs, suggesting new features (don't go crazy though!), and saying what can be improved (messages, commands, etc.)
     
  7. Kyo [KOF]

    Kyo [KOF] New Member

    Joined:
    Jun 20, 2012
    Messages:
    5
    Likes Received:
    0
    Hey In Ur scripts when we battle server crash??? :D
     
  8. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    That is because of PO, not because of the scripts. Complain towards them.
     
  9. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    I have updated the scripts to version 2.2.56!

    It has a bunch of bug fixes, improvements, and some core code has been rewritten.

    Rank Icons & Styles have been completely modified. They don't use files anymore, and you can't load from pastebin anymore either. This is because this feature is never used.

    A bunch of bugs with them have been fixed because of the rewrite! The useless rank icon/style commands have been removed and /styleinfo and /iconinfo have been merged into /styles and /icons

    Other than that, a new NoCrash option has been added that will hopefully fix some of your crashes but limits stuff (breaks tour tier checking somewhat..). If you are still having trouble with crashes when it's on, send me a PM saying when your server crashes (challenging, battle start/end, a command, etc.)

    The script will update to version 3.0.0 when the new PO comes out (can't wait!). Files will be separated, and the version number will be properly updated again (let's not make 1.0.60 -> 2.0.0 again!)

    Various scripts ("snippets") are in https://github.com/TheUnknownOne/PO-Server-Tools/tree/master/development . These will be added in the main script sometime (probably around the time 3.0.0 comes out).


    If you have any good ideas for 3.0.0, or have found a bug/have an idea for 2.2 (as the new po might take a while to be released), post them at https://github.com/TheUnknownOne/PO-Server-Tools/issues (be informative)


    Any questions? Send me a VM or PM.

    Edit: Yay, 500th post :D
     
  10. Maxima304

    Maxima304 New Member

    Joined:
    Aug 12, 2012
    Messages:
    14
    Likes Received:
    0
    Ah I upload them but when we start ratted battle the server shut down
     
  11. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Other than that, a new NoCrash option has been added that will hopefully fix some of your crashes but limits stuff (breaks tour tier checking somewhat..). If you are still having trouble with crashes when it's on, send me a PM saying when your server crashes (challenging, battle start/end, a command, etc.)

    Set NoCrash: false, to NoCrash: true, and it shouldn't crash anymore. This is because PO v2 tends to crash... very often (I'm blaming Qt though)
     
  12. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    what is causing the crash so I could work around on PO scripts which tend to crash on Windows sometimes?
     
  13. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    The sys.tier function. The server crashes when it's called, so it's best to do if statements or return.

    This is mainly:
    Ranking commands
    Tier checks
    Tournament tier checks (to test if the person is in the correct tier)
    Various checks around doubles, triples(battle mode), and challenge cup (clauses)

    Other than that, I don't know of any other crashes. It seems to be sys.tier and the crash log says its from ntdll. It might be windows, or something related to Qt 4.8.x
     
  14. Shoon

    Shoon New Member

    Joined:
    Oct 21, 2010
    Messages:
    6
    Likes Received:
    0
    Hello ! First at all, nice work with the scripts, they will help me a lot.

    But I have a problem: I put the code script in the "Script Window", the server doesn't show any error and when I try to connect the server shutdown (I don't do anything else, just try to connect).

    I have readen other similar messages on the top of this page but they just talk about crashes when you do something, not entering, thank you to reply ;)
     
  15. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    If you open the script window, and scroll down a bit you will see:
    NoCrash: false,

    Change this to:
    NoCrash: true,

    Basically changing 'false' to 'true' (without quotes). Click on 'Ok' and it shouldn't crash anymore although it does limit a few things but nothing really major.
     
  16. Shoon

    Shoon New Member

    Joined:
    Oct 21, 2010
    Messages:
    6
    Likes Received:
    0
    Thanks a lot, it has worked ;)
     
  17. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Added it in the OP too.
     
  18. uzuking

    uzuking New Member

    Joined:
    Aug 18, 2012
    Messages:
    1
    Likes Received:
    0
    Hello. first of all, TheUnknownOne, I would like to thank you for the good script. it was the only one to work the tournaments commands that I wanted.

    Now, to ask and to try helping a little:

    in lines 1869 and 1870, there this code:

    Code (text):
    1.  
    2. meteams = firstTeamFor(sys.id(p), this.tourtier);
    3. oppteams = firstTeamFor(sys.id(op), tourtier);
    4.  
    shouldn't it be "firstTeamForTier", on both lines?

    also, in line 1870 there's the following code:

    Code (text):
    1.  
    2. oppteams = firstTeamForTier(sys.id(op), tourtier);
    3.  
    Shouldn't be "this.tourtier"?

    Now, here's my problem: if I try to start a tournament battle, either with the /autostartbattles or with a challenge, the server crashes. But if I try a challenge with someone (with my test user, in this case) out of a tournament, it goes like there's nothing wrong.

    thanks for the help.
     
  19. Shoon

    Shoon New Member

    Joined:
    Oct 21, 2010
    Messages:
    6
    Likes Received:
    0
    One question more xD Which part of script I have to delete to delete channels like "Eval Area", "Mafia Channel", "Mount Silver", etc. ? Thanks again :)
     
  20. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    In the config:

    AutoChannelJoin: true,
    to
    AutoChannelJoin: false,

    This won't delete the channels, but you won't automatically join them (exception is auto join). The channels are required for certain things to work. You will find the watch channel very useful!
     
  21. Dezhovator

    Dezhovator Member

    Joined:
    Jul 21, 2012
    Messages:
    33
    Likes Received:
    0
    Since July, I haven't done anything about the script. However today I wanted to try your updated script. Tried and Fatal Script Error line 5705: SyntaxError: Parse error...
    Can you fix this? I hope it will work. Thanks....
     
  22. Ethan

    Ethan Member

    Joined:
    Nov 6, 2011
    Messages:
    238
    Likes Received:
    0
    I get same thing, TUO updated something iirc. He'll fix it soon.
     
  23. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Should be fixed now. Gonna write a small batch script to speed up testing.

    Edit: Batch script is done. Gonna make testing a whole lot faster!
     
    Last edited: Aug 21, 2012
  24. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    @uzuking:
    Completely missed your post. Try setting false to true in Config's NoCrash option.


    Other than that:
    Did uzuking's fix.

    Added improved NoCrash, this is how it works:
    Creates a file ".scriptsession" on script check. It gets deleted in serverShutDown. If the file still exists on startup, creates a file named "nocrash.txt" and sets Config.NoCrash to true until this file gets removed regardless of settings. Delete the file to undo this (system crash for example)

    Deleting .scriptsession does not matter as it will get deleted anyway (assuming you have nocrash on if you have crashes)

    Basically, whenever the server crashes the script will "detect" this and turn nocrash to true (on).
     
  25. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Updated to v2.2.60:
    Various improvements, new things, changes, etc. (what you expect :P)

    Including a somewhat untested version of improved tournament displays (now works with commands as well)
    Mafia has also been updated.

    Other than that, trivia has been updated (but still isn't working), new styles and rank icons have been added, channel storage has been improved and fixed, toggle commands were introduced (changed from the old on/off commands), tournament display has been added to channel specific options, and a lot of stuff has been improved in the code.

    Enjoy!
     
  26. Seph

    Seph New Member

    Joined:
    Mar 28, 2012
    Messages:
    12
    Likes Received:
    0
    Hey, don't know if I did something wrong, tried to load your scripts and got this:
    Fatal Script Error line 8365: SyntaxError: Parse error
    that line is this: o = Strings.length() * 1 += 1;
    So the script are not working atm.
     
  27. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
  28. Seph

    Seph New Member

    Joined:
    Mar 28, 2012
    Messages:
    12
    Likes Received:
    0
    I'm still getting the error?
     
  29. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Reload the page.
     
  30. Seph

    Seph New Member

    Joined:
    Mar 28, 2012
    Messages:
    12
    Likes Received:
    0
    I did, but I keep getting that message.
     
  31. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    I can't help you then, as I'm not having the same problem :|
     
  32. Seph

    Seph New Member

    Joined:
    Mar 28, 2012
    Messages:
    12
    Likes Received:
    0
    are you on? Go to my server if you can :c idk whats going on with it
     
  33. Seph

    Seph New Member

    Joined:
    Mar 28, 2012
    Messages:
    12
    Likes Received:
    0
    After putting the scripts in like the 50th time, the server crashed and it now works!! Thanks for the scripts TUO :D and stay saucy.

    Just one quick question though, what is the eval area for?
     
  34. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    To log the /eval command separately.
     
  35. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Working on new 3.0.0 here

    If someone is interested in translating the script into other languages when 3.0 is done, send me a pm!
     
  36. gymleadersabrina

    gymleadersabrina New Member

    Joined:
    Aug 19, 2012
    Messages:
    9
    Likes Received:
    0
    Hey, TUO, I've been using your scripts since I started my server a few months ago (Saffron City Gym), and following your directions has prevented me from having anything at all to complain about... and even with my little scripting experience I've managed to tweak little things here and there as necessary without any major issues. Many people who come to my server ask me for the scripts, and I'm happy to point them to yours! :D

    Anyway, I've been getting a lot complaints about the Battle Point system, pretty much from day one. I have a lot of regular players who really enjoy building up their BP for bragging rights, myself included. However, the consensus is that it's unfair that they always win or lose a completely random number of BP every battle, regardless of how well they did, how hard the battle was, or if someone forfeited or not. So, they keep asking me to alter the system so that how much BP they win or lose is based on the battle itself, not a random number.

    So, is it possible for me to edit the script so that it's no longer "You won " + randNum + " battle points!", but based on certain conditions being met? For example, if Player 1 forfeits the match, they lose between 30 and 50 bp ("You won" + randNum between >=30 and <=50 + "battle points!") and things like that without screwing something up? I don't want to try to edit major things like that without knowing if it'll effect something bigger, which is why I'm asking for your guidance.

    A lot of my players seem to get the short end of the stick after hard battles (winning 10 bp makes it seem like, "wow, why try so hard?") or really good strategic sweeps (losing only 30 battle points or so after getting annihilated in a 6-0 sweep is also something I hear people brag about, and it's annoying). I also end up forfeiting a lot of matches as a courtesy to my players when they mess something up or break a rule, so personally I'd also love to stop losing 100+ bp every time that happens, you know? xD

    I only have something like 250 bp after all this time since I have to constantly dig myself out of a hole, and that hardly reflects my skill as a player, which is what the concern is. Anyway, thanks for your time! =)
     
    Last edited: Nov 10, 2012
  37. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    The problem is that the script barely knows anything about the battle itself. The only way to "improve" the system is to change the random number logic so that if you win, you get 50-80 points, instead of 10-100 points, for example. I'll do that right now. Expect an update in ~10 minutes.

    Done: Tournaments should be a little bit more rewarding now, winning earns you more points (~50 should be the minimum), losing points is now limited to 35.
     
    Last edited: Nov 10, 2012
  38. gymleadersabrina

    gymleadersabrina New Member

    Joined:
    Aug 19, 2012
    Messages:
    9
    Likes Received:
    0
    I cannot thank you enough! I'll test it out and let you know what people think right away!
    :'D
     
  39. gymleadersabrina

    gymleadersabrina New Member

    Joined:
    Aug 19, 2012
    Messages:
    9
    Likes Received:
    0
    Okay, well right before I loaded the new scripts, one of my admins tried to start a tournament and informed me that the Tour Commands "no longer existed."

    I typed /commands to remind myself that they did indeed exist, and found /tourcommands there as always. I managed to start a tournament myself, but a few minutes later, 5 people had joined and suddenly, I couldn't use any more of the usual tour commands. I can't end the tournament, add or disqualify players, etc.

    I updated the scripts to the latest version you added for me about a minute later, hoping that that might fix it, but the issue remains. The "tourcommands" don't even show up in /commands anymore, and I'm not sure why that is. I'm getting "~Server~: The command tourcommands doesn't exist." and variations of that for each of the usual commands I try to use. The tournament is still active, but no one else can join and neither myself or my admins can end it.

    It's very strange. Any thoughts on this?
     
    Last edited: Nov 11, 2012
  40. gymleadersabrina

    gymleadersabrina New Member

    Joined:
    Aug 19, 2012
    Messages:
    9
    Likes Received:
    0
    Also, I apologize if you mentioned something about this issue in an earlier post, I must've missed it if that's the case.