View Full Version : About registring script, Please help
DevilCheater
06-01-2007, 09:20 AM
I have a great script which ill post soon but there is a problem .. i dont know how to registr it so every1 can see its stat ..
Can someone please help me ?
Ramage
06-01-2007, 09:23 AM
http://www.stats.srl-forums.com/?action=register_script
DevilCheater
06-01-2007, 09:51 AM
Yea , Thats done .. So now what should i write in my script to send reports ?
Infantry001
06-01-2007, 01:16 PM
ReportVar[0] := ReportVar[0] + 1;
etc.
Say ReportVar[0] was set as amount of loads done. Every time you finish chopping/mining/fishing/collecting a load, Make ReportVar[0] one more (see above code). Did i explain it good enough?
geerhedd
06-01-2007, 05:11 PM
i think what you are looking for is,
SendSRLReport;//sends srl report
DevilCheater
06-01-2007, 10:04 PM
Yes I understand so if my first variable was loadsdone then when the load is done i just write ReportVar[0] := ReportVar[0] + 1;
But there is one problem .... Unknown identifier 'ReportVar'
Well, first, you need to declare....
Const
YourSRLSTATSID = ''; // Stats ID.
YourSRLSTATSPASS = ''; // Stats Pass.
In the beginning of your script....then in your SetUpScript procedure....declare.....
SRLID := YourSRLstatsID;
SRLPassword := YourSRLstatsPASS;
Seeing you already registered it, I don't know what variables you added to be recorded....but inside the script, after each procedure using the variable..add line..
ReportVars[0] := ReportVars[0] + 1;
Changing the number to correspond with the appropriate variable you are using....
Then add this procedure into the script.....
Procedure ClearVars;
Var
I : Integer;
Begin
For I := 1 To 19 Do //however many variables you registered
ReportVars[i] := 0;
End;
Then somewhere in your SetUpScript procedure...declare
ClearVars;
If you have any more questions, take a look at Wiz's Ess mine (http://www.villavu.com/forum/showthread.php?t=5356)r, and the SRL Stats page where it is registered (http://www.stats.srl-forums.com/index.php?action=view_script&id=51), to get an idea of what variables to register and the appropriate structure of the script to add the procedures in most effectively......
~RAM
DevilCheater
06-02-2007, 06:29 AM
Hmmz , if the script should look like this then i still dont know what the problem is
Var DoorsOpened, X, X2: integer;
Const
VersionNumber = '1.0';
YourSRLSTATSID = ''; // Stats ID.
YourSRLSTATSPASS = ''; // Stats Pass.
Function OpenDoors: boolean;
begin
Result := blah blah blah;
end;
Procedure SetUpScript;
begin
SetUpsrl;
ScriptID := '172'
SRLID := YourSRLstatsID;
SRLPassword := YourSRLstatsPASS;
end;
Procedure ClearVars;
Var
I: Integer;
Begin
For I := 0 To 2 Do
ReportVars[i] := 0;
End;
begin
SetUpScript;
If OpenDoors then
ReportVars[0] := ReportVars[0] := 1
SendSRLReport;
ClearVars
end.
Grr, it won't let me copy and paste and edit it :mad:
anyways, take this part out of the main loop and put it at the end of the actual open door procedure.
the if/then is not needed.....
ReportVars[0] := ReportVars[0] := 1
or I believe can use it with something like this....
doors := doors + CountItemBmpTol(door, 15);
ReportVars[0] := CountItemBmpTol(door, 15);
DevilCheater
06-02-2007, 08:51 AM
Thats what I did ;( .. still nothing...
begin
SetUpScript;
if not LoggedIn then
LoginPlayer
LoadPics;
JustInCase;
Wait(1000);
repeat
repeat
// To Spinning wheel
MakeCompass('S');
SetRun(true)
RadialWalk(StairColor, 320, 400, 70, 1, 1);
Flag;
FindNormalRandoms
wait(500 + random(500));
MarkTime(TimeMarker);
repeat
ClimbDown;
Wait(1000 + random(500))
repeat
wait(100 + random(10));
until GetColor(200, 148) <> 16777215
until (Floor2) or (TimeFromMark(TimeMarker) > 30000)
if TimeFromMark(TimeMarker) > 30000 then
begin
writeln('Cant find stairs ');
Logout;
Players[CurrentPlayer].Active := false
end;
FindNormalRandoms
Wait(500 + random(100));
GetSymbolColors;
wait(100 + random(100));
MakeScreenPerfect;
if not ClickInRoom then
begin
OpenDoors;
DoorsOpened := DoorsOpened + 1;
ReportVars[1] := ReportVars[1] + 1;
end;
Flag;
GameTab(4);
FindNormalRandoms;
ClickWheel;
FindFastRandoms
FindTalk;
if GetColor(44, 37) = 3358280 then
begin //Spinning procedures starts here
Mouse(265, 112, 3, 3, False);
ChooseOption(Ix, Iy, ' X');
MarkTime(TimeMarker);
FlaxColor := GetColor(583, 229);
repeat
wait(100 + random(10));
FindFastRandoms;
FindTalk;
FindNormalRandoms;
until (GetColor(212, 392) = 0) or (TimeFromMark(TimeMarker) > 10000)
TypeSend('28' + Chr(13));
MarkTime(TimeMarker);
repeat
wait(100 + random(100));
if FindNormalRandoms then break;
If FindTalk then break;
if FindFight then
begin
writeln('Find fight ... running to bank ...')
break;
end;
until (TimeFromMark(TimeMarker) > 50000) or (not FindColor(Ix, Iy,
FlaxColor, mix1, miy1, mix2, miy2))
end; // end of spinning procedures !!!
// To bank
FindNormalRandoms
wait(100 + random(100))
MakeCompass('S')
if not ClickTostairs then
begin
OpenDoors;
DoorsOpened := DoorsOpened + 1;
//ReportVar[1] := ReportVar[1] + 1;
wait(500 + random(500));
if findColor(Ix, Iy, Stairs, mmx1, mmy1, mmx2, mmy2) then
Mouse(Ix, Iy, 2, 2, True)
end;
Flag;
wait(500 + random(500))
MarkTime(TimeMarker);
repeat
ClimbUp;
Wait(700 + random(300))
repeat
wait(100 + random(10));
until GetColor(200, 148) <> 16777215
until (not Floor2) or (TimeFromMark(TimeMarker) > 30000)
if TimeFromMark(TimeMarker) > 30000 then
begin
writeln('Cant find stairs ');
Logout;
Players[CurrentPlayer].Active := false
end;
Mouse(634 - 2, 130, 3, 0, True);
flag;
wait(500 + random(500))
// Banking procedures
FindNormalRandoms;
ReportVars[0] := ReportVars[0] + CountItemBmpTol(Bs, 30);
BsMade := BsMade + CountItemBmpTol(Bs, 30);
ReportVars[3] := ReportVars[3] + + CountItemBmpTol(Bs, 30)*15;
if not MyOpenBank(2970976) then
if not MyOpenBank(607067) then
if not MyOpenBank(4350580) then
begin
writeln('Did not find bank ')
Logout;
end;
DepsitBowString;
TakeOutFlax;
CloseBank;
if GetColor(485, 40) = 65536 then
Mouse(485, 40, 2, 2, True)
// end of banking procedures
XpGained := BsMade * 15;
ProgressReport;
SendSRLReport;
ClearVars
until (not Loggedin) or (BsMade >= BsToMake)
Nextplayer(true);
until false;
end.
Maybe problem is somewhere else ?
Yes ... works very good now :D
Tnx guys ... Specially you RAM
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.