From: theholyone
Hi,
Was just wondering if there was a way to keep current player within a tbox or something similar on the minimap in game?
so something like..
if player has moved away from box then
click (x,y)
Hate to ask without having to properly searched, but I won't be able to come back to the computer until tomorrow…
thanks in advanced and goodnight! working 36hrs with hopefully 3hrs of sleep is going to be fun
You can check if its coordinates sps.getplayerpos() which gives Tpoint is in box where you want to be.
For example code would look like:
if pointinbox(sps.getplayerpos(),BoxWhereYouWantItToBeInSpsMap) then blahblah else sps.blindwalk(PoinYouNeedToBeAt);
Other method i use for summoners is dtm. It is usefull if area is used to be small, map not always setted north as it is suspicious you everytime set norht to check if you in area and area you want to be is always visible in minimap. For this i use something similar like:
if finddtm(x,y,PosDtm,minimap.getbounds()) then
begin
if poinInBox(sps.pointToMainscreen(point(x,y),res),mainscreen.getbounds()) then mouse(res,mouse_left);
end
else failsafe();
Will post actual real code when ill be back from work at home. Real function looks like this:
function startPosition():boolean;
var
fx, fy, xb, yb,x,y: integer;
TPAB: tpointarray;
res: tpoint;
begin
if not isloggedin() then
exit;
result:=false;
inc(stpos);
if minimap.finddtm(POS_DTM, fx, fy) then //firsty tries use dtm if fails then failsafe using blindwalk
begin
smartimage.drawcross(point(fx, fy), 2, 255);
smartimage.drawcross(minimap.pointtomainscreen(point(fx, fy)), 10, 255);
writeln(distance(minimap.getcenterpoint(), point(fx, fy)));
if (distance(minimap.getcenterpoint(), point(fx, fy))) >= 12 then
begin
if (pointinbox(minimap.pointtomainscreen(point(fx, fy)), inttobox(200, 1, 575, 385)) or ((pointinbox(minimap.pointtomainscreen(point(fx, fy)), inttobox(3, 196, 211, 387))) ) )then //or (FindColorsSpiralTolerance(xb, yb, TPAB, 10326079, inttobox(265, 175, 315, 220), 6, colorSetting(2, 0.07, 0.22))))
begin
mouse(minimap.pointtomainscreen(point(fx, fy)), mouse_left);
wait(gaussrangeint(1200, 1750));
result:=true;
end else
begin
minimap.setAngle(gaussrangeint(30,60));
//result:=true;
end;
end else result:=true;
end
else //if dtm finding failed uses sps blindwalk.
begin
if (PointInBox(sps.getplayerpos(), inttobox(126, 114, 138, 134))) = false then //checks if player is within a //abox in map coordinates it should have been.
begin
Mainscreen.setAngle(ms_angle_high);
Sps_PosToMM(point(130, 126), sps.getplayerpos(), res);
if 0 >= (res.x) then
exit;
if PointInBox(minimap.pointstomainscreen([res])[0], inttobox(185, 1, 575, 388)) then
begin
mouse(minimap.pointstomainscreen([res])[0], mouse_left);
result:=true;
end
else
begin
Sps.walkPath([sps.getplayerpos(), point(130 + random( - 4, 4), 126 + random( - 4, 4))]);
end;
wait(random(785, 1486));
Minimap.waitPlayerMoving(random(1457, 2758));
result:=true;
end
else
begin
Mainscreen.setAngle(ms_angle_high);
//result:=true;
end;
end;
end;