Results 1 to 20 of 20

Thread: Script Tracking - Track your script or random events from any computer/mobile device

  1. #1
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default Script Tracking - Track your script or random events from any computer/mobile device

    Script Tracking
    Track your script or random events from any computer/mobile device


    I saw a request for a way of very quickly checking the status of an account without having to log into teamviewer. There was also a request for an app to be made for mobile devices, if anybody wants to do this feel free, if you want it to generate the results in a different way then just let me know.

    Try it out at http://mytracker.net84.net/

    The idea is that when a script is running it periodically updates it's status by running some code (see below) that posts it to my website where you can use your password to access it. It works in a similar way to SRL stats, but for a different purpose.

    At the moment the website looks awful, if you want to improve it send me your design ideas.

    When you go to the website you will be presented with this (Told you it looks awful):


    First of all you are going to want to create an account, clicking that link you will be presented with:

    then:


    Then you want to login, aft that you will be presented with this page:


    You can see at the moment that there are no status's posted, I have created a function in simba that adds info to this page for you to read:

    Simba Code:
    function AddAStatus(Username, CommitKey, ScriptName, Status : String) : Boolean;

    Username is the username of the account you just created, CommitKey is retrieved from your MyAccount area (see above screenshot), the script name is the name of the script you are currently running. Status is then the line that you want posting on the page.

    So if we wanted to post something we could put a line in like this:
    Simba Code:
    AddAStatus('testaccount', '0NvIQ14wFpyMfSWHcOmCrjoKd', 'MyEpicScript', 'Account '+IntToStr(CurrentAccount)+' has got stuck in a random event. Swapping to next account.');

    Then back on our page:


    You can see it has been added, Yay!

    You can keep adding more things, they will all be time and date stamped so you know when they were posted (the time shown is the time on the computer that is running the script, not the server time).


    You'll notice a "Clear Account Status" link, this clears all of the status's that are currently there, clicking it gives you a confirmation screen, once cleared all of your lovely information has gone:


    Here is the code for the function:
    Simba Code:
    function AddAStatus(Username, CommitKey, ScriptName, Status : String) : Boolean;
    Var
      Data : integer;
      H, M, Se, MS, D, Mo, Y : Word;
      S : String;
    begin
      DecodeTime(now, H, M, Se, MS);
      DecodeDate(now, Y, Mo, D);
      Data := InitializeHTTPClientWrap(False);
      ClearPostData(Data);
      AddPostVariable(Data, 'username', Username);
      AddPostVariable(Data, 'DevKey', CommitKey);
      AddPostVariable(Data, 'status', '<li>['+padz(IntToStr(D), 2)+'/'+padz(IntToStr(Mo), 2)+'/'+padz(IntToStr(Y), 2)+' '+padz(IntToStr(H), 2)+':'+padz(IntToStr(M), 2)+':'+padz(IntToStr(Se), 2)+'] ['+ScriptName+']<BR>'+Status);

      S := PostHTTPPageEx(Data, 'http://mytracker.net84.net/commit.php');
      FreeHTTPClient(Data);

      Result := Pos('True', S) <> 0;

      if(not Result)then
        begin
          WriteLn(Copy(S, 1, Pos('<!-- [url]www.000w[/url]', S) - 1));
        end;

    end;

    Enjoy!

    And for progress reports:
    Simba Code:
    function AddAStatusMulti(Username, CommitKey, ScriptName : String; Status : array of String) : Boolean;
    Var
      Data, i : integer;
      H, M, Se, MS, D, Mo, Y : Word;
      S : String;
    begin
      DecodeTime(now, H, M, Se, MS);
      DecodeDate(now, Y, Mo, D);
      Data := InitializeHTTPClientWrap(False);
      ClearPostData(Data);
      for i := low(Status) to high(status) do
        S := S + '<BR>' + Status[i];
      AddPostVariable(Data, 'username', Username);
      AddPostVariable(Data, 'DevKey', CommitKey);
      AddPostVariable(Data, 'status', '<li>['+padz(IntToStr(D), 2)+'/'+padz(IntToStr(Mo), 2)+'/'+padz(IntToStr(Y), 2)+' '+padz(IntToStr(H), 2)+':'+padz(IntToStr(M), 2)+':'+padz(IntToStr(Se), 2)+'] ['+ScriptName+'] '+S);

      S := PostHTTPPageEx(Data, 'http://mytracker.net84.net/commit.php');
      FreeHTTPClient(Data);

      Result := Pos('True', S) <> 0;

      if(not Result)then
        begin
          WriteLn(Copy(S, 1, Pos('<!-- [url]www.000w[/url]', S) - 1));
        end;

    end;
    which puts multiple strings under the same timestamp:


    FAQ:

    Why use a CommitKey, not just the password?
    So that you can use this in your scripts to be able to collect progress reports, without other users being able to log into your account.
    Last edited by putonajonny; 05-19-2012 at 06:35 PM.

  2. #2
    Join Date
    Jun 2011
    Location
    Anywhere that has WIFI
    Posts
    669
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is very nice! And extremely useful! Will definately experiment with this.

  3. #3
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    This is amazing dude!

  4. #4
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Bump, not getting the attention it deserves

  5. #5
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Nice work, Will try out later

  6. #6
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    This is amazing dude!
    A thread doesn't need a bump after 12 hours...anyways this isn't that amazing..it's rather simple actually..nice job nonetheless...
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  7. #7
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Added support for multiple strings for things like progress reports (see op). Improved the design of the webpage, also made it possible to use this feature to collect progress reports for yourself
    Last edited by putonajonny; 05-19-2012 at 06:37 PM.

  8. #8
    Join Date
    Feb 2012
    Location
    Denver, CO
    Posts
    863
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is a great idea! Is there any way to remotely shut down a script in case it does have an issue?

  9. #9
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Andres View Post
    This is a great idea! Is there any way to remotely shut down a script in case it does have an issue?
    Yes, very possible.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  10. #10
    Join Date
    May 2012
    Location
    John's Creek, Georgia, United States
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    86 Post(s)

    Default

    wow looks great! easier than tv

  11. #11
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Andres View Post
    This is a great idea! Is there any way to remotely shut down a script in case it does have an issue?
    You could even use it to change players/change options in the script if the scripter wanted to

  12. #12
    Join Date
    Mar 2012
    Posts
    60
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this is awesome could use a other website lay out though

  13. #13
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Interesting concept. Looks good minimalistic as well. Although the status part is a bit messy. Maybe increase the column width and try to justify the text there.

  14. #14
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is amazing. If there is going to be separate logs for different scripts, it will look very professional and painless to use
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  15. #15
    Join Date
    Mar 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great job on working the whole thing out, and even though I felt against it at the beginning, I feel more like supporting the idea now. And I came with a suggestion: screenshots?
    Projects Directory: http://subliment.co.cc/
    Latest News: Working on ZChopper
    ZChopper: The chopper that will chop, bank (or drop), and chop, forever (or till a random pops out)

  16. #16
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Subliment View Post
    Great job on working the whole thing out, and even though I felt against it at the beginning, I feel more like supporting the idea now. And I came with a suggestion: screenshots?
    Sorry, what do you mean?

  17. #17
    Join Date
    Mar 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    Sorry, what do you mean?
    Allowing the script to commit screenshots or something of that sort to the db.
    Projects Directory: http://subliment.co.cc/
    Latest News: Working on ZChopper
    ZChopper: The chopper that will chop, bank (or drop), and chop, forever (or till a random pops out)

  18. #18
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    Nice work. I use teamviewer myself can actually restart script's log in ect all on your phone.

  19. #19
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by CRU1Z1N View Post
    Nice work. I use teamviewer myself can actually restart script's log in ect all on your phone.
    same here works really well apart form a bit off 3G lag nice work though has real potential!
    Learning To Code - So Excuse the n00b questions!

  20. #20
    Join Date
    Mar 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Team-viewer through a smart phone works fine, but this is great as well!

Thread Information

Users Browsing this Thread

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

Posting Permissions

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