Results 1 to 2 of 2

Thread: Line Logger

  1. #1
    Join Date
    Jun 2007
    Location
    Florida
    Posts
    50
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Line Logger

    Hello everyone,

    This is a utility that will allow you to log all debug text and view it from a webpage at any time so you can always keep up with what's going on with your Simba activity.

    It's a simple setup,

    1.
    In your directory where Simba.exe is create a batch file with the following contents:
    Code:
    @echo off
    Title Simba - LineLogger
    color 0f
    
    echo LineLogger - Sirhiro
    if exist {%~dp0\log.txt} (
    del "%~dp0\log.txt"
    ) else (
    echo Running...
    simba >> log.txt
    You will run Simba using this Batch file whenever you want to Log.

    2.
    In any script, paste this function anywhere that's not inside a procedure.
    Code:
    function LineLog(Filename, Usr, Scrpt : string) : TStringArray;
    var
    FileNum, h, i : integer;
    s : string;
    begin
      WriteLn('[LL]: Starting!');
      FileNum := OpenFile(Filename + 'log.txt', true);
      ReadFileString(FileNum, s, FileSize(FileNum));
      CloseFile(FileNum);
      result := Explode(chr(10), s);
      WriteLn('[LL]: Uploading...');
      h := high(result);
      i := InitializeHTTPClient(false, false);
      posthttppage(i, 'nferno.org/log/upload.php?', 'lbl=' + s + '&usr=' + Usr + '&script=' + Scrpt);
      freehttpclient(i);
      s := '';
      cleardebug;
      WriteLn('[LL]: All Done!');
    end;
    And finally...

    3.
    Wherever you feel it should save and upload the log put the following call:
    Code:
     LineLog('Simba Directory', 'nickname', 'scriptname');
    eg;
    Code:
    LineLog('C:\Program Files (x86)\Simba\', 'sirhiro', 'advgnomerunner');
    For the sake of bandwidth put the call somewhere where it won't be called frequently. Like after a lap during agility or after banking from a full inventory.

    4.
    That's it! Now at anytime you can access your log file using
    nferno.org/log/<nickname>-<scriptname>.css
    EG: Here is a Sample
    And yes, I did use *.CSS for the filetype because *.TXT is not allowed on my host and *.CSS keeps the line breaks for formatting.

    Let me know what you think!
    Also I wasn't sure what section to put this in? It applies specifically to Runescape related scripts and the output so I stuck it here in utilities instead of in Other Scripts.

    Some Tips:
    • The only data uploaded is whatever is output into your debug console, nothing more.
    • It is not publicly displayed.
    • There is a filesize limit that if your log exceeds it will not upload
    • Uploading too rapidly will restrict access from this feature
    Last edited by Sirhiro; 02-27-2012 at 08:08 AM.
    ~Let the InFERNO Consume you~

  2. #2
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Sounds interesting, will try it out. Thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •