SRL Archive - OSR Help

DTM's


Ace257

2010-06-30 20:01:39

okay so i have my script, i need to add onto it though like add more dtm's i was wondering if someone could give me an example on how to incorporate this dtm into the script like say for instance if A doesn't happen then do Q.. I know java has the else method, but im not sure if scar allows it.

This is what i want it to find if it can't find A.

Q : Result:= DTMFromString('78DA6314616060906640015F73B919F881342' +
'394CF0852A38CAAE65B3F17440E590D139A9A6E6E5435202E3B9A' +
'9A6C347340F670A3A929E441510300EC0B083C');

This is the script.

Program Blacksmith;
{.Include SRL/SRL.scar}
Var
A, X, Y:Integer;

Function FindDTMCustom(var A, X, Y:Integer): Boolean;
Begin
A := DTMFromString('78DA639466606050604001DFFB7918FE03694' +
'620FE0F048C52400633AA9A9FD39DC0342394CF68002414D1D494' +
'59A3AA0199638CAAE6479711AA1A564CF760A81101126204EC520' +
'212E204D42803090D026A40F6A8A1A9399684A20600913516A8');
Result := FindDTM(A, X, Y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(A);
End;

Begin
If FindDTMCustom(A, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(1000+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
End.

Thank you anyone that can give me some advice! :)

NCDS

2010-06-30 20:33:58

From: Ace257
okay so i have my script, i need to add onto it though like add more dtm's i was wondering if someone could give me an example on how to incorporate this dtm into the script like say for instance if A doesn't happen then do Q.. I know java has the else method, but im not sure if scar allows it.

This is what i want it to find if it can't find A.

Q : Result:= DTMFromString('78DA6314616060906640015F73B919F881342' +
'394CF0852A38CAAE65B3F17440E590D139A9A6E6E5435202E3B9A' +
'9A6C347340F670A3A929E441510300EC0B083C');

This is the script.

Program Blacksmith;
{.Include SRL/SRL.scar}
Var
A, X, Y:Integer;

Function FindDTMCustom(var A, X, Y:Integer): Boolean;
Begin
A := DTMFromString('78DA639466606050604001DFFB7918FE03694' +
'620FE0F048C52400633AA9A9FD39DC0342394CF68002414D1D494' +
'59A3AA0199638CAAE6479711AA1A564CF760A81101126204EC520' +
'212E204D42803090D026A40F6A8A1A9399684A20600913516A8');
Result := FindDTM(A, X, Y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(A);
End;

Begin
If FindDTMCustom(A, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(1000+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
End.

Thank you anyone that can give me some advice! :)



Program Blacksmith;
{.Include SRL/SRL.scar}
Var
A, X, Y:Integer;

Function FindDTMCustom(var A, X, Y:Integer): Boolean;
Begin
A := DTMFromString('78DA639466606050604001DFFB7918FE03694' +
'620FE0F048C52400633AA9A9FD39DC0342394CF68002414D1D494' +
'59A3AA0199638CAAE6479711AA1A564CF760A81101126204EC520' +
'212E204D42803090D026A40F6A8A1A9399684A20600913516A8');
Result := FindDTM(A, X, Y, MSX1, MSY1, MSX2, MSY2);
if not Result then
begin
Q := DTMFromString('78DA6314616060906640015F73B919F881342' +
'394CF0852A38CAAE65B3F17440E590D139A9A6E6E5435202E3B9A' +
'9A6C347340F670A3A929E441510300EC0B083C');
Result := FindDTM(Q, X, Y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(Q);
end;
FreeDTM(A);
End;

Begin
If FindDTMCustom(A, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(1000+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
End.

Scar does allow if..then..else statements as well.

Coh3n

2010-07-01 06:15:13

^ That should work, but just so you know, SCAR allows else statements. ;)

Ace257

2010-07-01 23:54:30

when i run it it says unknown identifier Q how do i fix this? and if i put Q in as an integer it says syntax error…

cycrosism

2010-07-02 04:23:31

From: Ace257
when i run it it says unknown identifier Q how do i fix this? and if i put Q in as an integer it says syntax error…


I just added Q as an integer and it compiled


Program Blacksmith;
{.Include SRL/SRL.scar}
Var
A, X, Y, Q:Integer;

Function FindDTMCustom(var A, X, Y:Integer): Boolean;
Begin
A := DTMFromString('78DA639466606050604001DFFB7918FE03694' +
'620FE0F048C52400633AA9A9FD39DC0342394CF68002414D1D494' +
'59A3AA0199638CAAE6479711AA1A564CF760A81101126204EC520' +
'212E204D42803090D026A40F6A8A1A9399684A20600913516A8');
Result := FindDTM(A, X, Y, MSX1, MSY1, MSX2, MSY2);
if not Result then
begin
Q := DTMFromString('78DA6314616060906640015F73B919F881342' +
'394CF0852A38CAAE65B3F17440E590D139A9A6E6E5435202E3B9A' +
'9A6C347340F670A3A929E441510300EC0B083C');
Result := FindDTM(Q, X, Y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(Q);
end;
FreeDTM(A);
End;

Begin
If FindDTMCustom(A, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(1000+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
End.

Ace257

2010-07-02 17:36:27

okay so now i getting this problem. anyone know what this means?
[Error] (21150:4): Identifier expected

Program Blacksmith;
{.Include SRL/SRL.scar}
Var
A, X, Y, Q, W:Integer;
Function FindDTMCustom(var A, X, Y:Integer): Boolean;
Begin
A := DTMFromString('78DA639466606050604001DFFB7918FE03694' +
'620FE0F048C52400633AA9A9FD39DC0342394CF68002414D1D494' +
'59A3AA0199638CAAE6479711AA1A564CF760A81101126204EC520' +
'212E204D42803090D026A40F6A8A1A9399684A20600913516A8');
Result := FindDTM(A, X, Y, MSX1, MSY1, MSX2, MSY2);
if not Result then
begin
Q := DTMFromString('78DA6314616060906640015F73B919F881342' +
'394CF0852A38CAAE65B3F17440E590D139A9A6E6E5435202E3B9A' +
'9A6C347340F670A3A929E441510300EC0B083C');
Result := FindDTM(Q, X, Y, MSX1, MSY1, MSX2, MSY2);
if not Result then
begin
W:= DTMFromString('78DA6314656060106640015F57B033F003694' +
'6289F510048F0A0A98985CAC1D480CC914155F36D8D32AA1A3E4C' +
'355F730550D5A86271CF5C66543520AE109A5D493CA86A2481040' +
'B9A9A1A6E143500E23D0BCA');
Result := FindDTM(W, X, Y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(W);
end;
Begin
FreeDTM(Q);
end;
Begin
FreeDTM(A);
end;
Begin
If FindDTMCustom(A, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
Begin
If FindDTMCustom(Q, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
Begin
If FindDTMCustom(W, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
End;
End;
End.

Frement

2010-07-02 17:41:23

You had many un-needed begins in there that were missing ends.

Program Blacksmith;
{.Include SRL/SRL.scar}

Var
A, X, Y, Q, W:Integer;

Function FindDTMCustom(var A, X, Y:Integer): Boolean;
Begin
A := DTMFromString('78DA639466606050604001DFFB7918FE03694' +
'620FE0F048C52400633AA9A9FD39DC0342394CF68002414D1D494' +
'59A3AA0199638CAAE6479711AA1A564CF760A81101126204EC520' +
'212E204D42803090D026A40F6A8A1A9399684A20600913516A8');
Result := FindDTM(A, X, Y, MSX1, MSY1, MSX2, MSY2);
if not Result then
begin
Q := DTMFromString('78DA6314616060906640015F73B919F881342' +
'394CF0852A38CAAE65B3F17440E590D139A9A6E6E5435202E3B9A' +
'9A6C347340F670A3A929E441510300EC0B083C');
Result := FindDTM(Q, X, Y, MSX1, MSY1, MSX2, MSY2);
if not Result then
begin
W:= DTMFromString('78DA6314656060106640015F57B033F003694' +
'6289F510048F0A0A98985CAC1D480CC914155F36D8D32AA1A3E4C' +
'355F730550D5A86271CF5C66543520AE109A5D493CA86A2481040' +
'B9A9A1A6E143500E23D0BCA');
Result := FindDTM(W, X, Y, MSX1, MSY1, MSX2, MSY2);
end;
end;
FreeDTM(W);
FreeDTM(Q);
FreeDTM(A);
end;

Begin
If FindDTMCustom(A, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
If FindDTMCustom(Q, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
If FindDTMCustom(W, X, Y) Then
Begin
MoveMouseSmooth(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
End.

Ace257

2010-07-02 17:57:01

okay it says successfully compiled, but it says [Runtime Error] : Exception: Access violation at address 00786FCC in module 'scar.exe'. Read of address 0000001C in line 30 in script C:\Users\Chip\Desktop\SCAR 3.22\Scripts\real.scar

do i need to worry about this?

Frement

2010-07-02 18:03:17

Protip: use Simba.

Ace257

2010-07-02 19:19:32

is thier an easy way to converT?
i don't really like simba, can anyone else help on this runtime problem?

i luffs yeww

2010-07-02 20:18:54

Just a heads up, if this is for RuneScape, you should use SCAR 3.23.

Anyway, why don't you like Simba? And what you have should work just fine in Simba. Can't check right now, though.

Try running as administrator?

Frement

2010-07-02 20:22:24

From: i luffs yeww
Just a heads up, if this is for RuneScape, you should use SCAR 3.23.

Anyway, why don't you like Simba? And what you have should work just fine in Simba. Can't check right now, though.

Try running as administrator?


I don't think Simba has MoveMouseSmooth but he could use MMouse(X, Y, 3, 3);

Ace257

2010-07-02 20:39:53

sorry first time using simba, lol. it was giving me problems but i figured it out. Simba doesn't have humanmouse movements? :/

i luffs yeww

2010-07-02 20:43:49

^ wat. MMouse/Mouse are human-like.

Ace257

2010-07-02 21:04:54

i thought Movemousesmooth or movewindmouse wass…. guess im wrong. fixed that one problem now i have a problem in simba with the clickmouse..it says type mismatch.


Program Blacksmith;
Var
A, X, Y, Q, W:Integer;
Function FindDTMCustom(var A, X, Y:Integer): Boolean;
Begin
A := DTMFromString('78DA639466606050604001DFFB7918FE03694' +
'620FE0F048C52400633AA9A9FD39DC0342394CF68002414D1D494' +
'59A3AA0199638CAAE6479711AA1A564CF760A81101126204EC520' +
'212E204D42803090D026A40F6A8A1A9399684A20600913516A8');
Result := FindDTM(A, X, Y, 517, 90, 738, 600);
if not Result then
begin
Q := DTMFromString('78DA6314616060906640015F73B919F881342' +
'394CF0852A38CAAE65B3F17440E590D139A9A6E6E5435202E3B9A' +
'9A6C347340F670A3A929E441510300EC0B083C');
Result := FindDTM(Q, X, Y, 517, 90, 738, 600);
if not Result then
begin
W:= DTMFromString('78DA6314656060106640015F57B033F003694' +
'6289F510048F0A0A98985CAC1D480CC914155F36D8D32AA1A3E4C' +
'355F730550D5A86271CF5C66543520AE109A5D493CA86A2481040' +
'B9A9A1A6E143500E23D0BCA');
Result := FindDTM(W, X, Y, 517, 90, 738, 600);
end;
end;
FreeDTM(W);
FreeDTM(Q);
FreeDTM(A);
end;
Begin
If FindDTMCustom(A, X, Y) Then
Begin
MoveMouse(X,Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
If FindDTMCustom(Q, X, Y) Then
Begin
MoveMouse(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
If FindDTMCustom(W, X, Y) Then
Begin
MoveMouse(X, Y);
Wait(100+random(100));
ClickMouse(X, Y, True);
ClickMouse(X, Y, True);
End;
End.

Frement

2010-07-02 21:05:21

Instead of clickmouse use Mouse(); Way more human-like.

Ace257

2010-07-02 21:11:19

if i use mouse it says unknown identifier..

Frement

2010-07-02 21:18:14

You need to include SRL, and use SetupSRL; Try reading some beginner tutorials.

Ace257

2010-07-06 02:51:28

fixed it thanks :)