Author Topic: Is it possible to get the last, 25, 30 lines from the console.log in /any/ way?  (Read 1169 times)

I was wanting to make something in conky (similar to rainmeter, except it's linux) that would display what the console was outputting on my other computer on my desktop.

(tl;dr console output --> text file --> conky)

I tried just straight up using the console.log itself, but it's only showing the beginning of the file, not the end.

Conky does automatically update as well, so it doesn't have to update server/game-side.

Is this possible through Torque or is this not possible at all?

answer: no

solution: try learning about tcp objects and networking in torquescript.

I'm wondering this myself. I've tried going through the console text directly, but with no success.
Though, I might've made a mistake.

answer: no
Don't be so quick to jump the gun, there might be a way.

No, the console.log file is being accessed by Blockland and cannot be accessed by other programs until Blockland stops using it. (when BL closes)

No, the console.log file is being accessed by Blockland and cannot be accessed by other programs until Blockland stops using it. (when BL closes)
I don't mean by writing to it, only reading it.

I can confirm this is possible if I need to.

You could write an extremely simple C/whatever program that scans Blockland's memory for the data structure that holds the console output. From what I can tell from a quick Cheat Engine scan, it would be pretty simple to write a DLL which you would inject into Blockland's process and just look for the first text the console logs at game startup and go from there.

Crazy large image that I don't care to resize:


First, who are you? Second, I doubt the OP has the programming expertise to scan BL's memory. Third, Badspot would probably ban anyone injecting their Blockland copies with DLLs.

First, who are you? Second, I doubt the OP has the programming expertise to scan BL's memory. Third, Badspot would probably ban anyone injecting their Blockland copies with DLLs.
I'm not that advanced scripting-wise, yeah. ._.

First, who are you? Second, I doubt the OP has the programming expertise to scan BL's memory. Third, Badspot would probably ban anyone injecting their Blockland copies with DLLs.
I haven't looked into it at all, but does Blockland have some sort of anticheat? I would highly doubt it. If it does have some sort of rudimentary injection protection (or something stuffty like that), you could try reading from unprotected pages of the process (found w/ VirtualQueryEx) with ReadProcessMemory.

I'd really appreciate it if kalphiter/lub/ephi came in here and enlightened us on this kinda thing.

I haven't looked into it at all, but does Blockland have some sort of anticheat? I would highly doubt it. If it does have some sort of rudimentary injection protection (or something stuffty like that), you could try reading from unprotected pages of the process (found w/ VirtualQueryEx) with ReadProcessMemory.
Blockland does not have any kind of anti-cheat protection. It is the creator's opinion that personal development should be done in the provided scripting language using only the tools he gives us. While there's really no way for him to find out if you are injecting his program with a DLL, openly posting that you're doing so on the forum would probably result in a revokation of your game key.

I'd really appreciate it if kalphiter/lub/ephi came in here and enlightened us on this kinda thing.
Kalphiter is handicapped, Lub doesn't know Torque, Ephi never posts here. The answer has already been posted: it's impossible. Windows has file protection built into it so you can't access a file at the same time another process is using it. The only way to circumvent this would be to stop console from logging while you grab the contents of the file, but even if you do this Blockland itself can not read from files that aren't in the mod paths, so you can not parse this file from inside Blockland in any way. The only way to do this really at all is what dotdotcircle said, memory editing.

I just said I could access the file while it's in use. omfg.


I just said I could access the file while it's in use. omfg.
You should have specified the operating system you were using as well as how you are using a headless client to host. *nix file permissions are much more sane.

Edit: To contradict myself, you're using Wine, I haven't used it too much outside of rudimentary usage so I don't quite know how it accesses the file system.
« Last Edit: October 24, 2012, 08:25:03 PM by dotdotcircle »

I just said I could access the file while it's in use. omfg.
It's still irrelevant. You can't parse the log file using Torque so it's outside the scope of "Coding Help." Your options are:

A) Fix Conky to only read the last 20 lines
B) Write a program to constantly grab the last 20 lines of console.log and write them to a file Conky reads
C) Go balls out hardcore and learn to memory edit.

Edit: To contradict myself, you're using Wine, I haven't used it too much outside of rudimentary usage so I don't quite know how it accesses the file system.
Wine still uses Linux's libraries for handling files, so they're handled fine. You can access them while they're in use.

A) Fix Conky to only read the last 20 lines
This is the easiest way. You should be able to put this in a *rc file or something like that.
Code: [Select]
tail bl_log.txt -n 20
« Last Edit: October 24, 2012, 08:32:21 PM by dotdotcircle »