SRL Archive - Help and Support

Editing RadialWalk


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)

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

Echo_

2013-03-19 22:23:19

http://villavu.com/forum/showthread.php?t=88861

Justin

2013-03-19 22:25:30

Also you aren't calling SetupSRL; ?

rj

2013-03-19 22:33:46

From: Justin
Also you aren't calling SetupSRL; ?


Lol, forgot to do that thanks

@echo

You have given out too much Reputation in the last 24 hours, try again later.

Justin

2013-03-19 22:34:52

From: RJJ95
Lol, forgot to do that thanks

@echo

You have given out too much Reputation in the last 24 hours, try again later.



Did that solve the problem?

rj

2013-03-19 22:41:38

From: Justin
Did that solve the problem?


Yes but I'm not sure if Radial works with it yet I have not had a chance to test it will post reports shortly

rj

2013-03-19 23:04:59

DOUBLE POST


Got it working. Now moving onto SPS. Just kidding, but what would need to be edited? *cough* @DannyRS

Understanding a little:

c.IOManager, false, 0, 0, SS_MMCX-40, SS_MMCY-40, SS_MMCX+40, SS_MMCY+40

Im guessing the distance from middle of minimap to side? :p

DannyRS

2013-03-19 23:41:58

From: RJJ95
DOUBLE POST


Got it working. Now moving onto SPS. Just kidding, but what would need to be edited? *cough* @DannyRS

Understanding a little:

c.IOManager, false, 0, 0, SS_MMCX-40, SS_MMCY-40, SS_MMCX+40, SS_MMCY+40

Im guessing the distance from middle of minimap to side? :p


Pretty much, change all P06_ to SS_ in the P06SPS I edited, and add whatever mouse click function you want in the walking and you should be fine ;)

Justin

2013-03-20 00:58:52

From: RJJ95
DOUBLE POST


Got it working. Now moving onto SPS. Just kidding, but what would need to be edited? *cough* @DannyRS

Understanding a little:

c.IOManager, false, 0, 0, SS_MMCX-40, SS_MMCY-40, SS_MMCX+40, SS_MMCY+40

Im guessing the distance from middle of minimap to side? :p



Just sayin'