Results 1 to 18 of 18

Thread: help with DTM's

  1. #1
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default help with DTM's

    Simba Code:
    program new;
    {$i SRL-6/SRL.simba}
     var
     x, y, i: integer;

     BrewDTMs, RestDTMs, TeleDTMs: TIntegerarray
    procedure LoadDTMs;
    begin
    BrewDTMs := [
       DTMFromString('mLgAAAHicY2JgYOhjYmCYDsR6jAwMpkB89rQ9Q2WFCgMMMEIxAwMAgRcEfw=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmBIA2JORgYGViA+dsSGIT4+mQEGGKGYgQEAZ1kDyg=='),
       DTMFromString('mLgAAAHicY2JgYOhlYmCYCMS8jAwM7ED86NE8huCQcAYYYIRiBgYAgVAEnQ=='),
       DTMFromString('mLgAAAHicY2JgYLBkYmBwAGIBRgYGHiC+dm0Wg79/EAMMMEIxAwMAZJUD1g=='),
    RestDTMs := [
       DTMFromString('mLgAAAHicY2JgYLBkYmCwAeJ9jAwM24F4lksyQ4ymNQMMMEIxAwMAcdUD9g=='),
       DTMFromString('mLgAAAHicY2JgYOhjYmCYBMQHGBkYdgNxr100g62tAwMMMEIxAwMAif0Ehg=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmDIBOKjjAwMB4C41y6aId0vmgEGGKGYgQEAhWAEkw=='),
       DTMFromString('mLgAAAHicY2JgYNjOxMCwH4iPMjIwHALiRXX9DCam5gwwwAjFDAwApAEFVw=='),
    TeleDTMs :=[
       DTMFromString('mGQAAAHicY2RgYHBmYmAQYGRgCA0MZAABRhABABKWAVA='),
    end;
    so what im trying to do is, to get all the dtms in 1 command (BrewDTMs), so i can make it like,
    Simba Code:
    procedure LoadDTMs;
    begin
    BrewDTMs := [
       DTMFromString('mLgAAAHicY2JgYOhjYmCYDsR6jAwMpkB89rQ9Q2WFCgMMMEIxAwMAgRcEfw=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmBIA2JORgYGViA+dsSGIT4+mQEGGKGYgQEAZ1kDyg=='),
       DTMFromString('mLgAAAHicY2JgYOhlYmCYCMS8jAwM7ED86NE8huCQcAYYYIRiBgYAgVAEnQ=='),
       DTMFromString('mLgAAAHicY2JgYLBkYmBwAGIBRgYGHiC+dm0Wg79/EAMMMEIxAwMAZJUD1g=='),
    RestDTMs := [
       DTMFromString('mLgAAAHicY2JgYLBkYmCwAeJ9jAwM24F4lksyQ4ymNQMMMEIxAwMAcdUD9g=='),
       DTMFromString('mLgAAAHicY2JgYOhjYmCYBMQHGBkYdgNxr100g62tAwMMMEIxAwMAif0Ehg=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmDIBOKjjAwMB4C41y6aId0vmgEGGKGYgQEAhWAEkw=='),
       DTMFromString('mLgAAAHicY2JgYNjOxMCwH4iPMjIwHALiRXX9DCam5gwwwAjFDAwApAEFVw=='),
    TeleDTMs := [
       DTMFromString('mGQAAAHicY2RgYHBmYmAQYGRgCA0MZAABRhABABKWAVA='),
    end;
    if findDTM(BrewDTMs[i], x, y, x1, y1, x2, y2) then
    begin
     eat brew;
    but it gives me error on the "end" and says "error: invalid evaluation at line 21", dunno what im doing wrong any1 can help with this?

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

    Default

    "eat brew" must be 1 word no spaces
    Also there must be a ";" after TIntegerArray

    You never close the brackets in your Array.

    Simba Code:
    intArray := [1, 2, 3, 4];

    That's how a intarray is declared

    DTM array example
    Simba Code:
    procedure LoadDTMs;
    begin
    BrewDTMs := [
       DTMFromString('mLgAAAHicY2JgYOhjYmCYDsR6jAwMpkB89rQ9Q2WFCgMMMEIxAwMAgRcEfw=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmBIA2JORgYGViA+dsSGIT4+mQEGGKGYgQEAZ1kDyg=='),
       DTMFromString('mLgAAAHicY2JgYOhlYmCYCMS8jAwM7ED86NE8huCQcAYYYIRiBgYAgVAEnQ=='),
       DTMFromString('mLgAAAHicY2JgYLBkYmBwAGIBRgYGHiC+dm0Wg79/EAMMMEIxAwMAZJUD1g==')];
    RestDTMs := [
       DTMFromString('mLgAAAHicY2JgYLBkYmCwAeJ9jAwM24F4lksyQ4ymNQMMMEIxAwMAcdUD9g=='),
       DTMFromString('mLgAAAHicY2JgYOhjYmCYBMQHGBkYdgNxr100g62tAwMMMEIxAwMAif0Ehg=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmDIBOKjjAwMB4C41y6aId0vmgEGGKGYgQEAhWAEkw=='),
       DTMFromString('mLgAAAHicY2JgYNjOxMCwH4iPMjIwHALiRXX9DCam5gwwwAjFDAwApAEFVw==')];
    TeleDTMs :=[
       DTMFromString('mGQAAAHicY2RgYHBmYmAQYGRgCA0MZAABRhABABKWAVA=')];
    end;

  3. #3
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by rj View Post
    "eat brew" must be 1 word no spaces
    Also there must be a ";" after TIntegerArray
    that was an example, i dont have an eatbrew function or procedure even on my script, it was an example, and it didnt do anything when i put ; after tintegerarray

  4. #4
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by scripter1 View Post
    that was an example, i dont have an eatbrew function or procedure even on my script, it was an example, and it didnt do anything when i put ; after tintegerarray
    you are missing end brackets on your arrays

    some code

    Simba Code:
    procedure brew();
    var
      i, x, y: Integer;
    begin
      for i := 0 to high(BrewDTMs) do
        if findDTM(BrewDTMs[i], x, y, x1, y1, x2, y2) then
        begin
          //some code that click the DTM
        end else
        writeln('No brews found');
    end;

  5. #5
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    you are missing end brackets on your arrays

    some code

    Simba Code:
    procedure brew();
    var
      i, x, y: Integer;
    begin
      for i := 0 to high(BrewDTMs) do
        if findDTM(BrewDTMs[i], x, y, x1, y1, x2, y2) then
        begin
          //some code that click the DTM
        end else
        writeln('No brews found');
    end;
    yo can u tell me what am i doin wrong
    Simba Code:
    function EatBrew: Boolean;
    var
      x, y, i: Integer;
      potDTMs: TIntegerArray;
    begin
      for i := 0 to High(BrewDTMs) do
      If FindDTM(BrewDTMs[i], x, y, 548, 206, 737, 467) then
      begin (mouse_left)
      end;
    end;

     Function colorfind(): boolean;
    var
    x, y : integer;
    begin
      If(FindColor(x, y, 66073, 696, 16, 718, 44))then
      begin
       //WriteLn('Found Color!');
       Result := True;
        EatBrew;
      end else
        writeLn('Did not find color.');
    end;
    procedure mainloop();
    begin
      if colorfind() then EatBrew;
      wait(1234);
    end;
    begin
      getAndSet();
      while true do mainloop();
    end.
    , it does nothing, it just says "did not find color" on debug box, but it runs the script, but does nothing :O @jstemper @rj

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

    Default

    Quote Originally Posted by scripter1 View Post
    yo can u tell me what am i doin wrong
    Simba Code:
    function EatBrew: Boolean;
    var
      x, y, i: Integer;
      potDTMs: TIntegerArray;
    begin
      for i := 0 to High(BrewDTMs) do
      If FindDTM(BrewDTMs[i], x, y, 548, 206, 737, 467) then
      begin (mouse_left)
      end;
    end;

     Function colorfind(): boolean;
    var
    x, y : integer;
    begin
      If(FindColor(x, y, 66073, 696, 16, 718, 44))then
      begin
       //WriteLn('Found Color!');
       Result := True;
        EatBrew;
      end else
        writeLn('Did not find color.');
    end;
    procedure mainloop();
    begin
      if colorfind() then EatBrew;
      wait(1234);
    end;
    begin
      getAndSet();
      while true do mainloop();
    end.
    , it does nothing, it just says "did not find color" on debug box, but it runs the script, but does nothing :O @jstemper @rj
    then it didn't find the color.

  7. #7
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by rj View Post
    then it didn't find the color.
    it did, i had 50hp, it should eat at like 80 ish

  8. #8
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Just use Citrus's low hp function from the script he made for you...

  9. #9
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    Just use Citrus's low hp function from the script he made for you...
    the thing is i want it to eat higher than 75 hp, cuz it eats on 75 hp ( where the text turns orange), and i tried this script with sharks, not the dtms thing and such, and it worked, no clue why it aint working now.

  10. #10
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Simba Code:
    program new;
    {$I SRL-6/SRL.Simba}

    const
      eatAt : Integer := 800;

    function getSimpleText(Colors: TIntegerArray; x1, y1, x2, y2: integer; font: string): string;
    var
      textTPA: TPointArray;
      textATPA, textATPAS: T2DPointArray;
      i: integer;
      textStr: string;
    begin
      setLength(textATPAS, length(colors));
      for i := 0 to high(colors) do
        findColors(textATPAS[i], Colors[i], x1, y1, x2, y2);
      textTPA := mergeATPA(textATPAS);
      textATPA := SplitTPAEx(textTPA, 1, 10);
      filtertpasbetween(textatpa, 0, 1);
      SortATPAFromFirstPointX(textATPA, Point(0, 0));
      result := getTextATPA(textATPA, 3, font);
    end;

    function getHealth(): integer;
    begin
      try
        result := StrToInt(getSimpleText([2070783, 255, 65280, 501500, 65535, 855541], 721, 27, 742, 41, 'statchars'));
      except
        result := - 1;
      end;
    end;

    begin
      repeat
        writeln(getHealth());
        if ((getHealth() <= eatAt) and (getHealth() <> - 1)) then
        begin
          writeln('we are low hp');
          //insert eating procedure here
        end;
        sleep(250);
      until (false);
    end

    the hp reader is ripped from rj's alotic include, only thing i changed was the font and bounds to accommodate runeHD
    Last edited by jstemper; 10-12-2016 at 07:27 PM. Reason: <=

  11. #11
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    Simba Code:
    program new;
    {$I SRL-6/SRL.Simba}

    const
      eatAt : Integer := 800;

    function getSimpleText(Colors: TIntegerArray; x1, y1, x2, y2: integer; font: string): string;
    var
      textTPA: TPointArray;
      textATPA, textATPAS: T2DPointArray;
      i: integer;
      textStr: string;
    begin
      setLength(textATPAS, length(colors));
      for i := 0 to high(colors) do
        findColors(textATPAS[i], Colors[i], x1, y1, x2, y2);
      textTPA := mergeATPA(textATPAS);
      textATPA := SplitTPAEx(textTPA, 1, 10);
      filtertpasbetween(textatpa, 0, 1);
      SortATPAFromFirstPointX(textATPA, Point(0, 0));
      result := getTextATPA(textATPA, 3, font);
    end;

    function getHealth(): integer;
    begin
      try
        result := StrToInt(getSimpleText([2070783, 255, 65280, 501500, 65535, 855541], 721, 27, 742, 41, 'statchars'));
      except
        result := - 1;
      end;
    end;

    begin
      repeat
        writeln(getHealth());
        if ((getHealth() <= eatAt) and (getHealth() <> - 1)) then
        begin
          writeln('we are low hp');
          //insert eating procedure here
        end;
        sleep(250);
      until (false);
    end

    the hp reader is ripped from rj's alotic include, only thing i changed was the font and bounds to accommodate runeHD
    it doesnt click the food, idk why
    Simba Code:
    program new;
    var
         x, y, i: integer;
         left, top, right, bot: integer;

     BrewDTMs, RestDTMs, TeleDTMs: TIntegerArray;
     type
      TOption = record
        bounds: TBox;
        str: string;
      end;
      TOptionArray = array of TOption;
    const
      eatAt : Integer := 800;

    function getSimpleText(Colors: TIntegerArray; x1, y1, x2, y2: integer; font: string): string;
    var
      textTPA: TPointArray;
      textATPA, textATPAS: T2DPointArray;
      i: integer;
      textStr: string;
    begin
      setLength(textATPAS, length(colors));
      for i := 0 to high(colors) do
        findColors(textATPAS[i], Colors[i], x1, y1, x2, y2);
      textTPA := mergeATPA(textATPAS);
      textATPA := SplitTPAEx(textTPA, 1, 10);
      filtertpasbetween(textatpa, 0, 1);
      SortATPAFromFirstPointX(textATPA, Point(0, 0));
      result := getTextATPA(textATPA, 3, font);
    end;
    procedure LoadDTMs;
    begin
    BrewDTMs := [
       DTMFromString('mLgAAAHicY2JgYOhjYmCYDsR6jAwMpkB89rQ9Q2WFCgMMMEIxAwMAgRcEfw=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmBIA2JORgYGViA+dsSGIT4+mQEGGKGYgQEAZ1kDyg=='),
       DTMFromString('mLgAAAHicY2JgYOhlYmCYCMS8jAwM7ED86NE8huCQcAYYYIRiBgYAgVAEnQ=='),
       DTMFromString('mLgAAAHicY2JgYLBkYmBwAGIBRgYGHiC+dm0Wg79/EAMMMEIxAwMAZJUD1g==')];
    RestDTMs := [
       DTMFromString('mLgAAAHicY2JgYLBkYmCwAeJ9jAwM24F4lksyQ4ymNQMMMEIxAwMAcdUD9g=='),
       DTMFromString('mLgAAAHicY2JgYOhjYmCYBMQHGBkYdgNxr100g62tAwMMMEIxAwMAif0Ehg=='),
       DTMFromString('mLgAAAHicY2JgYEhhYmDIBOKjjAwMB4C41y6aId0vmgEGGKGYgQEAhWAEkw=='),
       DTMFromString('mLgAAAHicY2JgYNjOxMCwH4iPMjIwHALiRXX9DCam5gwwwAjFDAwApAEFVw==')];
    TeleDTMs := [
       DTMFromString('mGQAAAHicY2RgYHBmYmAQYGRgCA0MZAABRhABABKWAVA=')];
    end;
    procedure freethedtms;
    begin
      for i := 0 to high(BrewDTMs) do
      FreeDTM(BrewDTMs[i]);
      for i := 0 to high (RestDTMs) do
      FreeDTM(RestDTMs[i]);
      for i := 0 to high (TeleDTMs) do
      FreeDTM(TeleDTMs[i]);
      end;
    function getHealth(): integer;
    begin
      try
        result := StrToInt(getSimpleText([2070783, 255, 65280, 501500, 65535, 855541], 721, 27, 742, 41, 'statchars'));
      except
        result := - 1;
      end;
    end;
     function EatBrew: Boolean;
    var
      i, x, y: Integer;
      BrewDTMs: TIntegerArray;
    begin
      for i := 0 to High(BrewDTMs) do
      If FindDTM(BrewDTMs[i], x, y, 556, 208, 722, 462) then
      begin (MOUSE_LEFT)
      end;
    end;
    begin
      repeat
        writeln(getHealth());
        if ((getHealth() <= eatAt) and (getHealth() <> - 1)) then
        begin
          writeln('we are low hp');
          EatBrew();
        end;
        sleep(250);
      until (false);
    end
    it says "we are low hp" but doesnt click brew

  12. #12
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by scripter1 View Post
    it doesnt click the food, idk why it says "we are low hp" but doesnt click brew
    Because you never tell it to. You have (MOUSE_LEFT) instead of an actual mouse function, like the one in my script from your old thread.
    Last edited by Citrus; 10-13-2016 at 05:35 AM.

  13. #13
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Code:
    var
      i: integer;
      b: TBoxArray;
    begin
      b := tabBackpack.getSlotBoxes();
      for i := 0 to high(b) do
        if countColorTolerance(color###, b[i], tol###) > cutoff### then
          exit(i);
    Then just use mouseBox[i] or something.

    (I dislike DTM's)

  14. #14
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    Code:
    var
      i: integer;
      b: TBoxArray;
    begin
      b := tabBackpack.getSlotBoxes();
      for i := 0 to high(b) do
        if countColorTolerance(color###, b[i], tol###) > cutoff### then
          exit(i);
    Then just use mouseBox[i] or something.

    (I dislike DTM's)
    where in the script i put that? in the begin or in the eatbrew procedure?

  15. #15
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by scripter1 View Post
    where in the script i put that? in the begin or in the eatbrew procedure?
    I'm sure you'll be able to figure that out. It's just a snippet that you can use. It'll search each backpack slot for a color, if it has enough colors you can interact with the slot. I use it to find summoning scrolls in inventory.

  16. #16
    Join Date
    Apr 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    I'm sure you'll be able to figure that out. It's just a snippet that you can use. It'll search each backpack slot for a color, if it has enough colors you can interact with the slot. I use it to find summoning scrolls in inventory.
    does that mean i have to take the DTMs away? and it would only look for any item in inv

  17. #17
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    You don't move your mouse to the DTM. You also declare brewDTMs both globally, and locally.

    and you don't even load your DTMs into memory

  18. #18
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Are you using SRL6? Then all you need is this:
    Code:
    function findPots(): boolean;
    var
      i: integer;
      b: TBoxArray;
    begin
      b := tabBackpack.getSlotBoxes();
      for i := 0 to high(b) do
        if countColorTolerance(color###, b[i], tol###) > cutoff### then
          exit(true);
    end;
    
    if (actionbar.getHPPercent() < 80) and findPots() then
      typeByte(VK_b);
    Set your brews on the actionbar, bind them to the key 'b' and be done with it.

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
  •