Results 1 to 12 of 12

Thread: why does this crash my simba?

  1. #1
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default why does this crash my simba?

    i have this function (MyFindBirdNest) which i made for my vine vanquisher, but it seems to crash my simba after being called about 30 times, but i cannot reproduce it if i run the function by itself

    i know it is the function because if i comment out the line that calls it then simba doesn't crash

    here are the functions
    SCAR Code:
    function AddGroundItemArrays(Array1, Array2: TGroundItemArray): TGroundItemArray;
    var
      x, y, z: Integer;
    begin
      x:= Length(Array1);
      y:= Length(Array2);
      SetArrayLength(Result, x+y);

      for z:= 0 to High(Array1) do
        Result[z]:= Array1[z];

      for z:= 0 to y-1 do
        Result[(x+y)-(y-z)]:= Array2[z];
    end;

    function GetItemsInBox(Box: TBox): TGroundItemArray;
    var
      x, y: Integer;
      Temp: TGroundItemArray;
    begin
      for x:= Box.X1 to Box.X2 do
        for y:= Box.Y1 downto Box.Y2 do
        begin
          Temp:= GetItemsAt(Tile(x, y));
          Result:= AddGroundItemArrays(Result, Temp);
        end;
    end;

    function MyFindBirdNest: Boolean;
    var
      GroundItems: TGroundItemArray;
      i: Integer;
      BirdNestLoc: TTile;
    begin
      if Debug then
        Writeln('Searching for birds nest');
      GroundItems:= GetItemsInBox(Box);
      for i:=0 to High(GroundItems) do
        if (GroundItems[i].ID > 5069) and (GroundItems[i].ID < 5076) then
        begin
          writeln('found birds nest');
          writeln('picking up birds nest');
          BirdNestLoc:= TileToMS(GroundItems[i].Tile, 0);
          Mouse(BirdNestLoc.x, BirdNestLoc.y, 0, 0, False);
          Wait(250+Random(500));
          if ChooseOptionMulti(['ake', 'ird', 'est']) then
          begin
            Result:= True;
            writeln('picked up birds nest :)');
            Break;
          end;
        end;
      if Debug then
        Writeln('Finished searching for birds nest');
    end;

    if you have any idea what is causing it then i would be very greatful

    ~shut
    Last edited by Shuttleu; 07-30-2010 at 10:02 AM.

  2. #2
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You didn't say which function was the one causing it.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    This looks like your Simba is on crack. Try kicking him out of your computer and getting a new Simba to live in your Hard drive. If that doesn't work I hope someone else can because I see nothing wrong with this code.

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

    Default

    Try removing all reflection related code and see if it still happens.



    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)

  6. #6
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Perhaps the outdated hooks are killing Simba.

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

    Default

    Let me just state that whatever happens in libsmart is not Simba's fault. If the libsmart.dll segfaults / AV's then that will crash Simba (at least the script thread). Nothing you can do about it, that's what you get when using plugins.



    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)

  9. #9
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Ground item finding has a leak inside of SMART. We don't know what causes it, but its not in the reflection include its inside SMART itself. This is why I haven't used it because it can't be fixed by normal means.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  10. #10
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Ground item finding has a leak inside of SMART. We don't know what causes it, but its not in the reflection include its inside SMART itself. This is why I haven't used it because it can't be fixed by normal means.
    damn, any ideas on what else i can use to find the bird nest one the floor using reflection?

    ~shut

  11. #11
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  12. #12
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Um of course not it is ground item finding..just use color.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

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
  •