Results 1 to 5 of 5

Thread: Reflection Error

  1. #1
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default Reflection Error

    I've been working on a woodcutting script that chop two of the three oaks west of varrock. The Script is based on reflection, so I used the reflection function "ClickTree". This works fine, but it is not fast enough for me. I now want to write my own function to do this "ChopTree", but I keep getting a anoying error:

    [Error]: Access violation at address 00529714 in module 'scar.exe'. Read of address 00000228

    This is the function:
    Code:
    function ChopTree :Boolean  ;
    var
     x,y:Integer;
     MSPoint:Tpoint;
    begin
     if(GetObjectAt(3168,3421).objType = 1281) then
     begin
      MSPoint := TileToMS(Point(3168,3421),10);
      MMouse(MSPoint.x,MSPoint.y,5,5);
      wait(100+random(30));
      getMousePos(x,y);
      Mouse(x,y,0,0,true);
      Result:= true;
     end
     else
     begin
     if(GetObjectAt(3162,3417).objType = 1281) then
      begin
       MSPoint := TileToMS(Point(3162,3417),10);
       MMouse(MSPoint.x,MSPoint.y,5,5);
       wait(100+random(30));
       getMousePos(x,y);
       Mouse(x,y,0,0,true);
       Result:= true;
      end;
     end;
    end;
    Where the number 1281 is the ID of a oak tree.
    Where Point(3162,3417) and (3168,3421) are there Tiles.

    I want to check if the tree has already been cut, so I look at the tiles to check the ID number... but that line causes that error...

    Does anyone knows what I am doing wrong?

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    set GetObjectAt(tile.x,tile.y).objtype to a variable then check to see if it is the right id.

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    set GetObjectAt(tile.x,tile.y).objtype to a variable then check to see if it is the right id.
    Thanks Rep++

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    Thanks Rep++
    so it worked?

  5. #5
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Yes, it works really good

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •