SRL Archive - Help

Uptext DTM


Footy

2012-07-19 19:28:05

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
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;

Kasi

2012-07-19 19:32:58

why not just use GetUpTextAt() ?

Footy

2012-07-19 19:34:43

Isnt isuptext broken atm? or is getuptextat different? Could you please explain?

Kasi

2012-07-19 19:42:18

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


Writeln(rs_GetUpTextAt(7, 50));


Attack Itrarned terrorhird (lev'el: 81 I / 2 more ontions

Footy

2012-07-19 20:01:42

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
Writeln(rs_GetUpTextAt(7, 53));
Works flawlessly now, but still need help on my previous question.

Sin

2012-07-19 20:10:20


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.

Footy

2012-07-19 20:13:07

From: Shay

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!

Sin

2012-07-19 20:16:46

Let me know how it goes.

Kasi

2012-07-19 20:22:17


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.

Footy

2012-07-19 20:25:52

This is the function I made out of what you made.

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.

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
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.

Sin

2012-07-19 20:33:50

Yeah that's a downside to that function :/

Footy

2012-07-19 20:40:43

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?

Sin

2012-07-19 20:59:29

It's simple:


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

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


Footy

2012-07-19 21:01:46

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.