mc 服务器设置自动重启,服务器自动重启"脚本"

本文详细解析了一段用于自动启动和重启Minecraft服务器的批处理脚本。脚本首先设置服务器标题,然后指定Java运行参数,并定义了定时重启的逻辑,通过模拟键盘输入实现服务器的关闭和启动操作。此脚本对于Minecraft服务器管理者来说,能有效提高管理效率。
摘要由CSDN通过智能技术生成

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

首先把开服用的bat文件编辑下 在里面加入 'title 服务器' 一条

例子: @ECHO OFF

color b

title 服务器

SET BINDIR=%~dp0

CD /D "%BINDIR%"

"D:\java6\bin\java.exe" -Xincgc -Xmx1G -jar craftbukkit.jar

PAUSE

下面就是脚本了

//下面的指令“”里写你开服用的bat文件路径

RunApp "E:\TDDOWNLOAD\mc\1.3.2服务器端\运行服务器.bat"

Delay 5000

Hwnd = Plugin.Window.Find(0, "管理员: 服务器")

//下面是重启时间默认的是1小时

Delay 3600000

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,65)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,89)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,32)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,69)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,86)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,69)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,32)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,69)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,84)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,65)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,84)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,32)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,73)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,78)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,32)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,101)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,77)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,13)

Delay 300000

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,65)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,86)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,69)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,189)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,65)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,76)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,76)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,13)

Delay 5000

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,65)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,89)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,32)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,69)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,86)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,69)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,32)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,69)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,84)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,65)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,82)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,84)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,13)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,83)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,84)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,79)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,80)

Delay 500

Call Plugin.Bkgnd.KeyPress(Hwnd,13)

Delay 60000

Call Plugin.Bkgnd.KeyPress(Hwnd,13)

Delay 5000

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值