NKN
2012-09-18 21:03:36
A few days ago I had an idea to make a new type of walking.
Edit:
Got a basic version of it to work. Still tuning it to be more accurate.
This is how it should work:
TPA starts at MMCX,MMCY
Generates a DDTM of the area around you inside the script itself, marking the center of the minimap. (Blocks out the white dot that you are by checking if a point is in the Minimap dot of your character.)
You then move, and it searches for said DDTM.
It checks the distance between the two, generating a point.
It can then walk using that point.
(Right now, this is as far as I got. It walks back to the starting spot every time.)
Things I intend to add:
Reverse the process, making it walk forward instead of back.
Make a function that tells you the tpoint that you should walk to.
Make a walkpath and walktopoint function much like SPS
I don't know if this will even work, it's in early development stage. Leave any ideas/tips below?
I wanted to try and make a new way to walk. SPS needs maps, and only works in some areas, if it doesn't you need to make a new map, which some users can't do.
RadialWalk and DDTM's take a long time to set up, and can fail.
ObjDTM's require things around you, and never really worked well for me when I tried to use it.(In the wilderness.)
Edit: Here's what I got so far. It doesn't have many failsafes, this is just two hours of me starting it. D:
Cheers. :garfield:
Edit:
Got a basic version of it to work. Still tuning it to be more accurate.
This is how it should work:
TPA starts at MMCX,MMCY
Generates a DDTM of the area around you inside the script itself, marking the center of the minimap. (Blocks out the white dot that you are by checking if a point is in the Minimap dot of your character.)
You then move, and it searches for said DDTM.
It checks the distance between the two, generating a point.
It can then walk using that point.
(Right now, this is as far as I got. It walks back to the starting spot every time.)
Things I intend to add:
Reverse the process, making it walk forward instead of back.
Make a function that tells you the tpoint that you should walk to.
Make a walkpath and walktopoint function much like SPS
I don't know if this will even work, it's in early development stage. Leave any ideas/tips below?
I wanted to try and make a new way to walk. SPS needs maps, and only works in some areas, if it doesn't you need to make a new map, which some users can't do.
RadialWalk and DDTM's take a long time to set up, and can fail.
ObjDTM's require things around you, and never really worked well for me when I tried to use it.(In the wilderness.)
Edit: Here's what I got so far. It doesn't have many failsafes, this is just two hours of me starting it. D:
program new;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/misc/SmartGraphics.simba}
{$i SPS/SPS.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..2] of TDTMPointDef;
TempTDTM: TDTM;
SB : TBox;
TP,TP1 : TPoint;
begin
SB := IntToBox(MMCX - 7,MMCY - 7,MMCX + 7,MMCY + 7);
repeat
TP.x := randomRange(SB.X1,SB.X2);
TP.y := randomRange(SB.y1,SB.y2);
until(not(PointInBox(TP,IntToBox(625,133 - 50,629,137 - 50))))
dtmMainPoint.x := TP.x;
dtmMainPoint.y := TP.y;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := GetColor(TP.x,TP.y);
dtmMainPoint.Tolerance := 15;
SMART_DrawDot(True,TP,clPurple);
TP1.x := TP.x + randomrange(5,12);
TP1.y := TP.y + randomrange(5,12);
dtmSubPoints[0].x := TP1.x;
dtmSubPoints[0].y := TP1.y;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := GetColor(TP1.x,TP1.y);
dtmSubPoints[0].Tolerance := 15;
TP1.x := TP.x - randomrange(5,12);
TP1.y := TP.y - randomrange(5,12);
SMART_DrawDot(False,TP1,clPurple);
dtmSubPoints[1].x := TP1.x;
dtmSubPoints[1].y := TP1.y;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := GetColor(TP1.x,TP1.y);
dtmSubPoints[1].Tolerance := 15;
TP1.x := TP.x - randomrange(5,12);
TP1.y := TP.y - randomrange(-5,5);
SMART_DrawDot(False,TP1,clPurple);
dtmSubPoints[2].x := TP1.x;
dtmSubPoints[2].y := TP1.y;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := GetColor(TP1.x,TP1.y);
dtmSubPoints[2].Tolerance := 15;
SMART_DrawDot(False,TP1,clPurple);
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
procedure GetMyPos;
var
x,y,xp,yp,tx,ty,i,theWalk:integer;
myPos,op:TPoint;
theAngle:Extended;
begin
myPos := Point(0,0);
theWalk:=SetDDTM;
if(FindDTMRotated(theWalk,xp,yp,MMCX - 13,MMCY - 13,MMCX + 13,MMCY + 13,-pi/2,pi/2,0.1,theAngle)) then
begin
FindSymbol(tx,ty,'Bank');
Mouse(tx,ty,4,4,1);
FFlag(0);
while(isMoving) do
begin
wait(100);
end;
if(FindDTMRotated(theWalk,x,y,MMX1,MMY1,MMX2,MMY2,-pi/2,pi/2,0.1,theAngle)) then
begin
myPos.x :=myPos.x + (x - xp)
mypos.y := myPos.y + (y - yp)
writeln(ToStr(myPos) + 'dsfads');
mouse(MMCX + (mypos.x),MMCY + (mypos.y),1,1,1);
end;
end;
end;
function WalkToSpot:Boolean;
var
x,y,i,theWalk:integer;
FoundDTM:Boolean;
theAngle:Extended;
begin
theWalk:=SetDDTM;
SMART_DrawBoxEx(True,False,IntToBox(MMCX - 13,MMCY - 13,MMCX + 13,MMCY + 13),clRed);
if(FindDTMRotated(theWalk,x,y,MMCX - 13,MMCY - 13,MMCX + 13,MMCY + 13,-pi/2,pi/2,0.1,theAngle)) then
begin
FreeDTM(theWalk);
result := true;
mouse(x,y,1,1,1);
FFlag(0);
While(IsMoving) do
Wait(100);
end;
end;
procedure Mainloop;
begin
GetMyPos;
end;
begin
{$IFDEF SMART}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
Mainloop;
end.Cheers. :garfield:
Mmm:

