KitcheVadimas Posted January 19, 2016 Share Posted January 19, 2016 When I was on a non modded server, I noticed that it had custom server announcements for players joining. How do I do this for my server? I would like it to say the server rules once every hour or so, as well as custom announcements for players joining. Link to comment Share on other sites More sharing options...
Zillvr Posted January 19, 2016 Share Posted January 19, 2016 Hey @KitcheVadimas I believe this is what you are looking for.Cheers. Link to comment Share on other sites More sharing options...
KitcheVadimas Posted January 19, 2016 Author Share Posted January 19, 2016 No, I know what c_announce is. The announcements were automatic. Link to comment Share on other sites More sharing options...
Zillvr Posted January 19, 2016 Share Posted January 19, 2016 The server you saw may not be modded but I believe the admin created their own script for the console commands that listens for new players and utilizes the c_announce. Sadly, I do not have the necessary knowledge to write up the script to do so. Sorry for not being much help others with better know how may be able to, good luck. Link to comment Share on other sites More sharing options...
KitcheVadimas Posted January 19, 2016 Author Share Posted January 19, 2016 30 minutes ago, Zillvr said: The server you saw may not be modded but I believe the admin created their own script for the console commands that listens for new players and utilizes the c_announce. Sadly, I do not have the necessary knowledge to write up the script to do so. Sorry for not being much help others with better know how may be able to, good luck. Ok, thanks anyway. Link to comment Share on other sites More sharing options...
mcumba Posted January 19, 2016 Share Posted January 19, 2016 HI, i myself own a dedicated server, and I would love to know how to make the kind of script you are talking about, using the c_announce command! If any good soul could enlighten me, it would be much appreciated ! Thanks Link to comment Share on other sites More sharing options...
Muche Posted January 19, 2016 Share Posted January 19, 2016 I believe having client_only mods enabled on dedicated server will not mark the server as modded. Link to comment Share on other sites More sharing options...
Wellmax Posted January 20, 2016 Share Posted January 20, 2016 1. For a periodic announcement, you could do c_announce(msg,interval) on your server or via a cronjob with a Bash script. You should be able to use the DST commands via the console. To do this, add -console when you start your server. Example : screen -dmS dst_server1 "./dontstarve_dedicated_server_nullrenderer -conf_dir dst_server1 -console" nano server_announce.sh arg=$* screenName=dst_server1 #The screen name of your server screen -r $screenName -p 0 -X stuff "c_announce(\"""$arg""\")""$(echo -ne '\015')" Ctrl + O to save, and Ctrl + X to quit. chmod +x server_announce.sh To test it, try : ./announce_server.sh Your text here! crontab -e For a periodic message every hour for example, add this line to your crontab. 0 * * * * sh /path/to/server_announce.sh Your text goes here! 2. To welcome visitors on your server, nano join_server_announcement.sh while true do grep -m 1 "Join Announcement" <(tail -n 0 -F ~/.klei/dst_adventure_overworld/chat_log.txt)\ && sleep 15 && sh /path/to/announce_server.sh Welcome! #Link it to the announce_server script. done Ctrl + O to save, and Ctrl + X to quit. Now you can start a screen with the script in it. screen -dmS join_server_announcement "./join_server_announcement.sh" So, this is how you do this in Bash. If you have any question, do not hesitate. Link to comment Share on other sites More sharing options...
absimiliard Posted January 20, 2016 Share Posted January 20, 2016 From my file of useful stuffs: # Set announcement on player joining game TheWorld:ListenForEvent("ms_playerjoined", function() c_announce("This is a test announcement from the console") end) Note: I haven't tested this recently, it might be stale. Also, this announcement will only play until the world regens, which is fine for a Wilderness or Endless server but does mean you can't count on it for a Survival server. Link to comment Share on other sites More sharing options...
KitcheVadimas Posted January 22, 2016 Author Share Posted January 22, 2016 On 1/20/2016 at 11:34 AM, absimiliard said: From my file of useful stuffs: # Set announcement on player joining game TheWorld:ListenForEvent("ms_playerjoined", function() c_announce("This is a test announcement from the console") end) Note: I haven't tested this recently, it might be stale. Also, this announcement will only play until the world regens, which is fine for a Wilderness or Endless server but does mean you can't count on it for a Survival server. Thanks! Is there any way of re-adding a console command automatically? This is far more useful than having to tell them myself every-time someone joins. Also, can this be done with multiple announcements, or over time? Link to comment Share on other sites More sharing options...
absimiliard Posted January 22, 2016 Share Posted January 22, 2016 My testing showed I could set several of these up at once. So when a new player joined I'm pretty sure I could get it to say several things, I never found a way to selectively disable one once set up however. Also note, been a while since I did this,, so I'd suggest doing some testing, my memory ain't what it used to be when I was a young sysad, now it's all full of linux-crap and sql-scraps. There might be a way to get a console command to run automatically. I think it would essentially be making a mod. I'd suggest poking through that forum, your answer might be there. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.