SRL Archive - Discussions and Debates

Cstatus


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

Sumilion

2006-10-11 14:12:52

Hmm, if fakawi wouldn't have made RC.scar then i would love this idea, but i think that fawki's method is just way easier. Besides, if you can't get on RS then how would you be able to get on FTP ? Im sorry i'm kinda beating it down, it's just that Fawki's way is faster. Nevertheless good job, i couldn't have done it !

warship45

2006-10-11 14:19:54

yes however at school i can use an ftp client to get onto an ftp server so i can do it that way i will also be making an exe file for it so u are at a m8;s house u just run the exe and it will have a gui for the system so u can use it jsut as easy as fakawi from an exe when it is done. this will give u more power to stop/start script and so on change players and stuff like that. i understand what u are saying that his is easyer to use and i will be working on an ftp server or trying to find a free ftp server for a home pc so that any can use it with or with out a web site/ftp space.

the only thing that i dont like about fakawi is that it uses rs right under there noses if somone happend to report u at the moment u asked for a report the his hole system could be used to get use ban

Sumilion

2006-10-11 14:33:22

Yes your right, but i doubt it will happen. Your program does sound like it has potential, but there can only be 1 true radio controlled program ^^ let the battle begin :p

warship45

2006-10-11 14:35:27

From: Sumilion
but i doubt it will happen.


what do you mean you doubt it will happen? i dont think i understand what you ment by that lol

Sumilion

2006-10-11 14:53:16

That jagex would do that, for all they know im a friend of someone that happens to be an autoer.

warship45

2006-10-12 04:47:29

yes thay may just think you are a fiend but they will ban the autoer account and after to many may even ip ban you.

i have just updated the plugin it works better now you can now add up to 100 commands per line i will hopfully be working on an exe and a php script.

exe will allow you to have a gui system to use from anywhere and the php will be basicly the online version of the exe allow you to have a gui system on the internet to send reports and so on.


Edit: i am jsut testing the new system that will allow the script to send an sms message to any uk phone when the script is say stoped this is just being tested at the moment but i hope to get it all working in the next few days.