rj
2013-03-19 16:48:24
First of all.. credits to @WT-Fakawi and @nielsie95
I am getting this error when I attempt to edit Radial walk to use for my own private uses(no pun intended)
And it opens up globals.simba
This is what I attempted to edit Radial walk into
Here is what my include test looks like:
Just realized I forgot to change a couple things to SS_ constants but it should not effect it, I will fix those issues when I can run without the error
I am getting this error when I attempt to edit Radial walk to use for my own private uses(no pun intended)
Error: Exception: The bitmap[0] does not exist at line 664 And it opens up globals.simba
This is what I attempted to edit Radial walk into
function SS_LinearWalkEx(var TPA: TPointArray; cx, cy, TheColor, tol: Integer; Direction: Variant; Radius: Integer): Boolean;
var
time, SD, ED: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
time := GetSystemTime;
Direction := variantToDirection(Direction);
if (Direction < 50) then
SD := ((Direction + 360) - 50)
else
SD := (Direction - 50);
ED := (Direction + 50);
SD := Trunc(FixD(SD + 0.0));
ED := Trunc(FixD(ED + 0.0));
try
FindColorsTolerance(tpa, TheColor, SS_MMX1, SS_MMY1, SS_MMX2, SS_MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
LinearSort(tpa, cx, cy, Direction, False);
Result := (Length(tpa) > 0);
except
srl_Warn('LinearWalkEx', 'LWex error!', warn_AllVersions);
Exit;
end;
srl_Warn('LinearWalkEx', 'Took ' + IntToStr(GetSystemTime - time) + ' ms, found ' +
IntToStr(Length(TPA)) + 'points.', warn_Debug);
end;
function SS_RadialWalkEx(var TPA: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Variant; Radius: Integer): Boolean;
var
time: Integer;
SD, ED: extended;
begin
Result := False;
if (not LoggedIn) then Exit;
SD := variantToDirection(StartRadial);
ED := variantToDirection(EndRadial);
if (SD = ED) then
begin
srl_Warn('RadialWalkEx', 'StartRadial = EndRadial, using LinearWalkEx.', warn_Warning);
Result := SS_LinearWalkEx(tpa, cx, cy, TheColor, tol, StartRadial, Radius);
end;
time := GetSystemTime;
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
SortCircleWise(tpa, cx, cy, StartRadial, False, StartRadial > EndRadial);
Result := (Length(tpa) > 0);
except
srl_Warn('RadialWalkEx', 'An exception has occured', warn_AllVersions); Exit;
end;
srl_Warn('RadialWalkEx', 'Took ' + IntToStr(GetSystemTime - time) +
' ms, found' + IntToStr(Length(TPA)) + ' points', warn_Debug);
end;
function SS_RadialWalk(TheColor: Integer; StartRadial, EndRadial: Variant; Radius, Xmod, Ymod: Integer): Boolean;
var
TPA: TPointArray;
I: Integer;
begin
Result := False;
if SS_RadialWalkEx(tpa, SS_MMCX, SS_MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
FFlag(10);
Result := True;
Exit;
end;
end;
function SS_RadialWalkTolerance(Color: Integer; sRadial, eRadial: Variant; r, modX, modY, Tol: Integer): Boolean;
var
TPA: TPointArray;
i, h: Integer;
begin
Result := False;
if SS_RadialWalkEx(TPA, SS_MMCX, SS_MMCY, Color, Tol, sRadial, eRadial, r) then
begin
h := High(TPA);
for i := 0 to h do
if MFNF(TPA[i].x, TPA[i].y, modX, modY) then
begin
Result := WaitFunc(@Flag, 50, 500);
Exit;
end;
end;
end; [save in includes folder]Here is what my include test looks like:
Program New;
{$i srl/srl.simba}
//{$i SSInclude/SSInclude.simba}
//{$i SSInclude/Randoms.simba}
{$i SSInclude/MapWalk.simba}
Begin
SetupP07Include;
ActivateClient;
Wait(1400);
SS_RadialWalkTolerance(13423314, 140, 200, 25, 1, 2, 15);
WriteLn(SS_GetUpText);
End. Just realized I forgot to change a couple things to SS_ constants but it should not effect it, I will fix those issues when I can run without the error