View Full Version : Uptext DTM
Footy
07-19-2012, 11:28 PM
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('mbQAAAHicY2VgYPABYksgjgLiRCBWBmJHIH YBYmcobQ/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;
why not just use GetUpTextAt() ?
Footy
07-19-2012, 11:34 PM
Isnt isuptext broken atm? or is getuptextat different? Could you please explain?
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
07-20-2012, 12:01 AM
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.
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
07-20-2012, 12:13 AM
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!
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
07-20-2012, 12:25 AM
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.
Yeah that's a downside to that function :/
Footy
07-20-2012, 12:40 AM
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?
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
07-20-2012, 01:01 AM
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.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.