#singleinstance force #notrayicon filedelete, %A_Appdata%\RenDirCon\join.bat sk1=0 ong9=0 ifnotexist, %A_Appdata%\RenDirCon { Filecreatedir, %A_Appdata%\RenDirCon iniwrite, 1, %A_Appdata%\RenDirCon\Info.ini, Info, key } iniread, key, %A_Appdata%\RenDirCon\Info.ini, Info, key iniread, player, %A_Appdata%\RenDirCon\Info.ini, Info, Player if Player=ERROR { Player= } iniread, dir, %A_Appdata%\RenDirCon\Info.ini, Info, Directory if dir=ERROR { Msgbox, 48, Renegade Direct Connect, Please locate your Renegade Game File! gosub, dir iniread, dir, %A_Appdata%\RenDirCon\Info.ini, Info, Directory } menu, lvmenu, add, Join menu, lvmenu, add, Delete menu, lvmenu, add, Edit, edser gui, color, c0c0c0 Gui, Add, ListView, x6 y10 w490 h120 vlvmv glvr, Server Name|IP|Port|ID|Password Gui, Add, Text, x6 y170 w70 h16 , Player Name: Gui, Add, Edit, x126 y140 w170 h20 vdir, %dir% Gui, Add, Text, x6 y140 w110 h16 gdir, Your Renegade .exe: Gui, Add, Text, x6 y200 w110 h16 , Server Password: Gui, Add, Text, x306 y140 w70 h16 , Server Name: Gui, Add, Text, x306 y170 w55 h16 , Server IP: Gui, Add, Text, x306 y200 w60 h16 , Server Port: Gui, Add, Button, x416 y290 w0 h0 , Save Gui, Add, Edit, x126 y170 w170 h20 vplayer, %player% Gui, Add, Edit, x126 y200 w170 h20 vaddcmd, None Gui, Add, Edit, x376 y140 w170 h20 vservname, Gui, Add, Edit, x376 y170 w170 h20 vservip, Gui, Add, Edit, x376 y200 w170 h20 vservport, Gui, Add, Button, x506 y110 w40 h20 , Save Lv_ModifyCol(1,180) Lv_ModifyCol(2,120) Lv_ModifyCol(3,90) LV_ModifyCol(4,0) LV_ModifyCol(5,90) Gui, Show, h228 w555, Renegade Direct Connect update: LV_Delete() curlook=1 iniread, key, %A_Appdata%\RenDirCon\Info.ini, Info, key Loop, { redoloop: if curlook=%key% { break } else iniread, servname, %A_Appdata%\RenDirCon\Info.ini, %curlook%, Servername iniread, servip, %A_Appdata%\RenDirCon\Info.ini, %curlook%, IP iniread, servport, %A_Appdata%\RenDirCon\Info.ini, %curlook%, Port iniread, id, %A_Appdata%\RenDirCon\Info.ini, %curlook%, ID iniread, addcmd, %A_Appdata%\RenDirCon\Info.ini, %curlook%, addcmd if servname=ERROR { envadd, curlook, 1 goto, redoloop } LV_Add("",servname,servip,servport,id,addcmd) envadd, curlook, 1 } Return buttonrefresh: goto, update join: gui, submit, nohide iniwrite, %player%, %A_Appdata%\RenDirCon\Info.ini, Info, Player iniread, player, %A_Appdata%\RenDirCon\Info.ini, Info, Player iniread, addcmd, %A_Appdata%\RenDirCon\Info.ini, %id1%, addcmd iniread, servip, %A_Appdata%\RenDirCon\Info.ini, %id1%, IP iniread, servport, %A_Appdata%\RenDirCon\Info.ini, %id1%, Port fileappend, ( "%dir%" +connect %servip%:%servport% +netplayername "%player%" +password "%addcmd%" ), %A_Appdata%\RenDirCon\join.bat run, join.bat, %A_Appdata%\RenDirCon, hide Useerrorlevel if errorlevel=ERROR { Msgbox, 16, Renegade Direct Connect, Cannot run Join MS-DOS Batch File return } winwaitactive, Renegade filedelete, %A_Appdata%\RenDirCon\join.bat return delete: Msgbox, 20, Renegade Direct Connect, Are you Sure you want to Delete this Entry? Ifmsgbox, no { return } ifmsgbox, yes { inidelete, %A_Appdata%\RenDirCon\Info.ini, %id1% gosub, update return } return lvr: GuiContextMenu: if A_GuiControl <> lvmv return if A_EventInfo = 0 { return } if A_GuiEvent = RightClick { LV_GetText(id1, A_EventInfo, 4) menu, lvmenu, Show, %A_GuiX%, %A_GuiY% return } if A_GuiEvent = DoubleClick { LV_GetText(id1, A_EventInfo, 4) gui, submit, nohide iniwrite, %player%, %A_Appdata%\RenDirCon\Info.ini, Info, Player iniread, player, %A_Appdata%\RenDirCon\Info.ini, Info, Player iniread, addcmd, %A_Appdata%\RenDirCon\Info.ini, %id1%, addcmd iniread, servip, %A_Appdata%\RenDirCon\Info.ini, %id1%, IP iniread, servport, %A_Appdata%\RenDirCon\Info.ini, %id1%, Port fileappend, ( "%dir%" +connect %servip%:%servport% +netplayername "%player%" +password "%addcmd%" ), %A_Appdata%\RenDirCon\join.bat run, join.bat, %A_Appdata%\RenDirCon, hide Useerrorlevel if errorlevel=ERROR { Msgbox, 16, Renegade Direct Connect, Cannot run Join MS-DOS Batch File return } winwaitactive, Renegade filedelete, %A_Appdata%\RenDirCon\join.bat return } return edser: if ong9=1 { return } else iniread, servname, %A_Appdata%\RenDirCon\Info.ini, %id1%, ServerName iniread, addcmd, %A_Appdata%\RenDirCon\Info.ini, %id1%, addcmd iniread, servip, %A_Appdata%\RenDirCon\Info.ini, %id1%, IP iniread, servport, %A_Appdata%\RenDirCon\Info.ini, %id1%, Port gui, 9:color, c0c0c0 Gui, 9:Add, Text, x6 y5 w80 h14 , Server Name Gui, 9:Add, Edit, x6 y21 w130 h20 vnsn, %servname% Gui, 9:Add, Text, x6 y45 w80 h14 , Server IP Gui, 9:Add, Edit, x6 y61 w100 h20 vnsi, %servip% Gui, 9:Add, Text, x6 y85 w80 h14 , Server Port Gui, 9:Add, Edit, x6 y101 w65 h20 vnsp, %servport% Gui, 9:Add, Text, x6 y125 w90 h14 , Server Password Gui, 9:Add, Edit, x6 y141 w100 h20 vnac, %addcmd% Gui, 9:Add, Button, x6 y169 w130 h20 , Save Gui, 9:Show, h200 w143, Edit ong9=1 envset, cid, %id1% return 9buttonsave: gui, 9:submit, nohide iniwrite, %nac%, %A_Appdata%\RenDirCon\Info.ini, %cid%, addcmd iniwrite, %nsn%, %A_Appdata%\RenDirCon\Info.ini, %cid%, ServerName iniwrite, %nsi%, %A_Appdata%\RenDirCon\Info.ini, %cid%, IP iniwrite, %nsp%, %A_Appdata%\RenDirCon\Info.ini, %cid%, Port gui, 9:destroy ong9=0 Msgbox, 0, RenDirCon, New Server info has been appended! Hit 'ok' to refresh Server List settimer, refresh, 100 return refresh: settimer, refresh, off goto, update buttonsave: gui, submit, nohide if servip= { Msgbox, 16, RenDirCon, Please input a Server IP in order to save this entry! return } if servport= { Msgbox, 16, RenDirCon, Please input a Server Port in order to save this entry! return } if servname= { Msgbox, 16, RenDirCon, Please input a Server Name in order to save this entry! return } curlook=%key% iniwrite, %addcmd%, %A_Appdata%\RenDirCon\Info.ini, %curlook%, addcmd iniwrite, %servname%, %A_Appdata%\RenDirCon\Info.ini, %curlook%, ServerName iniwrite, %servip%, %A_Appdata%\RenDirCon\Info.ini, %curlook%, IP iniwrite, %servport%, %A_Appdata%\RenDirCon\Info.ini, %curlook%, Port iniwrite, %key%, %A_Appdata%\RenDirCon\Info.ini, %curlook%, ID envadd, key, 1 iniwrite, %key%, %A_Appdata%\RenDirCon\Info.ini, Info, key iniread, key, %A_Appdata%\RenDirCon\Info.ini, Info, key guicontrol,,addcmd,None guicontrol,,servname, guicontrol,,servip, guicontrol,,servport, gosub, update return dir: fileselectfile, rendir,3, C:\Westwood, Please locate your Renegade executable, Executable (*.exe) if errorlevel=1 { return } iniwrite, %rendir%, %A_Appdata%\RenDirCon\Info.ini, Info, Directory guicontrol,,dir, %rendir% return 9GuiClose: Gui, 9:destroy ong9=0 return GuiClose: gui, submit, nohide iniwrite, %player%, %A_Appdata%\RenDirCon\Info.ini, Info, Player ExitApp