Janilabo

function EvilTreeAt()

Apr 3rd, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.03 KB | None | 0 0
  1. function EvilTreeAt(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.   a: TStrArray;
  7. begin
  8.   Result := False;  
  9.   p := Point(x, y); // We create 'p' point of x,y coordinates
  10.   if (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.     a := ['Chop down Tree', 'Chop down Oak', 'Chop down Willow', 'Chop down Maple', 'Chop down Yew', 'Chop down Magic tree'];    
  13.     t := GetSystemTime; // Timer reset
  14.     repeat    
  15.       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.
  16.         True:                        // ..and else we will check for result.
  17.         if ((GetSystemTime - t) > 35) then // If time since mouse movement has been over 35 ms. then we can check for result...
  18.         begin
  19.           Result := RS07_IsUpTextCustomEx(a, [16777215, 65535], RS07_UpTextTol); // Is uptext with white and yellow as "Chop down *"? Result will be set as true, if it is...
  20.           if not Result then // OK, so result wasn't true, lets check for other texts...
  21.             b := (RS07_IsUpTextCustomEx(a, [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
  22.         end;
  23.         False:  
  24.         begin
  25.           case RS07_QuickObjectCheck of // If this MSSL variable is set as true, then...
  26.             True: SetMousePos(p.X, p.Y); // SetMousePos() will be used and else...
  27.             False: RS07_MoveMouse(p.X, p.Y); // Normal RS07_MoveMouse() movement!
  28.           end;    
  29.           t := GetSystemTime; // We mark the timer as current time (after movement)
  30.         end;
  31.       end;
  32.       MSSL_Wait(0); // MSSL_Wait with hotkey check!
  33.     until (Result or b or ((GetSystemTime - t) > 250)); // If this or this or this, then we are ready to break out!
  34.   end;
  35. end;
Advertisement
Add Comment
Please, Sign In to add comment