[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. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Tours are disabled in that channel then. Use /enabletours or /eval poChan.toursEnabled = true;
     
  2. gymleadersabrina

    gymleadersabrina New Member

    Joined:
    Aug 19, 2012
    Messages:
    9
    Likes Received:
    0
    "/enabletours" didn't work, but "/eval poChan.toursEnabled = true;" did! Thank you very, very much! Also, the new BP distribution is completely fair, the players (myself include) that got to try it on my server tonight all adore it.

    A thousand thank you's for the excellent work!
    C:
     
  3. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    I have no idea how that happened though (@ tours). Possibly changes to the channel data manager? I think it should be fixed if you restart the server, but I'm not really sure.

    Also, no problem :)
     
  4. gymleadersabrina

    gymleadersabrina New Member

    Joined:
    Aug 19, 2012
    Messages:
    9
    Likes Received:
    0
    Well, I have to re-apply that fix you gave me every time I restart the server or change something in the scripts (I make little changes the rules a lot, and every time I do I have to re-enable the tours). I'm not sure what happened either, but at least the fix you gave me is working.
     
  5. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Looking for the problem..

    Edit: I think I fixed it..
     
    Last edited: Nov 11, 2012
  6. gymleadersabrina

    gymleadersabrina New Member

    Joined:
    Aug 19, 2012
    Messages:
    9
    Likes Received:
    0
    I no longer have to re-enable tours upon re-starting the server, so I think it is fixed. Thank you once again!
    :D
     
  7. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Just letting everyone know that deprecated warnings will not be fixed (which do not occur < 2.0.06). Everything still works properly.
     
  8. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    IMPORTANT!

    I uploaded a pretty important security fix just now. Please update the scripts to protect yourself against an XSS-style attack which can be devastating.
     
  9. [Eon]Zekrom

    [Eon]Zekrom New Member

    Joined:
    Jul 5, 2012
    Messages:
    3
    Likes Received:
    0
    Scripts aren't working on my server, i updated everything and no commands work? Problem?
     
  10. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Contact me via PM.
     
  11. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    3.0 Spoilers
    -----------------

    Some people have asked me if I was working on a new script, and yes, this is true, albeit slowly. I'd say I'm currently at about 25% atm.

    I still have to do some core code, then the commands, and even when that's done, I'll probably have 10-20% left to do. This is because I'm planning on adding some new features that some of you might like. :)

    So, let's look at what's done:

    Core
    Core Utilities:
    ~40%
    Player Utilities: ~55%
    Channel Utilities: ~70%
    JSESSION: ~80%
    DataHash: ~80%
    Channel Data: ~95%
    Logging: ~85%
    Tournaments: ~95%

    Mafia:
    0%
    Other:
    ~15%

    Events
    Core Events:
    ~90%
    Player Events: ~80%
    Battle Events: ~80%
    Channel Events: ~85%
    Commands
    Basically no progress on this yet.

    New features:
    ~7%

    Estimated completion:
    approx. 27%

    New features include:
    - Less bugs (yes, this is actually a feature now).
    - Improved logging (now has the option to save to a file, which, by default, is server.log).
    - Better support for newer versions of v2 PO.
    - Updated version of Mafia.
    - Scripts are in multiple files. Scripts.js will also be < 2000 lines.
    - An actual API, as well as much more readable code.
    -
    Improved performance.
    - Improved data format (less disk space and faster loading times).
    - Possibly support for multiple languages if there are translators.
    - More script configuration options (these must be changed in the script itself).
    - Tournaments are now enabled on every channel, without lowering performance. (this also means less memory usage)
    - Eval now requires special access.
    - Integration with PO's new tempban system.
    - Possibly a new tournament type/mode (need feedback and suggestions).
    - Possibly support for "dynamic" announcements or perhaps an announcement markup language (or simply some extensions).
    - User preferences
    -
    Much easier to rename default channels.
    - More to come. Remember that the new features are at approx. 7%.

    Removed features: (not a complete list)
    - Trivia
    - Custom auth names
    - Superimp command
     
    Last edited: May 22, 2013
  12. Alex Scott

    Alex Scott Banned

    Joined:
    Jun 23, 2013
    Messages:
    2
    Likes Received:
    0
    PO Trainer Name:
    Alex Scott.
    For the current TUO scripts out, the /evalop command isn't working.
     
  13. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Development on the next version (3.0.0) has been stopped (a while ago, actually). If there's any demand for it, I'll probably finish it.

    If I would, it'd be written in CoffeeScript, and the script will remain a single file (output), but the source will be in multiple files.
     
  14. [HH]Reaper

    [HH]Reaper New Member

    Joined:
    Sep 20, 2013
    Messages:
    2
    Likes Received:
    0
    TheUnknownOne some of the tuo scripts command dont work like tournys and the kick command it says they was kicked from server but they stay and the tourny adds last player it says 0 players left to join can you help plz?
     
  15. [HH]Reaper

    [HH]Reaper New Member

    Joined:
    Sep 20, 2013
    Messages:
    2
    Likes Received:
    0
  16. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Official Release 2.6.3

    Official Release 2.6.3

    Today, version 2.6.3 has been released. Here are its changes:
    • The script now passes through JSLint more or less (the Mafia script doesn't, however)
    • Many bugs have been fixed

    NOTE: Some bugs might have been introduced in this release. PM me your stack traces/problems.

    Get it here (as usual)!

    -------------------------------

    As said previously, if there's a demand for me to continue working on 3.0.0, I'll be glad to hear it.
     
  17. Scatterbrain

    Scatterbrain You only live once*

    Joined:
    Jul 5, 2012
    Messages:
    865
    Likes Received:
    4
    Does this have the new mafia commands? (shield, dummy, dummy2, dummy3)
     
  18. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    No, the embedded Mafia is quite old (though it should be fairly easy to update it).
     
  19. roloc

    roloc New Member

    Joined:
    Jul 11, 2013
    Messages:
    19
    Likes Received:
    0
    When I try to use the force battle command on my server I get this error:

    Script Error line 792: TypeError: Result of expression 'tier.toLowerCase' [undefined] is not a function.
    firstTeamForTier(id = 10, tier = false) at scripts.js:792
    <anonymous>() at scripts.js:7423
    <anonymous>(src = 1, message = '/forcebattle Miss Wednesday!:Roloc', chan = 0) at scripts.js:8888
    <global>() at -1
     
  20. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Should be fixed now.
     
  21. roloc

    roloc New Member

    Joined:
    Jul 11, 2013
    Messages:
    19
    Likes Received:
    0
    Yup, works like a charm. Thanks!
     
  22. Pjupe

    Pjupe New Member

    Joined:
    Jun 30, 2013
    Messages:
    14
    Likes Received:
    0
    Hey guys. I have problems with mafia. There's always an error.
    When I type "/start" or "/starttheme default" it says:

    When I type "/votetheme" it says:
    It seems that there aren't installed themes ("/themes" shows nothing, "/add" and "/update" doesn't work either).
    Any solutions how to fix this?
     
  23. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    I believe you have to do /importold first (and you probably want to add some themes with it - Beta/Mafia forum has many available).
     
  24. Pjupe

    Pjupe New Member

    Joined:
    Jun 30, 2013
    Messages:
    14
    Likes Received:
    0
    It doesn't work (is it "/importold default" oder how does it work?)

    I. (This problem seems fixed since a reinstallation)
    But I have another question.
    Now I've tried ~ 5 tournaments and there's always a problem with "unofficial" battles.

    In most cases it says this:
    "(15:55:39) ~Server~: Your or your opponents team does not match the tournament tier (the match is not official)."

    But both have used a team of the tournament tier. In the watch channel it says (nobody changed or loaded a new team):
    "Script Warning in sys.tier: Player numbered 3 only has 6 teams, so you can't access team #12. tier(id = 3, team = 12) at -1 (src = 31, dest = 3, clauses = 263, rated = false, srcteam = 0, destteam = 12) at scripts.js:1820 (src = 31, dest = 3, clauses = 263, rated = false, srcteam = 0, destteam = 12, 5, 5) at scripts.js:9118 () at -1
    (16:07:18) ~Server~: Your or your opponents team does not match the tournament tier (the match is not official)."

    This means I have to (manually) disqualify the player who has lost the battle.
    It becomes even stranger: In one tournament there was autostart battles activated and I was forced to battle with a Gen. 5 team against Gen. 6 in a Gen. 6 tournament. I won this battle and qualified for the next round. In the next round was autostart deactivated and I was able to use my Gen. 6 team. I've lost the next round and it did nothing. I had to dq myself.
    Why does it work with "illegal" teams but not with legal teams?


    II. Edit: It works better now but sometimes it says it's a tournament match (which is true) but after the battle nothing happens. This seems to be totally random. An example:
    This happens not only when a player forfeits.


    III. Another thing is: I think it shouldn't be possible that a Megauser or Mod can force equal or higher authorities (even the server owner) into a tournament (you can rethink this for "afk" users also). This can be misused too easily imho.

    And there's a "style" problem. Look at this:
    The last 2 lines should come before the first 3. It makes no sense this way.
     
    Last edited: Dec 27, 2013
  25. TwilightAbsol

    TwilightAbsol Bringer of Disaster

    Joined:
    Apr 5, 2013
    Messages:
    20
    Likes Received:
    0
    PO Trainer Name:
    [ SKY ]TwilightAbsol
    Im having a few errors show up regarding the channels

    Script Error line 2677: TypeError: Result of expression 'JSESSION.channels(watch)' [undefined] is not an object.
    <anonymous>(src = 1, '') at scripts.js:2677
    <global>() at -1

    Script Error line 2685: TypeError: Result of expression 'JSESSION.channels(scriptchannel)' [undefined] is not an object.
    <anonymous>(src = 2, '') at scripts.js:2685
    <global>() at -1

    Script Error line 2681: TypeError: Result of expression 'JSESSION.channels(staffchannel)' [undefined] is not an object.
    <anonymous>(src = 3, '') at scripts.js:2681
    <global>() at -1
     
  26. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    You can try restarting your server, otherwise I don't really know right now.

    In case people are wondering, I'm not maintaining this anymore at the moment​.
     
  27. roloc

    roloc New Member

    Joined:
    Jul 11, 2013
    Messages:
    19
    Likes Received:
    0
    Aww, thats to bad. I really loved your script, been using it for a while now.