![Smile :)](./images/smilies/icon_e_smile.gif)
Code: Select all
#noenv
SetWorkingDir %A_ScriptDir%
GameFile = iw3mp.exe
;GameFile = notepad.exe
portA = 28972
portB = 28973
portC = 28974
portD = 28975
portE = 28976
portF = 28977
IP = 176.227.209.170
GamePID = 0
PicFile = %A_Temp%\BCKGROUND.bmp
FileInstall,C:\Users\WATTZ\Desktop\BCKGROUND.jpg,%PicFile%
Gui, Add, Picture, x-8 y0 w660 h420 vPicWp,%PicFile%
FileDelete,%PicFile%
Gui, Add, Picture, x-8 y0 w670 h420 , C:\Users\WATTZ\Desktop\BCKGROUND.jpg
Gui, Add, Button, x42 y160 w130 h40 gB_Options vB_tdmhc, TDM HC
Gui, Add, Button, x182 y160 w130 h40 gB_Options vB_tdm, TDM
Gui, Add, Button, x42 y220 w130 h40 gB_Options vB_dm, DEATHRUN
Gui, Add, Button, x182 y220 w130 h40 gB_Options vB_zom, ZOMBIES
Gui, Add, Button, x42 y280 w130 h40 gB_Options vB_mw2maps, MW2 MAPS
Gui, Add, Button, x182 y280 w130 h40 gB_Options vB_bomaps, BLACK OPS MAPS
Gui, Add, Button, x102 y350 w150 h30 gB_Options vB_fragforums, VIST FRAGZONE FORUMS
; Generated using SmartGUI Creator 4.0
Gui, Show, x127 y87 h414 w655, |FZ|COD4 SERVER CONNECTOR V1.1 By WATTZ & Temil2008
Return
B_Options:
if (A_GuiControl = "B_tdmhc")
port := portA
else if (A_GuiControl = "B_tdm")
port := portB
else if (A_GuiControl = "B_dm")
port := portC
else if (A_GuiControl = "B_zom")
port := portD
else if (A_GuiControl = "B_mw2maps")
port := portE
else if (A_GuiControl = "B_bomaps")
port := portF
else if (A_GuiControl = "B_fragforums")
port = na
if (port = "na")
{
run, http://www.fragzonegaming.co.uk/index.php?/index
return
}
if (GamePID != 0)
{
Process, Exist, %GamePID%
ProcessExistA := ErrorLevel
}
else
{
ProcessExistA = 0
}
Process, Exist, %GameFile%
ProcessExistB := ErrorLevel
If (ProcessExistA = 0 AND ProcessExistB = 0)
{
IfExist, %GameFile%
{
Run, %GameFile% +connect %IP%:%port% , %A_ScriptDir% , GamePID
Process, Priority, %GamePID%, high
}
else
{
MsgBox,, 48, Unable to locate file "iw3mp.exe" within the folder the launcher was placed.
}
}
else if (ProcessExistA != 0)
{
GamePID := ProcessExistA
gosub, SendToGame
}
else if (ProcessExistB != 0)
{
GamePID := ProcessExistB
gosub, SendToGame
}
return
SendToGame:
WinActivate, ahk_pid %GamePID%
WinWaitActive, ahk_pid %GamePID%,, 5
ifwinactive, ahk_pid %GamePID%
{
send, ``
Sleep, 500
Send, connect %IP%:%Port%
Sleep, 250
Send, {enter}
}
else
MsgBox, Was unable to make the game window active within 5secs.
return
GuiClose:
ExitApp