SRL Archive - Research & Development Lounge

Function/Script WorldMAPWalk<--Uses the World Map to walk from anywhere!


Macrosoft

2008-07-29 00:58:44

MAP (Macrosoft Auto Pather)<–Testing and Work still needed


UPDATE: All Problems Fixed! (Except for flag problem)

I have spent the last few weeks doing nothing but scripting this function and taking Xbox Live Breaks (lol). Oh yeah and playing tennis.

Your help is needed in order to find bugs and solve problems.

What it does
This function/script finds a DTM on the world map and then finds the angle needed to walk to that location.

Future Updates
Much more will be added later including the use of boats to travel onto and off of islands and the use of my currently not working CheckMovement function (Which should be better than flag because the flag tends to move off the screen when walking around walls etc.)

How to Use It

WMDestinationDTM is the DTM you are walking to MADE ON THE WORLD MAP. MMDestinationDTM is the DTM you are walking to MADE ON THE MINI MAP.

MLx and MLy are the coords of the TOP LEFT corner of the RED RECTANGLE on the mini overview of the world map. You should be standing at the location that you want the script to walk to when you press the word map button and find these coords.

Known Bugs

In the normal version, if the flag goes off the minimap, the "Flag" function will fail. Thus the function will fail. This will be fixed once I get CheckMovement working.

The Script

This script should walk to the Varrock East Bank (Or at least towards it for now). Keep in mind this is still in the testing stages and will have bugs. I suggest you try this somewhere in Varrock though it should work from almost anywhere. If the flag goes off the map at any time, the function will not work unless you are using the reflection version (This will be fixed with CheckMovement when I get it working).


NORMAL VERSION


program New;
{.include SRL/SRL.scar}
var
x, y, WMDTM, MMDTM: Integer;
function Loading: Boolean;
var
Load, x, y: integer;
begin
Load := BitmapFromString(29, 3, 'beNr7/x8CGFABsiCagv+oAJ' +
'd6kowlnk0TYwEHnoCA');
Result := FindBitmap(Load, x, y);
FreeBitmap(Load);
end;

function OpenMap: Boolean;
var
a: Integer;
begin
Mouse(530, 130, 20, 20, true);
a:=0;
repeat
Wait(500);
a:=a+1;
until(Loading)or(a=15);
if(a=15)then
begin
Result:=False;
WriteLn('Error: Could nor open map: Wont start to load');
Exit;
end;
a:=0;
repeat
Wait(1000);
a:=a+1;
until(not(Loading))or(a=20);
Wait(500+Random(1000));
if(a=20)then
begin
WriteLn('Error: Could not open map: Loading for too long');
Result:=False;
Exit;
end;
Result:=True;
end;

procedure CloseMap;
begin
Mouse(740, 10, 15, 15, True);
Wait(2000 + Random(1000));
end;

function FindAngle(L, D: Tpoint):Extended;
var
TrigAngle: Integer;
begin
if(L.x=D.x)then //if must go perfect n or s
begin
if(L.y>D.y)then //if go p north
begin
Result:=0;
Exit;
end else //if go p south
begin
Result:=180;
Exit;
end;
end;
if(L.y=D.y)then //if must go perfect e or w
begin
if(L.x>D.x)then //if go p west
begin
Result:=270;
Exit;
end else //if go p east
begin
Result:=90;
Exit;
end;
end;
TrigAngle:=Round(Degrees(ArcTan(Abs(D.y-L.y)/Abs(D.x-L.x))));
if(L.y>D.y)then //if need go north (destination higher than location
begin
if(L.x<D.x)then Result:=90-TrigAngle; //If need go NorthEast
if(L.x>D.x)then Result:=270+TrigAngle; //if need go NorthWest
end;
if(L.y<D.y)then //if need go south
begin
if(L.x<D.x)then Result:=90+TrigAngle; //if need go SouthEast
if(L.x>D.x)then Result:=270-TrigAngle; //If need southwest
end;
end;

function ChangeZoom(CurrentZoom, Zoom: Integer): Boolean;
var
ColCheck: array[0..1] of integer;
begin
if(CurrentZoom=Zoom)then Exit;
ColCheck[0]:=GetColor(565, 342);
ColCheck[1]:=GetColor(565, 373);
Mouse(562, 472, 27, 17, True);
Wait(100 + Random(100));
if(ColCheck[0]=GetColor(565, 342))and(ColCheck[1]=GetColor(565, 373))then
begin
Result:=False;
Exit;
end;
case(Zoom)of
37: Mouse(562, 340, 27, 17, True);
50: Mouse(562, 371, 27, 17, True);
75: Mouse(562, 402, 27, 17, True);
100: Mouse(562, 433, 27, 17, True);
end;
Mouse(562, 472, 27, 17, True);
Result:=True;
end;

function FindBRCorner(x, y: integer): Tpoint;
var
EdgeCol: integer;
begin
EdgeCol:=GetColor(x, y);
repeat
begin
x:=x+1;
end;
until(not(GetColor(x+1, y)=EdgeCol));
repeat
begin
y:=y+1;
end;
until(not(GetColor(x, y+1)=EdgeCol));
Result.x:=x;
Result.y:=y;
end;

function MoveMap(x, y: integer): boolean;
var
Cx, Cy, x1, y1, x2, y2, MS: Integer;
BR, Change: Tpoint;
begin
if(not(FindColorTolerance(x2, y2, 255, 605, 310, 760, 460, 5)))then
begin
Result:=False;
Exit;
end;
BR:=FindBRCorner(x2, y2);
Change.x:=x-x2;
Change.y:=y-y2;
Cx:=Round(Abs(BR.x-x2)/4);
Cy:=Round(Abs(BR.y-y2)/4);
MMouse(x2+Cx, y2+Cy, 2*Cx, 2*Cy);
MS:=MouseSpeed;
MouseSpeed:=3;
GetMousePos(x1, y1);
HoldMouse(x1, y1, True);
x2:=x1+Change.x-5+Random(10);
y2:=y1+Change.y-5+Random(10);
MMouse(x2, y2, 4, 4);
Wait(100+Random(100));
GetMousePos(x1, y1);
ReleaseMouse(x1, y1, True);
MouseSpeed:=MS;
Result:=True;
end;

procedure AngleWalk(Degrees, Radius: Integer);
var
x1, y1, Quad, Angle, x, y: Integer;
begin
Angle:=Round(rs_GetCompassAngleDegrees+Degrees);
if(Angle>=360)then Angle:=Angle-360;
if(Angle<0)then Angle:=Angle+360;
case Angle of
0..90: Quad:=1;
91..179: Quad:=2;
180..270: Quad:=3;
271..359: Quad:=4;
end;
repeat
if(Angle>=90)then Angle:=Angle-90;
until(Angle<=90);
y:= Round((cos(Radians(Angle))) * Radius);
x:= Round((sin(Radians(Angle))) * Radius);
case Quad of
1:
begin
y1:=MMCY-y
x1:=MMCX+x
end;

2:
begin
y1:=MMCY+x
x1:=MMCX+y
end;

3:
begin
y1:=MMCY+y
x1:=MMCX-x
end;

4:
begin
y1:=MMCY-x
x1:=MMCX-y
end;
end;
MouseFlag(x1, y1, 0, 0);
end;

function WorldMAPWalk(WMDestinationDTM, MMDestinationDTM: Integer; MLx, MLy: Integer): Boolean;
var
RDis, Trav, TDis, Dis, Angle, x, y, a, W, H: integer;
MC, Loc, Des: Tpoint;
Check, Stop: Boolean;
begin
MC.x:=383;
MC.y:=252;
GetClientDimensions(W, H);
MakeCompass('n');
for a:=0 to 3 do
begin
if(DTMRotated(MMDestinationDTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
MouseFlag(x, y, 10, 10);
WriteLn('Arrived at destination');
Result:=True;
Exit;
end;
Wait(500);
end;
repeat
begin
if(not(OpenMap))then
begin
Result:=False;
Exit;
end;
Check:=False;
if(DTMRotated(WMDestinationDTM, x, y, 0, 0, W, H))then
begin
Des.x:=x;
Des.y:=y;
Angle:=Round(FindAngle(MC, Des));
Dis:=Distance(MC.x, MC.y, Des.x, Des.y);
Check:=True;
CloseMap;
end else
begin
Mouse(670, 470, 27, 17, True);
Wait(400 + Random(100));
if(not(FindColorTolerance(x, y, 255, 605, 310, 760, 460, 5)))then
begin
Result:=False;
Exit;
end;
Loc.x:=x;
Loc.y:=y;
Des.x:=MLx;
Des.y:=MLy;
Dis:=(Distance(x, y, MLx, MLy)*455)/8;
Angle:=Round(FindAngle(Loc, Des));
MoveMap(MLx, MLy);
Wait(2000+Random(1000));//IdleTime(2000, 1000, 7);
CloseMap;
end;
WriteLn(Floattostr(Angle));
case Dis of
0..400: RDis:=Dis;

401..899: RDis:=Round(Dis/2+50)+Random(100);

900..1600: RDis:=Round((Dis/2)+Random(100));

else RDis:=800+Random(100);
end;
Trav:=0;
repeat
begin
case RDis-Trav of
(0-10)..10:Stop:=True;

0..75:
begin
TDis:=RDis-Trav;
AngleWalk(Angle-4+Random(8), TDis);
end;

76..120:
begin
TDis:=Round(((RDis-Trav)/2)-5+Random(10));
AngleWalk(Angle-4+Random(8), TDis);
end;

else
begin
TDis:=45+Random(30);
AngleWalk(Angle-5+Random(10), TDis);
end;
end;
Trav:=Trav+TDis;
end;
until(Stop);
if(Check)then
begin
MakeCompass('n');
for a:=0 to 15 do
begin
if(DTMRotated(MMDestinationDTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
if(Distance(MMCX, MMCY, x, y)>20)then MouseFlag(x, y, 10, 10);
WriteLn('Arrived at destination');
Result:=True;
Exit;
end;
Wait(250);
end;
Check:=False;
end;
Wait(300+Random(500));
end;
until(false);
end;
begin
SetupSRL;
ActivateClient;
WMDTM := DTMFromString('78DA639CCFC4C0C0C7C800024C0C10D0585BC' +
'6C00EA441A2FF8180712250460455CD993367E06A408071135046' +
'88809A354019595435B6B20CA86A960165D850D5009D80A20600F' +
'2E01161');
MMDTM := DTMFromString('78DA632C646260486700032608C5D05C5FC1C' +
'005A41981F83F10302600657250D5E4C6E8C2D580006323502617' +
'55CDDBA7EF50D5E402659C71DB05565386A906C31C907BBCF0AB0' +
'10096F1152C');
WorldMAPWalk(WMDTM, MMDTM, 698, 372);
FreeDTM(WMDTM);
FreeDTM(MMDTM);
end.

SMART/Reflection Version
This should work with Reflection and should thus be more dependable. I haven't tried it yet though.

{SMART/Reflection version}

program New;
{.Include SRL/SRL/Misc/SMART.scar}
{.Include SRL/SRL.scar}
{.Include SRL/SRL/reflection/reflection.scar}
var
x, y, WMDTM, MMDTM: Integer;
function Loading: Boolean;
var
Load, x, y: integer;
begin
Load := BitmapFromString(29, 3, 'beNr7/x8CGFABsiCagv+oAJ' +
'd6kowlnk0TYwEHnoCA');
Result := FindBitmap(Load, x, y);
FreeBitmap(Load);
end;

function OpenMap: Boolean;
var
a: Integer;
begin
Mouse(530, 130, 20, 20, true);
a:=0;
repeat
Wait(500);
a:=a+1;
until(Loading)or(a=15);
if(a=15)then
begin
Result:=False;
WriteLn('Error: Could nor open map: Wont start to load');
Exit;
end;
a:=0;
repeat
Wait(1000);
a:=a+1;
until(not(Loading))or(a=20);
Wait(500+Random(1000));
if(a=20)then
begin
WriteLn('Error: Could not open map: Loading for too long');
Result:=False;
Exit;
end;
Result:=True;
end;

procedure CloseMap;
begin
Mouse(740, 10, 15, 15, True);
Wait(2000 + Random(1000));
end;

function FindAngle(L, D: Tpoint):Extended;
var
TrigAngle: Integer;
begin
if(L.x=D.x)then //if must go perfect n or s
begin
if(L.y>D.y)then //if go p north
begin
Result:=0;
Exit;
end else //if go p south
begin
Result:=180;
Exit;
end;
end;
if(L.y=D.y)then //if must go perfect e or w
begin
if(L.x>D.x)then //if go p west
begin
Result:=270;
Exit;
end else //if go p east
begin
Result:=90;
Exit;
end;
end;
TrigAngle:=Round(Degrees(ArcTan(Abs(D.y-L.y)/Abs(D.x-L.x))));
if(L.y>D.y)then //if need go north (destination higher than location
begin
if(L.x<D.x)then Result:=90-TrigAngle; //If need go NorthEast
if(L.x>D.x)then Result:=270+TrigAngle; //if need go NorthWest
end;
if(L.y<D.y)then //if need go south
begin
if(L.x<D.x)then Result:=90+TrigAngle; //if need go SouthEast
if(L.x>D.x)then Result:=270-TrigAngle; //If need southwest
end;
end;

function ChangeZoom(CurrentZoom, Zoom: Integer): Boolean;
var
ColCheck: array[0..1] of integer;
begin
if(CurrentZoom=Zoom)then Exit;
ColCheck[0]:=GetColor(565, 342);
ColCheck[1]:=GetColor(565, 373);
Mouse(562, 472, 27, 17, True);
Wait(100 + Random(100));
if(ColCheck[0]=GetColor(565, 342))and(ColCheck[1]=GetColor(565, 373))then
begin
Result:=False;
Exit;
end;
case(Zoom)of
37: Mouse(562, 340, 27, 17, True);
50: Mouse(562, 371, 27, 17, True);
75: Mouse(562, 402, 27, 17, True);
100: Mouse(562, 433, 27, 17, True);
end;
Mouse(562, 472, 27, 17, True);
Result:=True;
end;

function FindBRCorner(x, y: integer): Tpoint;
var
EdgeCol: integer;
begin
EdgeCol:=GetColor(x, y);
repeat
begin
x:=x+1;
end;
until(not(GetColor(x+1, y)=EdgeCol));
repeat
begin
y:=y+1;
end;
until(not(GetColor(x, y+1)=EdgeCol));
Result.x:=x;
Result.y:=y;
end;

function MoveMap(x, y: integer): boolean;
var
Cx, Cy, x1, y1, x2, y2: Integer;
BR, Change: Tpoint;
begin
if(not(FindColorTolerance(x2, y2, 255, 605, 310, 760, 460, 5)))then
begin
Result:=False;
Exit;
end;
BR:=FindBRCorner(x2, y2);
Change.x:=x-x2;
Change.y:=y-y2;
Cx:=Round(Abs(BR.x-x2)/4);
Cy:=Round(Abs(BR.y-y2)/4);
MMouse(x2+Cx, y2+Cy, 2*Cx, 2*Cy);
MS:=MouseSpeed; //
MouseSpeed:=3;
GetMousePos(x1, y1);
HoldMouse(x1, y1, True);
x2:=x1+Change.x-5+Random(10);
y2:=y1+Change.y-5+Random(10);
MMouse(x2, y2, 4, 4);
Wait(100+Random(100));
GetMousePos(x1, y1);
ReleaseMouse(x1, y1, True);
MouseSpeed:=MS;
Result:=True;
end;

procedure AngleWalk(Degrees, Radius: Integer);
var
x1, y1, Quad, Angle, x, y: Integer;
begin
Angle:=Round(GetMinimapAngleDeg+Degrees);
if(Angle>=360)then Angle:=Angle-360;
if(Angle<0)then Angle:=Angle+360;
case Angle of
0..90: Quad:=1;
91..179: Quad:=2;
180..270: Quad:=3;
271..359: Quad:=4;
end;
repeat
if(Angle>=90)then Angle:=Angle-90;
until(Angle<=90);
y:= Round((cos(Radians(Angle))) * Radius);
x:= Round((sin(Radians(Angle))) * Radius);
case Quad of
1:
begin
y1:=MMCY-y
x1:=MMCX+x
end;

2:
begin
y1:=MMCY+x
x1:=MMCX+y
end;

3:
begin
y1:=MMCY+y
x1:=MMCX-x
end;

4:
begin
y1:=MMCY-x
x1:=MMCX-y
end;
end;
Mouse(x1, y1, 0, 0, True);
Wait(1000);
R_Flag;
end;

function WorldMAPWalk(WMDestinationDTM, MMDestinationDTM: Integer; MLx, MLy: Integer): Boolean;
var
RDis, Trav, TDis, Dis, Angle, x, y, a: integer;
MC, Loc, Des: Tpoint;
Check, Stop: Boolean;
begin
MC.x:=383; //
MC.y:=252; //
GetClientDimensions(W, H);
MakeCompassR('n');
for a:=0 to 3 do
begin
if(DTMRotated(MMDestinationDTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(x, y, 10, 10, True);
Wait(1000);
R_Flag;
WriteLn('Arrived at destination');
Result:=True;
Exit;
end;
Wait(500);
end;
repeat
begin
if(not(OpenMap))then
begin
Result:=False;
Exit;
end;
Check:=False;
if(DTMRotated(WMDestinationDTM, x, y, 0, 0, W, H))then
begin
Des.x:=x;
Des.y:=y;
Angle:=Round(FindAngle(MC, Des));
Dis:=Distance(MC.x, MC.y, Des.x, Des.y);
Check:=True;
CloseMap;
end else
begin
Mouse(670, 470, 27, 17, True);
Wait(400 + Random(100));
if(not(FindColorTolerance(x, y, 255, 605, 310, 760, 460, 5)))then
begin
Result:=False;
Exit;
end;
Loc.x:=x;
Loc.y:=y;
Des.x:=MLx;
Des.y:=MLy;
Dis:=(Distance(x, y, MLx, MLy)*455)/8;
Angle:=Round(FindAngle(Loc, Des));
MoveMap(MLx, MLy);
Wait(2000+Random(1000));//IdleTime(2000, 1000, 7);
CloseMap;
end;
WriteLn(Floattostr(Angle));
case Dis of
0..400: RDis:=Dis;

401..899: RDis:=Round(Dis/2+50)+Random(100);

900..1600: RDis:=Round((Dis/2)+Random(100));

else RDis:=800+Random(100);
end;
Trav:=0;
repeat
begin
case RDis-Trav of
(0-10)..10:Stop:=True;

0..75:
begin
TDis:=RDis-Trav;
AngleWalk(Angle-4+Random(8), TDis);
end;

76..120:
begin
TDis:=Round(((RDis-Trav)/2)-5+Random(10));
AngleWalk(Angle-4+Random(8), TDis);
end;

else
begin
TDis:=45+Random(30);
AngleWalk(Angle-5+Random(10), TDis);
end;
end;
Trav:=Trav+TDis;
end;
until(Stop);
if(Check)then
begin
MakeCompassR('n');
for a:=0 to 15 do
begin
if(DTMRotated(MMDestinationDTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
if(Distance(MMCX, MMCY, x, y)>20)then
begin
Mouse(x, y, 10, 10);
Wait(800+Random(400));
R_Flag;
end;
WriteLn('Arrived at destination');
Result:=True;
Exit;
end;
Wait(250);
end;
Check:=False;
end;
Wait(300+Random(500));
end;
until(false);
end;
begin
SMARTSetUp('world38', True, True, False);
SetTargetDC(SMARTGetDC);
SetupSRL;
SetupReflection;
ActivateClient;
WMDTM := DTMFromString('78DA639CCFC4C0C0C7C800024C0C10D0585BC' +
'6C00EA441A2FF8180712250460455CD993367E06A408071135046' +
'88809A354019595435B6B20CA86A960165D850D5009D80A20600F' +
'2E01161');
MMDTM := DTMFromString('78DA632C646260486700032608C5D05C5FC1C' +
'005A41981F83F10302600657250D5E4C6E8C2D580006323502617' +
'55CDDBA7EF50D5E402659C71DB05565386A906C31C907BBCF0AB0' +
'10096F1152C');
WorldMAPWalk(WMDTM, MMDTM, 698, 373);
FreeDTM(WMDTM);
FreeDTM(MMDTM);
end.

Have Fun!

-Macrosoft

Runescape Pro

2008-07-29 01:32:59

one word… GENIUS. Good job on this and good luck improving it.

Macrosoft

2008-07-29 09:04:12

Thanks so much for replying. *Cough*22 other views*Cough*

Zezi

2008-07-29 09:15:55

This was also my idea a long time ago

But i was told to drop it as it was a crap idea.


Oh well.

3Garrett3

2008-07-29 09:19:07

Umm.. For "CheckMovement". I never looked through the script. But I read what you wrote. Maybe I should just say good job first of all. I actually talked to someone about this exact idea. He was trying to explain it to me. It took quite some time before I understood. But now I do. Anyway. Good job even trying it :).

Now. For checking if you are moving. Use reflection. Reflection has a thing that is like.. movement speed or something. 0 for not moving i believe, 1-3 for moving.

Macrosoft

2008-07-29 09:19:33

Zezi-You were told it was a crap idea because its very hard to do. Not the actual scripting, but HOW to do it.

Thanks garrett

Im not sure what reflection does and I hope it doesn't ruin the usefulness of this script (I was in camp when reflection was released and I was too busy scripting to learn what it did)

3Garrett3

2008-07-29 09:25:18

From: Macrosoft
Zezi-You were told it was a crap idea because its very hard to do. Not the actual scripting, but HOW to do it.

Thanks garrett

Im not sure what reflection does and I hope it doesn't ruin the usefulness of this script (I was in camp when reflection was released and I was too busy scripting to learn what it did)


Yeah. No probs. I may have been the one to talk to zezi. You never know. I am not saying anything XD. I didnt tell anyone it was a shit idea. I said that I didnt understand.

The reflection to my knowledge gives an integer above 0 if you are moving though. Look up n3ss3s debugger. It gives you the values. And you should be able to figure it out from looking there too.

Macrosoft

2008-07-29 09:38:35

yes, but I think that reflection also allows you to walk to a tile, in which case i could make a simple function to walk from a current tile to a destination tile.

Edit: garrett, u live in Nova Scotia. My camp has a trip that I might do in a few years that goes to Nova Scotia. We bike around there for like 3 weeks. Maybe you have seen them!

3Garrett3

2008-07-29 09:48:58

From: Macrosoft
yes, but I think that reflection also allows you to walk to a tile, in which case i could make a simple function to walk from a current tile to a destination tile.

Edit: garrett, u live in Nova Scotia. My camp has a trip that I might do in a few years that goes to Nova Scotia. We bike around there for like 3 weeks. Maybe you have seen them!


Yeah. Reflection lets you walk to a tile. However, it sortof ruins the fun now, doesn't it :p.

Maybe I have seen them. However, I live in the sticks, so I doubt it goes near my house. Nova scotia is like a 5 hour drive from one end to the other, so it isnt small enough for 3 weeks to make it everywhere. I assume you probably bike in Halifax, NS or somewhere around there, as it is the only place really good enough for anyone to know about.

Macrosoft

2008-07-29 10:47:16

darn reflection ruins all the fun. Ill make a function that does the same thing with reflection, only it will prob be about 20 lines instead of 300. Oh well.

Camaro'

2008-07-29 11:09:16

Wont work. You know why.

  until(not(Loading))or (a=15+Random(10));
if(a=15)then













Just incase you dont (a=15+Random(10)); Returns a as most of the time a number greater then 15. SO a = 15 wont work, a >= 15 or A > 14 will work.

Macrosoft

2008-07-29 11:19:13

oh sorry i changed that last minute. Ill fix it

Gu3st...

2008-07-29 12:39:46

From: Macrosoft
Im not sure what reflection does and I hope it doesn't ruin the usefulness of this script (I was in camp when reflection was released and I was too busy scripting to learn what it did)


Hmm…. I think Wizzup? should be happy now, cause he wants failsafes in case the reflection fails… Awesome! :p

Hugolord

2008-07-29 13:25:28

Well, it doesn't really work for me but I still think it's a really awesome idea, you could ask Ruler for tips on how to make it better since he made a pretty nice auto-walking method for ibot (I know he used reflection but the concept is the same).

Macrosoft

2008-07-29 16:52:39

Updated!

It works fine for me…

Only thing I dont understand is that it doesnt move the overview thing, it just opens and closes it. I wanted it to move it. I never told it to close it either…weird

Edit: Not working for me anymore…problem with the update…

Krim0407

2008-07-29 17:59:46

Pretty nice work, but didn't reallty understand exactly what it does. Is it walking to where you want it to, or is that a unfinished one? Anyway, I reped you for nice work :)

Macrosoft

2008-07-29 21:23:32

found and fixed multiple ways that could have lead to the mess up, still not working!

BobboHobbo

2008-07-30 07:31:04

First off, Welcome back? And nice procedures.

Macrosoft

2008-07-30 08:11:26

thanks bob, i guess nobody realized I was gone. Im so stealthy :p

Naike

2008-07-30 12:04:02

Nice Macro!
Tell me when its back on track so i can test it ;)

Freddy1990

2008-07-30 16:53:38

First script that made me get one of my accounts out from under the dust after a year :p Unfortunately it failed, tried to walk from GE, but it kept clicking the NE corner of the minimap… But still, very nice!

Macrosoft

2008-07-30 21:59:00

its doing some odd things right now. It was working before, now its not even clicking in the minimap….

Naike

2008-08-04 05:09:11

Try to remember what you added before it all happend?
Then edit/delete it :)

Macrosoft

2008-08-05 05:13:22

well, what i did was I took something away that wasn't right. That flaw must have been counteracting other flaws to make it walk in the right direction from only where I was standing. So it appeared to work for me…

Queso

2008-08-05 07:23:15

Failed for me, I think it was because the flag went off the minimap.

Still, a nice idea indeed! I'd love to see this being fully operational!

Naike

2008-08-06 16:51:45

Well im about to test it!
Btw, Ive had to respond to our little contest so im soon releasing a script that makes oak planks xD
You still win :/

Macrosoft

2008-08-07 12:10:08

FIXED
NOW UP AND RUNNING

Im such a dooshbag. Look at this function:

procedure AngleWalk(Degrees, Radius: Integer);
var
x1, y1, Quad, Angle, x, y: Integer;
begin
Angle:=Round(rs_GetCompassAngleDegrees+Degrees);
if(Angle>=360)then Angle:=Angle-360;
if(Angle<0)then Angle:=Angle+360;
case Angle of
0..90: Quad:=1;
91..179: Quad:=2;
180..270: Quad:=3;
271..359: Quad:=4;
end;
y:= Round((cos(Radians(Angle))) * Radius);
x:= Round((sin(Radians(Angle))) * Radius);
case Quad of
1:
begin
y1:=MMCY-y
x1:=MMCX+x
end;

2:
begin
y1:=MMCY+x
x1:=MMCX+y
end;

3:
begin
y1:=MMCY+y
x1:=MMCX-x
end;

4:
begin
y1:=MMCY-x
x1:=MMCX-y
end;
end;
MouseFlag(x, y, 0, 0);
end;

Originally (version 1) the x1s and the y1s in the case statement were x and y. I saw the problem in this and changed them to x1 and y1. BUT being the dumbass that i am i didnt change the x and y on MouseFlag.


EDIT: Fixed a bunch of DTM problems. Should be almost flawless besides double click problem.

Freddy1990

2008-08-07 12:15:13

Nice job, the regular version works a lot better now

Macrosoft

2008-08-07 21:44:32

thanks :) Any idea why it is clicking the overview button twice?

i noticed a lot of people viewing this thread but not posting :mad:

Lee Lok Hin

2008-08-07 22:59:25

I tested, and gave you the results on IRC. Just treat this as a minor bump.

Macrosoft

2008-08-07 23:49:59

I think i missed the results on IRC… Can you post them?

Lee Lok Hin

2008-08-07 23:54:09

I think you got them. I thought I was TheVoiceInYourHead?

I did'nt save them though. All I remembered was It managed to go to the south of the varrock east bank, then went randomly around.

But that was before you fixed your dtm problem, so..

Macrosoft

2008-08-08 13:22:40

yeah thats fixed now. I thought you were voice cuz it said voice was viewing the thread…

TViYH

2008-08-08 13:40:12

Lol. It's funny how when I do a search for my ID, it comes up in threads like this =].

Macrosoft

2008-08-08 13:45:36

lol, yeah because of a previous post.

Did you ever end up testing this?? I saw you were viewing the thread a few days ago…:mad:

TViYH

2008-08-08 13:49:29

Yes, I've tested it multiple times. It loads the map and then nothing happens.

It also lags the entire time..

Macrosoft

2008-08-08 13:53:16

thats odd…. Ill have to check because it worked fine for freddy and I

You really should have posted that because I cant fix a problem if I don't know it exists.

The lag is probably causing a problem in the waiting loop for the open map function. How long does it load the map for?? If its more than like 20 seconds thats probably why…

Edit: I think I fixed it now…

Update: Should be more compatible with slower computers

TViYH

2008-08-08 14:42:04

Thanks mate. I'll try it out.

I also suggest creating a DeclarePlayers; and LoginPlayer; into it…lol..makes it a lot easier to test! =]

Macrosoft

2008-08-08 18:43:02

You honestly think i would do that??? Lol im too lazy…

Waddo

2008-08-08 19:45:40

Instead of using angle why not use gradient then you can give it randomness more easily

Macrosoft

2008-08-08 23:21:53

what is gradient??

TViYH

2008-08-08 23:23:07

Oh, and MacroHard. This time it just lagged throughout the entire script, and even more during the map opening.

Macrosoft

2008-08-10 16:47:47

Sorry dude my DTMs had too much areasize to each point so it made it super laggy.

Better DTMs now used so symbol will never cover them and so there will be less lag!

Macrosoft

2008-08-12 01:44:31

Massive Update: All problems except for Flag problem fixed!

WorldMAPWalk should now be almost fully functional. All DTM and lag problems have been fixed or improved. The double click problem has also been fixed so the function will now move the World Map.

basic_i

2008-08-12 01:49:30

umm i dont understand what this is for….is it like a talisman when u click locate or somthing??? a talisman for anything????

Macrosoft

2008-08-12 02:09:18

Well, it uses the world map to walk to a DTM (like a bitmap) from anywhere!

So I could start the script in falador or in lumbridge and it should still walk to the inputted DTM (in this case the Varrock East Bank).

The only known problem is that if the flag goes off the minimap (while walking around a wall or something) then Flag will screw up and possibly screw up the function (not a problem for the reflection version).

basic_i

2008-08-12 03:13:02

oh, like when walking around a wall and the flag disapeares for a few seconds but scar thinks it messed up so the whole thing caves in???……i going to make my first script (i even came up with name (PTA-pro travel agent) a walker…use reflection pathwalking from any f2p bank to any f2p bank….starting with draynor-fally…cuz i duno how to get downstairs in lumby…waiit…can u click the large map and it will take u there?!?!?!?!?!

Macrosoft

2008-08-12 03:18:55

No. My script USES the world map to find the angle and distance at which it must travel to get to a dtm from its current location.

CheckMovement almost done! So the flag problem will be fixed!

basic_i

2008-08-12 03:24:50

:eek: dream crusher!!! lol jk…ok….guess ill make somthing else..

Gu3st...

2008-08-12 04:41:50

Ok, this is what happens to me:

I log in, and it does the search for destination dtm 6 times, its enough with 1 time!


After that it finds varrock east bank on the world map, and begins to walk. It clicks 1 time and waits until my character stops (Flag; ), then it opens the worldmap, and wait like 10 secs, closes it, opens, Wait(10000);, closes, and repeat.

I am using the normal verision.

Macrosoft

2008-08-12 11:58:14

how far away are you. It should calculate the distance it has to go so it shouldn't be checking the World Map every time…

Well doesnt it need to search for the DTM a bit because if one of the dots is covered with a person dot then it might not be found??

Macrosoft

2008-09-01 21:03:48

Updated. Testing/suggestions would be highly appreciated (Heres what im hinting at: POST, DAMMIT, POST!).

NCDS

2008-09-04 21:51:30

this is such a great idea.
rep+ to you for actually attempting this.
goodluck on this script.

randy marsh

2008-09-06 23:47:16

Oh so could use this as a "deathwalk" in my script encase one of the users gets killed?

Macrosoft

2008-09-08 16:44:15

Pretty much. However, the main purpose of the script is to:

-Allow the user to start their character from anywhere
-Walk to a known place when lost

randy marsh

2008-09-08 17:10:44

Walk to a known place when lost


That could be so usefull for scripting as quite often i get lost when i am mining!

Macrosoft

2008-09-08 23:52:00

yeah, or you could do virtually the same thing with reflection, only in about 10 lines lol (damn you reflection).

This is basically for non-reflection scripts and for if and when reflection fails.