本帖最后由 hyx1521 于 2012-10-2 06:17 编辑
10月2号更新服务器自动重启脚本
更新内容
更新了句柄的获取 开启服务器后不用在等几秒了
降低了输入字的延迟
添加了重启前的最后提示信息
首先把开服用的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月2号更新服务器自动重启脚本
更新内容
更新了句柄的获取 开启服务器后不用在等几秒了
降低了输入字的延迟
添加了重启前的最后提示信息
首先把开服用的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
可以附上按键精灵然后发到我的软件资源版,哈哈哈哈
太谢谢楼主了!----------------------------------------------------------------------------------可是。怎么上传到按键精灵呢?
哦,我会了,谢谢楼主。
楼主!为什么我用了脚本,它重新帮我打开了服务端,可是之前的服务端却没有关掉呢!?
注意事项
确认打开的路径正确
开启时等待3秒 (因为打开后设置了2秒的延迟 才会设置当前最前的窗口为句柄)
循环次数为直到按中指键为止
打开服务器后等待3秒 因为我设置了获得句柄的延迟
确认打开的路径正确
开启时等待3秒 (因为打开后设置了2秒的延迟 才会设置当前最前的窗口为句柄)
循环次数为直到按中指键为止
打开服务器后等待3秒 因为我设置了获得句柄的延迟
打开服务器后等待3秒 因为我设置了获得句柄的延迟 也就是说当服务器端出现时先别切到别的窗口 先等几秒
哇,技术党。。。感谢楼主分享