SRL Archive - Scripting Help

Problems with DTM.


Zeta Matt

2013-08-25 00:50:12

I'm trying to make a script without SIMBA, using only rs client and adapting everything I have to. To detect some word in the chat, there is no "inChat" fucntion to damn help me, so I got into trying DTM's… So, I wanted to detect when someone says "mc" (case-sensitive, ofc) in chat, so I have said "mc" in chat and marked EVERY single point of the word to make my dtm. But it seems that it detects many things besides "mc", so I researched a bit and found something about DTM being found in any angle, which could be causing the problem… I need help to see if that is the problem. If it is, what function should I use to find a DTM exactly how it was when I printed (same angle, same array of points, same colour, same coordinates range…)? If it isn't, what should I do?
Thanks in advance!

if DetectNodes then                                                                                                                                                                                                                                                                                  //THIS ONE BELOW THAT HAS ALL THE POINTS OF "mc"! NOT FUCKING DAMN WORKING!
if FindDtm(DTMFromString('m1gAAAHic42JgYLgAxZeh+BoU3wHim1AMYl9iZmA4D8TngPgiEn0WiQ1SM///fKIwsYCRSIwAAOY0Jw4='), x, y, 9, 825, 209, 972) and FindDtm(DTMFromString('mrAAAAHic42BgYNgAxJuBeBsUb4aK7YLiI8wIfBAJ74eKzf8/Hy8mBBgJYBgAAJacHck='), x, y, 9, 825, 209, 972)and FindDtm(DTMFromString('mjwIAAHicxctbCoAgEAXQiRbScntDVv8uTDN3Ule4gojUpwMH5nU7EelpSPpghKlghoXWggN2ULBlFG/h5wTfitxgwMEFlrPl7PjjuY9iNs+Zj3xKP7qamtVU9FMv8IJx2Q=='), x, y, 9, 825, 209, 972) then
begin
Playsound('c:\simba\alarm');
writeln('Metal Detected! ' + TheTime);
wait(2000);
StopSound;
MMouse(x, y, 0, 0); //This was to check what the hell is was detecting.
end;

If anyone would be curious about why the hell I want to detect "mc"; it's because, after Battle of Lumbridge release, they created a friends chat to check which world got sacred metal nodes to extract. When someone finds one, they say "W65(65 is the example only)mc" and if I could detect that "mc", I'd be able to know whenever someone detects a node…

Sjoe

2013-08-25 07:53:35

It's better if u use a bitmap in this scenario :)

There are plenty of bitmap tutorials in the beginner section!

also wrong section :p

masterBB

2013-08-25 15:06:59

Moved to scripting help.

King

2013-08-25 19:04:10

Agree with Sjoe, I do believe SRL has the text functions written though bitmaps of text.

Itankbots

2013-08-25 19:40:18

Or use TPAtext stuff.

but bitmaps simpler

Zeta Matt

2013-08-26 15:36:52

Thanks sjoe for the help, I'm using bitmaps now and it's working better than DTM's. It's still failing a lot, since it was put to a tolerance of 60, but most of the times it detects what i want :)