Solved Automatic commands

Discussion in 'Plugin Requests' started by iScripters, Jan 12, 2015.

  1. Hi there,

    Been a while since I was active on here.. looking for some really small and simple plugin for Oxide 2, but no clue how to do it myself.

    Basically what I want is a plugin that executes a specific console command after the server is completely started (can do this with a timer too..) and then another command after X seconds. That's all.

    Would anyone be able to provide the required code for the plugin?


    Thanks!
     
  2. Wulf

    Wulf Community Admin

    As far as I know, there is no way to issue server commands from a plugin yet with Experimental.
     
  3. I create timed commands in Rusty Rcon client under the Admin Tab.
     
  4. Wulf

    Wulf Community Admin

    Commands from RCON and an external program is not the same as trying to issue commands internally via Lua plugins.
     
  5. correct
     
  6. Thanks for the replies! I've had this working on sauerkraut earlier (Yeah I know, not the same as Oxide) with a Python script, thought it might be possible with Lua too.

    Thanks anyway :)
     
  7. your welcome! :) good luck on your request, someone may possibly help you later with more knowledge on the subject.
     
  8. Wulf

    Wulf Community Admin

    They may be exposing a bit more than Oxide 2 does yet. I've been trying to find a method to execute commands, but no success so far as-is.
     
  9. Maybe BasePlayer:SendConsoleCommand("chat.say \"/command\" \"arg1\" \"arg2\" ")
    I think it should work. I'm not sure this is something that should be...
    And we can run the commands from the first player , who came to the server
     
    Last edited by a moderator: Jan 12, 2015
  10. Which commands would you want to execute?
     
  11. The exact commands are irrelevant, i think.. but it would be pure console commands (like status, server.stop, etc)
     
  12. Wulf

    Wulf Community Admin

    I don't think either of those commands exist in Experimental. :p

    I've tried pretty much everything, but nothing works to send commands other than chat.say really.

    Code:
        player:SendConsoleCommand("global.quit")
        global.ConsoleSystem.Run("global.quit", false)
        global.Application.Quit(nil)
        BasePlayer:SendConsoleCommand("global.quit")
    
     
  13. They do, give it a try :) Or, click to screenshot
     
  14. Wulf

    Wulf Community Admin

    Ahh, right. The server.stop command doesn't actually fully stop the server, at least not close it. It is the same as using global.Application.Quit(nil).
     
  15. Can't you run the commands by using ConsoleSystem.ClientRun(String command, bool sendToServer, bool WantsFeedback)
     
  16. Wulf

    Wulf Community Admin

    That'd be the client, no? You'd want it to run without a client present as well. That's why I was leaning toward ConsoleSystem.Run.
     
  17. Yes :p global.ConsoleSystem.Run("status", true) will work for the status command, so should work for other console commands as well
     
  18. Wulf

    Wulf Community Admin

    Hmmmm... not sure why I am having issues then.

    Edit: Nevermind... apparently server.stop and global.stop already exist, so they couldn't register.
    [DOUBLEPOST=1421097801][/DOUBLEPOST]Looks like I'll be porting my Auto Commands plugin to Experimental now then. :) Thanks @Mughisi.
     
  19. SendConsoleCommands not working for me too :c
    Need to use: arg.cmd.Call(arg)
    But I do not know how to make it work in a Lua .-. (System.Action)
     
  20. Wulf

    Wulf Community Admin

    We already figured it out. See the above posts. ;)