|
本帖最后由 fengzishao 于 2009-7-21 09:12 编辑
#include <Misc.au3>;运行环境
_Singleton("TheNameOfMyScript");如果运行过了再运行会直接退出
Opt("TrayMenuMode", 1);防止点击托盘图标时停止
$disk = IniRead(@ScriptDir&"\server.dat","SERVER","disk","")
$ip = IniRead(@ScriptDir&"\server.dat","SERVER","SVRIP","")
$ping = ping($ip,100)
if FileExists(@ScriptDir&"\server.dat") then
jc()
Else
TrayTip("提示","主要配置文件不存在",1,3)
Sleep(2000)
EndIf
Func connected()
If $ping Then
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Richtech\Cgo","ServerIp", "reg_sz", $ip)
Run("rundll32 RNDINTER.dll,RND32_StartSGXP")
Run(@scriptDir&"\game.exe","")
TrayTip("提示:","正在连接服务器!!",1,1)
Sleep(2000)
If FileExists($disk & ":\") Then
TrayTip("提示:","服务器连接成功!!",1,1)
Sleep(1000)
Else
TrayTip("提示:","服务器连接失败!!",1,3)
Sleep(1000)
EndIf
Else
TrayTip("提示:","虚拟磁盘服务器无法访问!!",1,3)
Run(@scriptDir&"\game.exe","")
Sleep(1000)
EndIf
EndFunc ;==>connected
Func jc()
If FileExists($disk&":\") Then
Run(@scriptDir&"\game.exe","")
Exit
Else
TrayTip("提示:", "正在搜索虚拟磁盘服务器!!", 1, 1)
connected()
Sleep(1000)
EndIf
EndFunc ;==>jc
一个朋友要。帮忙写的。同样的功能。编译出来的文件比别人的大些。 |
|