SRL Archive - SRL Archives

SRL Revision #15 and #16


Wizzup?

2008-04-05 12:03:38

SRL Revision #15.

  • Updated worlds.ini
  • Fixed CurrentWorld and Added GetCurrentWorld
  • All SRL-Development suggestions have been taken care of.
  • Fixed a bug in Withdraw.
  • Findlamp now supports all skills.
  • Added a new ChooseOption, which uses TPA's. What else? ;)
  • (MSX1, MSY1) has changed from (1,1) to (4,4)
  • Added a Const called SRLVersionNumber.
  • FindObj, FindObjEx and FindObjCustom use a new algorithm.
  • Players[].Pin has changed from an Integer to a String.
  • The DropItem() wait has been decreased.
  • LoggedIn now uses a findcolor instead of a getcolor.
  • All BankOpeners support Pin codes.
  • GetATPABounds, DrawTPACanvas and DrawATPACanvas have been added to WizzyPlugin.
  • w_UpdateLastBlackLine has been removed. FindDead has been adjusted so that it will still function.
  • FindRockColor and FindWaterColor have been updated,
  • Path.scar now uses a dynamic array. Default is still 50. Do not forget to call SetupPath;
  • You can either set the 'Path' length by using SetPathLength(yourlength) or just SetLength(Path, yourlength).
  • 'Clothes Shop' was twice in the newAutoColor array.
  • FFlag returns a boolean.
  • Added a failsafe in FixBank…

General updates and fixes:

  • We have tried to add more initilization to functions. (Result := '', Result := False, and Result := 0);
  • We have added an error system.
{*******************************************************************************
Procedure srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer);
by: SRL Dev Team
Description: WriteLn's a warning message.
*******************************************************************************}

Const
warn_AllVersions = 0;
warn_Terminate = -1;
warn_Warning = -2;

Procedure srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer);

Begin
Case wVersion Of
warn_Terminate: begin end;
warn_AllVersions: begin end;
warn_Warning: If Not ShowWarnings Then
Exit;
Else If wVersion <> SRLVersionNumber Then
Exit;
End;
WriteLn('** Warning in ' + ProcName + ': ' + ErrorMessage + '**');
If wVersion = -1 Then
TerminateScript;
End;

Apart from the three constants, you can also give the procedure a certain Revision number. Like we did in the new Deposit:
Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

Var
DepositX: Boolean;
All: Variant;
I, T, x, y: Integer;

Begin
If Not BankScreen Then
Exit;
If vType = 2 Then
srl_Warn('Deposit', '2 now means store per 2, not ''All''', 15);
DepositX := False;
Case VarType(vType) Of
3: Begin
DepositX := Not InIntArray([1, 5, 10], vType);
If vType = 1 Then
All := False
Else
All := True;
End;
11: All := vType;
End;
For I := 1 To 28 Do
Begin
If Not ExistsItem(I) Then
Continue;
MouseItem(I, Not All);
If DepositX Then
Begin
ChooseOption('Store X');
T := GetSystemTime;
While (Not FindColor(x, y, 8388608, MCX1, MCY1, MCX2, MCY2)) And (GetSystemTime - T < 3000) Do
Wait(100);
TypeSend(vType);
End Else If VarType(vType) = 3 Then
ChooseOption('Store ' + vType)
Else
ChooseOption('Store All');
T := GetSystemTime;
While ExistsItem(I) And (GetSystemTime - T < 2000) Do
Wait(50);
End;
End;

New ChooseOption:

function ChooseOption(txt: string): Boolean;
var
B: TBox;
P: TPointArray;
X, Y: Integer;

begin
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
FindColorsTolerance(P, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
If Length(P) = 0 Then
Exit;
B := GetTPABounds(P);
If FindText(X, Y, txt, upchars, B.X1, B.Y1, B.X2, B.Y2) Then
Begin
Result := True;
Mouse(B.X1 + 5, y + 1, Random(B.X2 - B.X1), random(13), True);
End
Else
begin
MMouse(B.X1 - 50, B.Y1 - 50, 40, B.Y2 - B.Y1);
Wait(200 + Random(100));
end;
end;

Wizzup?

2008-04-05 16:16:57

If you call GameTab when the bankscreen is open, you might experience some Warnings messages.

The fix would be changing srl_AllVersions to srl_Warning.
This is such a harmless bug that I will not release another revision so quickly, but for the scripters amongst you - it will fix that annoying warning message. ;)

function GameTab(tabnumber: Integer): Boolean;
var
c: Integer;
Coords: TPoint;
begin
if ((Tabnumber < 1) or (TabNumber > 15)) then
begin
srl_Warn('GameTab', IntToStr(tabnumber) + ' is no valid GameTab', warn_AllVersions);
Result := False;
Exit;
end;
if not TabExists(tabnumber) then
begin
srl_Warn('GameTab', IntToStr(tabnumber) + ' does not exist', warn_Warning); // <-- Used to be warn_AllVersions.
Result := False;
Exit;
end;
if (tabnumber = 14) then
Coords := Point(752, 12)
else if (tabnumber = 15) then
Coords := Point(538, 485)
else if (tabnumber <= 7) then
Coords := Point(540 + ((tabnumber -1) * 33), 185)
else
Coords := Point(540 + ((tabnumber mod 7) * 33), 485);
while not(GetCurrentTab = tabnumber) and (c < 4) do
Begin
Mouse(Coords.x, Coords.y, 8, 8, true);
Inc(c);
end;
Result := (GetCurrentTab = tabnumber);
end;

Wizzup?

2008-04-20 11:06:17

#16.

Deposit Fix, Two new bitmaps. (Dragon Axe and Maple Log)
New (experimental) function in NewAutoColor.scar