Results 1 to 12 of 12

Thread: Setting DTM's but when going to use Error.

  1. #1
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default Setting DTM's but when going to use Error.

    Code:
    Error: Exception: The given DTM Index[296] doesn't exist at line 242
    Not a clue why, could it be tripping up on the calling?
    Mat



    ^^

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

    Default

    I need some code, probably the dtm couldn't be found in the memory.
    Working on: Tithe Farmer

  3. #3
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    I need some code, probably the dtm couldn't be found in the memory.
    I have like 20DTM's and I'm Pushing each one in to one function:
    Simba Code:
    PrayerPot :=DTMFromString('mlwAAAHicY2dgYJjKxMAwH4h7gXguEE8D4glA3APEwowQLALEPEAsDsRiQCwAxNYHJwB1M2HFGgy4ASMeDAUAA/AGdw==');
    Simba Code:
    Function DTMMouseInv(DTM:Integer; Item:String):Boolean;
    Simba Code:
    Var
      pX,pY:integer;
    begin
        Ftab(25);
      If FindDTM(DTM,pX,pY,MiX1,MiY1,MiX2,MiY2)then
      begin
    Simba Code:
    DTMMouseInv(PrayerPot,'PrayerPot');
    :/
    E:
    It works in my Banking Function, im not freeing it either, but it doesn't work in the inv function :/



    ^^

  4. #4
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Where/how are you declaring it before using it in DTMMouseInv()?

  5. #5
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Where/how are you declaring it before using it in DTMMouseInv()?
    I am Declaring all of them right at the start, the thing is It runs in my Banking Function No DTMFreeing in there, but all the other pots SuperStr etc work but only prayer pot fails, I have no idea why.
    :/
    Thanks
    Mat



    ^^

  6. #6
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Error: Exception: The given DTM Index[295] doesn't exist at line 1073
    The following DTMs were not freed: [0, 1, 2, 3, 4, 5, 'Prayerpot', 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, SRL - Lamp bitmap, 18]
    Wtf?
    Its there but its erroring?
    WTF?



    ^^

  7. #7
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Mat View Post
    Error: Exception: The given DTM Index[295] doesn't exist at line 1073
    The following DTMs were not freed: [0, 1, 2, 3, 4, 5, 'Prayerpot', 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, SRL - Lamp bitmap, 18]
    Hmm... It looks like that could be the problem right there. If PrayerPot was declared properly, it would be listed as #6 in the DTM array...

    Do a Ctrl+F for 'Prayerpot' and double check everything that comes up?

  8. #8
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Hmm... It looks like that could be the problem right there. If PrayerPot was declared properly, it would be listed as #6 in the DTM array...

    Do a Ctrl+F for 'Prayerpot' and double check everything that comes up?
    I have it called EpicPrayer and it find it for the BankingFunction, but for the Invent Function can i get it to work?
    Simba Code:
    DTMMouseInv(EpicPrayer ,'Prayer Pot');
    DTMMouseBank(EpicPrayer);
    ?



    ^^

  9. #9
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    I had this exactly problem on my frost dragon er
    Once I finish up here and I get home I'll post yjr solution
    Its horrible typing on this bphonr lull.

  10. #10
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Only way I got it to work is having one for each function, the only thing that is stopping my FDK I'm like how the?
    :/
    Mat



    ^^

  11. #11
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    My guess is that your freeing them but not reloading them.

    For example this will not work:
    Simba Code:
    begin
      loadDTMs
      repeat
        Mainloop;
        FreeDTMs;
      until not LoggedIn;
    end.

    But this will:
    Simba Code:
    begin
      repeat
        loadDTMs;
        Mainloop;
        FreeDTMs;
      until not LoggedIn;
    end.

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

    Default

    Memory leak.. You keep loading and loading on the same variable thus u get that multiple indices not freed..

    Simba Code:
    {$I SRL/SRL.Simba}

    var
      GlobalDTM: Integer;

    procedure LoadAllDTMs;
    begin
      GlobalDTM:= DTMFromString('Some Random Base64Code Here');
    end;

    Procedure FreeAllDTMs;
    begin
      FreeDTM(GlobalDTM);
    end;


    Function DTMMouseBox(Item: Integer; Uptexts: TStringArray; Box: TBox): Boolean;
    var
      X, Y: Integer;
    begin
      Result:= False;
      If FindDTM(Item, X, Y, Box.X1, Box.Y1, Box.X2, Box.Y2) then
      begin
        MMouse(X, Y, 5, 5);
        Result:= IsUptextMultiCustom(Uptexts);
        if Result then
          ClickMouse2(MOUSE_LEFT);
      end;
    end;

    begin
      SetupSRL;
      LoadAllDTMs;
      AddOnTerminate('FreeAllDTMs');

      DTMMouseBox(GlobalDTM, [''], MSBox);
      DTMMouseBox(GlobalDTM, [''], MIBox);
    end.
    I am Ggzz..
    Hackintosher

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
  •