SRL Archive - OSR Intermediate Scripting Tutorials

Adding SRL Stats To Your script.


shaunthasheep

2007-06-02 11:20:52

give time for the image to load

Buckleyindahouse

2007-06-02 11:24:49

OMFG, Thank you so much. I always wondered how to do this.

shaunthasheep

2007-06-02 12:25:24

From: c0de
Cool, next time try not to scatter images all around lol :)

Good tut, it'll help people a lot.


lol i wasn't on planning scattering the images all over the place, but when it came to those wide images, i didn't want to waste space.

And thanks for all the comments =)

Dan Cardin

2007-06-02 14:58:08

really nice tut!! nice and colourful! thats way cool!

Hugolord

2007-06-14 07:04:35

Thanks for this was wondering how to do this!

gamer716

2007-06-14 07:42:18

a question: i register SRL Stats but i forgot my ID key. How can i recover it?

Haxor

2007-06-14 07:45:27

ill try ask my friend if hell add srl stats for the monk killer

JAD

2007-06-14 19:08:10

From: gamer716
a question: i register SRL Stats but i forgot my ID key. How can i recover it?


What I do when I forget it is click the members list, and click sort by name. Then just look for your name and look next to it for your ID.

And awesome tut! May help me a bit if I can't figure out how to register my almost released script :)

gsquare567

2007-06-14 20:01:31

so does this mean every time i increase one of the variables i need to cal SRLRandomsReport?

kemico2

2007-06-14 21:05:39

Thank you so much rs moneky i always wanted to put this in one of my scripts but i never knew how.

WhiteShadow

2007-06-14 21:18:28

From: gsquare567
so does this mean every time i increase one of the variables i need to cal SRLRandomsReport?


Just add SRLRandomsReport; right after your progress report.

gsquare567

2007-06-15 00:15:58

ok i did that, but its not working… http://www.stats.srl-forums.com/index.php?action=view_script&id=190
ReportVars[5] := ReportVars[5] + 1; // talks
and after
SRLRandomsReport; // send ReportVars to SRL
EDIT: when i try setupsrl.scar, for user ID i type gsquare567 and i get this error…
[Runtime Error] : Exception: Access violation at address 00000000. Read of address 00000000 in line 755 in script C:\Program Files\SCAR 3.06\includes\SRL\SetupSRL.scar
am i using the right user id, if not, how do i get it if i have… misplaced it?
edit again: i got this when i ran my script "Invalid Script ID"

SetupSRL;
ScriptID := '190';

WhiteShadow

2007-06-15 00:46:22

SRL ID # not SRL username on these forums. "p

EDIT:
I think the Rs Monkey forgot a few things.

Here this is taken from my script.

SetupSRL;
SRLID := dSRLID; //const
SRLPassword:= dSRLPASS; //const
for i:= 0 to 19 do //<---
ReportVars[i]:= 0;
ScriptID := '';
SetUpSRLReport; // <---

Hugolord

2007-06-15 06:18:31

hey i get this Assignment expected in script after

ScriptId :='192';
SrlRandomsReport;
ReportVars[0]= Varname1(Rocks);

can anyone help me? :(

WhiteShadow

2007-06-16 02:26:19

From: hugolord
hey i get this Assignment expected in script after

ScriptId :='192';
SrlRandomsReport;
ReportVars[0]= Varname1(Rocks);

can anyone help me? :(


It should be

ReportVars[0]:= ReportVars[0] + AnIntegerVariable; 

shaunthasheep

2007-06-17 11:02:49

ReportVars[0] := ReportVars[0] + CountItemBmpMaskTol(OreMask, 15);

i stole this oremask from Wizzups VEM lol.
hopefully he won't mind

OreMask := BitmapFromString(11, 11, 'z78DA73730301033070436' +
'2238B60024C35B84CC0A5923C13F0BB937813F0EB22DE04CC5022' +
'CF04CADD404CC890EA0BFCE2F85D4E4C6A212FF470998FCC0600F' +
'B599CC1');

Lalaji

2007-06-17 11:20:57

Great tut but i think one of the like dosent open for me.

Timer

2007-06-18 10:46:39

Can Some One Please Add In The Thing That Updates Srl Stats For Me Every Time It Does Procedure ReportProgress;?

P.S. This Is Just Some Of My Script You Might Need To Use To Add Stats &
The Thing To Report To SRL Stats Is
CoalMined

Procedure ReportProgress;
Begin;
ClearReport;
AddToReport('Progress Report')
AddToReport('Auto CoalMiner')
AddToReport('By: Timer150')
AddToReport('')
AddToReport('Averaged Coal/Exp')
AddToReport('Mined ' + inttostr(CoalMined) + ' Coal')
AddToReport('Exp Gained ' + inttostr(CoalMined*50))
End;

Procedure AttackCheck;
Begin
If(Findcolor(x,y,Blood,201,113,327,220))Then
RunFarAway;
end;

Procedure Drop_Coal(Color:Integer);
var
x, y, Drop:Integer;
begin
Drop:= DTMFromString('78DA63B4636260E064644006FFFFFF07D3305' +
'1465BA01A5E5435300057E30A542344408D07500D0F01BBF48854' +
'C346408D19A69B31D480FCCE875F0D00B9181450');
while(FindColor(x,y,Color,548,168,761,496))do
begin
Mouse(x+5,y,1,1,false);
Wait(900);
if(FindDtm(Drop,x,y,548,168,761,496))then
begin
Mouse(x,y,1,1,true)
Wait(450);
end;
end;
FreeDtm(Drop);
end;

Var Z:integer;

Procedure MineOre;
Begin;
Repeat;
Mine_Coal;
Attackcheck;
Z:=z+1;
CoalMined:=CoalMined+1;
ReportProgress;
Until(Z=Ore);
End;

Procedure DoItAll;
Begin;
MineOre;
Speak('Droping')
Say('Feel Free To Take ^.^')
Drop_Coal(Coal2);
End;

Begin;
SetupTimersInclude;
ReportProgress;
Setup;
Setup2;
SetupSRL;
ScriptID := '199';
Repeat;
DoItAll;
Until(CoalMined>OreToMine);
End.

Timer

2007-06-18 10:48:59

Any 1 Here?

crossback7

2007-06-18 11:13:08

Don't double post, suprisingly it'll probably take more than two minutes for someone to answer.

And try doing it for yourself first. You didn't even make an attempt at it in your above script. If you can't do it, then you should ask for some help.

shaunthasheep

2007-06-18 11:29:56

what about this?

Procedure ReportProgress;
Begin;
ClearReport;
AddToReport('Progress Report')
AddToReport('Auto CoalMiner')
AddToReport('By: Timer150')
AddToReport('')
AddToReport('Averaged Coal/Exp')
AddToReport('Mined ' + inttostr(CoalMined) + ' Coal')
AddToReport('Exp Gained ' + inttostr(CoalMined*50))
SrlRandomsReport;
End;

Procedure AttackCheck;
Begin
If(Findcolor(x,y,Blood,201,113,327,220))Then
RunFarAway;
end;

Procedure Drop_Coal(Color:Integer);
var
x, y, Drop:Integer;
begin
Drop:= DTMFromString('78DA63B4636260E064644006FFFFFF07D3305' +
'1465BA01A5E5435300057E30A542344408D07500D0F01BBF48854' +
'C346408D19A69B31D480FCCE875F0D00B9181450');
while(FindColor(x,y,Color,548,168,761,496))do
begin
Mouse(x+5,y,1,1,false);
Wait(900);
if(FindDtm(Drop,x,y,548,168,761,496))then
begin
Mouse(x,y,1,1,true)
Wait(450);
end;
end;
FreeDtm(Drop);
end;

Var Z:integer;

Procedure MineOre;
Begin;
Repeat;
Mine_Coal;
Attackcheck;
Z:=z+1;
CoalMined:=CoalMined+1;
ReportVars[0] := ReportVars[0] + 1;
ReportProgress;
Until(Z=Ore);
End;

Procedure DoItAll;
Begin;
MineOre;
Speak('Droping')
Say('Feel Free To Take ^.^')
Drop_Coal(Coal2);
End;

Begin;
SetupTimersInclude;
ReportProgress;
Setup;
Setup2;
SetupSRL;
ScriptID := '199';
Repeat;
DoItAll;
Until(CoalMined>OreToMine);
End.

n3ss3s

2007-06-19 09:23:37

Hugolord, everytime you do something like that with vars, you need to have := there instead of only = because, the ":" is the assigner or whats it called :D


Timer, what do you mean by that?

Timer

2007-06-20 12:06:29

Thanks Rs Monkey

the scar noob

2007-06-20 13:50:42

From: WhiteShadow
Just add SRLRandomsReport; right after your progress report.

is this the answer you were looking for?

EDIT: so non-srl membs also can do that?

Bourdou!

2007-08-19 16:13:57

Does it record the time spent running automatically?

Pitbull

2008-02-21 09:01:09

Failed when compiling
Line 67: [Error] (12379:13): Unknown identifier 'SRLVersionNumber' in script C:\Users\Bert\AppData\Local\VirtualStore\Program Files\SCAR 3.14\includes\SRL\SetUpSRL.scar

This is the error i get when I try to run SetUpSrl.scar, anyone know how to fix this ? I am using Vista, I'll also attach my script in which I think I included ScriptID and stuff right.

program PBautotalker;
{.include SRL/SRL.scar}

var
frmDesign : TForm;
ForumNameLabel : TLabel;
ColorLabel : TLabel;
EffectLabel : TLabel;
Message1Label : TLabel;
Message2Label : TLabel;
ForumNameEdit : TEdit;
ColorEdit : TEdit;
Edit2 : TEdit;
EffectEdit : TEdit;
Message1Edit : TEdit;
Message2Edit : TEdit;
StartButton : TButton;

ForumName, Color, Effect, Message1, Message2 : String;

procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;

procedure ClickButton(sender: TObject);
begin
Writeln('Thnx for using PBautotalker!');
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;

end;

Procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 98;
frmDesign.Width := 401;
frmDesign.Height := 277;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.ShowHint := True;
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
ForumNameLabel := TLabel.Create(frmDesign);
ForumNameLabel.Parent := frmDesign;
ForumNameLabel.Left := 32;
ForumNameLabel.Top := 32;
ForumNameLabel.Width := 57;
ForumNameLabel.Height := 13;
ForumNameLabel.Hint := 'Fill out your SRL-forum username here';
ForumNameLabel.Caption := 'ForumName';
ForumNameLabel.ParentShowHint := False;
ForumNameLabel.ShowHint := False;
ColorLabel := TLabel.Create(frmDesign);
ColorLabel.Parent := frmDesign;
ColorLabel.Left := 32;
ColorLabel.Top := 64;
ColorLabel.Width := 65;
ColorLabel.Height := 13;
ColorLabel.Hint := 'For the possible color'#39's check my thread';
ColorLabel.Caption := 'Color';
ColorLabel.ParentShowHint := False;
ColorLabel.ShowHint := False;
EffectLabel := TLabel.Create(frmDesign);
EffectLabel.Parent := frmDesign;
EffectLabel.Left := 32;
EffectLabel.Top := 96;
EffectLabel.Width := 65;
EffectLabel.Height := 13;
EffectLabel.Hint := 'For the possible effect'#39's check my thread';
EffectLabel.Caption := 'Effect';
EffectLabel.ParentShowHint := False;
EffectLabel.ShowHint := False;
Message1Label := TLabel.Create(frmDesign);
Message1Label.Parent := frmDesign;
Message1Label.Left := 32;
Message1Label.Top := 128;
Message1Label.Width := 85;
Message1Label.Height := 13;
Message1Label.Hint := 'Fill out message 1 here';
Message1Label.Caption := 'Message1';
Message1Label.ParentShowHint := False;
Message1Label.ShowHint := False;
Message2Label := TLabel.Create(frmDesign);
Message2Label.Parent := frmDesign;
Message2Label.Left := 32;
Message2Label.Top := 160;
Message2Label.Width := 85;
Message2Label.Height := 13;
Message2Label.Hint := 'Fill out message 2 here';
Message2Label.Caption := 'Message2';
Message2Label.ParentShowHint := False;
Message2Label.ShowHint := False;
ForumNameEdit := TEdit.Create(frmDesign);
ForumNameEdit.Parent := frmDesign;
ForumNameEdit.Left := 128;
ForumNameEdit.Top := 32;
ForumNameEdit.Width := 225;
ForumNameEdit.Height := 21;
ForumNameEdit.Hint := 'Enter your SRL forum'#39's name here';
ForumNameEdit.ParentShowHint := False;
ForumNameEdit.ShowHint := True;
ForumNameEdit.TabOrder := 8;
ColorEdit := TEdit.Create(frmDesign);
ColorEdit.Parent := frmDesign;
ColorEdit.Left := 128;
ColorEdit.Top := 64;
ColorEdit.Width := 121;
ColorEdit.Height := 21;
ColorEdit.Hint := 'For the possible color'#39's check my thread';
ColorEdit.TabOrder := 9;
Edit2 := TEdit.Create(frmDesign);
Edit2.Parent := frmDesign;
Edit2.Left := 144;
Edit2.Top := 104;
Edit2.Width := 1;
Edit2.Height := 21;
Edit2.TabOrder := 10;
Edit2.Text := 'Edit2';
EffectEdit := TEdit.Create(frmDesign);
EffectEdit.Parent := frmDesign;
EffectEdit.Left := 128;
EffectEdit.Top := 96;
EffectEdit.Width := 121;
EffectEdit.Height := 21;
EffectEdit.Hint := 'For the possible effect'#39's check my thread';
EffectEdit.TabOrder := 11;
Message1Edit := TEdit.Create(frmDesign);
Message1Edit.Parent := frmDesign;
Message1Edit.Left := 128;
Message1Edit.Top := 128;
Message1Edit.Width := 225;
Message1Edit.Height := 21;
Message1Edit.Hint := 'Fill out message 1 here';
Message1Edit.TabOrder := 12;
Message2Edit := TEdit.Create(frmDesign);
Message2Edit.Parent := frmDesign;
Message2Edit.Left := 128;
Message2Edit.Top := 160;
Message2Edit.Width := 225;
Message2Edit.Height := 21;
Message2Edit.Hint := 'Fill out message 2 here';
Message2Edit.TabOrder := 13;
StartButton := TButton.Create(frmDesign);
StartButton.Parent := frmDesign;
StartButton.Left := 264;
StartButton.Top := 64;
StartButton.Width := 89;
StartButton.Height := 49;
StartButton.Hint := 'Start the script ! :)';
StartButton.Caption := 'START';
StartButton.TabOrder := 15;
StartButton.OnClick := @ClickButton;
end;

procedure Talk;
begin

Color := ColorEdit.text;
Effect := EffectEdit.text;
Message1 := Message1Edit.text;
Message2 := Message2Edit.text;



if(IsFKeyDown(1))then
begin
repeat
wait(1450 + Random(850))
TypeSend(Color + ':' + Effect + ':' + Message1);
Talks:=Talks+1;
ReportVars[0] := ReportVars[0] + 1;
until (IsFKeyDown(2))
end;

if(IsFKeyDown(3))then
begin
repeat
wait(1350 + Random(950))
TypeSend(Color + ':' + Effect + ':' + Message2);
Talks:=Talks+1;
ReportVars[0] := ReportVars[0] + 1;
until (IsFKeyDown(4))
end;
end;

procedure Proggy;
begin

ForumName := ForumNameEdit.text;

ClearDebug;
Writeln('<><~><><~><><~><><~><><~><><~><><~><><~><><~><><~>');
Writeln('<~> ');
Writeln('<->--PBautotalker was used by ' + ForumName + ' ');
Writeln('<->--PBautotalker sent ' + IntToStr(Talks) + ' messages' + ' ');
Writeln('<->--PBautotalker ran for ' + TimeRunning + ' ');
Writeln('<~> ');
Writeln('<><~><><~><><~><><~><><~><><~><><~><><~><><~><><~>');

end;

Procedure Sig;
begin
wait(750 + random(250));

Writeln(' ');
Writeln(' +, ,, ');
Writeln(' :*: *, ');
Writeln(' ,*, +:* ');
Writeln(' ,#:, *,W,+ ');
Writeln(' .@W,, WW. ');
Writeln(' +W@ . * +WW: ');
Writeln(' :WW# , , .WW, ');
Writeln(' ,WW* + ,WW. ');
Writeln(' .WW+ , *:,,,,,,,,,,,,,.::::::+ , ,WW** ');
Writeln(' #WW. ,,+#@WWWWWWWWWWWW*WWWWWWWWWWW@+, ,WWW, ');
Writeln(' ,WW.,: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW+:+,#W+ ');
Writeln(' *+WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW. ');
Writeln(' +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW, ');
Writeln(' WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW. ');
Writeln(' #WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW@: ');
Writeln(' ,#WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW* : ');
Writeln(' ,@WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW, . ');
Writeln(' *,,:WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW:, , ');
Writeln(' :, W@WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW , ');
Writeln(' . :WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW: , ');
Writeln(' + ,@WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW . ');
Writeln(' ,WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW: : ');
Writeln(' ,WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW#WW . ');
Writeln(' + #W,WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW+@# , ');
Writeln(' : .@,WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW@:, , ');
Writeln(' * *:WWWWWWWWWWW,WWWWWWWWWWWWWWWWWWW, : ');
Writeln(' , ,#WWWWWWWWWWW:WWWWWWWWWWWWWWWWWWW , ');
Writeln(' , +WWWWWWWWWWWW+WWWWWWWWWWWWWWWWWWWW , ');
Writeln(' .WWWWWWWWWWWWW#WWWWWWW,WWWWWWWWWWWW@ ');
Writeln(' ,#WWWWWWWWWW@WWWWWWWW##WWWWWWWWWWW*, , ');
Writeln(' ,**,:@WWWWWWWW.WWWWWWW*WWWWWWWWW*, .W,, * ');
Writeln(' ,@WW,.W@*+#@@:W:@WWWWWWW+ @+*:+@WW* WWW. . ');
Writeln(' * ,+WW:,,WWWW ,,WWWWWWWWWWW@,#. *WWW,,:WW@, . ');
Writeln(' *,,WWWW#, #*, ,:WWWWWWWWWWWWWW@ ,,:., *WWWW. . ');
Writeln(' + ,WWWWWW:, , WWWWWWWWWWWWWWWW,, , +WWWWWW. . ');
Writeln(' + ,WWWWWWWW: @WWWWWWWWWWWWWWWWW:,*WWWWWWWW: : ');
Writeln(' : ,WWWWWW:W@,@WWWWWWWWWWWWWWWWWWW*:#,WWWWWW: : ');
Writeln(' : ,@WWWWW# ,WWWWWWWWWWWWWWWWWWWWWW.,+WWWWW* + ');
Writeln(' + *WWWWW,+W.WWWWWWWWWWWWWWWWWW*##,WWWWW, # ');
Writeln(' * ,@WWW+,.#WWWWWWWWWWWWWWWWWWW,,,#WW*. ');
Writeln(' ,. WWWWWWW@###@WWWWWWWW, ,, , ');
Writeln(' :, WWWW@,,.+#@WW@#@WWWW, ');
Writeln(' , ,+ , #WWW,*,,,.:. ,WW@ , ');
Writeln(' :, +W+, ,WW,, , , ,WW. ,+ ');
Writeln(' ., :WW: #WW: ** ,*,#W@. ,+ ');
Writeln(' , .WW# ,+WWW*:.., ,,,:#WW@, , ');
Writeln(' . ,@W, WWWWWWWW, WWWWWWWW:, , ');
Writeln(' ,,,WW, +WWWWWWWW@, #WWWWWWWW*, . ');
Writeln(' , .WW,,WWWWWWWWW #WWWWWWWW ');
Writeln(' ,,. :WWWWWWWW *WWWWWWW# ');
Writeln(' . ,WWWWWWW* ,#WWWWWW, . ');
Writeln(' +WWWW#, ,@WWW# , ');
Writeln(' , , @W*, ,*. ');
Writeln(' , ,,,,,, ');
Writeln(' , , ,:W ,@@., ');
Writeln(' :#., ,.* ,* ');
Writeln(' +, ,, , ');
Writeln(' . , . ,,, .* ., , : ');
Writeln(' :, , :,. ');
Writeln(' ');
Writeln(' ');

end;

begin
SafeInitForm;
SafeShowFormModal;
ActivateClient;
SetupSRL;
ScriptID := '661';
repeat
Talk;
until (IsFKeyDown(5))
SrlRandomsReport;
Proggy;
Sig;
end.

I hope any1 has an answer.

Daniel.Blaze

2008-02-21 09:35:56

The procedure SRLRandomsReport; sends the stats to the server. Just put that into your script progress report.

Pitbull

2008-02-25 06:38:02

From: Daniel.Blaze
The procedure SRLRandomsReport; sends the stats to the server. Just put that into your script progress report.


If that was directed to me, thnx, because that was part of the problem. I fixed it however and finally got my stat's to work.

[ontopic] It's great that people like you write tut's for the less experienced among us. Keep doing good work like this ! This certainly helped me and I'm sure it helped other people to. So thnx ! :spot:

Good luck botting,

PB.

0wn 4 skill

2008-08-22 10:06:18

Thanx, this helped me add stats to my script :D

welcome

2008-09-04 01:46:40

Does this automatically report randoms such as old men and their boxes?

Griff

2008-09-06 21:15:55

thanks a lot man, this is an awesome tut! Pics were good, but a lil everywhere :P

zereoth

2008-09-08 12:41:45

Simple and elegant tutorial, will use it in my falador smelter if i ever find the time to finish it :S

Tniffoc

2008-09-21 13:08:56

I doubt that you can do this but it's worth asking. Can you change the number/name of report vars after you have registered the script?

Thanks in advance,
Tniffoc

boomerswims

2008-09-21 13:12:45

=/ i don't get it. - what does it do?

Tniffoc

2008-09-21 13:18:41

From: boomerswims
=/ i don't get it. - what does it do?

SRL Stats records what the script does for everybody using it so that you can see what it can and can't do and you can put the [ACRONYM="statistics"]stats[/ACRONYM] in your sig so that people can see your script is good!