Results 1 to 21 of 21

Thread: Can't click item with DTM

  1. #1
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Can't click item with DTM

    Simba Code:
    Procedure ClickPieDish;
    var
      Dish, x, y: Integer;
    begin
      Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgtoBieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQBIwEAuggOYg==');
      If FindDTM(Dish, x, y, MSX1, MSY1, MSX2, MSY2) Then
      begin
        WriteLn('Found pie dish.');
        MMouse(x, y, 5, 5);
        If IsUpText('ish') Then
        begin
          WriteLn('Clicking Pie Dish');
          Mouse(x, y, 0, 0, True);
        end;
      end;
    FreeDTM(Dish);
    end;

    It moves the mouse to the pie dish, but it won't click on it. I changed the first MMouse to Mouse and it worked, but it does not work if i check for uptext then click on it.

  2. #2
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    MMouse(x, y, 5, 5);
    Mouse(x, y, 5, 5, false); // False is to right click it.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  3. #3
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    MMouse (x, y, 5, 5);
    if (IsUpTextMultiCustom(['ish'])) then

    try that.

    btw, is the dish in the inventory?
    Last edited by punkd; 03-25-2012 at 10:35 PM.

  4. #4
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by punkd View Post
    MMouse (x, y, 5, 5);
    if (IsUpTextMultiCustom(['ish'])) then

    try that.
    Nope, that did not work.

    MMouse(x, y, 5, 5);
    Mouse(x, y, 5, 5, false); // False is to right click it.
    I would just use Mouse if i didn't want to check the uptext for it. Using both seems somewhat redundant. Also, the second 5, 5 moves your mouse two times. One time for MMouse and then another for Mouse, which would seem kind of weird.

    The dish is in the bank, could that be the problem? I got it to work in the inventory.
    Last edited by blother; 03-25-2012 at 10:39 PM.

  5. #5
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    MMouse (x, y, 5, 5);
    if (IsUpTextMultiCustom(['ish'])) then
    begin
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, True);


    that should do the job.

    If your planning on withdrawing more than one, Use Mouse(x, y, 0, 0, False);

  6. #6
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by punkd View Post
    MMouse (x, y, 5, 5);
    if (IsUpTextMultiCustom(['ish'])) then
    begin
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, True);


    that should do the job.

    If your planning on withdrawing more than one, Use Mouse(x, y, 0, 0, False);
    There is something wrong with the uptext.
    Simba Code:
    If (IsUpTextMultiCustom(['ish'])) Then
        begin
          WriteLn('Clicking pie dish');
          GetMousePos(x, y);
          Mouse(x, y, 0, 0, True);
        end else
          WriteLn('Did not click Pie dish.');

    I used that to check it and it always says it does not click.

    I haven't added withdrawing more, but i plan to. Should i use ChooseOption('ithdraw-x') then type 14 if i want to do half of the inventory worth?

  7. #7
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Maybe its the uptext. Whats the exact name of the item.

  8. #8
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    The name is "Pie dish"

    I have tried using 'ie' and 'ie dish' but those did not work either.

    It worked using 'Pie dish' but i thought you weren't supposed to use the exact word? Well, I tried to add ChooseOption and now it won't work even when i take that away. Not sure what is the problem now because it just worked a second ago.
    Last edited by blother; 03-25-2012 at 11:00 PM.

  9. #9
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    (*
    Withdraw
    ~~~~~~~~

    .. code-block:: pascal

    function Withdraw(Col, Row, Amount: Integer): Boolean;

    Withdraws Amount at Column/Row.

    .. note::

    Author: Starblaster100, Town, Wizzup? and Narcle
    Last Modified: Unknown

    Example:

    .. code-block:: pascal

    Withdraw(1, 3, 28);
    *)
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  10. #10
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    If (IsUpTextMultiCustom(['ie','dish'])) Then
    begin
    WriteLn('Clicking pie dish');
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, True);
    end else
    WriteLn('Did not click Pie dish.');

    I thought it was one word -.-. kk use that. Probly will show did not click pie dish, they click it but it works. In my scripts when im withdrawing 14 items, I tell them to have x set to 14 and just use waitoptionmulti for withdrawing 14.

  11. #11
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by begginer View Post
    (*
    Withdraw
    ~~~~~~~~

    .. code-block:: pascal

    function Withdraw(Col, Row, Amount: Integer): Boolean;

    Withdraws Amount at Column/Row.

    .. note::

    Author: Starblaster100, Town, Wizzup? and Narcle
    Last Modified: Unknown

    Example:

    .. code-block:: pascal

    Withdraw(1, 3, 28);
    *)
    I might try that, but i didn't want to force putting the item in a specific bank slot.

    If (IsUpTextMultiCustom(['ie','dish'])) Then
    begin
    WriteLn('Clicking pie dish');
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, True);
    end else
    WriteLn('Did not click Pie dish.');

    I thought it was one word -.-. kk use that. Probly will show did not click pie dish, they click it but it works. In my scripts when im withdrawing 14 items, I tell them to have x set to 14 and just use waitoptionmulti for withdrawing 14.
    Still didn't work I don't understand why it won't find the uptext.

  12. #12
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    0.o if u dnt mind sending me the script i can run a test.

  13. #13
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Simba Code:
    Procedure ClickPieDish;
    var
      Dish, x, y: Integer;
    begin
      Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgtoBieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQBIwEAuggOYg==');
      If FindDTM(Dish, x, y, MSX1, MSY1, MSX2, MSY2) Then
      begin
        WriteLn('Found pie dish.');
        MMouse(x, y, 7, 7);
        If (IsUpTextMultiCustom(['ie', 'dish'])) Then
        begin
          WriteLn('Clicking pie dish');
          GetMousePos(x, y);
          Mouse(x, y, 0, 0, True);
        end else
          WriteLn('Did not click Pie dish.');
      end;
    FreeDTM(Dish);
    end;

    That is all i have as of now :/ I just started on it and haven't even gotten to opening up the bank and such like that.

    I added 'ithdraw' to the uptext and it finds it, but not every time.
    Last edited by blother; 03-25-2012 at 11:26 PM.

  14. #14
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Well, I tested the function on my system it works with the Function I sent you but try this

    Simba Code:
    Procedure ClickPieDish;
    var
      Dish, x, y: Integer;
    begin
      Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgtoBieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQBIwEAuggOYg==');
      If FindDTM(Dish, x, y, MSX1, MSY1, MSX2, MSY2) Then
      begin
        WriteLn('Found pie dish.');
        MMouse(x, y, 7, 7);
        If (IsUpTextMultiCustom(['ie', 'dish'])) Then
        begin
          WriteLn('Clicking pie dish');
          GetMousePos(x, y);
          MMouse(x, y, 0, 0);
          clickmouse2(true)
        end else
          WriteLn('Did not click Pie dish.');
      end;
    FreeDTM(Dish);
    end;

    Its just something you need to try using different functions. I use HumanMMouse, a function made by Flight.

    Does the script even point on the DTM itself?

  15. #15
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by punkd View Post
    Well, I tested the function on my system it works with the Function I sent you but try this

    Simba Code:
    Procedure ClickPieDish;
    var
      Dish, x, y: Integer;
    begin
      Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgtoBieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQBIwEAuggOYg==');
      If FindDTM(Dish, x, y, MSX1, MSY1, MSX2, MSY2) Then
      begin
        WriteLn('Found pie dish.');
        MMouse(x, y, 7, 7);
        If (IsUpTextMultiCustom(['ie', 'dish'])) Then
        begin
          WriteLn('Clicking pie dish');
          GetMousePos(x, y);
          MMouse(x, y, 0, 0);
          clickmouse2(true)
        end else
          WriteLn('Did not click Pie dish.');
      end;
    FreeDTM(Dish);
    end;

    Its just something you need to try using different functions. I use HumanMMouse, a function made by Flight.

    Does the script even point on the DTM itself?
    It won't find the uptext with that I don't know why. The problem I am sure is solely with the uptext because it works fine if i don't check for it.

    Do you mean does it move the mouse over the DTM? It does, but i thought i should use a failsafe to make sure it is clicking the right item if you are going to suggest taking that part out. I may end up doing that because it probably will not end up being an issue if i don't check for the uptext.

  16. #16
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Use the Procedure I showed. Its a bit different. It should work

  17. #17
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I used it and it worked the first time i tried it, but then i tried to run it more to test it and it hasn't worked since.

  18. #18
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    bro somethings wrong lol. Its not possible for it to work once and not work again.

    MSN me Jokerv818@live.com

  19. #19
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Alright i added you

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

    Default

    That's a fragile procedure.. use WaitUptext instead.. why? because the mouse procedure will return before the mouse even gets to x, y.. happening to me as well so a simple wait will help it.. then when it gets to x, y, check for uptext.. it'll work then.

    U can even see for yourself:

    MMouse(X, Y, 0, 0);
    writeln(GetUptext); <--- will return an uptext that is different from the object at x, y..

    MMouse(X, Y, 0, 0);
    if (Waituptext('vdfs', 600) then
    writeln(GetUptext); <-- will return the exact uptext at X, Y.
    I am Ggzz..
    Hackintosher

  21. #21
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    That's a fragile procedure.. use WaitUptext instead.. why? because the mouse procedure will return before the mouse even gets to x, y.. happening to me as well so a simple wait will help it.. then when it gets to x, y, check for uptext.. it'll work then.

    U can even see for yourself:

    MMouse(X, Y, 0, 0);
    writeln(GetUptext); <--- will return an uptext that is different from the object at x, y..

    MMouse(X, Y, 0, 0);
    if (Waituptext('vdfs', 600) then
    writeln(GetUptext); <-- will return the exact uptext at X, Y.
    Oh wow that is just so... simple lol. Thank you so much! Makes sense why it would work sometimes, but not always. Now i can get on to failing at the rest of my script

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
  •