Results 1 to 21 of 21

Thread: Object Finding.. Out of Memory :(

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default Object Finding.. Out of Memory :(

    Why does this give me Out of Memory error... It makes me have to restart simba in order to run the script again... It runs out of memory after 3 rocks :S

    Simba Code:
    Procedure FindRock1;
    var
    RockObj : TRSObject;
    Rock: TTile;
    RockLoc: TTile;
    Me:TMe;

    begin
    Me := GetMe;
    RockObj := GetObjectByID (3803, OBJECT_TYPE_INTERACTABLE, 52);
    If(FindRSObjectSimple(RockObj) = True) then
    begin
    Repeat
      Writeln('The First rock is found!');
      wait(500);
      Mouse(RockObj.Tile.x, RockObj.Tile.y, 2, 2, True);
      Writeln('Clicked the first rock.');
      writeln ('Climbed down the First Rock!');
    Until((Me.Animation = 740) or (Me.Animation = 739));
    end else
    begin
      wait(500);
      RockLoc := Tile(2885, 3683);            //Rock Position Tile
      Rock := TileToMS (RockLoc, 0);

      Mouse (Rock.x, Rock.y, 2, 2, false);
      if R_ChooseOption ('Climb Rocks') then
      begin
        writeln ('Climbed down the First Rock!');
      end else
      writeln('Cannot Find the First Rock!');
    end;
    end;

    And can someone explain why this doesnt work?

    Simba Code:
    Procedure TrollHeimWalk2;
    var
    TTroll2: TTileArray;
    Me: TTile;

    begin
    Me:= GetMyPos;           //(2884,3683)
    //Repeat
      TTroll2 := [Tile(2881,3686), Tile(2874,3677), Tile(2874,3669), Tile(2872,3671)];
      WalkPath(TTroll2);
    //Until((Me.x = 2872) and (Me.y = 3671));
    end;
    I am Ggzz..
    Hackintosher

  2. #2
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Reflection has memory leaks. I'd suggest restarting and trying again. You may not have enough memory anyway, though. Dunno.

    Specs?

  3. #3
    Join Date
    Dec 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try out RRL!

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Reflection has memory leaks. I'd suggest restarting and trying again. You may not have enough memory anyway, though. Dunno.

    Specs?
    3GB Ram DDR3, 64bit, Dual Core 500gb HDD.. :S

    So nothing is wrong with my functions right??
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Try restarting and see if it gives the out of memory error. And are you using a vm?

    And from a quick glance I don't see anything really "wrong." I'm pretty tired and haven't done any srl/reflection stuff in awhile though, so don't trust me.

    What do you mean by it doesn't work? Does it not click? Does it just end? Does it walk the wrong way?

    And are you sure you picked the tiles correctly?

  6. #6
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Try restarting and see if it gives the out of memory error. And are you using a vm?

    And from a quick glance I don't see anything really "wrong." I'm pretty tired and haven't done any srl/reflection stuff in awhile though, so don't trust me.

    What do you mean by it doesn't work? Does it not click? Does it just end? Does it walk the wrong way?

    And are you sure you picked the tiles correctly?
    Nope.. Just one operating system.. Windows 7.. And as for the walk function not working, It doesnt move the character at all... It stays there forever..
    I am Ggzz..
    Hackintosher

  7. #7
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Yes, Reflection's objects leak pretty bad. For now, if the object is in a static location, try using TileToMS?


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  8. #8
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Harry View Post
    Yes, Reflection's objects leak pretty bad. For now, if the object is in a static location, try using TileToMS?
    KK ty alot.. And Harry, How would I then Detect if a door is open or closed if its leaking like that..

    P.S. I learned a lot of coding from reading your scripts.
    I am Ggzz..
    Hackintosher

  9. #9
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Doors are tricky. You could solve it like color does (Reflection and color can be combined easily). Glad my scripts help :P


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  10. #10
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Is there anyway you can detect whether a door is open or closed? If so what is the best way to open/close it?
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

  11. #11
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    With reflection I believe the door just has a diff. ID? And with colour you might be able to check whether the option is "Open" (so the door is closed) or "Close" (so it's open).
    Ce ne sont que des gueux


  12. #12
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Doors can be done via color as well if you're using an exact door location every time in your script and if your camera is facing a certain angle, then you can search for the brown'ish colors and if they're in a certain position (where they'd be if it was closed) AND if the uptext is "Open" then the door is closed and we call to click it for opening, and if the brown colors are slightly to the left/right of the close position AND the uptext is "Close", then we're fine. Just have to use a little imagination.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  13. #13
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Doors are pretty easy. Just use OpenDoor in Reflection folder ( Of course modification is needed, because mostly Doors are NOT Interactable Object. )

    Just use Other kind of Object type ( WALL_OBJECT )


    ~Home


    EDIT: Get the ids From PowerBöt.

  14. #14
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Here's a simple object finding script for Simba, I forget who wrote this but if I remember the name I'll post it here. Basically run this and stand next to the object you want to get the ID of and it'll give you the object's ID and the X/Y tile, it must be directly North/East/South/West of your position, for example not NE/SW.

    Simba Code:
    program ObjectFinder;
    {$DEFINE SMART}
    {$i srl\srl.scar}
    {$i reflection\reflection.simba}

    const
    {---SMART Setup Constants---}
      WORLD = 32;
      MEMBERS = false;
      SIGNED = true;
    {---------------------------}

    var
      NPCs: TNPCArray;
      i, ii, x, y: Integer;
      FishTP : TPoint;
      Me: TMe;

    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      With Players[0] Do
      Begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;
        Integers[0] := 0;
        Pin := '';
      End;
    End;

    // Get objects near you
    //function GetInteractObjIDAdjacent (Tile : TTile) : Integer;
    procedure FindObjNear;
    var myObj : TRSObject;
        myTile, newTile : TTile;
        i : Integer;
    begin
      if not LoggedIn then exit;
      myTile := GetMyPos;
      writeln ('[--Objects--]');
      newTile := Tile((myTile.x-1),myTile.y);
      MyObj := GetObjectAt(newTile, OBJECT_TYPE_INTERACTABLE);
        if MyObj.ID > 0 then
          begin
          writeln ('(W)');
          writeln ('ID: '+inttostr(MyObj.ID)+', Tile('+inttostr(MyObj.Tile.x)+','+inttostr(MyObj.Tile.y)+')');
          end;

      newTile := Tile((myTile.x),myTile.y-1);
      MyObj := GetObjectAt(newTile, OBJECT_TYPE_INTERACTABLE);
        if MyObj.ID > 0 then
          begin
          writeln ('(S)');
          writeln ('ID: '+inttostr(MyObj.ID)+', Tile('+inttostr(MyObj.Tile.x)+','+inttostr(MyObj.Tile.y)+')');
          end;

      newTile := Tile((myTile.x+1),myTile.y);
      MyObj := GetObjectAt(newTile, OBJECT_TYPE_INTERACTABLE);
        if MyObj.ID > 0 then
          begin
          writeln ('(E)');
          writeln ('ID: '+inttostr(MyObj.ID)+', Tile('+inttostr(MyObj.Tile.x)+','+inttostr(MyObj.Tile.y)+')');
          end;

      newTile := Tile((myTile.x),myTile.y+1);
      MyObj := GetObjectAt(newTile, OBJECT_TYPE_INTERACTABLE);
        if MyObj.ID > 0 then
          begin
          writeln ('(N)');
          writeln ('ID: '+inttostr(MyObj.ID)+', Tile('+inttostr(MyObj.Tile.x)+','+inttostr(MyObj.Tile.y)+')');
          end;
    end;



    procedure MainLoop;
    begin
      if not LoggedIn then exit;
      SetAngle (true);
      MakeCompass ('n');
      SetRun (true);
      wait (random(500));
      repeat
        FindObjNear;
        wait (1000);
        cleardebug;
      until (false)
    end;

    begin
      Smart_Members := MEMBERS;
      Smart_Server := WORLD;
      Smart_Signed := SIGNED;
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      cleardebug;
      MainLoop;
    end.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  15. #15
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    I think it was either Cstrike or Naike who wrote that program. Anyways, I still think this is a problem with the "secondlevelobject_GetID" hook. Have you tried using the debugging version of Simba to see what was going on?

  16. #16
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I think you might be right Echo, "secondlevelobject_GetID" is in the 'D' file I guess you call it? And it just so happens my most common error involved with crashing Simba/Smart was "Field not found: d". I get swarmed with this and eventually "formWriteln: Error: Exception: Out of memory at line 83" which crashes Smart and so on...

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  17. #17
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I think you might be right Echo, "secondlevelobject_GetID" is in the 'D' file I guess you call it? And it just so happens my most common error involved with crashing Simba/Smart was "Field not found: d". I get swarmed with this and eventually "formWriteln: Error: Exception: Out of memory at line 83" which crashes Smart and so on...
    Well its in the jh class, but the field name is int d. I have been fooling around with it a little, changing the name of the hook in hooks.simba, but the memory issue is still there. Isn't it convenient that when a double xp weekend comes around, all of a sudden we have issues reading object IDs from the client? Damn Jagex.

  18. #18
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    We (Harry, Ben, I) fixed a memory leak, I'll merge it to srl-reflection soon.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  19. #19
    Join Date
    Feb 2008
    Posts
    748
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    We (Harry, Ben, I) fixed a memory leak, I'll merge it to srl-reflection soon.
    Beat you to it :P

  20. #20
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by pyroryan View Post
    Beat you to it :P
    Cool.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  21. #21
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Yeah... Ive been wondering about FindRsObjectSimple... everytime I try using it ... it doesnt find the object but when I use getobjectbyid its successful.
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

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
  •