warship45
2006-10-11 13:49:42
Cstatus
Hello i have been working on this project for a while, it allows you to control scar form any internet connection as long as you can access http and ftp.
How it works:-
basicly you upload a file called Cstatus.txt with the commands in it e.g.
report;screenshot;nextplayer
as soon as the command Cstatus has been run in the loop it will read the file useing http it will then check what commands you have asked to be done you can use any up to 100 at once. if you have said report it will upload a report file to the ftp if you said screen shot it will take a screen shot and upload that and so on.
Installing:-
Copy this into a new scar file and save in the inculdes with a name of Cstatus
download the plugin from here:- http://0z0.co.uk/Cstatus.zip
put the plugin dll file into the plugins part of scar open scar and make sure you include the file like you do with srl.
Useing Cstatus:-
To use it is simple here is an exaple
the first command sets up the addon to allow it to connect to ftp.
Writeln2 is used in stend of writeln it does the same thing just adds to an array too
the cstatus is the command that does the imporant stuff and it can be called over and over in side a loop or somthing.
thanks for testing the plugin below i have listed a few things that i will be adding to the addon in a few weeks.
Comming soon:-
Load scar files
Save scar files
Send and replace scar files
Start scripts
Send remote command to scar
shutdown scar
change rs world
Hello i have been working on this project for a while, it allows you to control scar form any internet connection as long as you can access http and ftp.
How it works:-
basicly you upload a file called Cstatus.txt with the commands in it e.g.
report;screenshot;nextplayer
as soon as the command Cstatus has been run in the loop it will read the file useing http it will then check what commands you have asked to be done you can use any up to 100 at once. if you have said report it will upload a report file to the ftp if you said screen shot it will take a screen shot and upload that and so on.
Installing:-
Copy this into a new scar file and save in the inculdes with a name of Cstatus
Var
CsURL,Csplayersname,CsFTP,Csuser,Cspass: string;
Creport: array[0..100] of string;
arrayindexpoint: Integer;
{*******************************************************************************
procedure Writeln2(S: String);
By: Warship45
Description: writes the line to scar and to it's own report
*******************************************************************************}
Procedure Writeln2(S: string);
begin
Writeln(s);
Creport[arrayindexpoint]:=s;
arrayindexpoint:=arrayindexpoint+1;
if arrayindexpoint>100 then begin arrayindexpoint:=0 end;
end;
{*******************************************************************************
procedure CstatusSetup(URL,Playername,ftpurl,ftpuser,ftppass: String);
By: Warship45
Description: Setsup the Cstatus include
*******************************************************************************}
Procedure CstatusSetup(URL,Playername,FTPurl,FTPuser,FTPpass: string);
begin
CsURL:=URL;
Csplayersname:=Playername;
CsFTP:=FTPurl;
Csuser:=FTPuser;
Cspass:=FTPpass;
SetupCstatus(Csuser,Cspass,CsFTP,apppath);
ConnectCstatus(Csplayersname);
end;
{*******************************************************************************
procedure Cstatus;
By: Warship45
Description: Goes in the main loop and checks for messages from remote
*******************************************************************************}
Procedure Cstatus;
var
Cstatusmessage: string;
CSmessage: array[0..100] of string;
CAB,CSmessageindex,reportCAB: Integer;
begin
Cstatusmessage:=GetHTTPPage(InitializeHTTPClient(True,True),CsURL+Csplayersname+'Cstatus.txt');
if Cstatusmessage<>'' then
begin
for CAB:=0 to Length(Cstatusmessage)-1 do
begin
if StrGet(Cstatusmessage,CAB+1)=';' then
begin
CSmessageindex:=CSmessageindex+1;
end else begin
CSmessage[CSmessageindex]:=CSmessage[CSmessageindex]+StrGet(Cstatusmessage,CAB+1);
end;
end;
for CAB:=0 to CSmessageindex do
begin
if Lowercase(CSmessage[CAB])='report' then
begin
for reportCAB:= 0 to arrayindexpoint do
begin
Caddtoreport(Creport[reportCAB]);
end;
Cstatusreport;
Cstatusput('Creport.txt');
end;
if Lowercase(CSmessage[CAB])='stopscript' then
begin
TerminateScript;
end;
if Lowercase(CSmessage[CAB])='screenshot' then
begin
ScreenshotCstatus;
end;
if Lowercase(CSmessage[CAB])='nextplayer' then
begin
Logout;
NextPlayer(false);
end;
end;
Cstatusdelete;
end;
end;download the plugin from here:- http://0z0.co.uk/Cstatus.zip
put the plugin dll file into the plugins part of scar open scar and make sure you include the file like you do with srl.
Useing Cstatus:-
To use it is simple here is an exaple
CstatusSetup(httpurl,playersname,ftpurl,username,password);
Writeln2('hello');
Writeln2('report');
Cstatus;the first command sets up the addon to allow it to connect to ftp.
Writeln2 is used in stend of writeln it does the same thing just adds to an array too
the cstatus is the command that does the imporant stuff and it can be called over and over in side a loop or somthing.
thanks for testing the plugin below i have listed a few things that i will be adding to the addon in a few weeks.
Comming soon:-
Load scar files
Save scar files
Send and replace scar files
Start scripts
Send remote command to scar
shutdown scar
change rs world