SRL Archive - Help

Withdraw method doesn't work :(


Syntax

2012-06-09 22:50:25

So I made this script in a couple minutes and thought it'd work.. Anyway if anyone could point out what is wrong with it:
program Astral_Crafter;
//{$DEFINE SMART}
{$i srl/srl.simba}


Procedure DeclarePlayers;
begin;
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;

Players[0].Name:='';
Players[0].Pass:='';
Players[0].Nick:='';
Players[0].Active:=True;
Players[0].Pin:='';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
Procedure Supplies;
Var
Small, Medium, Large, X, Y: Integer;

begin
Small := DTMFromString('mwQAAAHic42RgYJjCyMAwG4j7gLgHiqdBxaYC8TwgzgWqK4XiHCBOAeIEIE6HihUCsY+rFZBkxIpd7U2hbMIAuwmoGA4AQM0KtA==');
If findDTM(Small, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Small Pouch');
MMouse(x, y, 7, 7);
If WaitUpText('mal',1000+randomrange(100,700)) Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Writeln('Withdrew Small Pouch');
begin
Medium := DTMFromString('mAAEAAHic42FgYMhgZGAoAuICIM4E4iQgToDSqUBcCJXLBeJEIM4D6ikE4jIgroDS+UCcBcRpDBB5EDsViJOAONTXEUgykoBJA6SYjG46AL2TCx8=');
If findDTM(Medium, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Medium Pouch');
MMouse(x, y, 7, 7);
If WaitUpText('edi',1000) Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Writeln('Withdrew all');
begin
Large := DTMFromString('mKgEAAHic42NgYDjIyMCwC4j3AvE2KD4ExGeA+BQQHwfio0B8AogPAPFuqFg+UG8iEKcBcS4QlwFxJRCXQvlZULlkIE6AylUAsY+rFZBkJAOTB8ixCdM2ALllEY0=');
If findDTM(Large, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Large Pouch');
MMouse(x, y, 7, 7);
If WaitUpText('arg',1000+randomrange(100,700)) Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Writeln('Withdrew Large Pouch');
end;
end;
end;
end;
end;
end;
end;
end;
FreeDTM(Large);
FreeDTM(Medium);
FreeDTM(Small);
end;


begin
Smart_Signed := TRUE;
Smart_Members := False;
Smart_SuperDetail := FALSE;
Smart_Server := 35;
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.


riwu

2012-06-09 22:54:48

U need to improve ur standards..the begin and end are jumping everywhere.
Which part didn't work? What did the debug say? If it doesn't say 'Found xxx Pouch' it means it couldn't recognise ur DTMs.

Google

2012-06-09 23:03:06

program Astral_Crafter;
//{$DEFINE SMART}
{$i srl/srl.simba}

Var
Small, Medium, Large,
X, Y: Integer;
Procedure DeclarePlayers;
begin;
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;

Players[0].Name:='';
Players[0].Pass:='';
Players[0].Nick:='';
Players[0].Active:=True;
Players[0].Pin:='';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
Procedure CallThings;
Begin
Small := DTMFromString('mwQAAAHic42RgYJjCyMAwG4j7gLgHiqdBxaYC8TwgzgWqK4XiHCBOAeIEIE6HihUCsY+rFZBkxIpd7U2hbMIAuwmoGA4AQM0KtA==');
Medium := DTMFromString('mAAEAAHic42FgYMhgZGAoAuICIM4E4iQgToDSqUBcCJXLBeJEIM4D6ikE4jIgroDS+UCcBcRpDBB5EDsViJOAONTXEUgykoBJA6SYjG46AL2TCx8=');
Large := DTMFromString('mKgEAAHic42NgYDjIyMCwC4j3AvE2KD4ExGeA+BQQHwfio0B8AogPAPFuqFg+UG8iEKcBcS4QlwFxJRCXQvlZULlkIE6AylUAsY+rFZBkJAOTB8ixCdM2ALllEY0=');
End;
Procedure FreeThings;
Begin
FreeDTM(Small);
FreeDTM(Medium);
FreeDTM(Large);
End;
Procedure Supplies;
begin
If findDTM(Small, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Small Pouch');
MMouse(x, y, 7, 7);
ClickMouse2(True);
Writeln('Withdrew Small Pouch');
end;
If findDTM(Medium, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Medium Pouch');
MMouse(x, y, 7, 7);
ClickMouse2(True);
Writeln('Withdrew Medium Pouch');
end;
If findDTM(Large, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Large Pouch');
MMouse(x, y, 7, 7);
ClickMouse2(True);
Writeln('Withdrew Large Pouch');
end;
end;


begin
Smart_Signed := TRUE;
Smart_Members := False;
Smart_SuperDetail := FALSE;
Smart_Server := 35;
SetUpSRL;
Callthings;
AddOnTerminate('FreeThings');
ActivateClient;
DeclarePlayers;
LoginPlayer;

Repeat
Supplies;
Until(Not(LoggedIn))
FreeThings;
TerminateScript();
end.

There you go :)
Reuploaded missed a few things

Brandon

2012-06-09 23:09:15

Now I will explain what was wrong with your script since no one else did.. I'm not going to fully edit it but I did a bit..

One problem. You are calling "GetMousePox(X, Y)" before you move the mouse. When you do such a thing, it overrides X and Y with the current cursor position. Thus the cursor will move 0 pixels since it's already at there.

Next you have written your program sequentially. This means that if one function fails, all of them will since they never get called.

Example: You are looking for the small pouch first and IF that pouch is found, then it will look for the medium.. and IF that one is found then it will look for the large. What happens if the small is never found? Well it will never look for medium and in turn never look for the large.

I have left the script sequentially as you have it but I have fixed your standards and MousePos problem. You can fix the sequences yourself.

Your fixed sequential code:

program Astral_Crafter;
//{$DEFINE SMART}
{$i srl/srl.simba}


Procedure DeclarePlayers;
begin;
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;

Players[0].Name:='';
Players[0].Pass:='';
Players[0].Nick:='';
Players[0].Active:=True;
Players[0].Pin:='';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
Procedure Supplies;
Var
Small, Medium, Large, X, Y: Integer;

begin
Small := DTMFromString('mwQAAAHic42RgYJjCyMAwG4j7gLgHiqdBxaYC8TwgzgWqK4XiHCBOAeIEIE6HihUCsY+rFZBkxIpd7U2hbMIAuwmoGA4AQM0KtA==');
Medium := DTMFromString('mAAEAAHic42FgYMhgZGAoAuICIM4E4iQgToDSqUBcCJXLBeJEIM4D6ikE4jIgroDS+UCcBcRpDBB5EDsViJOAONTXEUgykoBJA6SYjG46AL2TCx8=');
Large := DTMFromString('mKgEAAHic42NgYDjIyMCwC4j3AvE2KD4ExGeA+BQQHwfio0B8AogPAPFuqFg+UG8iEKcBcS4QlwFxJRCXQvlZULlkIE6AylUAsY+rFZBkJAOTB8ixCdM2ALllEY0=');

If findDTM(Small, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Small Pouch');
MMouse(x, y, 7, 7);

If WaitUpText('mal',1000+randomrange(100,700)) Then
begin
ClickMouse2(MOUSE_LEFT);
Writeln('Withdrew Small Pouch');

If findDTM(Medium, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Medium Pouch');
MMouse(x, y, 7, 7);

If WaitUpText('edi',1000) Then
begin
Mouse(x, y, 0, 0, True);
Writeln('Withdrew all');

If findDTM(Large, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x, y, 7, 7);

If WaitUpText('arg',1000+randomrange(100,700)) Then
begin
Mouse(x, y, 0, 0, True);
Writeln('Withdrew Large Pouch');
end;
end;
end;
end;
end;
end;
FreeDTM(Large);
FreeDTM(Medium);
FreeDTM(Small);
end;


begin
Smart_Signed := TRUE;
Smart_Members := False;
Smart_SuperDetail := FALSE;
Smart_Server := 35;
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.


My opinion:

Procedure Supplies;
Var
X, Y, I: Integer;
ArrayOfDTMs: TIntegerArray;
Uptexts: TStringArray;
begin
Uptexts:= ['mal', 'ediu', 'rge'];
SetLength(ArrayOfDTMs, 3);
ArrayOfDTMs[0]:= DTMFromString('mwQAAAHic42RgYJjCyMAwG4j7gLgHiqdBxaYC8TwgzgWqK4XiHCBOAeIEIE6HihUCsY+rFZBkxIpd7U2hbMIAuwmoGA4AQM0KtA==');
ArrayOfDTMs[1]:= DTMFromString('mAAEAAHic42FgYMhgZGAoAuICIM4E4iQgToDSqUBcCJXLBeJEIM4D6ikE4jIgroDS+UCcBcRpDBB5EDsViJOAONTXEUgykoBJA6SYjG46AL2TCx8=');
ArrayOfDTMs[2]:= DTMFromString('mKgEAAHic42NgYDjIyMCwC4j3AvE2KD4ExGeA+BQQHwfio0B8AogPAPFuqFg+UG8iEKcBcS4QlwFxJRCXQvlZULlkIE6AylUAsY+rFZBkJAOTB8ixCdM2ALllEY0=');

For I:= 0 To 2 Do
If FindDTM(ArrayOfDTMs[I], X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(X, Y, 0, 0);
If WaitUptextMulti(Uptexts, 600) then
ClickMouse2(MOUSE_LEFT);
end;

FreeDTM(ArrayOfDTMs[0]);
FreeDTM(ArrayOfDTMs[1]);
FreeDTM(ArrayOfDTMs[2]);
end;

Also you may want to make these functions instead of procedures so that you can check the return value to tell if the Item was withdrawn.

Syntax

2012-06-11 09:14:14

Both not working for me :( I got it to work mysel ftho ty guys