Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.20 KB | None | 0 0
  1. program new;
  2. {$I SRL/OSR.simba}
  3. {$I RSWalker/Walker.simba}
  4.  
  5. var
  6.   RSW:TRSWalker;
  7.   t: Int64 := GetTickCount;
  8.  
  9. procedure TRSWalker.MouseToNextPoint(myPos: TPoint);
  10. var
  11.   i: Int32 := Self.FPathIdx;
  12.   mmPos: TPoint;
  13.   SlowMouse: TMouse;
  14.   b: TBox;
  15. begin
  16.   while (i < High(FPath)) and (myPos.DistanceTo(FPath[i+1]) < MM_RAD) do
  17.     Inc(i);
  18.  
  19.   mmPos := FPath[i] - myPos + minimap.Center;
  20.   mmPos := RotatePoint(mmPos, Minimap.GetCompassAngle(False), Minimap.Center.X, Minimap.Center.Y);
  21.  
  22.   SlowMouse := Mouse;
  23.   SlowMouse.Speed := Random(6,10);
  24.   b := Box(mmPos, Random(5,18), Random(5,18));
  25.   SlowMouse.Move(b, False, rndSkewed);
  26. end;
  27.  
  28. procedure onMove(sender: PRSWalker; var DoWait: Boolean);
  29. var
  30.   flag: TPoint;
  31.   dist: Int32;
  32. begin
  33.   if (GetTickCount-t < srl.SkewedRand(0,30,700)) or (not Minimap.FindFlag(Flag)) then
  34.     Exit();
  35.  
  36.   dist := Trunc(flag.DistanceTo(Minimap.GetMiddle));
  37.   if InRange(dist, Random(5,10), Random(60,70)) then
  38.     Sender^.MouseToNextPoint(sender^.GetMyPos());
  39.  
  40.   t := GetTickCount;
  41. end;
  42.  
  43.  
  44. begin
  45.   RSW.Init('world.png');
  46.   RSW.MemScanEnabled := True;
  47.   RSW.onMoveEvent := @onMove;
  48.   AddOnTerminate(@RSW.Free);
  49.  
  50.   RSW.WebWalk(P_FALADOR, 4, 0.3);
  51. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement