Footy
08-11-2012, 08:53 PM
I read abu_jwka's Records tut, and I thought I understood everything, but when I go to use a variable I assigned in my LoadTLeatherRecord procedure, it has a value of 0, even though I assigned it to a different variable. Can someone show me what Im doing wrong? Heres the parts of the script, in order, related to the issue.
program AlKharid_Tanner;
{$i srl/srl.simba}
type TLeatherRecord = record
LeatherDTM, WaitTimeMin, WaitTimeMax:integer;
end;
var
LDTM:TLeatherRecord;
Hides_Tanned:Integer;
const
Row = 2; //Row of item to tan in bank.
Column = 2; //Column of item to tan in bank.
Hides_To_Tan = 56; //How many hides are you tanning?
Profit_per_hide = 20; //How much profit do you make per hide tanned? Used in progress report.
procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username Here!
Players[0].Pass := ''; //Password Here!
Players[0].Pin := ''; //Pin here!
Players[0].Active := True;
Players[0].Strings[0] := 'GreenLeather'; //What Are we Tanning? Options(GreenLeather, RedLeather, BlackLeather, BlueLeather, RoyalLeather, HardLeather, SoftLeather) Dont Missspell them!
End;
Procedure LoadTLeatherRecord;
begin
case lowercase(Players[CurrentPlayer].Strings[0]) of
'GreenLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYEhkZGBIAeJQIA4A4hwgvg TED4D4JBBfAOKLQMxpywVUzYSCQSLogBELBgMADIgGaQ==');
LDTM.WaitTimeMin := 1000;
LDTM.WaitTimeMax := 1400;
end;
'BlueLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYChkZGBIB+JUIK4A4mogvg LEJ4D4FhDfg7K5eTyBqplQMBcDJmDEgsEAADGZBtM=');
LDTM.WaitTimeMin := 1200;
LDTM.WaitTimeMax := 1800;
end;
'RedLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNjAyMCwGIiXA/EeIF4HxJeA+CwQ3wXiy0B8BIhteTmBqplQMBcDJmDEgsEAAKFa B/E=');
LDTM.WaitTimeMin := 2000;
LDTM.WaitTimeMax := 3000;
end;
'BlackLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNBiZGBQAmJTIJYHYjMgvg jE94D4FBCfAOLLIDlZWaBqJhTMxYAJGLFgMAAAqwgFag==');
LDTM.WaitTimeMin := 2500;
LDTM.WaitTimeMax := 3500;
end;
'SoftLeather': begin
LDTM.LeatherDTM := DTMFromString('mggAAAHicY2NgYIgH4mwgTgXiICAOBeIMIL 7IyMBwDYiPAfE5IL4DxbYWnEBZJgzMyoAdMOLAEAAA+wgH0Q== ');
LDTM.WaitTimeMin := 0;
LDTM.WaitTimeMax := 0;
end;
'HardLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYLgDxE+B+DkQXwbiSyDMyM BwHIhvAfEdID4NxDoaskAZJhTMxYAJGLFgMAAAAcAI+g==');
LDTM.WaitTimeMin := 0;
LDTM.WaitTimeMax := 0;
end;
'RoyalLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYFjOyMAwA4jXAfEWIJ4DxJ eA+BoQ3wPiU1DsIB0OVM2EgrkYMAEjFgwGAKx3CDA=');
LDTM.WaitTimeMin := 3000;
LDTM.WaitTimeMax := 4000;
end;
end;
end;
Procedure SetupStuff;
begin
SetupSRL;
DeclarePlayers;
LoadTLeatherRecord;
Loginplayer;
wait(randomrange(100, 200));
Gametab(tab_inv);
Makecompass('W');
end;
Function ClickTanner:boolean;
var
TanScreenDTM, counter, x, y:Integer;
begin
TanScreenDTM := DTMFromString('mggAAAHicY2NgYHjLyMBwE0j3A7EjEOsDcS wQPwGKLwXiqUC8EIinAPFkIC61EWb4//8/BuYC6mHFghlxYAgAAPN8FvQ=');
if not(loggedin) then
exit;
wait(randomrange(500, 1000));
if findobjTPAMulti(x, y, [TannerCapeColor, TannerShirtColor], 5, 2, 10, 10, 20, ['llis', 'Ellis']) then
begin
wait(randomrange(100, 300));
Mouse(x, y, 2, 2, mouse_right);
waitoption('ides', 1000);
end else
begin
Mouse(257, 152, 4, 4, mouse_right);
WaitOptionmulti(['hides', 'ide', 'an hi'], 1000);
end;
Marktime(counter);
repeat
wait(randomrange(50, 150));
if TimeFromMark(counter) > 8000 then
begin
writeln('Tanning screen not opening up! Logging out!');
Logout;
TerminateScript;
end;
until(FindDTM(TanScreenDTM, x, y, MCX1, MCY1, MCX2, MCY2));
Result := True;
FreeDTM(TanScreenDTM);
wait(randomrange(1000, 2000));
end;
Procedure TanHides;
var
Counter, x, y:integer;
begin
if not(loggedin) then
exit;
if FindDTM(LDTM.LeatherDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Mouse(x, y, 5, 5, mouse_left);
exit;
end else
begin
MMouse(501, 427, 2, 10)
wait(randomrange(LDTM.WaitTimeMin, LDTM.WaitTimeMax));
Mousebox(5, 341, 505, 426, 3);
Marktime(counter);
repeat
wait(randomrange(50, 200));
if TimefromMark(counter) > 10000 then
begin
writeln('We couldnt find the LeatherDTM! Logging out!');
Logout;
Terminatescript;
end;
until(findDTM(LDTM.LeatherDTM, x, y, MCX1, MCY1, MCX2, MCY2));
mouse(x, y, 5, 5, mouse_left);
exit;
end;
Writeln('Strings[0] String " ' + (Players[0].Strings[0]) + ' " Is unknown. Please enter an option from the list. Terminating script!');
Logout;
Terminatescript;
end;
Procedure ReleaseDTMs;
begin
FreeDTM(LDTM.LeatherDTM);
end;
begin
SetupStuff;
//repeat
//WalkToTanner;
if ClickTanner then
begin
writeln(IntToStr(LDTM.WaitTimeMax));
TanHides;
end;
{WalkToBank;
repeat
OpenBankCustom;
until(BankScreen or pinscreen);
Bankprocedure;
Proggy;
until(Hides_Tanned >= Hides_To_Tan);}
ReleaseDTMs;
end.
program AlKharid_Tanner;
{$i srl/srl.simba}
type TLeatherRecord = record
LeatherDTM, WaitTimeMin, WaitTimeMax:integer;
end;
var
LDTM:TLeatherRecord;
Hides_Tanned:Integer;
const
Row = 2; //Row of item to tan in bank.
Column = 2; //Column of item to tan in bank.
Hides_To_Tan = 56; //How many hides are you tanning?
Profit_per_hide = 20; //How much profit do you make per hide tanned? Used in progress report.
procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username Here!
Players[0].Pass := ''; //Password Here!
Players[0].Pin := ''; //Pin here!
Players[0].Active := True;
Players[0].Strings[0] := 'GreenLeather'; //What Are we Tanning? Options(GreenLeather, RedLeather, BlackLeather, BlueLeather, RoyalLeather, HardLeather, SoftLeather) Dont Missspell them!
End;
Procedure LoadTLeatherRecord;
begin
case lowercase(Players[CurrentPlayer].Strings[0]) of
'GreenLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYEhkZGBIAeJQIA4A4hwgvg TED4D4JBBfAOKLQMxpywVUzYSCQSLogBELBgMADIgGaQ==');
LDTM.WaitTimeMin := 1000;
LDTM.WaitTimeMax := 1400;
end;
'BlueLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYChkZGBIB+JUIK4A4mogvg LEJ4D4FhDfg7K5eTyBqplQMBcDJmDEgsEAADGZBtM=');
LDTM.WaitTimeMin := 1200;
LDTM.WaitTimeMax := 1800;
end;
'RedLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNjAyMCwGIiXA/EeIF4HxJeA+CwQ3wXiy0B8BIhteTmBqplQMBcDJmDEgsEAAKFa B/E=');
LDTM.WaitTimeMin := 2000;
LDTM.WaitTimeMax := 3000;
end;
'BlackLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNBiZGBQAmJTIJYHYjMgvg jE94D4FBCfAOLLIDlZWaBqJhTMxYAJGLFgMAAAqwgFag==');
LDTM.WaitTimeMin := 2500;
LDTM.WaitTimeMax := 3500;
end;
'SoftLeather': begin
LDTM.LeatherDTM := DTMFromString('mggAAAHicY2NgYIgH4mwgTgXiICAOBeIMIL 7IyMBwDYiPAfE5IL4DxbYWnEBZJgzMyoAdMOLAEAAA+wgH0Q== ');
LDTM.WaitTimeMin := 0;
LDTM.WaitTimeMax := 0;
end;
'HardLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYLgDxE+B+DkQXwbiSyDMyM BwHIhvAfEdID4NxDoaskAZJhTMxYAJGLFgMAAAAcAI+g==');
LDTM.WaitTimeMin := 0;
LDTM.WaitTimeMax := 0;
end;
'RoyalLeather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYFjOyMAwA4jXAfEWIJ4DxJ eA+BoQ3wPiU1DsIB0OVM2EgrkYMAEjFgwGAKx3CDA=');
LDTM.WaitTimeMin := 3000;
LDTM.WaitTimeMax := 4000;
end;
end;
end;
Procedure SetupStuff;
begin
SetupSRL;
DeclarePlayers;
LoadTLeatherRecord;
Loginplayer;
wait(randomrange(100, 200));
Gametab(tab_inv);
Makecompass('W');
end;
Function ClickTanner:boolean;
var
TanScreenDTM, counter, x, y:Integer;
begin
TanScreenDTM := DTMFromString('mggAAAHicY2NgYHjLyMBwE0j3A7EjEOsDcS wQPwGKLwXiqUC8EIinAPFkIC61EWb4//8/BuYC6mHFghlxYAgAAPN8FvQ=');
if not(loggedin) then
exit;
wait(randomrange(500, 1000));
if findobjTPAMulti(x, y, [TannerCapeColor, TannerShirtColor], 5, 2, 10, 10, 20, ['llis', 'Ellis']) then
begin
wait(randomrange(100, 300));
Mouse(x, y, 2, 2, mouse_right);
waitoption('ides', 1000);
end else
begin
Mouse(257, 152, 4, 4, mouse_right);
WaitOptionmulti(['hides', 'ide', 'an hi'], 1000);
end;
Marktime(counter);
repeat
wait(randomrange(50, 150));
if TimeFromMark(counter) > 8000 then
begin
writeln('Tanning screen not opening up! Logging out!');
Logout;
TerminateScript;
end;
until(FindDTM(TanScreenDTM, x, y, MCX1, MCY1, MCX2, MCY2));
Result := True;
FreeDTM(TanScreenDTM);
wait(randomrange(1000, 2000));
end;
Procedure TanHides;
var
Counter, x, y:integer;
begin
if not(loggedin) then
exit;
if FindDTM(LDTM.LeatherDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Mouse(x, y, 5, 5, mouse_left);
exit;
end else
begin
MMouse(501, 427, 2, 10)
wait(randomrange(LDTM.WaitTimeMin, LDTM.WaitTimeMax));
Mousebox(5, 341, 505, 426, 3);
Marktime(counter);
repeat
wait(randomrange(50, 200));
if TimefromMark(counter) > 10000 then
begin
writeln('We couldnt find the LeatherDTM! Logging out!');
Logout;
Terminatescript;
end;
until(findDTM(LDTM.LeatherDTM, x, y, MCX1, MCY1, MCX2, MCY2));
mouse(x, y, 5, 5, mouse_left);
exit;
end;
Writeln('Strings[0] String " ' + (Players[0].Strings[0]) + ' " Is unknown. Please enter an option from the list. Terminating script!');
Logout;
Terminatescript;
end;
Procedure ReleaseDTMs;
begin
FreeDTM(LDTM.LeatherDTM);
end;
begin
SetupStuff;
//repeat
//WalkToTanner;
if ClickTanner then
begin
writeln(IntToStr(LDTM.WaitTimeMax));
TanHides;
end;
{WalkToBank;
repeat
OpenBankCustom;
until(BankScreen or pinscreen);
Bankprocedure;
Proggy;
until(Hides_Tanned >= Hides_To_Tan);}
ReleaseDTMs;
end.