SRL Archive - Research & Development Lounge

Web Script Status Viewer liek


Simtoon

2010-01-15 19:20:30

I made this so you can view the status of your scripts online

Basically what this does is it sends status of your script to a database and from that database theres a php script that allows you to view it.

Thats all it does right now i need to add more features when i get some time i wrote this in 15mins



program New;

{.include SRL/SRL.scar}



Procedure SendStatus(wat : string; SendTime : Boolean);

var

Client : integer;

PostHTTP : String;



begin

Client := InitializeHTTPClient(false, false);

AddPostVariable(Client, 'status', wat);

if SendTime then

AddPostVariable(Client, 'time', TheTime);

PostHTTP := PostHTTPPageEx(Client, 'http://localhost/status.php');

WriteLn('Sent Status "' + wat + '"');

FreeHTTPClient(Client);

end;





Procedure ScriptTerminate;

begin

SendStatus('Script End', True);

end;



begin

SendStatus('Script Started', True);

end.



All you need to do in the script is add the Procedure and Add SendStatus() where you want the status to be update the parms are very easy all it is is SendStatus('status here', True or False if you want the time) True for Time and False for no time

Also add one in the script terminate so it can show when the script stops…

Right now this is basic will add more features later, im trying to make a public system i havent started yet.. Ill add more features later also suggest some features to be added..

You need to edit the config.php for your settings and you need to make the database and the sql table is there.

YoHoJo

2010-01-15 22:09:13

Pretty cool, always nice to see how you account is going.
You know though, SRL stats system already does this Also, it even allows you to set the accounts to true again! :D