Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program new;
- {$I SRL/OSR.simba}
- {$I RSWalker/Walker.simba}
- var
- RSW:TRSWalker;
- t: Int64 := GetTickCount;
- procedure TRSWalker.MouseToNextPoint(myPos: TPoint);
- var
- i: Int32 := Self.FPathIdx;
- mmPos: TPoint;
- SlowMouse: TMouse;
- b: TBox;
- begin
- while (i < High(FPath)) and (myPos.DistanceTo(FPath[i+1]) < MM_RAD) do
- Inc(i);
- mmPos := FPath[i] - myPos + minimap.Center;
- mmPos := RotatePoint(mmPos, Minimap.GetCompassAngle(False), Minimap.Center.X, Minimap.Center.Y);
- SlowMouse := Mouse;
- SlowMouse.Speed := Random(6,10);
- b := Box(mmPos, Random(5,18), Random(5,18));
- SlowMouse.Move(b, False, rndSkewed);
- end;
- procedure onMove(sender: PRSWalker; var DoWait: Boolean);
- var
- flag: TPoint;
- dist: Int32;
- begin
- if (GetTickCount-t < srl.SkewedRand(0,30,700)) or (not Minimap.FindFlag(Flag)) then
- Exit();
- dist := Trunc(flag.DistanceTo(Minimap.GetMiddle));
- if InRange(dist, Random(5,10), Random(60,70)) then
- Sender^.MouseToNextPoint(sender^.GetMyPos());
- t := GetTickCount;
- end;
- begin
- RSW.Init('world.png');
- RSW.MemScanEnabled := True;
- RSW.onMoveEvent := @onMove;
- AddOnTerminate(@RSW.Free);
- RSW.WebWalk(P_FALADOR, 4, 0.3);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement