taultunleashed logoLog File Interaction : VGExtreme General Discussion
newtopic  postreply
 [ 4 posts ] 
blue large dot

Log File Interaction : VGExtreme General Discussion

Posted: March 23rd, 2007, 8:00 am
 
binafus

Total Posts: 154
Joined: November 3rd, 2006, 4:27 pm
binafus's Reps: 0
User avatar
Active User > 50 Posts
Looking for the code to interact with a log file.

If I do /log in the game it does not write the file till I close out that log file.

How can Interact with events without closing and opening the log file?

I know a few people that are working on bots have been doing this if someone could post the code please.


Reply with quote
Posted: March 23rd, 2007, 5:14 pm
 
xaraph
xaraph's Reps:
User avatar
If you check the code I pm'd to you for the crafting bot, you'll see some FileSystemObject(FSO) declarations (a windows API) along with WyvernX's EnableChatLog() function. Basically, you enable the chatlogfunction first, then set your FSO objects to the log (it's in your xum folder, I think it's called VGChatLog). Using the FSO you can load each line of the log dynamically into a txt string or array if you choose. Repeated calls to the ReadLine method will load any new lines so you can set it in a loop with a sleep command and constantly check new lines in the log. If you're unfamiliar with the FSO there are tons of tutorials on the web.


Reply with quote
Posted: March 23rd, 2007, 5:29 pm
 
xaraph
xaraph's Reps:
User avatar
Here's some basics:

(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Dim fso
Dim path As String
Dim file
Dim txtLine As String
txtLine = ""

Function OpenLogFile ()
   On Error GoTo ErrHandler
   Set fso = COM.CreateCOMObject("Scripting.FileSystemObject")
   path =  root.GetExhumeDirectory & "\VGLogDump.log"
   Set file = fso.opentextfile(path, 1)
   'lets loop through all the old stuff and get to the end of the file before we start generating new content
   Do Until file.AtEndOfStream
      txtLine = file.ReadLine
   Loop
   'Now enable the chatlog in preparation for new content
   EnableChatLog
   OpenLogFile = True
   Exit Function
   
   ErrHandler:
   OpenLogFile = False
End Function


and to loop through the chatlog once it's open:

(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Do Until file.AtEndOfStream
   txtLine = file.ReadLine
   If InStr(txtLine, "Crafting recipe selected") Then
   bCraftStart = True
   End If
Loop



after each file.Readline, it reads a new line of the chatlog for you to run your checks against (in my case, I was checking if the string held "Crafting Recipe Selected").


Reply with quote
Posted: March 23rd, 2007, 5:59 pm
 
binafus

Total Posts: 154
Joined: November 3rd, 2006, 4:27 pm
binafus's Reps: 0
User avatar
Active User > 50 Posts
Thanks xaraph was looking through when I came back here.

Did not notice you had sent me the file sorry.


Reply with quote
Want Advertisements After The Last Post Removed? Create A Free Account!

blue large dot Who is online
Users browsing this forum: No registered users and 22 guests

Popular Sections
SWTOR Cheats
Guild Wars 2 Cheats
Guild Wars 2 Hacks
Guild Wars 2 Bots
Diablo 3 Cheats
Guild Wars 2 Mods

Popular Sections
WoW Cataclysm Cheats & Exploits
WoW Cataclysm Hacks & Bots
Star Wars The Old Republic Cheats
SWTOR Mods
Torchlight 2 Cheats
SWTOR Space Mission Bots
Site Nav and RSS
RSS Feed of VGExtreme General Discussion RSS Feed 
Sitemap of VGExtreme General Discussion Sitemap 
SitemapIndex SitemapIndex
RSS Feed RSS Feed
Channel list Channel list
left bottom corner Site and Contents Copyright 2001-2012 All Rights Reserved TaultUnleashed.com bottom corner
top left
top right
createaccount
Username:   Password:   Remember Me?