Results 1 to 14 of 14

Thread: Uptext DTM

  1. #1
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Uptext DTM

    Im using an Uptext DTM to make sure im clicking on the bank, as my script keeps clicking off the bank. Im using the following code, but it wont work. In the DTM editor, it finds the DTM every time. The DTM is of the uptext when hovering over SW bank
    Simba Code:
    Procedure Bank;
    var
      BankDTM, x, y:integer;
    begin
      BankDTM := DTMFromString('mbQAAAHicY2VgYPABYksgjgLiRCBWBmJHIHYBYmcobQ/EktePM0jdOA6mQVj4ynEGbIARCwYDAMlQC0U=');
      Writeln('Time To Bank');
      wait(randomrange(200, 300));
      MMouse(259, 170, 4, 4);
      wait(randomrange(200, 400));
      if FindDTM(BankDTM, x, y, 1, 1, 765, 553) then
      begin
        Clickmouse2(1);
        wait(randomrange(1500, 2000));
        Mouse(583, 277, 2, 2, Mouse_right);
        Chooseoption('ll')
        wait(randomrange(400, 500));
        Mouse(102, 159, 2, 2, Mouse_right);
        wait(randomrange(300, 400));
        Chooseoption('ll');
        wait(randomrange(200, 400));
        Mouse(490, 84, 2, 2, 1);
        wait(randomrange(400, 600));
        Fletched := Fletched + 28
      end;
    end;
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  2. #2
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    why not just use GetUpTextAt() ?

  3. #3
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Isnt isuptext broken atm? or is getuptextat different? Could you please explain?
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  4. #4
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    nope, uptext isnt broken, however the coords are off. one sec ill write something up for you.

    Edit, its a little broken, but its usable, saves you from making dtms

    Simba Code:
    Writeln(rs_GetUpTextAt(7, 50));

    Progress Report:
      Attack Itrarned terrorhird (lev'el: 81 I / 2 more ontions
    Last edited by Kasi; 07-19-2012 at 11:56 PM.

  5. #5
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Works good enough, for use bank chest / 4 more options, it returned "!!se Bank chest / 4 more ontions" How would I use this to return a true or false if it finds Bank Chest though? Sorry for all the questions :P
    E: changed it to
    Simba Code:
    Writeln(rs_GetUpTextAt(7, 53));
    Works flawlessly now, but still need help on my previous question.
    Last edited by Footy; 07-20-2012 at 12:06 AM.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

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

    Default

    Simba Code:
    procedure TestUptext;
    var
      s,uText:String;
    begin
      s := 'my uptext';
      uText := rs_GetUpTextAt(5,5);
      if (s = uText) then
        writeLn('correct') else writeLn('false');
    end;
    Make it into a function.

  7. #7
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Shay View Post
    Simba Code:
    procedure TestUptext;
    var
      s,uText:String;
    begin
      s := 'my uptext';
      uText := rs_GetUpTextAt(5,5);
      if (s = uText) then
        writeLn('correct') else writeLn('false');
    end;
    Make it into a function.
    <3 Sin Thanks! and thanks pureblood too!
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

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

    Default

    Let me know how it goes.

  9. #9
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Simba Code:
    Function IsUpTextEx2(S : String) : Boolean
    Begin
      Result := (Pos(S, rs_GetUpTextAt(7,53)) > 0);  
    End;

    never compare 2 whole strings, if even 1 char is wrong it wont match.

  10. #10
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is the function I made out of what you made.
    Simba Code:
    Function BankUptext:boolean;
    var
      s,uText:String;
    begin
      s := 'Bank chest';
      uText := rs_GetUpTextAt(7,53);
      if (s = uText) then
        begin
          writeLn('correct')
          Result := True
        end else
          begin
            Writeln('False');
            Result := False
          end;
    This is how I'm calling it.
    Simba Code:
    Procedure Bank;
    begin
      Writeln('Time To Bank');
      wait(randomrange(200, 300));
      MMouse(259, 170, 2, 2);
      wait(randomrange(200, 500));
      if BankUptext = True then
      begin
        wait(randomrange(1500, 2000));
        Mouse(583, 277, 2, 2, Mouse_right);
        Chooseoption('ll')
        wait(randomrange(400, 500));
        Mouse(102, 159, 2, 2, Mouse_right);
        wait(randomrange(300, 400));
        Chooseoption('ll');
        wait(randomrange(200, 400));
        Mouse(490, 84, 2, 2, 1);
        wait(randomrange(400, 600));
        Fletched := Fletched + 28
      end else
      Bank

    end;
    And in my debug I got this
    Code:
    New window: 4326166
    Compiled successfully in 640 ms.
    SRL Compiled in 16 msec
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    False
    Time To Bank
    Successfully executed.
    It only executed because I manually stopped it. I'm assuming the uptext has to match exactly what I entered? If so, its not much of a deal, Ill just have to click on the chest where it wont hover over people aswell.
    E: @Pure, thats what I suspected. How would I go about using that function? My knowledge on functions is very limited, the function I made 2 minutes ago was the first I've ever made. Using Sins function wont work. It would mean I'm clicking on the same Y value +/- 1 every time.
    Last edited by Footy; 07-20-2012 at 12:30 AM.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

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

    Default

    Yeah that's a downside to that function :/

  12. #12
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would use that function, but theres only about a 3 pixel gap between people in the area being in the uptext, and clicking off the bankchest. Can someone explain how I would use Purebloods function, if it would work better?
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

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

    Default

    It's simple:

    Simba Code:
    Function IsUpTextEx2(S : String) : Boolean
    Begin
      Result := (Pos(S, rs_GetUpTextAt(7,53)) > 0);  
    End;

    procedure UberCooll33t;
    begin
     if IsUpTextEx2('string') then
      yadaadada;
    end;

  14. #14
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Knew it would be something like that. As I said, I'm still trying to grasp functions. Thanks for the help guys! It's getting late, so I'll try this tomorrow.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

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
  •