Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Im Not a Programmer, Need input on Program
#1
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
Null
#2
ok first what am i looking at, what am i looking for, and what language is it in O_o
#3
Looks like an IP changer for D2.

Wrong section btw.

~moved
"One murder makes a villain, millions a hero. "
- Beilby Porteus, Death, A Poem
#4
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
Null


Possibly Related Threads…
Thread Author Replies Views Last Post
  ilvl program quick question hardcoretyler2 1 240 04-21-2007, 01:32 AM
Last Post: Juke
  Looking for a program... youthpoisoner 4 259 07-24-2006, 04:55 PM
Last Post: 5|*42
  video making Program needed hellsing293 1 172 07-12-2006, 04:23 AM
Last Post: streetsoldier707
  Found A Nice Little Program WooT 6 369 06-26-2006, 05:40 PM
Last Post: WooT
  anyone know how to goal program in QM for windows? Bloodangel26 0 168 05-12-2006, 04:39 AM
Last Post: Bloodangel26
  what program MxJerrett 1 192 04-04-2006, 12:23 PM
Last Post: Tool
  Request: Computer Program Bowbow 0 209 01-28-2006, 09:14 AM
Last Post: Bowbow
  WebCam Recording Program? ZxSlippy191 12 227 01-02-2006, 12:39 PM
Last Post: Dan
  mmm what program? 1337^ 4 317 09-08-2005, 03:44 AM
Last Post: asgaroth
  good program nchapman450 5 278 08-10-2005, 12:57 PM
Last Post: Karant

Forum Jump:


Users browsing this thread: 1 Guest(s)