Results 1 to 20 of 20

Thread: DTM help xD

  1. #1
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default DTM help xD

    Hi again

    Thanks for the great responses on my other threads- i may not post, but I definitely read through all the responses

    Now, I was wondering what is wrong with this bit of code here:

    Simba Code:
    function WithdrawPieShell: boolean;
     var
      x, y, PieShell: Integer;
    begin
     Result := (false);
     Result := (FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2));
    begin
    PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
           'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
           '0F0904');
    begin
    if (invcount > 0) then
    depositall;
    if (invcount = 0) then
    begin
    if FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    repeat
    Mouse (x, y, 0, 0, False);
    ChooseOption ('ithdraw-7');
    until (invcount = 7);
    if (invcount = 7) then
    end;
    if result = (false) then
    Writeln ('failed to find pie shell dtm :(');
    end;
    freeDTM(PieShell);
    end;
    end;
    end;

    If you notice 'Writeln ('failed to find pie shell dtm ');' well, my whole debug box is filled with that I am trying to remove 7 pie shells from the bank, and i can't find anything wrong with it :'(
    Edit: I made the DTM today! And they don't change :O it can't be wrong; maybe the 'MIX1, MIY1, MIX2, MIY2' is searching in the wrong place- i really don't know

    Thanks for any help XD
    Last edited by i need to bot!; 01-19-2012 at 11:42 PM.

  2. #2
    Join Date
    Feb 2011
    Location
    Earth
    Posts
    1,784
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You have to call the DTM from string stuff before you search for it.

    Currently: Working on Defending&Attacking in my Castle-Wars Script
    Project Rebuild: 90M/170M

  3. #3
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by i need to bot! View Post
    Hi again

    Thanks for the great responses on my other threads- i may not post, but I definitely read through all the responses

    Now, I was wondering what is wrong with this bit of code here:

    Simba Code:
    function WithdrawPieShell: boolean;
     var
      x, y, PieShell: Integer;
    begin
     Result := (false);
     Result := (FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2));
    begin
    PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
           'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
           '0F0904');
    begin
    if (invcount > 0) then
    depositall;
    if (invcount = 0) then
    begin
    if FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    repeat
    Mouse (x, y, 0, 0, False);
    ChooseOption ('ithdraw-7');
    until (invcount = 7);
    if (invcount = 7) then
    end;
    if result = (false) then
    Writeln ('failed to find pie shell dtm :(');
    end;
    freeDTM(PieShell);
    end;
    end;
    end;

    If you notice 'Writeln ('failed to find pie shell dtm ');' well, my whole debug box is filled with that I am trying to remove 7 pie shells from the bank, and i can't find anything wrong with it :'(

    Thanks for any help XD
    You should use standards, then it will be easier for all of us to read, but it seems to me that you have created a DTM which script cannot find, have you read the tutorials? Here's a good one.

    ~Eerik.

    E: I was ninjad by better answer, here's how you should do it:
    Code:
    begin
      Result := (false);
      PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
          'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
          '0F0904');
      Result := (FindDTM(PieShell, x, y, MIX1, MIY1, MIX2, MIY2));

  4. #4
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, but I still get the error; I'll try again tommorow

  5. #5
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    You really should work or standards ,if you want help ,show us clear code.

    Simba Code:
    function WithdrawPieShell: boolean;
    var
      x, y, PieShell: Integer;
    begin
      Result := (false);      // you dont need this line , boolean is always false ,when created
      Result := (FindDTM(PieShell, x, y, MIX1, MIY1, MIX2, MIY2)); // This line is before you even define DTM :) So it's searching for DTM which is empty! = always false
      begin
        PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' + 'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' + '0F0904');
        begin
          if (invcount > 0) then
            depositall;
          if (invcount = 0) then           // you can use 'else' instead of second 'if'
          begin
            if FindDTM(PieShell, x, y, MIX1, MIY1, MIX2, MIY2) then
            begin
              repeat
                Mouse(x, y, 0, 0, False);
                ChooseOption('ithdraw-7');
              until (invcount = 7);
              if (invcount = 7) then
             end;
              if result = (false) then       // According to what you did at beginning ,result will be always false
                Writeln('failed to find pie shell dtm :(');
            end;
            freeDTM(PieShell);
          end;
        end;
      end;

  6. #6
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Code:
    function WithdrawPieShell: boolean;
     var
      x, y, PieShell: Integer;
    begin
      Result := false;
      PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
             'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
             '0F0904');
      if (invcount > 0) then
        depositall;
      if FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        repeat
          Mouse(x, y, 3,3, False);
          ChooseOption ('ithdraw-7');
        until (invcount = 7);        //add failsafe
      end;
      if (not(result)) then
        Writeln ('failed to find pie shell dtm :(');
      freeDTM(PieShell);
    end;
    its a little better now. couldn't spend too much time on it.
    Last edited by x[Warrior]x3500; 01-20-2012 at 03:02 AM.

  7. #7
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Awesome, thanks for the help... but it still doesn't find the DTM

  8. #8
    Join Date
    Jun 2007
    Location
    Greenville, SC
    Posts
    1,149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Pay attention, I'm going to blow your mind. :P jk
    The reason it is not being found is because I believe you said your trying to get it from the bank? MIX1 and other variations of MI stand for main inventory. The bank screen is in the main screen aka MS. Example MSX1. Now there is also MCX1 which would be the chat box. I hope I solved the problem and good luck.

  9. #9
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Runescape Pro View Post
    Pay attention, I'm going to blow your mind. :P jk
    The reason it is not being found is because I believe you said your trying to get it from the bank? MIX1 and other variations of MI stand for main inventory. The bank screen is in the main screen aka MS. Example MSX1. Now there is also MCX1 which would be the chat box. I hope I solved the problem and good luck.
    ^Awesome, that was exactly what i was looking for but...

    now i get:

    Simba Code:
    Warning! You passed wrong values to a finder function: ys > ye (515,337). Swapping the values for now.
    Warning! You passed a wrong ye to a finder function: 515. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.

    :O i mean, wth

    btw, im using

    Simba Code:
    if FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2) then
    begin
    Writeln ('found pie shell dtm :)');

    god i fail

  10. #10
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by i need to bot! View Post
    ^Awesome, that was exactly what i was looking for but...

    now i get:

    Simba Code:
    Warning! You passed wrong values to a finder function: ys > ye (515,337). Swapping the values for now.
    Warning! You passed a wrong ye to a finder function: 515. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.

    :O i mean, wth

    btw, im using

    Simba Code:
    if FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2) then
    begin
    Writeln ('found pie shell dtm :)');

    god i fail

    Should be:
    Simba Code:
    if FindDTM(PieShell, x, y, MSX1, MSY1, MSX2, MSY2) then
    begin
    Writeln ('found pie shell dtm :)');

    See the difference?

  11. #11
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Actually took some time to spot the difference

    still get this though

    Warning! You passed wrong values to a finder function: ys > ye (515,337). Swapping the values for now.
    Warning! You passed a wrong ye to a finder function: 515. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.

  12. #12
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Are you using that code anywhere else in your script? I dont think this part gives the warning anymore after you have changed it to what ive posted

  13. #13
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It still has

    Writeln ('found pie shell dtm ');

    well, here is the rest of my script:

    Simba Code:
    program MehScript;

    {$DEFINE Smart}
    {$i srl/srl.simba}

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name      := '';
      Players[0].Pass      := '';
      Players[0].Nick      := '';
      Players[0].Pin       := '';
      Players[0].Active    := true;
      LoginPlayer
    end;

    var
      x, y: integer;

    function WithdrawPieShell: boolean;
     var
      x, y, PieShell: Integer;
    begin
      Result := (false);
      PieShell := DTMFromString('78DA639CCAC0C050C98002E696BB816946289' +
           'FF10390686640034C286A00BFF403E2');
      Result := (FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2));
    begin
    if (invcount > 0) then
    depositall;
    if (invcount = 0) then
    begin
    if FindDTM(PieShell, x, y, MSX1, MSY1, MSX2, MSY2) then
    begin
    Writeln ('found pie shell dtm :)');
    if result = (false) then
    begin
    Writeln ('not found pie shell');
    repeat
    Mouse (x, y, 0, 0, False);
    ChooseOption ('ithdraw-7');
    until (invcount = 7);
    if (invcount = 7) then
    end;
    end;
    freeDTM(PieShell);
    end;
    end;
    end;


    function WithdrawStrawberry: boolean;
     var
      x, y, Strawberry: Integer;
    begin
     Result := (false);
     Result := (invcount = 7);
      Strawberry := DTMFromString('78DA638C616060C86240018BAD8CC1342394C' +
           'F5800240E30A0012654351540E2100135F540620701350D406223' +
           '01355D40620101351D40622501351381C444026A26038999F8D50' +
           '0003DBF0B74');
    begin
    if FindDTM(Strawberry, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    if isuptext ('strawberry') then
    begin
    repeat
    Mouse (x, y, 0, 0, False);
    ChooseOption ('ithdraw-7');
    until (result);
    end;
    if (false) then
    begin
    if FindDTM(Strawberry, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    Mouse (x, y, 0, 0, False);
    ChooseOption ('ithdraw-7');
    end;
    end;
    end;
    end;
    end;



    procedure WithdrawCookingApple;
    var
      x, y, CookingApple: Integer;
    begin
    CookingApple := DTMFromString('78DA630C626060B0624001DCBEBC609A11CA6' +
           '79C05249218D00013AA9AD940229A809A45402200BF1A004C6C03' +
           'E4');
    begin
    if FindDTM(CookingApple, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    repeat
    Mouse (x, y, 0, 0, False);
    ChooseOption ('ithdraw-7');
    until (invcount = 21);
    end;
    freeDTM(CookingApple);
    if (invcount = 28) then
    begin
    closebank;
    end;
    end;
    end;

    procedure WithdrawWatermelon;
    var
      x, y, Watermelon: Integer;
    begin
    Watermelon := DTMFromString('78DA638C6660603066400109F542609A11CA6' +
           '7BC09248C18D00013A61A2B026A2E020975FC6A00A24404A4');
    begin
    if FindDTM(Watermelon, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    repeat
    Mouse (x, y, 0, 0, False);
    ChooseOption ('ithdraw-7');
    until (invcount = 28);
    end;
    freeDTM(Watermelon);
    end;
    end;

    function BankColour: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.19, 0.49);

      if not (FindColorsTolerance(arP, 4664116, MSX1, MSY1, MSX2, MSY2, 11)) then
      begin
        Writeln('Failed to find the color, no result(bankcolour).');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function PieShell: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.20, 0.35);

      if not (FindColorsTolerance(arP, 4552348, MSX1, MSY1, MSX2, MSY2, 1)) then
      begin
        Writeln('Failed to find the color, no result(pieshell).');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function Strawberry: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.20, 0.35);

      if not (FindColorsTolerance(arP, 4552348, MSX1, MSY1, MSX2, MSY2, 1)) then
      begin
        Writeln('Failed to find the color, no result(Strawberry).');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function Watermelon: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.06, 0.08);

      if not (FindColorsTolerance(arP, 2710312, MSX1, MSY1, MSX2, MSY2, 6)) then
      begin
        Writeln('Failed to find the color, no result(Watermelon).');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;
    function Apple: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.40, 0.07);

      if not (FindColorsTolerance(arP, 1076776, MSX1, MSY1, MSX2, MSY2, 12)) then
      begin
        Writeln('Failed to find the color, no result(Apple).');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    procedure camera;
    begin
    makecompass(180);
    end;

    procedure bankbanker;
    begin
    if findobjcustom(x, y, ['ank'], [BankColour], 2) then
    begin
    Mouse(x, y, 0, 0, false);
    chooseoption ('Bank Banker');
    if (bankscreen) then
    end;
    end;

    procedure Depositstuff;
    begin
    if (bankscreen) then
    begin
    if (InvCount > 0) then
    begin
    depositall;
    end;
    end;
    end;

    procedure UsePieShell;
    begin
    if (invcount = 28) then
    begin
    if (bankscreen) then
    closebank;
    begin
    if findobjcustom(x, y, ['Pie Shell'], [PieShell], 2) then
    begin
    Mouse(x, y, 0, 0, true);
    chooseoption ('Use');
    end;
    end;
    end;
    end;

    begin
       SetupSRL;
       DeclarePlayers;
       LoginPlayer;
       camera;
    repeat
       bankbanker;
    until (bankscreen);
       Depositstuff;
    begin
    repeat
       WithdrawPieShell;
    until (invcount = 7);
    if (invcount = 7) then
    begin
    repeat
       WithdrawStrawberry;
    until (invcount = 14)
       WithdrawWatermelon;
    if (invcount = 14) then
    begin
    repeat
       WithdrawCookingApple;
    until (invcount = 21)
    if (invcount = 21) then
    begin
    repeat
       UsePieShell;
    until (invcount = 28)
    end;
    end;
    end;
    end;
    end.

  14. #14
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Ill look into it later today, I cant display it on my mobile

  15. #15
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kl thanks for the help

  16. #16
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    function WithdrawPieShell: boolean;
    var
    x, y, PieShell: Integer;
    begin
    Result := (false);
    PieShell := DTMFromString('78DA639CCAC0C050C98002E696BB8169462 89' +
    'FF10390686640034C286A00BFF403E2');
    Result := (FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2));


  17. #17
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks xD could i pm you for help if i get stuck this was really pissing me off

  18. #18
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by i need to bot! View Post
    thanks xD could i pm you for help if i get stuck this was really pissing me off
    Yeah you can always pm me

  19. #19
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    now i get


    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]
    Last edited by i need to bot!; 01-21-2012 at 10:00 PM.

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

    Default

    Quote Originally Posted by i need to bot! View Post
    get


    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

    now ...
    Don't worry about it.. this is because the script terminated prematurely (Before it's end)..

    Basically if you stop the script before it stops naturally, sometimes it does not get time to free those things. Usually when you terminate rather than stopping and waiting. it's no biggie.. happens to almost every scripter here.
    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
  •