[REQUEST] Send commands when server starts

Discussion in 'Archived: Plugin Requests' started by iPodHacks142, May 26, 2013.

  1. Offline

    iPodHacks142

    Hi. I really need a plugin that will send console commands when the server starting up. I tried one called StartUpCmds but it doesn't really work. Can someone please do this for me? Thanks in advance.
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    iPodHacks142

    How do I go about doing this? It doesn't say how anywhere.
     
  4. Online

    timtower Administrator Administrator Moderator

    They have an wiki, you need to add lines to the main.ms, I think that it was : run(<your command without an / here>)
     
  5. Offline

    iPodHacks142

    But that plugin is just for making custom commands, not running them when a server starts up.
     
  6. Online

    timtower Administrator Administrator Moderator

    I used it a long time, everything in the main.ms is run when the plugin is loaded
     
  7. Offline

    iPodHacks142

    Ok thanks. Looks like the plugin has what I need. But the wiki doesn't tell me how to use commands on start up. Could you maybe show me an example?
     
  8. Online

    timtower Administrator Administrator Moderator

    Just add lines to the main.ms
    Code:
    run(pardon Timtower)
    run(ban Tnt)
    run(ban Notch)
     
  9. Offline

    iPodHacks142

    The things on the wiki all have it like run('ban notch'). Should this be like that too?
     
  10. Online

    timtower Administrator Administrator Moderator

    Yep
     
  11. Offline

    iPodHacks142

    Ok so I tried that but I can't seem to get it to work. Would it be possible to show me a full main.ms file with this in it?
     
  12. Online

    timtower Administrator Administrator Moderator

    If can give you one if you send me yours ;)
     
  13. Offline

    iPodHacks142

    Heres the default one:
     
  14. Online

    timtower Administrator Administrator Moderator

    iPodHacks142
    Code:
    ######################################################
    #
    # Sample Main file. This file is run when the server
    # starts up, or the plugin is reloaded. It can be used
    # as an opportunity to register events or do other things
    # when the server initially starts. Variables defined here
    # will go out of scope, so you can't assign() something and
    # then use it in a command, for instance.
    #
    ######################################################
     
    assign(@server_name, '<Server Name>')
     
    #Echo out a server greeting to the console
    console('Welcome to this server, which is running CommandHelper!')
     
    #Bind an event to the player join, and tell ops hello. We send in
    #@server_name, so we can use it inside the event handler
    bind(player_join, null, null, [USER=8023]Event[/USER], @server_name,
    #if the player is an op, let's send them a message
    if(pisop(@event[player]), tmsg(@event[player], 'Welcome to' @server_name))
    run('pardon timtower')
    run('ban Notch')
    )
     
  15. Offline

    iPodHacks142

    It's not working
     
  16. Online

    timtower Administrator Administrator Moderator

    What is the error? Can't do anything without it
     
  17. Offline

    iPodHacks142

    This is the only error in the log file for CommandHelper:
     
  18. Online

    timtower Administrator Administrator Moderator

    iPodHacks142 Try an dev build ;) I think that this is an old version.
    And please tahg me ;)
     
  19. Offline

    iPodHacks142

    timtower Still not working. This time there are no error logs. Any ideas?
     
  20. Offline

    MXCRAFTSERVER

    If you want I would be willing to make this plugin for you.
     
  21. Offline

    aronuserparty98

  22. Offline

    iPodHacks142

    MXCRAFTSERVER That would be great.

    Thanks but not what i'm looking for.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  23. Offline

    MXCRAFTSERVER

    I have an idea how to do it, it will be ready in a couple days or less.
     
  24. Offline

    iPodHacks142

  25. Offline

    aronuserparty98

    Oh, sorry. My bad.
     
  26. Offline

    Ultimate_n00b

    I got this.
    Give me a bit less than a hour.

    25 lines of code =D
    <Edit by Moderator: Redacted mediafire url>
    Just edit them in the config. If you want commands like to add delete reload, it'll only take a few more minutes.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 6, 2016
  27. Offline

    iPodHacks142

    [quote uid=90707285 name="Ultimate_n00b" post=1687727]25 lines of code =D
    <Edit by Moderator: Redacted mediafire url>
    Just edit them in the config. If you want commands like to add delete reload, it'll only take a few more minutes.[/quote]

    Not working:
     
    Last edited by a moderator: Nov 6, 2016
  28. Offline

    breezeyboy

    Update yo Java.
     
  29. Offline

    Ultimate_n00b

    [quote uid=90728598 name="iPodHacks142" post=1687736]Not working:[/quote]

    Yeah, I compile with 7.
    But on the other hand, I added commands + permissions

    /sc - startcommand.help - Views the basic commands
    /sc add <command> - startcommand.add - Add a command
    /sc list <page#> - startcommand.list - The first page is 0, not 1
    /sc delete <#> - startcommand.delete - Delete a start command

    Sadly, 96 lines of code. Not like its a lot, but I can't submit it to the 50 line page = (
    Well, heres the link:

    <Edit by Moderator: Redacted mediafire url>

    I suppose I could compile with java 6, I just don't feel like downloading it >_>
     
    Last edited by a moderator: Nov 6, 2016
  30. Offline

    breezeyboy

Share This Page