Hello guys.
Everytime i use a script it writes something with a error :S
Something like this Line 22: [Error] (22:1): Unable to register function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray; in script C:\Documents and Settings\mette-C\Skrivebord\TViYH's PowerMiner 1.1.scar
I use this script:
{
Version 0.1: Initial Release (17 Dec 2008)
Version 1.0, 1.1: Release #2 (18 Dec 2008)
!INSTRUCTIONS!
Start near a mining spot!
Fill out DeclarePlayers!
-Booleans[0] - If the pick is equipped, put True here.
-Strings[0] - Direction to run if it finds a fight (N, S, E, W).
-Integers[0] - Put the color of the rock here. Make sure it's the color of the vein!
-Integers[1] - Tolerance for the rock. 8-10 is good.
-Integers[2] - Wait time for the rock to be mined.
-Integers[3] - Loads for the player to do.
Move the crosshairs over RuneScape.
Click play!
}
program New;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
const
SRL_ID = '';
SRL_Password = '';
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Booleans[0] := True; // Pick is equipped?
Players[0].Strings[0] := 'N'; // Run direction?
Players[0].Integers[0] := 6053221; // Rock color
Players[0].Integers[1] := 10; // Rock tolerance
Players[0].Integers[2] := 8000; // Rock wait time (in msec)
Players[0].Integers[3] := 5; // Loads to do
end;
const
Version = 'Version 1.1';
var
x, y: Integer;
function PostReport(ScriptName, Website, Proggy : String): Boolean;
var
Dbase : String;
Client : Integer;
begin
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
Wait(10);
AddPostVariable(Client, 'proggy', Proggy);
AddPostVariable(Client, 'scn', ScriptName);
Dbase := PostHTTPPageEx(Client, Website);
FreeHTTPClient(Client);
Result := true;
end;
function antiBan : boolean;
begin
if not LoggedIn then Exit;
case Random(15) of
0..3: GameTab(Random(10) + 1);
4..10: Players[CurrentPlayer].Integers[7] := GetSkillLevel('mining');
end;
Result := True;
end;
function hasPick : boolean;
var
PickDTM: Integer;
begin
if not LoggedIn then Exit;
Status('Pick Check');
PickDTM := DTMFromString('78DA63B4676660F8CAC8800CF4E45919FE0 36' +
'99828A31350CD2754353059B81A77A09A7704D47803D5BC21 A0C6860' +
'835AE4035CF08A8B100AA7949408D2550CD1F026AAC816AFE 13E1F75' +
'704D4F801D57CC4AF060005D70EC5');
if Players[CurrentPlayer].Booleans[0] = True then // Equipped
begin
GameTab(5);
if FindDTM(PickDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Result := True
else
Result := FindPick;
end
else
begin
GameTab(4);
if FindDTM(PickDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Result := True
else
Result := FindPick;
end;
FreeDTM(PickDTM);
if not Result then
begin
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'No Pick';
Logout;
Exit;
end;
end;
procedure HandleGas; // The_Claw
begin
if not LoggedIn then Exit;
SaveScreenshot(ScriptPath + 'Found gas ' + TimeRunning + '.bmp');
Mouse(MMCX + 10, MMCY + 10, 5, 5, True);
SRLRandomsReport;
FFlag(0);
FTWait(4);
end;
function tv_FindNormalRandoms: Boolean;
var
i: Integer;
begin
if not LoggedIn then Exit;
Status('Random Check');
for i := 1 to 10 do
begin
case I of
1: Result := SolveNonTalkingRandoms;
2: Respond;
3: Result := FindTalk;
4: Result := FindDead;
5: Result := FindLamp(LampSkill);
6: if FindBox then
begin
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'Has Box';
Logout;
Exit;
end;
7: Result := RC;
8: Result := FindMod;
9: if FindGas(x, y) then HandleGas;
10: if FindFight then RunAway(Players[CurrentPlayer].Strings[0], True, 1, 7000);
end;
end;
end;
function antiRandoms : boolean;
begin
if not LoggedIn then Exit;
tv_FindNormalRandoms;
Result := True;
end;
function findRock(var x, y: Integer) : boolean;
var
RockCol, RockTol, i, rx, ry: Integer;
RockPoints: TPointArray;
ATPA: T2DPointArray;
begin
if not LoggedIn then Exit;
antiRandoms;
RockCol := Players[CurrentPlayer].Integers[0]; // RockCol
RockTol := Players[CurrentPlayer].Integers[1]; // RockTol
FindColorsSpiralTolerance(MSCX, MSCY, RockPoints, RockCol, MSX1, MSY1, MSX2, MSY2, RockTol);
ATPA := SplitTPA(RockPoints, 3);
SortATPASize(ATPA, True);
antiRandoms;
Status('Rock Check');
for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], rx, ry);
MMouse(rx, ry, 0, 0);
Wait(RandomRange(125, 750));
if IsUpText('ine') then
begin
Result := True;
Status('Found rock at: ' + IntToStr(rx) + ':' + IntToStr(ry));
Inc(Players[CurrentPlayer].Integers[5]);
ReportVars[1] := Players[CurrentPlayer].Integers[5];
x := rx;
y := ry;
Exit;
end;
end;
end;
procedure mineRock;
var
Tries, T, RockClicked: Integer;
begin
if not LoggedIn then Exit;
Players[CurrentPlayer].Loc := 'Mine';
antiRandoms;
case Random(20) of
3: hasPick;
end;
if not findRock(x, y) then
begin
if Tries = 3 then
begin
WriteLn('Could not find rocks.');
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'No Rocks';
Logout;
Exit;
end
else
Inc(Tries);
end
else
begin
antiRandoms;
case Random(2) of
0: Mouse(x, y, 0, 0, True);
1: begin
Mouse(x, y, 0, 0, False);
Wait(RandomRange(125, 750));
ChooseOption('ine');
end;
end;
antiRandoms;
FFlag(1);
T := InvCount;
MarkTime(RockClicked);
repeat
Wait(RandomRange(125, 1250));
antiRandoms;
antiBan;
case Random(10) of
0: hasPick;
end;
until((TimeFromMark(RockClicked) >= Players[CurrentPlayer].Integers[2]) or (InvCount > T) or InvFull);
Status('Mine Rock');
end;
end;
function dropOres : boolean;
var
OreDTM: Integer;
begin
if not LoggedIn then Exit;
if not InvFull then Exit;
Status('Drop Ores');
OreDTM := DTMFromString('78DA63CC676660F8CAC8800C3A1BEA19FE0 36' +
'9902898AE00AAF989AA06220B2381741150CD0B026AAA806A BE10501' +
'30754F39D809A74A09A7704D4E401D5FC25A02603A8E61501 3520BFB' +
'F26A02695B07B0050B71186');
repeat
Wait(RandomRange(125, 750));
if FindDTM(OreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
DropItem(CoordsToItem(x, y));
until(not FindDTM(OreDTM, x, y, MIX1, MIY1, MIX2, MIY2));
Inc(Players[CurrentPlayer].Integers[4]);
ReportVars[0] := ReportVars[0] + Players[CurrentPlayer].Integers[4];
FreeDTM(OreDTM);
Result := True;
end;
procedure progressReport;
var
i: Integer;
begin
Status('Progress Report');
ClearDebug;
WriteLn('');
WriteLn('--TViYH''s Powerminer ' + Version);
for i := 0 to High(Players) do
if Players[i].Integers[4] > 0 then
WriteLn('Player ' + Players[i].Nick + ': Active = ' + BoolToStr(Players[i].Active) + '; Levels Raised = ' + IntToStr((Players[i].Integers[7] - Players[i].Integers[6])) + '; Loads = ' + IntToStr(Players[i].Integers[4]) + '; Clicked = ' + IntToStr(Players[i].Integers[5]) + '; Location = ' + Players[i].Loc);
WriteLn(TimeRunning);
WriteLn('--TViYH''s Powerminer ' + Version);
SRLRandomsReport;
PostReport('TViYH Powerminer', 'http://scarprogressreports.net76.net/add.php', GetDebugText);
end;
function mainLoop : boolean;
begin
LoginPlayer;
repeat
Players[CurrentPlayer].Integers[6] := GetSkillLevel('mining');
repeat
SetAngle(True);
repeat
mineRock;
until((InvFull) or (not LoggedIn));
if DropOres then
ProgressReport;
until (Players[CurrentPlayer].Integers[3] <= Players[CurrentPlayer].Integers[4]) or (not LoggedIn);
if AllPlayersInactive then
begin
progressReport;
TerminateScript;
end
else
NextPlayer(Players[CurrentPlayer].Active);
until(AllPlayersInactive);
Result := True;
end;
begin
SetupSRL;
ScriptID := '170';
SRLID := SRL_ID;
SRLPassword := SRL_Password;
ActivateClient;
DeclarePlayers;
if mainLoop then
progressReport;
end.
What is wrong?
Thanks


Reply With Quote


and there has been some big chances 