Janilabo

function EvilTreeAt()

Apr 3rd, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.00 KB | None | 0 0
  1. function EvilTreeAt(treeName: string; x, y: Integer): Boolean; // Make sure treeName is exactly the same as in uptext! CASE-SENSITIVE
  2. var
  3.   p: TPoint;
  4.   t: Integer;
  5.   b: Boolean;
  6. begin
  7.   treeName := Trim(treeName);
  8.   Result := False;  
  9.   p := Point(x, y); // We create 'p' point of x,y coordinates
  10.   if ((treeName <> '') and PointInBox(p, RS07_GameActionBx) and RS07_LoggedIn) then // We check that point is inside main screen AND that we are logged in, before we continue.
  11.   begin    
  12.     t := GetSystemTime; // Timer reset
  13.     repeat    
  14.       case MSSL_MouseNearPt(p, 2) of // With this step we case the next action of.. If mouse is not near our point, we will move it to it.
  15.         True:                        // ..and else we will check for result.
  16.         if ((GetSystemTime - t) > 35) then // If time since mouse movement has been over 35 ms. then we can check for result...
  17.         begin
  18.           Result := RS07_IsUpTextCustom(('Chop down ' + treeName), [16777215, 65535], RS07_UpTextTol); // Is uptext with white and yellow as "Chop down *"? Result will be set as true, if it is...
  19.           if not Result then // OK, so result wasn't true, lets check for other texts...
  20.             b := (RS07_IsUpTextCustom(('Chop down ' + treeName), [16777215, 16776960], RS07_UpTextTol) or RS07_IsUpText('Walk here')); // If uptext is normal tree-text OR "Walk here", then variable 'b' will be set as true
  21.         end;
  22.         False:  
  23.         begin
  24.           case RS07_QuickObjectCheck of // If this MSSL variable is set as true, then...
  25.             True: SetMousePos(p.X, p.Y); // SetMousePos() will be used and else...
  26.             False: RS07_MoveMouse(p.X, p.Y); // Normal RS07_MoveMouse() movement!
  27.           end;    
  28.           t := GetSystemTime; // We mark the timer as current time (after movement)
  29.         end;
  30.       end;
  31.       MSSL_Wait(0); // MSSL_Wait with hotkey check!
  32.     until (Result or b or ((GetSystemTime - t) > 250)); // If this or this or this, then we are ready to break out!
  33.   end;
  34. end;
Advertisement
Add Comment
Please, Sign In to add comment