SRL Archive - OSR Help

CoifCrafter


SmellyPenguin

2012-04-01 16:17:42

When I run the script, it does everything correctly, opens the banking, and then does nothing, why is that? I don't know what I'm doing wrong…


program FleaWine;
{$DEFINE SMART}
{$include srl/srl.simba}

var
StartTime, Made, MadeH, Sec,XP,XPH:Integer;
xpg,lxp,totalXP:integer;
Leather, Coif, Thread: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 = 'Coif'; //what to make set as either Beer,Candle,oil,vial,fishbowl,orb,lanternlens,lightorb
XPPerGlass = 36;//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
Leather := DTMFromString('mbQAAAHicY2VgYKhiZGDoAOIWIM4B4nIgZgTif0A5HiDNAsT8QGxhwg4UYULDmIARCwYDAGhmBBY=');
Coif := DTMFromString('mggAAAHicY2NgYPBlZGBwA+JwKPaD8pmA+C9QnhFI8wIxDxBzg9i8PEBRJiwYO2DEgSEAAFk1A0E=');
Thread := DTMFromString('mbQAAAHicY2VgYFjDxMCwA4g3APESIF4MxIqMDAxSQKwJxAaMEH5fRwdQNRMaxgSMWDAYAADtiAXQ');
end;

procedure freeeDTM;
begin
FreeDTM(Leather);
FreeDTM(Coif);
FreeDTM(Thread);
end;

procedure bank;
var
x,y,x2,y2:Integer;
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(Leather,x,y,MBX1,MBy1,MBX2,MBY2) then
begin
Mouse(x,y,1,2,true);
ChooseOption('All');
wait(200+random(50));
end;
if FindDTM(Thread,x,y,MBX1,MBy1,MBX2,MBY2) then
begin
Mouse(x,y,1,2,true);
ChooseOption('All');
wait(200+random(50));
CloseBank;
end;
wait(500+random(100));
end;
end;
procedure hover;
begin
HoverSkill(SKILL_CRAFTING,False);
wait(100+random(10));
Ftab(25);
end;
procedure blowGlass;
var
x,y:integer;
begin
if not (GetCurrentTab = 25) then
Ftab(25);
if FindDTM(Leather,x,y,MIx1,mIy1,mix2,miy2) then
begin
Mouse(x,y,1,1,true);
wait(100+random(100));
end;
if (makewhat = 'Coif') then
begin
if FindDTM(Coif,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(Leather,x,y,MIx1,mIy1,mix2,miy2));
IncEx(Made,27);
end;
end;
writeln('banking');
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);
stats_IncVariable('Crafting EXP (Gained)', Round(made * XPPerGlass));
Stats_Commit;
lxp := XP;
MarkTime(CommitTime);
end;

begin
ClearDebug;
SetupLogin;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetDTM;
StartTime:=GetSystemTime;
SetupSRLStats(804, SRLStats_User, SRLStats_Password);
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)>=300000) then
Commit;
if (TimeFromMark(reporttime)>=30000) then
proggy;
until(false);
FreeeDTM;
end.

EDIT: This is all taken from FleaGlassBlower, I just want to make an easy CoifFletcher for MY USE only.


Credits:

the flea - 99.999999999999999999%

http://villavu.com/forum/showthread.php?t=75636 For FleaGlassBlower!

tehq

2012-04-01 16:29:32

The ranx and rany should be numbers. They add randomness to where the click will be. For example,
Mouse(479, 425, 5, 5, mouse_left);  

E: You don't need the global x and y variables either since you define them locally :)

SmellyPenguin

2012-04-01 16:33:42

You mean the x/y variables at the top?

tehq

2012-04-01 16:35:41

From: SmellyPenguin
You mean the x/y variables at the top?


Yes, you define them within the procedures that use them. If you compile the script, it should show up as a hint. ;)

SmellyPenguin

2012-04-01 16:37:24

Alright thanks, removed them along with the unneeded mouse variable I defined. By the way, the hint is [Hint] C:\Simba\Includes\SRL/SRL/core/mapwalk.simba(1353:3): Variable 'BOX' never used at line 1352. My script is not 1352 lines long…O.O

tehq

2012-04-01 16:41:59

From: SmellyPenguin
[Hint] C:\Simba\Includes\SRL/SRL/core/mapwalk.simba(1353:3)


The hint isn't for your script, it's just an unused variable in the SRL include. Good luck with this script!

SmellyPenguin

2012-04-01 22:29:45

Thanks and I updated the script, problem in OP.

SmellyPenguin

2012-04-07 23:05:05

Bump