Blizzard Sector
Im Not a Programmer, Need input on Program - Printable Version

+- Blizzard Sector (https://www.blizzsector.co)
+-- Forum: General Community (https://www.blizzsector.co/forum-3.html)
+--- Forum: Tech Forum (https://www.blizzsector.co/forum-14.html)
+--- Thread: Im Not a Programmer, Need input on Program (/thread-20974.html)



Im Not a Programmer, Need input on Program - Juke - 08-12-2005

Think you can Help?


Code:
========Jizzmasta's IP Changer for PvPGN Server Running Diablo2 LOD v1.10========
'Date: 17 March 2005


'=====START=====

'Ask for input of New IP address
Dim StrIP
Dim StrRealm
strIP = InputBox("Enter New IP", "New IP", default, 5000, 5000)
strRealm = InputBox("Enter Realm Name (No Spaces)", "Realm", default, 5000, 5000)

Const ForReading = 1
Const ForWriting = 2


'=====d2cs.conf=====

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
   ("d2cs.conf", ForReading)

Do Until objTextFile.AtEndOfStream
   strLine = objTextFile.ReadLine
   If Left(strLine, 9) = "realmname" Then
       strNewText = strNewText & "realmname      =   " & StrRealm & vbCrLf
   elseif Left(strLine, 9) = "servaddrs" Then
       strNewText = strNewText & "servaddrs      =   " & strIP & ":6113" & vbCrLf
   elseif Left(strLine, 12) = "gameservlist" Then
   strNewText = strNewText & "gameservlist      =   " & strIP & vbCrLf
   elseif Left(strLine, 9) = "bnetdaddr" Then
   strNewText = strNewText & "bnetdaddr      =   " & strIP & ":6112" & vbCrLf
   else strNewText = strNewText & strLine & vbCrLf
   End If
Loop

objTextFile.Close
Set objTextFile = objFSO.OpenTextFile _
   ("d2cs.conf", ForWriting)
objTextFile.Write(strNewText)
objTextFile.Close


'=====d2dbs.conf=====

strNewText=""
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
   ("d2dbs.conf", ForReading)

Do Until objTextFile.AtEndOfStream
   strLine = objTextFile.ReadLine
   If Left(strLine, 9) = "servaddrs" Then
       strNewText = strNewText & "servaddrs      =   " & strIP & ":6114" & vbCrLf
   elseif Left(strLine, 12) = "gameservlist" Then
   strNewText = strNewText & "gameservlist      =   " & strIP & vbCrLf
   else strNewText = strNewText & strLine & vbCrLf
   End If
Loop

objTextFile.Close
Set objTextFile = objFSO.OpenTextFile _
   ("d2dbs.conf", ForWriting)
objTextFile.Write(strNewText)
objTextFile.Close


'=====realm.conf=====

strNewText=""
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
   ("realm.conf", ForReading)

Do Until objTextFile.AtEndOfStream
   strLine = objTextFile.ReadLine
   If Left(strLine, 1) <> """" Then
       strNewText = strNewText & strLine & vbCrLf
   else strNewText = strNewText & """" & StrRealm & """" & "      ""PvPGN Realm""      " & StrIP & ":6113" & vbCrLf
   End If
Loop

objTextFile.Close
Set objTextFile = objFSO.OpenTextFile _
   ("realm.conf", ForWriting)
objTextFile.Write(strNewText)
objTextFile.Close


'=====Registry String Values from d2gs.reg=====

Dim WSHShell, RegLocate, RegLocate1
Set WSHShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\D2Server\D2GS\D2CSIP"
WSHShell.RegWrite RegLocate,StrIP,"REG_SZ"
RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\D2Server\D2GS\D2DBSIP"
WSHShell.RegWrite RegLocate,StrIP,"REG_SZ"
WScript.Quit ' Tells the script to stop and exit.

Plz put it together and unload it for me Thanks.

This file should be saved as *.vbs


Im Not a Programmer, Need input on Program - 4sylum - 08-12-2005

ok first what am i looking at, what am i looking for, and what language is it in O_o


Im Not a Programmer, Need input on Program - Obfuscate - 08-13-2005

Looks like an IP changer for D2.

Wrong section btw.

~moved


Im Not a Programmer, Need input on Program - Juke - 08-13-2005

Thanks for the Move, Its a Conf IP Changer for Diablo 2 Realms"PvPgn", Im running a demstx IP and need to set up for testing so i don't have to keep chaging the IP in 10 defferant .conf files. I got Banned Last Night so i'm trying to Get my sever going that i have been stalling on for some time know.

hopefully next week i will have a statix and sever will beable to hold 15K ppl



"got to wait until after court"

all i need is to Load it into VB or somthing and save as IPchanger.vbs