SRL Archive - Research & Development Lounge

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


putonajonny

2012-05-18 20:58:32

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:

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:
  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:
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:
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.

Jokester

2012-05-18 21:13:57

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

Sin

2012-05-18 21:16:19

This is amazing dude!

Sin

2012-05-19 08:21:37

Bump, not getting the attention it deserves

Olly

2012-05-19 08:46:46

Nice work, Will try out later :)

Sex

2012-05-19 08:58:36

From: Sin
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…:)

putonajonny

2012-05-19 10:12:02

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

Andres

2012-05-20 21:24:46

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

Sex

2012-05-21 00:35:43

From: Andres
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.

Physic

2012-05-21 01:29:20

wow looks great! easier than tv

putonajonny

2012-05-21 10:01:13

From: Andres
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

chuckyb0y

2012-05-22 08:13:48

this is awesome :) could use a other website lay out though

[S]paz

2012-05-22 08:17:51

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.

Er1k

2012-05-25 06:47:48

This is amazing. If there is going to be separate logs for different scripts, it will look very professional and painless to use ;)

Subliment

2012-05-26 12:01:52

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?

putonajonny

2012-05-26 14:59:18

From: Subliment
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?

Subliment

2012-05-27 16:26:31

From: putonajonny
Sorry, what do you mean?


Allowing the script to commit screenshots or something of that sort to the db.

Mark

2012-05-27 16:44:02

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

NoUserName

2012-05-27 18:33:05

From: CRU1Z1N
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!

xsomix

2012-06-02 14:23:24

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