- 版权类型
- 原创
- 版权链接
- #
- 前置组件
- 前置一python:
1.官网安装
https://www.python.org/
2.已经下载好的蓝凑云连接
https://wwxh.lanzoum.com/iol8j16dl3sd
密码:cmij
前置二,psutil的python库
安装好python后,windows徽标键+R打开运行,输入cmd,打开终端,输入
pip install psutil
这个命令,等待安装完成
教程:(xxxx是源码保护)
源代码:
#需要安装python,编写时使用python3.11
#使用方法:改后缀为py后,右键,选择edit with idle后面唯一的一个选项,会打开源码窗口,点击run,run moudle
import psutil#需要打开cmd输入"pip install psutil"
import subprocess
import time
def xxxxxxxxxxxx:
for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
if proc.info['name'] == 'bedrock_server_mod.exe':#可以把此处改为别的名字以适配别的核心
xxxxxxxxxxxxx
xxxxxxxxxxxxxx
def xxxxxxxxxxxxxxxxx:
subprocess.Popen(r'D:\server\bedrock_server_mod.exe')#可以把此处路径修改以适配别的开服路径
while xxxx:
if xxxxxxxxxxxxxxx:
xxxxxxxxxxxxxxxxxxxxxxx
time.sleep(1)#此处timesleep后的数字意思是多久重启一次
源代码:
#需要安装python,编写时使用python3.11
#使用方法:改后缀为py后,右键,选择edit with idle后面唯一的一个选项,会打开源码窗口,点击run,run moudle
import psutil#需要打开cmd输入"pip install psutil"
import subprocess
import time
def xxxxxxxxxxxx:
for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
if proc.info['name'] == 'bedrock_server_mod.exe':#可以把此处改为别的名字以适配别的核心
xxxxxxxxxxxxx
xxxxxxxxxxxxxx
def xxxxxxxxxxxxxxxxx:
subprocess.Popen(r'D:\server\bedrock_server_mod.exe')#可以把此处路径修改以适配别的开服路径
while xxxx:
if xxxxxxxxxxxxxxx:
xxxxxxxxxxxxxxxxxxxxxxx
time.sleep(1)#此处timesleep后的数字意思是多久重启一次