Results 1 to 4 of 4

Thread: Error: Exception: The given DTM Index[0] doesn't exist

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default Error: Exception: The given DTM Index[0] doesn't exist

    I don't understand why I am getting this error. It can't find the 'Cure_me' DTM


    Simba Code:
    program AutoCure;
    {$i srl/srl.simba}
    {$include SoulSplit/SoulInclude.simba}

    var
      SpellCasted: Integer;
      SpellAmount: string;

    procedure CureMe;
    var
      X, Y: integer;
    begin
      if FindDTM(Cure_Me, x, y, SS_IX, SS_IY, SS_IX2, SS_IY2) then
      begin
        mmouse(x, y, 1, 1);
        wait(randomrange(5, 10));
        clickmouse2(mouse_Left);
        IncEx(SpellCasted, 1);
        wait(randomrange(5, 25));
      end;
    end;

    procedure ClickSpellBook;
    var
      X, Y: integer;
    begin
      if FindDTM(Tab_Spell, x, y, SS_WSX, SS_WSY, SS_WSX2, SS_WSY2) then
      begin
        mmouse(x, y, 1, 1);
        wait(randomrange(100, 200));
        clickmouse2(mouse_Left);
        wait(randomrange(600, 800));
        CureMe;
      end;
    end;

    procedure CheckSpellBook;
    var
      X, Y: integer;
    begin
      if (FindDTM(Cure_Me, x, y, SS_IX, SS_IY, SS_IX2, SS_IY2) = false) then
      begin
        ClickSpellBook;
      end;
      CureMe;
    end;

    procedure AskSpellCast;
    begin
      if (InputQuery('How many spells would you like to cast?', 'Amount:', SpellAmount)) then
        CheckSpellBook;
    end;

    begin
      AskSpellCast;
      repeat
        CheckSpellBook;
      until (StrToInt(SpellAmount)) <= SpellCasted;
    end.


    I have it included in my skills include:

    Simba Code:
    Var
      Raw_Shark, Raw_RockTail, Raw_Manta: Integer;
      Cook_Shark, Cook_RockTail, Cook_Manta: Integer;
      Tab_Cb, Tab_Skills, Tab_Inventory, Tab_Wear:Integer;
      Tab_Pray, Tab_Spell:Integer;
      Cure_Me:Integer;
    Procedure SI_SetDTMs;
    begin
      // Cooking and fishing
      Raw_Shark := DTMFromString('mggAAAHicY2NgYChmYmDIBeIiIK6A4jwg/gqU+wXEv4H4JwOE/xmI68vLGcpycxhqS0sZpvd0g/k5qakMnEA5bJgRB4YAAJdAET4=');
      Raw_RockTail := DTMFromString('mggAAAHicY2NgYFjAxMCwEIiXAvFiIJ4DxLOB+DdQ7gsQ/wRiBkYGhn9A6jsQm+tKMhhoSjI4BDkwpDelM2jKSTJ42WsycALlsGFGHBgCAJrSDRA=');
      Raw_Manta := DTMFromString('mggAAAHicY2NgYChlYmAoAeIaIK4E4iIgzgViB0YGBisgtgNiVyB2B2JbIE7LmcGQkjmFwdUzjSEyvo0hIa2fIatoPgMn0CxsmBEHhgAA5cIMYA==');

      Cook_Shark := DTMFromString('mggAAAHicY2NgYJjHxMCwCIjnAvFMIJ4FxEuBWJaRgUESiCWgWA6IFYA4M9CKYVZdBkNHQQxDf1kCmL+6t4SBE2gWNsyIA0MAAAV5DHs=');
      Cook_RockTail := DTMFromString('mbQAAAHicY2VgYDjDxMBwCogvAPFpID4KxH+A4l+A+CcQMzIyMPwG0laSDAyh9hwM5XHxDJ05uQzVMbwMnEBxdMyIBYMBAK45DIc=');
      Cook_Manta := DTMFromString('mggAAAHicY2NgYChkYmAoBeJ8IM6C0iD+Q6DcEyi+D8R3gPgeEBeHOzDEe5qB6YoYZ4aCUFuGMAd9Bk6gHDbMiANDAACxLg4E');
      // Tabs
      Tab_Cb := DTMFromString('mwQAAAHic42RgYFBkYmDQgGIZIJYCYgUgVmeCyEkA8Q6gug1AvB+I90LZ64F4OxDvA+JtQFyTH8Lw6+9vhmVmAgwfukXA7Ekt+QwxIZ4MydE+DJ216QycQHWEMCMRGA4AKgYWng==');
      Tab_Skills := DTMFromString('mbQAAAHicY2VgYPBgYmBwB2IHIA6Ass8BxY8B8XkgvgDEl4E4aFIcw6wL/Qw7nZwYTOY/BvN5gOLomBELBgMAbcsNLQ==');
      Tab_Inventory := DTMFromString('mlwAAAHicY2dgYOhmguDJUNwFxC1A3ArE54Hyx4D4JAOEfRlKg/gyPKwMa4rVGObEqjK4qQgw1HpJAUUZwWxOIAsXZsSDoQAA0yAOKQ==');
      Tab_Wear := DTMFromString('mggAAAHicY2NgYFjLBMEboPQyKD4HlDvOAKEvAfFFID4FxNLSkgxT56xmcLCyALMzSysYJs2ZysANlMOGGXFgCAAAOtgPcw==');
      Tab_Pray := DTMFromString('mlwAAAHicY2dgYDjNxMBwBojPA/ElKPsEEB8H4nNA+WNAfJIBwr4ExBdAeoD419/fDIdu3WYwDo8Cs0G45fAhMJ8TKI8LM+LBUAAAD0UapQ==');
      Tab_Spell := DTMFromString('mlwAAAHicY2dgYHjLxMDwBog/A/EnIH4HxM+g+BxQ/hgQnwLiC0B8BYgvAfFpIM70VAOSjAzTiizAuCdHh6E9WImhtSqVgRMogwsz4sFQAADn1RNQ');
      // Spells
      Cure_Me := DTMFromString('mbQAAAHicY2VgYJBiZmCQBGIFIJYGYhEgtmFiYDAFYmsgdmSC8MNv6DHMuFMDpo3PMoAxJwMmZsSCwQAAGVUIpg==');
    end;
    Procedure FreeSI;
    begin
      FreeDTM(Raw_Shark);
      FreeDTM(Raw_RockTail);
      FreeDTM(Raw_Manta);
      FreeDTM(Cook_Shark);
      FreeDTM(Cook_RockTail);
      FreeDTM(Cook_Manta);
      FreeDTM(Tab_Cb);
      FreeDTM(Tab_Skills);
      FreeDTM(Tab_Inventory);
      FreeDTM(Tab_Wear);
      FreeDTM(Tab_Pray);
      FreeDTM(Tab_Spell);
      FreeDTM(Cure_Me);
    end;

    Procedure SetupSoulInclude;
    begin
      AddOnTerminate('FreeSI');
      SI_SetDTMs;
      Writeln('SoulInclude setup');
    end;



    Why is it saying it does not exist?

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    procedure/function definitions must be executed before they have any effect. When you include a module, only the function names are stored to the global symbol table, but their contents are not automatically executed (for obvious reasons).

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    procedure/function definitions must be executed before they have any effect. When you include a module, only the function names are stored to the global symbol table, but their contents are not automatically executed (for obvious reasons).
    So.. what did I do wrong?

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Lol I got it I forgot to add

    Simba Code:
    SetupSoulInclude;

    lol

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
  •