SRL Archive - OSR Help

Symbol help


Mr. Doctor

2010-01-25 18:55:23

I made a DTM of a bank symbol for the MiniMap. I did this because some people have lag problems and SCAR freezing. Here is both of my procedures,


function BankSym : boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
Result := FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2);
end;

procedure SymTest;
var
X, Y :integer;
begin
if(BankSym)then
begin
Writeln('Yes');
Mouse( X, Y, 2, 2, True);
end;
end;

It does writeln yes but does not click the symbol. Any idears? Do I have incorporate both into one procedure?

Rick

2010-01-25 19:14:19

What's wrong with FindSymbol and adjusting SymbolAccuracy ?

Mr. Doctor

2010-01-25 19:16:52

From: r!ch!e
What's wrong with FindSymbol and adjusting SymbolAccuracy ?


It uses bitmaps. Aren't DTMs faster than bitmaps?

Bionicle

2010-01-25 19:17:39

From: Junkj
I made a DTM of a bank symbol for the MiniMap. I did this because some people have lag problems and SCAR freezing. Here is both of my procedures,


function BankSym : boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
Result := FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2);
end;

procedure SymTest;
var
X, Y :integer;
begin
if(BankSym)then
begin
Writeln('Yes');
Mouse( X, Y, 2, 2, True);
end;
end;

It does writeln yes but does not click the symbol. Any idears? Do I have incorporate both into one procedure?


Are you making sure that the whole symbol is on the map? That is what symbol accuracy is for for symbol finding.

Rick

2010-01-25 19:19:01

I doesn't really matter, I don't think there is that much of a speed difference in the later versions of SCAR. Besides, just adjust SymbolAccuracy to 60% and it is almost guaranteed to work. Just remember to reset it to the default value of 80%

Edit: And lol.


procedure SymTest;
var
X, Y :integer;
begin
if(BankSym)then
begin
Writeln('Yes');
Mouse( X, Y, 2, 2, True);
end;
end;

Do you see X and Y getting values assigned ? Your FindFunction returns true if it finds the DTM, it does not however return co-ords. Right now, you just move the mouse to (0,0)

Mr. Doctor

2010-01-25 19:20:10

From: bionicle1800
Are you making sure that the whole symbol is on the map? That is what symbol accuracy is for for symbol finding.


Yep. The mouse just moves to the top left corner after it writeln's yes.

Rick

2010-01-25 19:21:46

You aren't passing the X and Y values between functions …

Mr. Doctor

2010-01-25 19:23:32

From: r!ch!e
You aren't passing the X and Y values between functions …


I'm pretty sure I tried that, too… Let me try this again.

Rick

2010-01-25 19:26:39

Do you have MSN ? I will help you whenever you need if you are willing to listen to what I am saying.

Mr. Doctor

2010-01-25 19:28:07

From: r!ch!e
Do you have MSN ? I will help you whenever you need if you are willing to listen to what I am saying.


Meh, I'll just use FindSymbol because there are too many dots on the MM over the bank symbol. Yeah, I do have MSN.

Rick

2010-01-25 19:29:21


function BankSym : boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
Result := FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2);
end;

procedure SymTest;
var
X, Y :integer;
begin
if(BankSym)then
begin
Writeln('Yes');
Mouse( X, Y, 2, 2, True);
end;
end;

I'm trying to tell you that you didn't pass the x and y values from the DTM function to your other function.

Mr. Doctor

2010-01-25 19:30:54

From: r!ch!e

function BankSym : boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
Result := FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2);
end;

procedure SymTest;
var
X, Y :integer;
begin
if(BankSym)then
begin
Writeln('Yes');
Mouse( X, Y, 2, 2, True);
end;
end;

I'm trying to tell you that you didn't pass the x and y values from the DTM function to your other function.


PM me your MSN. There's definitely a better way to do this.

0wn 4 skill

2010-01-25 19:35:17

Try this?

program ClickBankDTM;
{.include SRL/SRL.scar}

var
fx, fy : integer;

function BankSym(fx,fy: Integer):boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;
end;

procedure SymTest;
begin
if(BankSym(fx,fy))then
begin
Writeln('Yes');
Mouse(fx,fy, 2, 2, True);
end;
end;

Mr. Doctor

2010-01-25 19:41:16

After I updated my SRL folder I now get Unknown Identifier TPAFromText from Math.scar.

0wn 4 skill

2010-01-25 19:43:08

From: Junkj
After I updated my SRL folder I now get Unknown Identifier TPAFromText from Math.scar.


There was nothing wrong with your folder. Copy this into scar and run it and tell me if it works.

program ClickBankDTM;
{.include SRL/SRL.scar}

var
fx, fy : integer;

function BankSym(fx,fy: Integer):boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;
end;

begin
SetupSRL;
ActivateClient;
if(BankSym(fx,fy))then
begin
Writeln('Yes');
Mouse(fx,fy, 2, 2, True);
end;
end.

Mr. Doctor

2010-01-25 19:52:26

From: 0wn 4 skill
There was nothing wrong with your folder. Copy this into scar and run it and tell me if it works.

program ClickBankDTM;
{.include SRL/SRL.scar}

var
fx, fy : integer;

function BankSym(fx,fy: Integer):boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;
end;

begin
SetupSRL;
ActivateClient;
if(BankSym(fx,fy))then
begin
Writeln('Yes');
Mouse(fx,fy, 2, 2, True);
end;
end.


I tried, after I updated (everyday) it now says that. Nothing with your code.

0wn 4 skill

2010-01-25 19:53:17

1. Close an Reopen Scar.
2. If above doesnt work then Restart Computer.

Bebe

2010-01-25 19:57:02

Also replace your plugins with current ones. That could also cause problems.

Heavenguard

2010-01-25 19:58:25

Why not just make a DTM of the Banker Dots. Im pretty sure there is like 3 static colors in each of those dots [meaning no tolerance needed], and just make the Area Size like 2.

0wn 4 skill

2010-01-25 20:01:19

From: Heavenguard
Why not just make a DTM of the Banker Dots. Im pretty sure there is like 3 static colors in each of those dots [meaning no tolerance needed], and just make the Area Size like 2.


He said before that the DTM was working:

Writeln('Yes');


He just doesnt understand that he has to assign co-ordinates to where the DTM is.

Thanks for your help though! :D

Mr. Doctor

2010-01-25 20:11:31

From: Bebe
Also replace your plugins with current ones. That could also cause problems.


I reverted back to Revision 343, seems to have fixed it. Getting help from R!ch!e, now. Thanks for all the help!

Bad Boy JH

2010-01-25 23:24:50

program ClickBankDTM;
{.include SRL/SRL.scar}

var
fx, fy : integer;

function BankSym(fx,fy: Integer):boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;
end;

begin
SetupSRL;
ActivateClient;
if(BankSym(fx,fy))then
begin
Writeln('Yes');
Mouse(fx,fy, 2, 2, True);
end;
end.

You see the Fx and fy aren't being outputted as variables, they are inputs…

try this


program ClickBankDTM;
{.include SRL/SRL.scar}

var
fx, fy : integer;

function BankSym(var fx,fy: Integer):boolean;
var
BSM, x, y : integer;
begin
Result := False
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;
end;

begin
SetupSRL;
ActivateClient;
if(BankSym(fx,fy))then
begin
Writeln('Yes');
Mouse(fx,fy, 2, 2, True);
end;
end.

see the change
(fx, fy:integer)
became
(var fx, fy:integer) meaining they are outputted as variables and saved. before you put in the var, they weren't registed…

ALSO I added Result := False at the begining, that way, if it doesn't find the DTM, it won't still assume its true, because Im pretty sure true is the default status for one of those…

then try replacing

If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;

with

Result := FindDTM(BSM, fx, fy, MMX1, MMY1, MMX2, MMY2)

less code…

0wn 4 skill

2010-01-26 03:41:01

From: Bad Boy JH
program ClickBankDTM;
{.include SRL/SRL.scar}

var
fx, fy : integer;

function BankSym(fx,fy: Integer):boolean;
var
BSM, x, y : integer;
begin
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;
end;

begin
SetupSRL;
ActivateClient;
if(BankSym(fx,fy))then
begin
Writeln('Yes');
Mouse(fx,fy, 2, 2, True);
end;
end.

You see the Fx and fy aren't being outputted as variables, they are inputs…

try this


program ClickBankDTM;
{.include SRL/SRL.scar}

var
fx, fy : integer;

function BankSym(var fx,fy: Integer):boolean;
var
BSM, x, y : integer;
begin
Result := False
BSM := DTMFromString('78DA63FCC2C4C0709D0105BCBFA008A619A17' +
'CC6DF4035D718D00023AA1A90391708A8798B6917869AF7403577' +
'08A8F949841A907BEEE1570300AFC40E99');
If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;
end;

begin
SetupSRL;
ActivateClient;
if(BankSym(fx,fy))then
begin
Writeln('Yes');
Mouse(fx,fy, 2, 2, True);
end;
end.

see the change
(fx, fy:integer)
became
(var fx, fy:integer) meaining they are outputted as variables and saved. before you put in the var, they weren't registed…

ALSO I added Result := False at the begining, that way, if it doesn't find the DTM, it won't still assume its true, because Im pretty sure true is the default status for one of those…

then try replacing

If FindDTM( BSM, x, y, MMX1, MMY1, MMX2, MMY2) then
Begin
Result:=True;
fx:=x;
fy:=y;
end;

with

Result := FindDTM(BSM, fx, fy, MMX1, MMY1, MMX2, MMY2)

less code…


oh dear god thanks man

Bad Boy JH

2010-01-26 03:43:54

So long as that wasn't sarcasm…your welcome!

0wn 4 skill

2010-01-26 11:40:03

Sarcasm? I wouldn't dream of it!

Thanks for your help dude :)