Log in

View Full Version : Can't click item with DTM



blother
03-25-2012, 10:23 PM
Procedure ClickPieDish;
var
Dish, x, y: Integer;
begin
Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgto BieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQ BIwEAuggOYg==');
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.

begginer
03-25-2012, 10:30 PM
MMouse(x, y, 5, 5);
Mouse(x, y, 5, 5, false); // False is to right click it.

punkd
03-25-2012, 10:32 PM
MMouse (x, y, 5, 5);
if (IsUpTextMultiCustom(['ish'])) then

try that.

btw, is the dish in the inventory?

blother
03-25-2012, 10:37 PM
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.

punkd
03-25-2012, 10:41 PM
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);

blother
03-25-2012, 10:46 PM
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.
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?

punkd
03-25-2012, 10:54 PM
Maybe its the uptext. Whats the exact name of the item.

blother
03-25-2012, 10:56 PM
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.

begginer
03-25-2012, 11:00 PM
(*
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);
*)

punkd
03-25-2012, 11:03 PM
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.

blother
03-25-2012, 11:09 PM
(*
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.

punkd
03-25-2012, 11:19 PM
0.o if u dnt mind sending me the script i can run a test.

blother
03-25-2012, 11:22 PM
Procedure ClickPieDish;
var
Dish, x, y: Integer;
begin
Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgto BieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQ BIwEAuggOYg==');
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.

punkd
03-25-2012, 11:27 PM
Well, I tested the function on my system it works with the Function I sent you but try this

Procedure ClickPieDish;
var
Dish, x, y: Integer;
begin
Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgto BieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQ BIwEAuggOYg==');
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?

blother
03-25-2012, 11:36 PM
Well, I tested the function on my system it works with the Function I sent you but try this

Procedure ClickPieDish;
var
Dish, x, y: Integer;
begin
Dish := DTMFromString('m6wAAAHic42ZgYHBhZGAIAOIgIPYDYjcgto BieyAOBGIfILYG4udA/BBKvwfij0D8BogfQ9mvgfgeVC7LXw9oOhNRmIsBP+CCYhEgZiQ BIwEAuggOYg==');
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.

punkd
03-25-2012, 11:39 PM
Use the Procedure I showed. Its a bit different. It should work

blother
03-25-2012, 11:42 PM
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.

punkd
03-25-2012, 11:46 PM
bro somethings wrong lol. Its not possible for it to work once and not work again.

MSN me Jokerv818@live.com

blother
03-25-2012, 11:49 PM
Alright i added you

Brandon
03-26-2012, 12:04 AM
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.

blother
03-26-2012, 12:14 AM
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 :p