SRL Archive - OSR Help

Help out a guy who could become a serious scripter?


bevannick

2013-01-09 18:31:45

Ive been having this problem with this script.
program RuneSudokuLargeCasket; //Made by 68z35h9




{$i srl/srl/misc/smart.simba}
{$i SRL/SRL.simba}

const
NumbOfPlayers = 1;
ClickDelay = 10; //Delay between the input of answers

var
numbstring, posfind:string;
ansArray : Array[1..81] of String;
count, i, v, c, z, x, y, row, col, boxrow, boxcol:integer;

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name :=''; // Username
Pass :=''; // Password
Active := True;
Pin := ''; // Leave blank if you have no pin.
end;
end;

Procedure Antiban;
Begin
Case Random(100) Of
10: HoverSkill('random', False);
20: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
30: IdleTime(100+random(700), 100+Random(100), 0.2+RandomE/2);
40: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
60: RandomMovement;
End;
end;

procedure TalkToAli;
var
x, y:integer;
begin
if (FindObjCustom(x, y, ['Ali', 'orri'], [6310966, 10847070, 5850673, 11305313, 6309942, 7099965, 10846813], 3)) then
begin
Mouse(x, y, 2, 2, mouse_left);
repeat
Wait(100+random(100));
until (ClickContinue(true, true));
repeat
Wait(100+random(100));
until not (ClickContinue(true, true));
repeat
Wait(100+random(100));
until (FindNPCChatText('unes', clickleft));
repeat
Wait(100+random(100));
until (FindNPCChatText('arge', clickleft));
repeat
Wait(100+random(100));
until (ClickContinue(true, true));
repeat
Wait(100+random(100));
until (FindNPCChatText('xamine', clickleft));
end;
end;

procedure writeAnsArray(inputString : string);
begin
for i:=1 to 81 do
begin
if not (strtoint(copy(inputString,i,1)) = 0) then
begin
ansArray[i] := (copy(inputString,i,1));
end else
begin
ansArray[i] := '123456789';
end;
end;
end;

function checkRows : boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the row
begin
row := (((i-1)/9)+1); //determines the row
for v:=1 to 81 do
begin
if (row = (((v-1)/9)+1)) then //checks if the row of boxes 1-81 matches the row of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0) then //if the string can be found in any of the strings on the same row
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same row');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function checkCols: boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the col
begin
col := (((i-1) mod 9)+1); //determines the col
for v:=1 to 81 do
begin
if (col = (((v-1) mod 9)+1)) then //checks if the col of boxes 1-81 matches the col of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0) then //if the string can be found in any of the strings on the same col
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same col');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function checkTbTbox : boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the 3x3 box
begin
boxrow := ((((i-1)/9)/3)+1); //determines the boxrow
boxcol := ((((i-1) mod 9)/3)+1); //determines the boxcol
for v:=1 to 81 do
begin
if ((boxrow = ((((v-1)/9)/3)+1)) and (boxcol = ((((v-1) mod 9)/3)+1))) then //checks if the boxcol and boxrow match the boxcol and boxrow of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0 ) then //if the string can be found in any of the string on the same boxcol and boxrow
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same boxcol and boxrow');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function solvesquares : boolean;
begin
if (checkRows or checkCols or checkTbTbox) then
begin
result := true;
end;
end;

function singlesRows : boolean;
begin
for row:=1 to 9 do //for rows 1 - 9
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (row = (((v-1)/9)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;

function singlesCols : boolean;
begin
for col:=1 to 9 do //for col 1 - 9
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (col = (((v-1) mod 9)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;

function singlesTbTbox : boolean;
begin
for boxrow:=1 to 3 do //for col 1 - 9
begin
for boxcol:=1 to 3 do
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (boxrow = ((((v-1)/9)/3)+1)) and (boxcol = ((((v-1) mod 9)/3)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;
end;

function solvesingles : boolean;
begin
if (singlesRows or singlesCols or singlesTbTbox) then
begin
result := true;
end;
end;

procedure outputPuzzle;
begin
i := 1;
for v:=1 to 9 do
begin
writeln('['+ansArray[i]+']['+ansArray[i+1]+']['+ansArray[i+2]+']['+ansArray[i+3]+']['+ansArray[i+4]+']['+ansArray[i+5]+']['+ansArray[i+6]+']['+ansArray[i+7]+']['+ansArray[i+8]+']');
i := i + 9;
end;
end;

procedure findAnswer;
begin
repeat
repeat
//it attempts to solve in the until
until not (solvesquares);
//it attempts to solve in the until
until not (solvesingles);
end;

procedure writeNumbstring;
var
x, y, mind1, mind11, fire2, fire22, air3, air33, water4, water44, earth5, earth55, body6, body66, death7, death77, chaos8, chaos88, law9, law99:integer;
begin
mind1 := 2396666;
fire2 := 1648049;
air3 := DTMFromString('mbQAAAHicY2VgYGgD4hoo7oViWyC2A2JrIDYHYicg/v3xAwZmBYqjY0YsGAwAfcYSNw==');
water4 := 11607321;
earth5 := 1001067;
body6 := 14886176;
death7 := DTMFromString('mQwAAAHicY2ZgYGgC4lYg7gDiOii/F4j5eHkZfn/8AMasQD4MMyJhIAAAZCAJEg==');
chaos8 := 2405882;
law9 := 16394532;
mind11 := 2264307;
fire22 := 1581996;
air33 := DTMFromString('mbQAAAHicY2VgYGgD4hoo7oViSSgWA2IhIJYF4r+fPmFgVqA4OmbEgsEAAEvuEZg=');
water44 := 11279384;
earth55 := 934759;
body66 := 14361631;
death77 := DTMFromString('mWAAAAHicY2FgYFgFxEuBeB0QrwFiESBWhGJeEOblZfj76RMcswLFkDEjGgYBAGcxC/M=');
chaos88 := 2273523;
law99 := 15935522;
c := 22;
numbstring := '';
for i:=1 to 9 do
begin
z := 133;
for v:=1 to 9 do
begin
if (FindColorTolerance(x, y, mind1, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, mind11, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '1';
end else if (FindColorTolerance(x, y, fire2, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, fire22, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '2';
end else if (FindDTM(air3, x, y, z-15, c-15, z+15, c+15)) then
begin
numbstring := numbstring + '3';
end else if (FindColorTolerance(x, y, water4, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, water44, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '4';
end else if (FindColorTolerance(x, y, earth5, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, earth55, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '5';
end else if (FindColorTolerance(x, y, body6, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, body66, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '6';
end else if (FindDTM(death7, x, y, z-15, c-15, z+15, c+15) or FindDTM(death77, x, y, z-15, c-15, z+15, c+15)) then
begin
numbstring := numbstring + '7';
end else if (FindColorTolerance(x, y, chaos8, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, chaos88, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '8';
end else if (FindColorTolerance(x, y, law9, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, law99, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '9';
end else
begin
numbstring := numbstring + '0';
end;
z := z+37;
end;
c := c+37;
end;
FreeDTM(air3);
FreeDTM(death7);
FreeDTM(air33);
FreeDTM(death77);
end;

procedure inputAnswer;
var
x1, y1:integer;
begin
x1 := 29;
y1 := 112;
for v:=1 to 9 do
begin
Mouse(x1, y1, 5, 5, mouse_left);
for i:=1 to 81 do
begin
if (strtoint(ansArray[i]) = v) then
begin
if not (strtoint(numbstring[i]) = v) then
begin
Mouse(((133)+(37*((i-1) mod 9))), ((22)+(37*((i-1)/9))), 3, 3, mouse_left);
wait(ClickDelay+random(2));
end;
end;
end;
y1 := y1 + 50;
if (v = 5) then
begin
y1 := 112;
x1 := x1 + 50;
end;
end;
end;

procedure SolveLargePuzzle;
var
x, y:integer;
begin
v := 0
repeat
wait(100+random(100));
v := v+1;
until ((FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5) or (v = 30)))
if (FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5)) then
begin
writeNumbstring;
writeln(numbstring);
writeAnsArray(numbstring);
findAnswer;
outputPuzzle;
inputAnswer;
end;
end;

procedure BuyRunes;
var
x, y:integer;
begin
if (FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5)) then
begin
Mouse(50, 70, 30, 5, mouse_left);
Wait(3000+random(500));
FindNPCChatText('uy', Clickleft);
Wait(1000+random(300));
count := count+1;
end;
end;

begin
Smart_Server := 54;
Smart_Members := True;
SetupSRL;
Declareplayers;
Repeat
if not (LoggedIn) then
LoginPlayer;
Antiban;
FindNormalRandoms;
TalkToAli;
SolveLargePuzzle;
BuyRunes;
Writeln('RunTime : '+TimeRunning);
Writeln('Caskets Opened : '+toStr(count));
Writeln('Large caskets per hour : ' + toStr((3600000*count)/GetTimeRunning));
Until false;
end.
I didnt write this script i just downloaded it and i keep getting this error.

[Error] C:\Simba\Includes\srl/srl/misc/smart.simba(46:19): Invalid number of parameters at line 45
Compiling failed.

i would really appericate some help here!

ogustuce

2013-01-09 18:36:03

replace {$i srl/srl/misc/smart.simba} by {$DEFINE SMART}

{$i srl/srl/misc/smart.simba} is outdated i think

also replace
Smart_Server := 54;
Smart_Members := True;

by

SRL_SixHourFix := True;
Smart_FixSpeed := True;

theres a couple of outdated codes

ogustuce

2013-01-09 18:43:36

From: bevannick
Ive been having this problem with this script.
program RuneSudokuLargeCasket; //Made by 68z35h9




{$i srl/srl/misc/smart.simba}
{$i SRL/SRL.simba}

const
NumbOfPlayers = 1;
ClickDelay = 10; //Delay between the input of answers

var
numbstring, posfind:string;
ansArray : Array[1..81] of String;
count, i, v, c, z, x, y, row, col, boxrow, boxcol:integer;

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name :=''; // Username
Pass :=''; // Password
Active := True;
Pin := ''; // Leave blank if you have no pin.
end;
end;

Procedure Antiban;
Begin
Case Random(100) Of
10: HoverSkill('random', False);
20: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
30: IdleTime(100+random(700), 100+Random(100), 0.2+RandomE/2);
40: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
60: RandomMovement;
End;
end;

procedure TalkToAli;
var
x, y:integer;
begin
if (FindObjCustom(x, y, ['Ali', 'orri'], [6310966, 10847070, 5850673, 11305313, 6309942, 7099965, 10846813], 3)) then
begin
Mouse(x, y, 2, 2, mouse_left);
repeat
Wait(100+random(100));
until (ClickContinue(true, true));
repeat
Wait(100+random(100));
until not (ClickContinue(true, true));
repeat
Wait(100+random(100));
until (FindNPCChatText('unes', clickleft));
repeat
Wait(100+random(100));
until (FindNPCChatText('arge', clickleft));
repeat
Wait(100+random(100));
until (ClickContinue(true, true));
repeat
Wait(100+random(100));
until (FindNPCChatText('xamine', clickleft));
end;
end;

procedure writeAnsArray(inputString : string);
begin
for i:=1 to 81 do
begin
if not (strtoint(copy(inputString,i,1)) = 0) then
begin
ansArray[i] := (copy(inputString,i,1));
end else
begin
ansArray[i] := '123456789';
end;
end;
end;

function checkRows : boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the row
begin
row := (((i-1)/9)+1); //determines the row
for v:=1 to 81 do
begin
if (row = (((v-1)/9)+1)) then //checks if the row of boxes 1-81 matches the row of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0) then //if the string can be found in any of the strings on the same row
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same row');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function checkCols: boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the col
begin
col := (((i-1) mod 9)+1); //determines the col
for v:=1 to 81 do
begin
if (col = (((v-1) mod 9)+1)) then //checks if the col of boxes 1-81 matches the col of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0) then //if the string can be found in any of the strings on the same col
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same col');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function checkTbTbox : boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the 3x3 box
begin
boxrow := ((((i-1)/9)/3)+1); //determines the boxrow
boxcol := ((((i-1) mod 9)/3)+1); //determines the boxcol
for v:=1 to 81 do
begin
if ((boxrow = ((((v-1)/9)/3)+1)) and (boxcol = ((((v-1) mod 9)/3)+1))) then //checks if the boxcol and boxrow match the boxcol and boxrow of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0 ) then //if the string can be found in any of the string on the same boxcol and boxrow
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same boxcol and boxrow');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function solvesquares : boolean;
begin
if (checkRows or checkCols or checkTbTbox) then
begin
result := true;
end;
end;

function singlesRows : boolean;
begin
for row:=1 to 9 do //for rows 1 - 9
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (row = (((v-1)/9)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;

function singlesCols : boolean;
begin
for col:=1 to 9 do //for col 1 - 9
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (col = (((v-1) mod 9)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;

function singlesTbTbox : boolean;
begin
for boxrow:=1 to 3 do //for col 1 - 9
begin
for boxcol:=1 to 3 do
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (boxrow = ((((v-1)/9)/3)+1)) and (boxcol = ((((v-1) mod 9)/3)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;
end;

function solvesingles : boolean;
begin
if (singlesRows or singlesCols or singlesTbTbox) then
begin
result := true;
end;
end;

procedure outputPuzzle;
begin
i := 1;
for v:=1 to 9 do
begin
writeln('['+ansArray[i]+']['+ansArray[i+1]+']['+ansArray[i+2]+']['+ansArray[i+3]+']['+ansArray[i+4]+']['+ansArray[i+5]+']['+ansArray[i+6]+']['+ansArray[i+7]+']['+ansArray[i+8]+']');
i := i + 9;
end;
end;

procedure findAnswer;
begin
repeat
repeat
//it attempts to solve in the until
until not (solvesquares);
//it attempts to solve in the until
until not (solvesingles);
end;

procedure writeNumbstring;
var
x, y, mind1, mind11, fire2, fire22, air3, air33, water4, water44, earth5, earth55, body6, body66, death7, death77, chaos8, chaos88, law9, law99:integer;
begin
mind1 := 2396666;
fire2 := 1648049;
air3 := DTMFromString('mbQAAAHicY2VgYGgD4hoo7oViWyC2A2JrIDYHYicg/v3xAwZmBYqjY0YsGAwAfcYSNw==');
water4 := 11607321;
earth5 := 1001067;
body6 := 14886176;
death7 := DTMFromString('mQwAAAHicY2ZgYGgC4lYg7gDiOii/F4j5eHkZfn/8AMasQD4MMyJhIAAAZCAJEg==');
chaos8 := 2405882;
law9 := 16394532;
mind11 := 2264307;
fire22 := 1581996;
air33 := DTMFromString('mbQAAAHicY2VgYGgD4hoo7oViSSgWA2IhIJYF4r+fPmFgVqA4OmbEgsEAAEvuEZg=');
water44 := 11279384;
earth55 := 934759;
body66 := 14361631;
death77 := DTMFromString('mWAAAAHicY2FgYFgFxEuBeB0QrwFiESBWhGJeEOblZfj76RMcswLFkDEjGgYBAGcxC/M=');
chaos88 := 2273523;
law99 := 15935522;
c := 22;
numbstring := '';
for i:=1 to 9 do
begin
z := 133;
for v:=1 to 9 do
begin
if (FindColorTolerance(x, y, mind1, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, mind11, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '1';
end else if (FindColorTolerance(x, y, fire2, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, fire22, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '2';
end else if (FindDTM(air3, x, y, z-15, c-15, z+15, c+15)) then
begin
numbstring := numbstring + '3';
end else if (FindColorTolerance(x, y, water4, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, water44, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '4';
end else if (FindColorTolerance(x, y, earth5, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, earth55, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '5';
end else if (FindColorTolerance(x, y, body6, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, body66, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '6';
end else if (FindDTM(death7, x, y, z-15, c-15, z+15, c+15) or FindDTM(death77, x, y, z-15, c-15, z+15, c+15)) then
begin
numbstring := numbstring + '7';
end else if (FindColorTolerance(x, y, chaos8, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, chaos88, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '8';
end else if (FindColorTolerance(x, y, law9, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, law99, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '9';
end else
begin
numbstring := numbstring + '0';
end;
z := z+37;
end;
c := c+37;
end;
FreeDTM(air3);
FreeDTM(death7);
FreeDTM(air33);
FreeDTM(death77);
end;

procedure inputAnswer;
var
x1, y1:integer;
begin
x1 := 29;
y1 := 112;
for v:=1 to 9 do
begin
Mouse(x1, y1, 5, 5, mouse_left);
for i:=1 to 81 do
begin
if (strtoint(ansArray[i]) = v) then
begin
if not (strtoint(numbstring[i]) = v) then
begin
Mouse(((133)+(37*((i-1) mod 9))), ((22)+(37*((i-1)/9))), 3, 3, mouse_left);
wait(ClickDelay+random(2));
end;
end;
end;
y1 := y1 + 50;
if (v = 5) then
begin
y1 := 112;
x1 := x1 + 50;
end;
end;
end;

procedure SolveLargePuzzle;
var
x, y:integer;
begin
v := 0
repeat
wait(100+random(100));
v := v+1;
until ((FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5) or (v = 30)))
if (FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5)) then
begin
writeNumbstring;
writeln(numbstring);
writeAnsArray(numbstring);
findAnswer;
outputPuzzle;
inputAnswer;
end;
end;

procedure BuyRunes;
var
x, y:integer;
begin
if (FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5)) then
begin
Mouse(50, 70, 30, 5, mouse_left);
Wait(3000+random(500));
FindNPCChatText('uy', Clickleft);
Wait(1000+random(300));
count := count+1;
end;
end;

begin
Smart_Server := 54;
Smart_Members := True;
SetupSRL;
Declareplayers;
Repeat
if not (LoggedIn) then
LoginPlayer;
Antiban;
FindNormalRandoms;
TalkToAli;
SolveLargePuzzle;
BuyRunes;
Writeln('RunTime : '+TimeRunning);
Writeln('Caskets Opened : '+toStr(count));
Writeln('Large caskets per hour : ' + toStr((3600000*count)/GetTimeRunning));
Until false;
end.
I didnt write this script i just downloaded it and i keep getting this error.

[Error] C:\Simba\Includes\srl/srl/misc/smart.simba(46:19): Invalid number of parameters at line 45
Compiling failed.

i would really appericate some help here!


there, compiled succesfully




{$DEFINE SMART}
{$I SRL/SRL.Simba}

const
NumbOfPlayers = 1;
ClickDelay = 10; //Delay between the input of answers

var
numbstring, posfind:string;
ansArray : Array[1..81] of String;
count, i, v, c, z, x, y, row, col, boxrow, boxcol:integer;




procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Number of Players to use
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; // Player to start with, first one is 0
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True; // just leave it as is.
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
Players[0].Integers[1] := 10000; // Number of loads
Players[0].Integers[2] := 375; // Xp For 1 Pouch Made <----------------------------------------
end;

Procedure Antiban;
Begin
Case Random(100) Of
10: HoverSkill('random', False);
20: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
30: IdleTime(100+random(700), 100+Random(100), 0.2+RandomE/2);
40: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
60: RandomMovement;
End;
end;

procedure TalkToAli;
var
x, y:integer;
begin
if (FindObjCustom(x, y, ['Ali', 'orri'], [6310966, 10847070, 5850673, 11305313, 6309942, 7099965, 10846813], 3)) then
begin
Mouse(x, y, 2, 2, mouse_left);
repeat
Wait(100+random(100));
until (ClickContinue(true, true));
repeat
Wait(100+random(100));
until not (ClickContinue(true, true));
repeat
Wait(100+random(100));
until (FindNPCChatText('unes', clickleft));
repeat
Wait(100+random(100));
until (FindNPCChatText('arge', clickleft));
repeat
Wait(100+random(100));
until (ClickContinue(true, true));
repeat
Wait(100+random(100));
until (FindNPCChatText('xamine', clickleft));
end;
end;

procedure writeAnsArray(inputString : string);
begin
for i:=1 to 81 do
begin
if not (strtoint(copy(inputString,i,1)) = 0) then
begin
ansArray[i] := (copy(inputString,i,1));
end else
begin
ansArray[i] := '123456789';
end;
end;
end;

function checkRows : boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the row
begin
row := (((i-1)/9)+1); //determines the row
for v:=1 to 81 do
begin
if (row = (((v-1)/9)+1)) then //checks if the row of boxes 1-81 matches the row of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0) then //if the string can be found in any of the strings on the same row
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same row');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function checkCols: boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the col
begin
col := (((i-1) mod 9)+1); //determines the col
for v:=1 to 81 do
begin
if (col = (((v-1) mod 9)+1)) then //checks if the col of boxes 1-81 matches the col of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0) then //if the string can be found in any of the strings on the same col
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same col');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function checkTbTbox : boolean;
begin
for i:=1 to 81 do
begin
if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the 3x3 box
begin
boxrow := ((((i-1)/9)/3)+1); //determines the boxrow
boxcol := ((((i-1) mod 9)/3)+1); //determines the boxcol
for v:=1 to 81 do
begin
if ((boxrow = ((((v-1)/9)/3)+1)) and (boxcol = ((((v-1) mod 9)/3)+1))) then //checks if the boxcol and boxrow match the boxcol and boxrow of the string above ^
begin
if not (v = i) then //if the box is not the same box as the correct string ^
begin
if not ((pos(ansArray[i], ansArray[v])) = 0 ) then //if the string can be found in any of the string on the same boxcol and boxrow
begin
//writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same boxcol and boxrow');
delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
result := true;
end;
end;
end;
end;
end;
end;
end;

function solvesquares : boolean;
begin
if (checkRows or checkCols or checkTbTbox) then
begin
result := true;
end;
end;

function singlesRows : boolean;
begin
for row:=1 to 9 do //for rows 1 - 9
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (row = (((v-1)/9)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;

function singlesCols : boolean;
begin
for col:=1 to 9 do //for col 1 - 9
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (col = (((v-1) mod 9)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;

function singlesTbTbox : boolean;
begin
for boxrow:=1 to 3 do //for col 1 - 9
begin
for boxcol:=1 to 3 do
begin
for c:=1 to 9 do //for numbers 1 - 9
begin
z := 0;
posfind := '';
for v:=1 to 81 do //for boxes 1 - 81
begin
if (boxrow = ((((v-1)/9)/3)+1)) and (boxcol = ((((v-1) mod 9)/3)+1)) then //checks if the row of boxes 1-81 matches the row above ^
begin
if not ((pos(inttostr(c), ansArray[v])) = 0) then //if the number is found in the box
begin
z := z+1; //count + 1
posfind := posfind + inttostr(v); //string of box
end;
end;
end; //if only 1 is found
if ((z = 1) and not (length(ansArray[strtoint(posfind)]) = 1)) then
begin
ansArray[strtoint(posfind)] := inttostr(c); //replaces the string with the number
result := true;
end;
end;
end;
end;
end;

function solvesingles : boolean;
begin
if (singlesRows or singlesCols or singlesTbTbox) then
begin
result := true;
end;
end;

procedure outputPuzzle;
begin
i := 1;
for v:=1 to 9 do
begin
writeln('['+ansArray[i]+']['+ansArray[i+1]+']['+ansArray[i+2]+']['+ansArray[i+3]+']['+ansArray[i+4]+']['+ansArray[i+5]+']['+ansArray[i+6]+']['+ansArray[i+7]+']['+ansArray[i+8]+']');
i := i + 9;
end;
end;

procedure findAnswer;
begin
repeat
repeat
//it attempts to solve in the until
until not (solvesquares);
//it attempts to solve in the until
until not (solvesingles);
end;

procedure writeNumbstring;
var
x, y, mind1, mind11, fire2, fire22, air3, air33, water4, water44, earth5, earth55, body6, body66, death7, death77, chaos8, chaos88, law9, law99:integer;
begin
mind1 := 2396666;
fire2 := 1648049;
air3 := DTMFromString('mbQAAAHicY2VgYGgD4hoo7oViWyC2A2JrIDYHYicg/v3xAwZmBYqjY0YsGAwAfcYSNw==');
water4 := 11607321;
earth5 := 1001067;
body6 := 14886176;
death7 := DTMFromString('mQwAAAHicY2ZgYGgC4lYg7gDiOii/F4j5eHkZfn/8AMasQD4MMyJhIAAAZCAJEg==');
chaos8 := 2405882;
law9 := 16394532;
mind11 := 2264307;
fire22 := 1581996;
air33 := DTMFromString('mbQAAAHicY2VgYGgD4hoo7oViSSgWA2IhIJYF4r+fPmFgVqA4OmbEgsEAAEvuEZg=');
water44 := 11279384;
earth55 := 934759;
body66 := 14361631;
death77 := DTMFromString('mWAAAAHicY2FgYFgFxEuBeB0QrwFiESBWhGJeEOblZfj76RMcswLFkDEjGgYBAGcxC/M=');
chaos88 := 2273523;
law99 := 15935522;
c := 22;
numbstring := '';
for i:=1 to 9 do
begin
z := 133;
for v:=1 to 9 do
begin
if (FindColorTolerance(x, y, mind1, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, mind11, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '1';
end else if (FindColorTolerance(x, y, fire2, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, fire22, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '2';
end else if (FindDTM(air3, x, y, z-15, c-15, z+15, c+15)) then
begin
numbstring := numbstring + '3';
end else if (FindColorTolerance(x, y, water4, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, water44, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '4';
end else if (FindColorTolerance(x, y, earth5, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, earth55, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '5';
end else if (FindColorTolerance(x, y, body6, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, body66, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '6';
end else if (FindDTM(death7, x, y, z-15, c-15, z+15, c+15) or FindDTM(death77, x, y, z-15, c-15, z+15, c+15)) then
begin
numbstring := numbstring + '7';
end else if (FindColorTolerance(x, y, chaos8, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, chaos88, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '8';
end else if (FindColorTolerance(x, y, law9, z-15, c-15, z+15, c+15, 5) or FindColorTolerance(x, y, law99, z-15, c-15, z+15, c+15, 5)) then
begin
numbstring := numbstring + '9';
end else
begin
numbstring := numbstring + '0';
end;
z := z+37;
end;
c := c+37;
end;
FreeDTM(air3);
FreeDTM(death7);
FreeDTM(air33);
FreeDTM(death77);
end;

procedure inputAnswer;
var
x1, y1:integer;
begin
x1 := 29;
y1 := 112;
for v:=1 to 9 do
begin
Mouse(x1, y1, 5, 5, mouse_left);
for i:=1 to 81 do
begin
if (strtoint(ansArray[i]) = v) then
begin
if not (strtoint(numbstring[i]) = v) then
begin
Mouse(((133)+(37*((i-1) mod 9))), ((22)+(37*((i-1)/9))), 3, 3, mouse_left);
wait(ClickDelay+random(2));
end;
end;
end;
y1 := y1 + 50;
if (v = 5) then
begin
y1 := 112;
x1 := x1 + 50;
end;
end;
end;

procedure SolveLargePuzzle;
var
x, y:integer;
begin
v := 0
repeat
wait(100+random(100));
v := v+1;
until ((FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5) or (v = 30)))
if (FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5)) then
begin
writeNumbstring;
writeln(numbstring);
writeAnsArray(numbstring);
findAnswer;
outputPuzzle;
inputAnswer;
end;
end;

procedure BuyRunes;
var
x, y:integer;
begin
if (FindColorTolerance(x, y, 797794, 470, 20, 490, 40, 5)) then
begin
Mouse(50, 70, 30, 5, mouse_left);
Wait(3000+random(500));
FindNPCChatText('uy', Clickleft);
Wait(1000+random(300));
count := count+1;
end;
end;

begin
SRL_SixHourFix := True;
Smart_FixSpeed := True;
SetupSRL;
Declareplayers;
Repeat
if not (LoggedIn) then
LoginPlayer;
Antiban;
FindNormalRandoms;
TalkToAli;
SolveLargePuzzle;
BuyRunes;
Writeln('RunTime : '+TimeRunning);
Writeln('Caskets Opened : '+toStr(count));
Writeln('Large caskets per hour : ' + toStr((3600000*count)/GetTimeRunning));
Until false;
end.