1.17 (obsolete) Command Timelines 1.0.3

Create custom-made macros with an easy-to-understand programming language

  1. GameRoom

    Plugin Developer Zero Day Plugin Author

    Joined:
    Jun 20, 2012
    Messages:
    37
    Version 1.0.2

    This plugin lets you run custom-made macros to help with things such as countdowns. Just make them in the easy-to-understand programming language in Notepad and save them in the TShock/tshock directory.

    Commands (you can use /tl instead of /timeline):
    /timeline start <file> [arguments] - Starts a macro with the given filename. If any arguments are defined, type those too.
    /timeline stop <file> - Stops the macro with the given filename.
    /timeline show - Shows all running macros.

    Permissions:
    timeline.admin.useall - Lets the group start or stop any timeline.
    timeline.use-[file] - Allows a group to use a specific command. For example, you can give a group the permission timeline.use-example.txt, and that group will only be able to use that timeline. You can also specify a folder such as with the permission timeline.use-registeredusers. If you create a folder within the TShock folder called that, any timeline in it will be usable for those with the permission.

    Examples:
    Let's say you want a game to start in 30 seconds. You type /timeline start wait30secs.txt. Before doing this, you must create the macro. Go into TShock/tshock and create the new file, wait30secs.txt. In it should be something like this:
    Code:
    //This is a comment.
    #wait 1000 //The timeline will wait for 1000 milliseconds.
    bc The game is starting in 30 seconds.
    #wait 15000
    bc 15 seconds...
    #wait 5000
    bc 10 seconds
    #wait 1000
    bc 9
    #wait 1000
    bc 8
    #wait 1000
    bc 7
    #wait 1000
    bc 6
    #wait 1000
    bc 5
    #wait 1000
    bc 4
    #wait 1000
    bc 3
    #wait 1000
    bc 2
    #wait 1000
    bc 1
    #wait 1000
    bc The game has started!
    antibuild off
    As you can see, executing a command is just as easy as doing so in the server console. You also have the command #wait <milliseconds>. But what if you want something more complicated? This example shows how to pass arguments into a macro.
    Code:
    #req name, adjective, adjective2
    #wait 500
    bc {0} is {1}.
    #wait 2000
    bc {0} really is {2}.
    
    The #req command should be passed at the start of the code, and it sends an error message to the player if he doesn't have the proper arguments, which are separated with commas. You can replace any bit of code with these arguments. You're not just limited to text; you could, for example, have one of the arguments be an entire command, you could modify how long to wait at a point, or you could even use an argument to switch a comment on or off.

    Links:
    Download | Source

    Changelog:
    1.0.1 - Updated permissions to be file and folder-specific.
     
    • Like Like x 3
  2. Ijwu

    Ijwu Level 11

    Joined:
    Apr 4, 2012
    Messages:
    647
    Sweet. Looks good, source-wise. I was afraid you were going to Thread.Sleep to do the waiting but I'm happy to say I was wrong.
     
  3. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
    Me too. lol
     
  4. Ps2004

    Ps2004 Level 1

    Joined:
    Jul 5, 2014
    Messages:
    5
    Sweet plugin !
    Love it ! No more need to check clock for CTG preptime ! It does it all !
    Announce rules, countdown, remove antibuild ! Yay !
     
    • Like Like x 1
  5. Ijwu

    Ijwu Level 11

    Joined:
    Apr 4, 2012
    Messages:
    647
    Approved.
     
  6. Terrabear

    Terrabear Level 6

    Joined:
    Jun 26, 2014
    Messages:
    138
    Cooool, but it seems that bc in text file doesn't support non-english languages.
     
  7. GameRoom

    Plugin Developer Zero Day Plugin Author

    Joined:
    Jun 20, 2012
    Messages:
    37
    Could you give me an example of a command that doesn't work?
     
  8. dark22

    dark22 Level 4

    Joined:
    May 17, 2014
    Messages:
    97
    The problem occurs with characters (ã, õ, ç), etc. How much is a text they are replaced by asterisks (*). Maybe it's inconvenient for those who want to use the special characters, but I personally do not use them because are "bold" and badly formatted in the terraria chat, then do not use accents.

    @GameRoon, great job, your plugin is very interesting.
     
  9. Terrabear

    Terrabear Level 6

    Joined:
    Jun 26, 2014
    Messages:
    138
    umm, only 'bc', the broadcast. and normal english broadcast is working well, so trivial thing.

    I'm using non-english language, here is an example - '가나다라마바사아자차카타파하'
    I applied language patch made by countryman, so don't have to worry about the font or format.

    It was just a minor report, so don't concern yourself too much about this, thanks! :)
     
  10. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,597
    Hi. This is because the font used by Terraria doesn't have these characters. It can't display them, so it displays a * instead
     
    • Like Like x 1
  11. GameRoom

    Plugin Developer Zero Day Plugin Author

    Joined:
    Jun 20, 2012
    Messages:
    37
    An update is out! Specifically, permissions were changed a bit.
     
    • Like Like x 1
  12. T3seR

    T3seR Level 0

    Joined:
    Dec 29, 2014
    Messages:
    2
    Hmm. Hellow, I tried to make a auto cmd with this pluggin, i used two files 01.txt and 02.txt, 01 txt is only to start 02 again, and the end of 02 is to start 01

    in 01 is only
    [#wait 1000
    timeline start 02.txt]

    in 02 is
    [#wait 5000
    //all
    #wait 5000
    //biome crimson normal
    #wait 5000
    //biome corruption normal
    #wait 5000
    //biome hallow normal
    #wait 600000
    timeline start 01.txt]

    this commands with two bars "//" is from WorldEdit, Is for recover world of crimson and corruption every 10 min, but the pluggin don't exe the commands whith this two bars.. only whihout bars =/, have some fix for it?
     
  13. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,597
    Try using a single /.
    i.e.,
    Code:
    [#wait 1000
    timeline start 02.txt]
     
    [#wait 5000
    /all
    #wait 5000
    /biome crimson normal
    #wait 5000
    /biome corruption normal
    #wait 5000
    /biome hallow normal
    #wait 600000
    timeline start 01.txt]
    
     
    • Like Like x 1
  14. T3seR

    T3seR Level 0

    Joined:
    Dec 29, 2014
    Messages:
    2

    Yeyyyy worked :D
     
    • Like Like x 1
  15. Ravensteam

    Ravensteam Level 1

    Joined:
    Dec 12, 2014
    Messages:
    6
    Hello!

    I'm currently running into a bit of a problem here. I'm trying to create a timeline to do a weekly reset of my server. Most of it works fine, including the fix for the worldedit issue, however the commands /bringtospawn(from https://tshock.co/xf/index.php?threads/1-16-bring-players-to-spawn.3000/), /resetplayers all(from https://tshock.co/xf/index.php?threads/1-16-ssc-character-reset.3059/), and /restart(found in the default TShock command list) state that they're invalid commands upon running the timeline. Separately, all three work fine. Here's the timeline:
    //Resets world back to default
    #wait 604800000 //1 week
    bc Server will reset in 30 seconds! Thanks for playing!
    #wait 15000
    bc 15 seconds...
    #wait 5000
    bc 10 seconds
    #wait 1000
    bc 9
    #wait 1000
    bc 8
    #wait 1000
    bc 7
    #wait 1000
    bc 6
    #wait 1000
    bc 5
    #wait 1000
    bc 4
    #wait 1000
    bc 3
    #wait 1000
    bc 2
    #wait 1000
    bc 1
    #wait 1000
    /schematic load World1
    /all
    /paste
    /bringtospawn
    /resetplayers all
    /restart
    Help would be greatly appreciated.

    Thanks,
    Jerry
     
  16. Kojiro_S

    Kojiro_S Level 11

    Joined:
    Feb 16, 2014
    Messages:
    636
    The WorldEdit commands require a / on the script because it's actually part of the command name (IE //paste). Non-WorldEdit commands should be written without the backslash.

    Try this:
    Code:
    #wait 604800000
    bc Server will reset in 30 seconds! Thanks for playing!
    #wait 15000
    bc 15 seconds...
    #wait 5000
    bc 10 seconds
    #wait 1000
    bc 9
    #wait 1000
    bc 8
    #wait 1000
    bc 7
    #wait 1000
    bc 6
    #wait 1000
    bc 5
    #wait 1000
    bc 4
    #wait 1000
    bc 3
    #wait 1000
    bc 2
    #wait 1000
    bc 1
    #wait 1000
    /schematic load World1
    /all
    /paste
    bringtospawn
    resetplayers all
    restart
    
    By the way, I think restart is not a good choice if what you seek is an automatic reboot. AFAIK it always ask you to choose a world, even if you have only one. If I'm wrong, please correct me..
     
    • Like Like x 1
  17. Ravensteam

    Ravensteam Level 1

    Joined:
    Dec 12, 2014
    Messages:
    6
    Thank you, I shall attempt that once I get back to the computer to run the game in.

    I've restarted my server numerous times, it's auto-set to load the same world, so for me that's no issue.
     
  18. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,597
    You should be able to use command-line args to skip world and port selection. (-world, -port)
     
  19. Kojiro_S

    Kojiro_S Level 11

    Joined:
    Feb 16, 2014
    Messages:
    636
    Didn't know that. Then I add to /restart the same parameters I have set up on my launch shortcut?
     
  20. Ravensteam

    Ravensteam Level 1

    Joined:
    Dec 12, 2014
    Messages:
    6
    I'm aware it's been a while since a new post on here, but an inquiry has come up. How do I have a timeline run every time the server restarts?