Was woundering if someone could take some time to assist me in modifying a VBS to extract items sold in the broker to an external file and seperate the plat gold silver and copper into seperate cells in excel. I would like if it would run independant of XU so that XU is not needed.
an example script here that takes out the players location and makes an excel forim with the locations may assist you in getting this to work. I am not a coder or programer but I did some searching to find something that almost does what I want just not exactly, and I don't have the skills to just go add/edit to get it to do what I want.
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Dim objTextFile
Dim objFSO
Dim OpenTextFile
Dim Working1
Dim objRE
Dim objInputFile
Dim objWorking1
Dim howmany
Dim objreplacewith
Dim strNewText
Dim strWorking1
Dim strWorking2
Dim strWorking3
Dim strfinaloutput
strInputFile = InputBox("Enter the INPUT path & filename.")
strfinaloutput = InputBox("Enter the OUTPUT path & filename.")
strWorking1 = "Workingfile1"
strWorking2 = "Workingfile2"
strWorking3 = "Workingfile3"
Set objRE = New RegExp
objRE.Pattern = ".* Your location is "
strreplacewith = "Your location is "
objRE.Global = True
objRE.IgnoreCase = True
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objInputFile = objFso.OpenTextFile(strInputFile,ForReading)
Set objWorking1 = objFso.OpenTextFile(strWorking1,ForWriting,True)
howmany = 1
Do Until objInputFile.AtEndOfStream
strReplaced = objRE.Replace(objInputFile.ReadLine,strreplacewith)
objWorking1.WriteLine strReplaced
Loop
objWorking1.Close
objInputFile.Close
Set objTextFile = objFSO.OpenTextFile _
(strWorking1, 1)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.ReadLine
If Left(strLine, 4) = "Your" Then
strNewText = strNewText & strLine & vbCrLf
End If
Loop
objTextFile.Close
Set objTextFile = objFSO.OpenTextFile _
(strWorking1, 2)
objTextFile.Write(strNewText)
objTextFile.Close
Set objRE = New RegExp
objRE.Pattern = ".* Your location is "
strreplacewith = "Your location is "
objRE.Global = True
objRE.IgnoreCase = True
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objInputFile = objFso.OpenTextFile(strWorking1,ForReading)
Set objWorking1 = objFso.OpenTextFile(strWorking2,ForWriting,True)
Do Until objInputFile.AtEndOfStream
strReplaced = objRE.Replace(objInputFile.ReadLine,strreplacewith)
objWorking1.WriteLine strReplaced
Loop
objWorking1.Close
objInputFile.Close
Set objRE = New RegExp
objRE.Pattern = "Your location is "
strreplacewith = ""
objRE.Global = True
objRE.IgnoreCase = True
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objInputFile = objFso.OpenTextFile(strWorking1,ForReading)
Set objWorking1 = objFso.OpenTextFile(strWorking2,ForWriting,True)
Do Until objInputFile.AtEndOfStream
strReplaced = objRE.Replace(objInputFile.ReadLine,strreplacewith)
objWorking1.WriteLine strReplaced
Loop
objWorking1.Close
objInputFile.Close
Set objRE = New RegExp
objRE.Pattern = "[.] Your orientation.*"
strreplacewith = ""
objRE.Global = True
objRE.IgnoreCase = True
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objInputFile = objFso.OpenTextFile(strWorking2,ForReading)
Set objWorking1 = objFso.OpenTextFile(strWorking3,ForWriting,True)
Do Until objInputFile.AtEndOfStream
strReplaced = objRE.Replace(objInputFile.ReadLine,strreplacewith)
objWorking1.WriteLine strReplaced
Loop
objWorking1.Close
objInputFile.Close
Set objRE = New RegExp
objRE.Pattern = ", "
strreplacewith = "%"
objRE.Global = True
objRE.IgnoreCase = True
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objInputFile = objFso.OpenTextFile(strWorking3,ForReading)
Set objWorking1 = objFso.OpenTextFile(strfinaloutput,ForWriting,True)
howmany = 1
Do Until objInputFile.AtEndOfStream
strReplaced = objRE.Replace(objInputFile.ReadLine,strreplacewith)
objWorking1.WriteLine strReplaced
howmany = howmany+1
Loop
objWorking1.Writeline ""
objWorking1.Writeline ""
objWorking1.Writeline ""
objWorking1.Writeline "ZONERECT%=-MAX(A6:A" & howmany & ")%=MIN(C5:C" & howmany & ")%=-MIN(A5:A" & howmany & ")%=MAX(C3:C" & howmany & ")"
objWorking1.Close
objInputFile.Close
Set MyFile = objfso.GetFile("Workingfile1")
MyFile.Delete
Set MyFile2 = objfso.GetFile("Workingfile2")
MyFile2.Delete
Set MyFile3 = objfso.GetFile("Workingfile3")
MyFile3.Delete
WScript.Echo "Extracted " & howmany & " x,y,z coordinates."
Set howmany = Nothing
Set objWorking1 = Nothing
Set objWorking2 = Nothing
Set objWorking3 = Nothing
Set objInputFile = Nothing
Set objFso = Nothing
Set objRE = Nothing
Following are instructions that came with the loc extractor
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
What it does:
creates an excel document. Has each number separated into 3 different columns
A=X coordinate
B=Z coordinate
C=Y coordinate
also places a row at the end that calculates the zonerect of the mapped area based off the /locs.
How to use it:
01) Put the logfile in the same directory as the script (or be prepared to type full path info)
02) Run the script
03) Type in the INPUT filename (your raw eq2 log)
04) Type in the OUTPUT filename (the data to import into Excel)
05) Open Excel
06) Go to Data->Import External Data->Import Data
07) Find and open the OUTPUT file
08) Check the Delimited Option, say NEXT (not finish)
09) Click in the OTHER field, type in "%"
10) Click Finish, OK
How it does it:
1) Removes all lines that dont have "your location is"
2) Removes everything before the coordinate in each line
3) Removes everything after the coordinates in each line
4) Replaces ", " with %
5) Adds the formula for the zonerect finder at the bottom
6) Saves the results into an external file, never writing to the original logfile
Can this be changed to do the following?
EI look for "03/14/2007 01:50am XXXX bought 1 severed teak for 1p,10g,50s,20c"
has to be smart enough to filter out items you bought in the log file that reads
"you have bought"
Extract the text and add it to an excel form with the following collums.
Date, time, (erase xxxx(players name)), item sold, plat, gold, silver, copper
should have 7 collums and look something like
03/14/2007, 01:50am,1 severed teak, 1,10,50,20
The point in this is that I currently have an excel spread sheet that tracks all this stuff and the end result shows me market trending peak times and average sales broken down into days weeks and months. But I have to manualy input all the data.