the flea
2012-02-20 14:08:22
I'm having some trouble with getting my script to commit to the srl stats feature can someone please explain where I am going wrong?
I am trying to commit to this script http://stats.villavu.com/script/804 which can be found here http://villavu.com/forum/showthread.php?t=75636 however I will post a copy of it on this thread for simplicities sake.
I know the script runs fine as I ran it for about 2 hours last night.
my commit procedure is:
and I have called SetupSRLStats(804, SRLStats_User, SRLStats_Password); when the script starts.
the full script is as follows:
I am trying to commit to this script http://stats.villavu.com/script/804 which can be found here http://villavu.com/forum/showthread.php?t=75636 however I will post a copy of it on this thread for simplicities sake.
I know the script runs fine as I ran it for about 2 hours last night.
my commit procedure is:
Procedure Commit;
begin
xpg := (XP - lxp); //calculates xp gained since last commit
stats_IncVariable('Crafting EXP (Gained)', Round(made * XPPerGlass));
Stats_Commit;
lxp := XP; //saves the variable for next time it needed to commit
MarkTime(CommitTime);
end; and I have called SetupSRLStats(804, SRLStats_User, SRLStats_Password); when the script starts.
the full script is as follows:
program FleaWine;
{$DEFINE SMART}
{$include srl/srl.simba}
var
StartTime, Made, MadeH, Sec, state,XP,XPH:Integer;
xpg,lxp,totalXP:integer;
Glass,Beer,Candle,oil,vial,fishbowl,orb,lanternlens,lightorb:integer;
reporttime,committime:integer;
const
SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ''; // Your SRL Stats Password (If you dont have one then just leave it as it is)
Makewhat = 'orb'; //what to make set as either Beer,Candle,oil,vial,fishbowl,orb,lanternlens,lightorb
XPPerGlass = 52.5;//xp per glass beerglass = 17.5, candle lantern = 19, oil lamp = 25, vial = 35
// fishbowl = 42.5, orb = 52.5, latern lens = 55, lightorb = 70
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];//Random event prices.
end;
end;
procedure setDTM;
begin
Glass := DTMFromString('mlwAAAHicY2dgYHBlYmDwBGJnILYCYnsg9obST4HyL4D4NQOE/RCIH0DFbuQ4MlypimY4nC/FcLo8guFokjXDkeJQhpPF0gz8QHlcmBEPhgIA5jUS+Q==');
Beer := DTMFromString('mrAAAAHic42BgYPAAYncgdgJiFyD2B2IvKN8biBcwMjCsBOJFQDwLiBcC8XQgXg7ES4C4pqyMISMlhaG+spLBzdmZwcHWlsHf25shLzODobq0lIEfaAY+zEgAwwAAD9sQ7A==');
Candle := DTMFromString('mrAAAAHic42BgYJgJxHOBeBoQTwLiyUA8Ayo2D4gXMjIwrATiVUC8GIjnAPFMIJ4L5Rvp6zOkZ5YwxMVnMASFxoP5IBwakcwQHJrAwA80Ax9mJIBhAADuJBGY');
oil := DTMFromString('mbQAAAHicY2VgYHgGxC+A+C2U/RiI5zMyMCwH4qVAPB1Ky8opMXh4+jM4OrgxiIlLMYSGxTPwA9WiY0YsGAwAb8cLWw==');
vial := DTMFromString('mrAAAAHic42BgYLBiZGAwBWInILZmhPBtgdgMiO2AeCEQrwbiVVB6OhDPA+JFQDwDiJNTMhgSE1MZbG0dGGJiEhhCQyMZXF09GFJSMhlcXN0Z+IF24MOMBDAMAAB8qQ9+');
fishbowl := DTMFromString('mwQAAAHic42RgYOhjhOBWIJ4OxJOAuAOKQex2IJ4LxMuAeDEQzwfiGVC8AoiXAPEcIC4oKGM4d+4WGK9cuQnMh4nt3XsCzOYH2kcIMxKB4QAAOQEcPA==');
orb := DTMFromString('mWAAAAHicY2FgYBBhZGCQAWIhIJYA4qVAPBeIF0LZyUnxDI6OdgzRkWEMjg52DFxAPciYEQ2DAABoaQbI');
lanternlens := DTMFromString('mlwAAAHicY2dgYEhnZGBIAuJsIM4B4mQgTgDiXCCeC8RLoXgWEM8E4vlAPA+IzS0dGAyNLBhkZBXAtKd3CIOTiy+DmoYuAz/QXFyYEQ+GAgDHRwwi');
lightorb := DTMFromString('mrAAAAHic42BgYJgJxHOBeBoQTwLiyUA8Ayo2D4gXMjIwrATiVUC8GIjnAPFMIJ4L5Rvp6zOkZ5YwxMVnMASFxoP5IBwakcwQHJrAwA80Ax9mJIBhAADuJBGY');
end;
procedure freeeDTM;
begin
FreeDTM(Glass);
FreeDTM(Beer);
FreeDTM(Candle);
FreeDTM(oil);
FreeDTM(vial);
FreeDTM(fishbowl);
FreeDTM(orb);
FreeDTM(lanternlens);
FreeDTM(lightorb);
end;
procedure bank;
var
x,y,x2,y2:Integer;
begin
if (state = 1) then
begin
Writeln('banking');
OpenBankChest(SRL_Bank_SW);
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
if BankScreen then
begin
wait(900+random(200));
DepositAll;
if FindDTM(Glass,x,y,MBX1,MBy1,MBX2,MBY2) then
begin
Mouse(x,y,1,1,false);
ChooseOption('All');
wait(200+random(50));
CloseBank;
state := 2;
end;
wait(500+random(100));
end;
end;
end;
procedure hover;
begin
HoverSkill(SKILL_CRAFTING,False);
wait(100+random(10));
Ftab(25);
end;
procedure blowGlass;
var
x,y:integer;
begin
if (state = 2) then
begin
if not (GetCurrentTab = 25) then
Ftab(25);
if FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2) then
begin
Mouse(x,y,1,1,true);
wait(100+random(100));
end;
if (makewhat = 'beer') then
begin
if FindDTM(Beer,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: hover;
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
IncEx(Made,28);
state := 1;
end;
end;
if (makewhat = 'candle') then
begin
if FindDTM(Candle,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: HoverSkill(SKILL_CRAFTING,False);
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
made := made + 28;
state := 1;
end;
end;
if (makewhat = 'oil') then
begin
if FindDTM(oil,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: HoverSkill(SKILL_CRAFTING,False);
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
made := made + 28;
state := 1;
end;
end;
if (makewhat = 'vial') then
begin
if FindDTM(vial,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: HoverSkill(SKILL_CRAFTING,False);
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
made := made + 28;
state := 1;
end;
end;
if (makewhat = 'fishbowl') then
begin
if FindDTM(fishbowl,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: HoverSkill(SKILL_CRAFTING,False);
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
made := made + 28;
state := 1;
end;
end;
if (makewhat = 'orb') then
begin
if FindDTM(orb,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: HoverSkill(SKILL_CRAFTING,False);
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
made := made + 28;
state := 1;
end;
end;
if (makewhat = 'lanternlens') then
begin
if FindDTM(lanternlens,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: HoverSkill(SKILL_CRAFTING,False);
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
made := made + 28;
state := 1;
end;
end;
if (makewhat = 'lightorb') then
begin
if FindDTM(lightorb,x,y,MCx1,MCy1,MCx2,MCy2) then
begin
Mouse(x,y,3,3,true);
wait(50+random(200));
repeat
wait(1000);
case random(700) of
0: HoverSkill(SKILL_CRAFTING,False);
1: BoredHuman;
2: RandomMovement;
end;
until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
made := made + 28;
state := 1;
end;
end;
writeln('banking');
end;
end;
procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 87;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;
procedure Proggy;
begin
Sec := (1+((Getsystemtime-StartTime)/1000));
MadeH := (3600 / SeC * (Made));
writeLn('=======FleaGlassBlower======');
writeLn('Time Running: ' + TimeRunning);
writeLn('Items crafted: ' + IntToStr(Made));
writeLn('Items/h: ' + IntToStr(MadeH));
writeLn('XP gained: ' + ToStr(made * XPPerGlass));
writeLn('XP/h: ' + IntToStr(Round(3600 / SeC * (made * XPPerGlass))));
writeLn('=======================');
MarkTime(ReportTime);
end;
Procedure Commit;
begin
xpg := (XP - lxp); //calculates xp gained since last commit
stats_IncVariable('Crafting EXP (Gained)', Round(made * XPPerGlass));
Stats_Commit;
lxp := XP; //saves the variable for next time it needed to commit
MarkTime(CommitTime);
end;
begin
ClearDebug;
SetupLogin;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetDTM;
StartTime:=GetSystemTime;
SetupSRLStats(804, SRLStats_User, SRLStats_Password);
state :=1;
made :=0;
MarkTime(ReportTime);
MarkTime(CommitTime);
if LoggedIn then
ClickNorth(SRL_ANGLE_HIGH);
repeat
Bank;
wait(200+random(50));
blowGlass;
wait(100+random(200));
if (TimeFromMark(CommitTime)>=30000) then
Commit;
if (TimeFromMark(reporttime)>=30000) then
proggy;
until(false);
FreeeDTM;
end.