Log in

View Full Version : WaitUpTextMulti



P1ng
06-01-2012, 02:42 PM
I have these two lines listed in different procedures of a script, but for one reason or another it keeps being unable to find this UpText. I've debugged the procedures and I'm positive the issue is with finding the UpText, haven't ever previously had this/a similar problem so I'm not quite sure how to go about fixing it.

For finding the UpText "Bow string"
if WaitUpTextMulti(['trin','ow','str','ing'],3000 + random(500)) then

For finding the UpText "longbow (u)"
if WaitUpTextMulti(['ong','gbo','gbo','u'],3000 + random(500)) then

I've tried all sorts of different combinations to make up the words and I'm aware that you need to use correct spacing and/or capitals. Any help would be greatly appreciated :)

EDIT: I need the second one to have some way to specify that it is unstrung to avoid withdrawing strung bows by accident.

CephaXz
06-01-2012, 04:26 PM
I had that problem too. So I just use MouseBankSlot to withdraw items. Probably because uptext doesn't work with that color.

Correct me if I'm wrong :p

Google
06-01-2012, 04:48 PM
IF WAITUPTEXTMULTI(['ngbow (u)','(u)'], 2000) THEN

This would be for the unstrung longbows

And as far as not withdrawing the items what is happening could you give a little more detail? Are you having the mouse go to the slot where the item is?


Edit: I will just write something to save time


MMOUSE(449, 109, 3, 3);
IF WAITUPTEXTMULTI(['trin','ow','str','ing'], 2000) THEN

So in this case its moving the mouse to the top right slot of the bank, then checking if the up text is there.


MMOUSE(450, 150, 3, 3);
IF WAITUPTEXTMULTI(['ngbow (u)','(u)'], 2000) THEN

Same with this one here but its all the way to the top right under the first slot.

P1ng
06-01-2012, 09:49 PM
Well it checks for the DTM, moves to the slot, checks the uptext and then withdraws the item if it passes those checks. But at the moment it works about 80% of the time and the other 20 it will move to the slot and then abort.
Will test out your suggestion and get back to you

EDIT: These are the two actual functions
procedure WithdBS;
begin
Wait(RandomRange(1200,1800));
if not LoggedIn then
begin
ScrErr:= ' Is Not Logged In.';
TerminateScript;
end else
if WaitFunc(@BankScreen,50 + random(25),3000 + random(500)) then
begin
if (InvCount > 0) then
DepositItAll else
if WaitFindDTMEx(BS,x,y,MBX1,MBY1,MBX2,MBY2,250 + random(50),3000 + random(500)) then
begin
MMouse(x-1,y-1,2,2);
Wait(RandomRange(500,600));
if WaitUpTextMulti(['trin','ow','str','ing'],3000 + random(500)) then
case Random(5) of
1..4:
begin
ClickMouse2(False);
if not WaitOption('14',1000) then
begin
MMouse(x-1,y-1,3,3);
if WaitUpTextMulti(['trin','ow','str','ing'],3000 + random(500)) then
begin
ClickMouse2(False);
if WaitOption('-X',1000) then
begin
Wait(RandomRange(1500,2000));
TypeSend('14');
Exit;
end else
Exit;
end else
Exit;
end else
Exit;
end;

5:
begin
ClickMouse2(False);
WaitOption('-X',1000);
Wait(RandomRange(1500,2000));
TypeSend('14');
Exit;
end;
end else
ScrErr:= ' Incorrect UpText On Bowstring @WithdBS.';
TerminateScript;
// Incorrect UpText
end else
ScrErr:= ' No Bowstring DTM @WithdBS.';
TerminateScript;
// No BS In Bank
end else
ScrErr:= ' Not In BankScreen @WithdBS.';
TerminateScript;
// Not In BankScreen
end;

procedure WithdLU;
begin
Wait(RandomRange(800,1400));
if not LoggedIn then
begin
ScrErr:= ' Is Not Logged In.';
TerminateScript;
end else
if WaitFunc(@BankScreen,50 + random(25),3000 + random(500)) then
begin
if WaitFindDTMEx(LU,x,y,MBX1,MBY1,MBX2,MBY2,250 + random(50),3000 + random(500)) then
begin
MMouse(x-1,y-1,2,2);
Wait(RandomRange(500,600));
if WaitUpTextMulti(['ong','gbo','gbo','u'],3000 + random(500)) then
case Random(10) of
1..5:
begin
ClickMouse2(False);
WaitOption('14',1000);
Exit;
end;

6:
begin
ClickMouse2(False);
WaitOption('-X',1000);
Wait(RandomRange(1500,2000));
TypeSend('14');
Exit;
end;

7..10:
begin
ClickMouse2(False);
WaitOption('All',1000);
Exit;
end;
end else
ScrErr:= ' Incorrect UpText On Longbow(u) @WithdBS.';
TerminateScript;
// Incorrect UpText
end else
ScrErr:= ' No Longbow(u) DTM @WithdLU.';
TerminateScript;
// No Longbow DTMs
end else
ScrErr:= ' Not In BankScreen @WithdLU.';
TerminateScript;
// Not In BankScreen
end;