App Exit configuration on Generic Module

  • 23 Views
  • Last Post 2 weeks ago
lela810 posted this 2 weeks ago

So, I was setting up a Generic Module for Screeps. Now I'm having some Problems closing the Process with AMP. Now I'm Asking if there is any way to run a STOP Script or something in that direction? On that Note I asked myself what "App.ExitFile=app_exit.lck" means/stands for, because it is not mentioned in the Wiki.

Thanks in Advance! :)

P.S. my start script

#!/bin/bash 
exit_script() {
echo ""
echo "Stopping Server"
screen -XS screeps quit
rm screenlog.0
}

trap exit_script TERM


screen -d -L -S screeps -m npx screeps start --port $1 --cli_port $2 --cli_host $3
timeout 20 tail -f screenlog.0 
npx screeps cli

Order By: Standard | Newest | Votes
Mike posted this 2 weeks ago

It's not necessary. You should just run npx screeps start... directly (do not use shell scripts!) and then you can just use the String exit method with a value of quit.

  • Liked by
  • lela810
lela810 posted this 2 weeks ago

I will try that but, if I execute the Command directly, I won't have any CLI functionality of the game. On top of that, there is not (to my knowledge) any way of stopping the Server from the Game CLI. Unless you have a way to execute and stop both npx screeps start and npx screeps cli there is no way around a start script.

Thanks :)

Close