Log in

View Full Version : How do i add SRL Stats to my script?



Decs
02-21-2012, 08:36 PM
I have been working on my first script and i want it have SRL Stats
i can not get it to work... Can someone take a look and possibly tell
me what i am doing wrong?

All i know is the "incVariable" is the problem (its not updating SRL Stats)

It's in the "//BANKING" section of the script

program WillowCutter;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

//INFORMATION
const
Tree_Type = 'Willow';
Signed_App = True;

//SETTINGS
Bank_Pin = '0000'; //Bank Pin
RS_Memeber = False; //Members Status (True/False)
Default_World = 38; //Default World Used

//SRL-STATS
SRLStats_Username = 'Name'; //SRL Stats Username
SRLStats_Password = 'Pass'; //SRL Stats Password

//VARIABLES
Var
Willows_Chopped: Integer;
Experience_Gained: Integer;

//PLAYERS
Procedure DeclarePlayers;
begin
HowManyPlayers := 1; //Total Players
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //Default Player

Players[0].Name := 'Name'; //RuneScape Username
Players[0].Pass := 'Pass'; //RuneScape Password
Players[0].Nick := 'Nick'; //First 3-4 Letters of Username
Players[0].Active := True; //Player Status
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

//ANTI-RANDOMS
procedure AntiRandoms;
begin
FindNormalRandoms;
LampSkill := 'woodcutting';
LevelUp;
end;

//ANTI-BAN
Procedure AntiBan;
begin
if(not(LoggedIn)) then Exit;
Case Random(250) of

10:
begin
WriteLn('Performing Anti-Ban.');
HoverSkill('Woodcutting', false);
wait(1634+Random(2169));
end;

30:
begin
WriteLn('Performing Anti-Ban.');
PickUpMouse;
end;

40:
begin
WriteLn('Performing Anti-Ban.');
MakeCompass('N');
wait(100+random(433));
MakeCompass('S');
wait(50+random(124));
MakeCompass('N');
FindNormalRandoms;
end;

50:
begin
WriteLn('Performing Anti-Ban.');
ExamineInv;
end;

end;
end;

//WALKING(WILLOWS)
Procedure WalkToWillows;
Var
walkTree:TPointArray;

begin
SPS_Setup(RUNESCAPE_SURFACE,['10_9','11_9','11_8','9_8','9_9']);
walkTree := [Point(4186, 3668), Point(4184, 3645), Point(4151, 3721)];
SPS_WalkPath(walkTree);
end;

//WALKING(BANK)
Procedure WalkToBank;
Var
walkBank:TPointArray;

begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE,['10_9','11_9','11_8','9_8','9_9']);
walkBank := [Point(4152, 3698), Point(4202, 3685)];
SPS_WalkPath(walkBank);
end;

//BANKING
Procedure bankLogs;

begin
if(InvFull) then
begin

WriteLn('Inventory full, Banking');

OpenBankFast('db');
WriteLn('Depositing ' + Tree_Type + ' logs.');

if(PinScreen) then
WriteLn('Entering Bank PIN: ' + Bank_Pin + '.');
InPin(Bank_Pin);

if(BankScreen) then
DepositAll;
Willows_Chopped := Willows_Chopped + 28;
Experience_Gained := Experience_Gained + 1890;
WriteLn('Deposited ' + Tree_Type + ' logs.');

WriteLn('Closing Bank');
WriteLn('Willows Chopped: ' + IntToStr(Willows_Chopped));
WriteLn('Experience Gained: ' + IntToStr(Experience_Gained));

CloseBank;

if (Tree_Type = 'Willow') then
stats_IncVariable('Willow Logs Chopped', 28);

WriteLn('Finding Walk Path');
Wait(2000 + Random(1500));
WriteLn('Found Walk Path');
Wait(1000 + Random(300));
WriteLn('Walking to Willows');

end;
end;

//INVENTORY
Procedure checkFullInv;
begin
if(InvFull) then
begin
WriteLn('Inventory Full, Finding bank...');
WalkToBank;
Wait(1000 + Random(1500));
WriteLn('Bank Found, Walking to bank...');
bankLogs;
WalkToWillows;
end;
end;

//WOODCUTTING
Procedure treeChop;
var x, y: integer;
begin
if not LoggedIn then Exit;

if(InvFull) then exit;
repeat
if FindObj(x, y, 'hop', 3491141, 10) then
Mouse(x, y, 1, 1, false);
ChooseOption('hop');

repeat
wait(1200+random(450));
AntiBan;
AntiRandoms;
checkFullInv;
Until not(IsUpText('illow')or(InvFull))
until(InvFull);
end;

//SMART
begin
Smart_Server := Default_World;
Smart_Members := RS_Memeber;
Smart_SuperDetail := False;
Smart_Signed := Signed_App;
ClearDebug;

//SETUPS
SetUpSRL;
SetupSRLStats(819, SRLStats_Username, SRLStats_Password);
ActivateClient;
DeclarePlayers;
LoginPlayer;

Willows_Chopped := 0;
Experience_Gained := 0;

ClearDebug;

repeat
WalkToWillows;
treeChop;
WalkToBank;
bankLogs;
Stats_Commit;
until (Willows_Chopped >= 5000);

end.

I would truly be thankful for any sort of help!

Ashaman88
02-21-2012, 09:28 PM
http://villavu.com/forum/showthread.php?t=63266

Decs
02-21-2012, 09:42 PM
http://villavu.com/forum/showthread.php?t=63266

thanks for the link but i already tried that one, and it did not work for me
as im not positive where to add the incVariable

EDIT: this is my first script, still trying to learn these things

Ashaman88
02-21-2012, 09:59 PM
You put the incVariable wherever in your script that variable increases. So if mining an ore is your variable, put the incvariable where you have successfully mined the ore. Does that make sense?

Decs
02-21-2012, 10:07 PM
i just posted the script, so maybe someone will help me figure out what im doing wrong?

Decs
02-22-2012, 12:55 AM
sorry, gotta bump this cause the problem is driving me crazy

i feel like ive tried it every possible way and it will not work