Wizzup?
2008-05-25 11:52:00
Please report any bugs / files that should be in there.
I will move it to SRL Members after a few days.
2008-05-25 11:52:00
2008-05-25 12:16:43
2008-05-25 12:21:03
2008-05-25 12:21:33
2008-05-25 13:17:34
2008-05-25 13:46:48
2008-05-25 13:58:35
2008-05-25 14:13:00
2008-05-25 14:22:39
From: Sumilion
Have a peek in Scripting Tools too (ACA). It automates a thing or two for you with the new object finder. The creating of FindObjRecord thingy has a little bug but all you have to do is add : MSX1, MSY1, MSX2, MSY2 to the parameters, I trust you know how ;)
2008-05-25 14:23:42
// ยป function FindObjTPAMulti(var x, y: integer; color, tol, cts, ObjWidth, ObjHeight, // * by Wizzup
// minCount :Integer; UpText: tstringarray): Boolean;
procedure ShopSwitchTab(name:string); // * by Rasta Magician
2008-05-25 14:44:31
2008-05-25 15:06:58
From: Bobarkinator
Ah I noticed that the ACA included is new. It does the Record for you. Be nice to do it in runtime though.
2008-05-25 15:26:58
From: Sumilion
To do what runtime ?
2008-05-25 17:02:14
From: Bobarkinator
Get the info during runtime. Lik GetObjRecord(Colors: TIntegerArray): TAutoColorInfo;. It would get all the info from the colors. With Colors you collect. Most likely user input. And the more I think about it, I think if you have the colors then find the object yourself. So never mind :p
2008-05-26 13:59:33
if (FindDtm(DTMRange[i], FX, FY, x1, y1, x2, y2)) then
begin
if (IntInBox(FX, FY, IntToBox(10, 10, 500, 330))) then
if (FindDtm(DTMRange[i], FX, FY, x1, y1, x2, y2)) then
begin
if (FX > 10) and (FY > 10) and (FX < 500) and (FY < 330) then
2008-05-26 14:34:07
2008-05-26 14:36:03
From: n3ss3s
I have no idea why we didn't modernize it to TPAs…
2008-05-26 14:56:17
2008-05-26 15:18:03
program New;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Mining.scar}
var
x, y: Integer;
begin
SetupSRL;
SetupMining;
FindObjRock(x, y, rimmington_Iron);
end.
2008-05-27 02:52:50
program Tolerance_Finder_by_Abyssal_and_Bobarkinator;
var
bx, by, Col: Integer;
EndInitForm: Boolean;
frmTolFind: TForm;
lblColor: Array of TLabel;
btnPick: Array of TButton;
btnAdd: TButton;
lblTolerance, lblTol: TLabel;
txtColor: Array of TEdit;
TolTime: TTimer;
ColorArray: TIntegerArray;
procedure PickCol(Sender: TObject);
Var
I: Integer;
begin
PickColor(Col, bx, by);
For I:= 0 To High(btnPick) Do
If Sender = btnPick[i] Then
Begin
txtColor[i].Text:= IntToStr(Col);
Break;
End;
end;
function GetTolerance(Colors: TIntegerArray): Integer;
var
i,L,C,Tol: Integer;
TolCount: TIntegerArray;
begin
SetArrayLength(TolCount, GetArrayLength(Colors));
For L:= 0 To High(Colors) Do
For C:= 0 TO High(Colors) Do
Begin
While Not SimilarColors(Colors[L], Colors[C], Tol) Do
Inc(Tol);
If Tol > TolCount[L] Then TolCount[L]:= Tol;
Tol:= 0;
End;
For I:= 0 to High(Colors) Do
If TolCount[I] < TolCount[Tol] Then Tol:= I;
Result:= TolCount[Tol];
end;
Function ColorsToIntArray: TIntegerArray;
Var
I: Integer;
Begin
SetArrayLength(Result, GetArrayLength(txtColor));
For I:= 0 To High(txtColor) Do
Result[I]:= StrToInt(txtColor[I].Text);
End;
procedure TolTimeProc(Sender: TObject);
begin
Try
ColorArray:= ColorsToIntArray;
lblTol.Caption:= IntToStr(GetTolerance(ColorArray));
Except End;
end;
Procedure AddColor(Sender: TObject);
Var
I: Integer;
Begin
I:= GetArrayLength(lblColor) + 1;
frmTolFind.Height:= ((I + 1)* 30) + 35
btnAdd.Top:= (I * 30) + 10;
SetArrayLength(lblColor, I);
lblColor[I - 1]:= TLabel.Create(frmTolFind);
With lblColor[I - 1] Do
Begin
Parent:= frmTolFind;
Left:= 10;
Top:= ((I - 1) * 30) + 13;
Width:= 68;
Height:= 14;
Caption:= 'Color ' + IntToStr(I) + ':';
End;
SetArrayLength(txtColor,I);
txtColor[I - 1]:= TEdit.Create(frmTolFind);
With txtColor[I - 1] Do
Begin
Parent:= frmTolFind;
Left:= 81;
Top:= ((I - 1) * 30) + 10;
Width:= 121;
Height:= 22;
TabOrder:= 8 + I - 1;
End;
SetArrayLength(btnPick, I);
btnPick[I - 1]:= TButton.Create(frmTolFind);
With btnPick[I - 1] Do
Begin
Parent:= frmTolFind;
Left:= 206;
Top:= ((I - 1) * 30) + 11;
Width:= 20;
Height:= 20;
Caption:= 'P';
OnClick:= @PickCol;
End;
End;
procedure InitFormOnClose(Sender: TObject; var Action: TCloseAction);
begin
if(not(frmTolFind.ModalResult = 1))then
EndInitForm:= True;
end;
procedure InitForm;
begin
frmTolFind:= CreateForm;
with frmTolFind do
begin
OnClose:= @InitFormOnClose;
BorderStyle:= bsSingle;
BorderIcons:= [biSystemMenu];
FormStyle:= fsStayOnTop;
Left:= 265;
Top:= 128;
Width:= 350;
Height:= 125;
Caption:= 'Tolerance Finder by Abyssal';
Color:= clBtnFace;
Font.Color:= clWindowText;
Font.Height:= -12;
Font.Name:= 'Verdana';
Font.Style:= [];
PixelsPerInch:= 96;
end;
TolTime:= TTimer.Create(frmTolFind);
with TolTime do
begin
Interval:= 250;
OnTimer:= @TolTimeProc;
end;
lblColor[0]:= TLabel.Create(frmTolFind);
with lblColor[0] do
begin
Parent:= frmTolFind;
Left:= 10;
Top:= 13;
Width:= 68;
Height:= 14;
Caption:= 'Color 1:';
end;
lblColor[1]:= TLabel.Create(frmTolFind);
with lblColor[1] do
begin
Parent:= frmTolFind;
Left:= 10;
Top:= 43;
Width:= 68;
Height:= 14;
Caption:= 'Color 2:';
end;
txtColor[0]:= TEdit.Create(frmTolFind);
with txtColor[0] do
begin
Parent:= frmTolFind;
Left:= 81;
Top:= 10;
Width:= 121;
Height:= 22;
TabOrder:= 8;
end;
txtColor[1]:= TEdit.Create(frmTolFind);
with txtColor[1] do
begin
Parent:= frmTolFind;
Left:= 81;
Top:= 40;
Width:= 121;
Height:= 22;
TabOrder:= 9;
end;
btnPick[0]:= TButton.Create(frmTolFind);
With btnPick[0] Do
Begin
Parent:= frmTolFind;
Left:= 205;
Top:= 11;
Width:= 20;
Height:= 20;
Caption:= 'P';
OnClick:= @PickCol;
End;
btnPick[1]:= TButton.Create(frmTolFind);
With btnPick[1] Do
Begin
Parent:= frmTolFind;
Left:= 206;
Top:= 41;
Width:= 20;
Height:= 20;
Caption:= 'P';
OnClick:= @PickCol;
End;
btnAdd:= TButton.Create(frmTolFind);
With btnAdd Do
Begin
Parent:= frmTolFind;
Left:= 81;
Top:= 70;
Width:= 121;
Height:= 22;
Caption:= 'Add color';
OnClick:= @AddColor;
End;
lblTolerance:= TLabel.Create(frmTolFind);
with lblTolerance do
begin
Parent:= frmTolFind;
Left:= 236;
Top:= 29;
Width:= 66;
Height:= 14;
Caption:= 'Tolerance:';
Font.Color:= clWindowText;
Font.Height:= -12;
Font.Name:= 'Verdana';
Font.Style:= [];
ParentFont:= False;
end;
lblTol:= TLabel.Create(frmTolFind);
with lblTol do
begin
Parent:= frmTolFind;
Left:= 308;
Top:= 29;
Width:= 9;
Height:= 14;
Caption:= '0';
Font.Color:= clWindowText;
Font.Height:= -12;
Font.Name:= 'Verdana';
Font.Style:= [fsBold];
ParentFont:= False;
end;
end;
procedure SafeInitForm;
var
V: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('InitForm', V);
end;
procedure ShowInitFormModal;
begin
frmTolFind.ShowModal;
end;
procedure SafeShowInitFormModal;
var
V: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowInitFormModal', V);
end;
procedure MainInitForm;
begin
SafeInitForm;
SafeShowInitFormModal;
FreeForm(frmTolFind);
end;
begin
SetArrayLength(txtColor, 2);
SetArrayLength(lblColor, 2);
SetArrayLength(btnPick, 2);
ClearDebug;
MainInitForm;
if(EndInitForm)then
TerminateScript;
end.
2008-05-27 03:24:33
From: Bobarkinator
All of SRL needs to be TPAized.
2008-05-27 03:29:09
From: Wizzup?
Yes!
2008-05-27 04:06:07
2008-05-27 04:24:09
From: n3ss3s
SKy, if you didn't notice (:p) almost all of the SCAR side functions of the Leo -solver use TPAs :D
2008-05-27 05:45:26
2008-05-27 06:33:03
2008-05-27 10:53:54
From: Markus
We should fully DTMize SRL :D
2008-05-27 11:04:23
2008-05-28 05:29:03
Anything but TPA's! TPAs are taking over the world :scared:
DTM = Slow TPA, with less attributes.
2008-05-28 06:15:52
2008-05-28 12:47:06
2008-05-28 16:37:47
From: n3ss3s
C: Array [0..1] of Integer :p I think that's closer to a "Double Array" than a two dimensional array is x)
What's so special about your 2D array?
2008-05-28 22:44:33
2008-05-28 22:53:36
2008-05-28 23:33:55
From: Bobarkinator
TPointArrayArray FTW :p
2008-05-28 23:54:15
From: bullzeye95
Get with the times: T2DPointArray :rolleyes:
2008-05-29 09:10:03
2008-05-29 09:34:33
2008-05-29 15:43:21
2008-05-29 16:40:22
2008-05-29 17:34:53
2008-05-30 16:46:28
2008-05-30 16:55:14
From: XcanadamanX
it couldn't find the forester for me. it kept clicking the plants and trees
2008-05-30 17:40:02
2008-06-01 04:28:44
2008-06-01 04:53:02
2008-06-01 05:02:52
2008-06-01 05:31:13
2008-06-01 06:48:11
2008-06-01 09:53:45
2008-06-01 12:47:09
2008-06-01 13:22:36
2008-06-01 13:23:16
2008-06-02 04:20:34
From: the scar noob
kinda like 12 spam-posts of you all.. shame you, I should give you all an infraction!:p
-Tsn.
2008-06-02 07:11:33
2008-06-02 08:27:31
2008-06-02 11:07:00
From: Wizzup?
I thought you added the 'Can' yourself, SKy. :(
2008-06-02 13:53:30
2008-06-03 19:21:13
From: Sumilion
Also just for kicks, run this in the rimmington mine near the iron ores.program New;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Mining.scar}
var
x, y: Integer;
begin
SetupSRL;
SetupMining;
FindObjRock(x, y, rimmington_Iron);
end.
From: tarajunky
Which Dev revision does this most closely resemble?
2008-06-04 10:59:14
2008-06-04 11:32:48
2008-06-04 11:49:38
{^^^^^^^^^^^^^^^^^ MINEROCK ^^^^^^^^^^^^^^^^^^^^^^^}
{This Procedure will find a rock And mine it. Rocktype defines the rock
your looking For. 1 is clay, 2 is copper, 3 is tin
4 is iron, 5 is silver, 6 is coal, 7 is gold, 8 is mithril, 9 is
adamantite And 10 is rune}
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^}
Function MineRock(RockType, x1, y1, x2, y2 : Integer) : Boolean;
2008-06-04 11:51:10
From: Markus
Maybe:
{^^^^^^^^^^^^^^^^^ MINEROCK ^^^^^^^^^^^^^^^^^^^^^^^}
{This Procedure will find a rock And mine it. Rocktype defines the rock
your looking For. 1 is clay, 2 is copper, 3 is tin
4 is iron, 5 is silver, 6 is coal, 7 is gold, 8 is mithril, 9 is
adamantite And 10 is rune}
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^}
Function MineRock(RockType, x1, y1, x2, y2 : Integer) : Boolean;
2008-06-04 11:51:53
2008-06-04 11:53:07
From: the scar noob
And what has that to do with squig??:p
-Tsn.
2008-06-04 12:19:41
2008-06-04 12:25:39
From: WT-Fakawi
Squig! Finally!
2008-06-04 12:28:23
From: tarajunky
Is anyone else having problems with Trade.scar?
It compiles now, but it's still not really working for me. It usually doesn't wait for the tradescreen to open, and doesn't correctly identify items when it does.
2008-06-04 12:28:30
2008-06-04 13:32:09
From: Rasta Magician
sumilion, i think i once read that one of fawk's dreams for srl was to have super fast function that could do about everything.
(findRock, findTree, Cook('meat') ) etc. so i guess it's good. :p
~RM
2008-06-04 15:20:52
From: Boreas
Warning: Trying to comprehend teh Fawks awesome power may have dire consequences.
2008-06-05 15:00:42
repeat
Walk(Falador, Rimmington)
Mine;
Bank(Falador)
until(False)2008-06-05 19:01:57
From: WT-Fakawi
Squig dreamed of script that could do virtually anything from anywhere, with lots of High-Level Functions, only at the time he didnt have the knowledge to accomplish such tasks. He tried scripts like:
repeat
Walk(Falador, Rimmington)
Mine;
Bank(Falador)
until(False)
He was however the first one that prooved to me possible writing a HUGE library on your own. But actually his ugly library (sry squiglyo) was the only Library that turned out to be totally obsolete once I figured out which stuff I needed from ppsuqbalwz, mutant and RsN for compiling SRL.
I have always been in favor of High Level functionality, hence the Skill-Libraries. It was tara's remarks: " Which Dev revision does this most closely resemble?" that triggered me to say "Squig!"
With all the talent SRL has these days, I see Squig's dream becoming more and more reality. And not only that….with beautiful code too!