SRL Archive - Senior News and General

Srl #17 [beta]


Wizzup?

2008-05-25 11:52:00

SRL #17.
Please report any bugs / files that should be in there.
I will move it to SRL Members after a few days.

Hobbit

2008-05-25 12:16:43

Not going into SVN?

Markus

2008-05-25 12:21:03

Not yet, we want to be sure everything is ok.

SKy Scripter

2008-05-25 12:21:33

I think after a few days i could have mordaut solved.. even though i haven't accomplished much… x)

n3ss3s

2008-05-25 13:17:34

If you really are going to have it done soon, in my opinion we should wait for it before releasing rev 17 to SvN.

Bobarkinator

2008-05-25 13:46:48

Woot. Didn't Sumillion make some new object finding or something?

n3ss3s

2008-05-25 13:58:35

Have a peek in Object.scar ;)

Sumilion

2008-05-25 14:13:00

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 ;)

Bobarkinator

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 ;)


Lol who doesn't have ACA already :p

Looks incredibly nice. I think I'll work on a function to fill in some of the data automatically ;)

Sir R. M8gic1an

2008-05-25 14:23:42

Nice! /me goes have a look :)

description wrong in Object.scar:


// ยป function FindObjTPAMulti(var x, y: integer; color, tol, cts, ObjWidth, ObjHeight, // * by Wizzup
// minCount :Integer; UpText: tstringarray): Boolean;

doesn't exist anymore, and in FindObjTpa you forgot to say it now uses a TSA.

btw, starblaster, damn amazing job there with FindObjRecordEx

Description missing in Amount.scar

procedure ShopSwitchTab(name:string); // * by Rasta Magician

~RM

Bobarkinator

2008-05-25 14:44:31

Ah I noticed that the ACA included is new. It does the Record for you. Be nice to do it in runtime though.

Sumilion

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.


To do what runtime ?

Bobarkinator

2008-05-25 15:26:58

From: Sumilion
To do what runtime ?


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

Sumilion

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


Yes it's pretty pointless to do it runtime, cause that would mean that either :

a.) you already got the colors, which means you can do make the record before you run it.
b.) know what the object is to get the colors from it, but if you already know where it is, why make a finder during runtime ? And even so, if you found it, you can get exact colors, why work with tolerances from the record ? Exact colors are better than tolerances (in some cases)

Special Ed

2008-05-26 13:59:33

I'm still looking through this so this post will probably be edited a lot but I might as well start it now.

in Cooking.scar from the procedure "FindRange" would


if (FindDtm(DTMRange[i], FX, FY, x1, y1, x2, y2)) then
begin
if (IntInBox(FX, FY, IntToBox(10, 10, 500, 330))) then

be better than


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

The latter is what is in there right now.

n3ss3s

2008-05-26 14:34:07

I have no idea why we didn't modernize it to TPAs…

Special Ed

2008-05-26 14:36:03

From: n3ss3s
I have no idea why we didn't modernize it to TPAs…


Heh… I was just thinking about that… Why not make all the MM and MS coordinates into TPoints and TBoxes?

Bobarkinator

2008-05-26 14:56:17

All of SRL needs to be TPAized.

Sumilion

2008-05-26 15:18:03

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.

Bobarkinator

2008-05-27 02:52:50

I modded The tolerance finder by Abyssal to support more than 2 colors as it is a great tool for when you don't feel like firing up ACA but still want to get tolerances. Anyways, here it is. You can put this one in the scripting tools or keep it as it is.

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.

Wizzup?

2008-05-27 03:24:33

From: Bobarkinator
All of SRL needs to be TPAized.


Yes!

SKy Scripter

2008-05-27 03:29:09

From: Wizzup?
Yes!


No!

n3ss3s

2008-05-27 04:06:07

SKy, if you didn't notice (:p) almost all of the SCAR side functions of the Leo -solver use TPAs :D

SKy Scripter

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


I know lol x).

just felt like saying that :).

Markus

2008-05-27 05:45:26

We should fully DTMize SRL :D

n3ss3s

2008-05-27 06:33:03

Kill the maverick.

Wizzup?

2008-05-27 10:53:54

From: Markus
We should fully DTMize SRL :D


DTM = Slow TPA, with less attributes.

Markus

2008-05-27 11:04:23

Anything but TPA's! TPAs are taking over the world :scared:

n3ss3s

2008-05-28 05:29:03

Anything but TPA's! TPAs are taking over the world :scared:


And you know their first goal o_O

DTM = Slow TPA, with less attributes.


Lol, remember how our irc convo about DTM's / TPAs ended up? :p

TPAs > DTMs :o

SKy Scripter

2008-05-28 06:15:52

you guys all suck


Double Array ftw.

c: array of array of Integer;

n3ss3s

2008-05-28 12:47:06

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?

SKy Scripter

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?



2D rock ass. :p

they allow me to do a lot of things Tpoints just cant do :).

Boreas

2008-05-28 22:44:33

AoTPA ftw!

Bobarkinator

2008-05-28 22:53:36

TPointArrayArray FTW :p

bullzeye95

2008-05-28 23:33:55

From: Bobarkinator
TPointArrayArray FTW :p


Get with the times: T2DPointArray :rolleyes:

Bobarkinator

2008-05-28 23:54:15

From: bullzeye95
Get with the times: T2DPointArray :rolleyes:


Meh…they are interchangeable :p. But T2DPointArray looks cooler

Wizzup?

2008-05-29 09:10:03

Array Of TPointArray is the coolest. But I prefer TPointArrayArray over T2DPointArray…

n3ss3s

2008-05-29 09:34:33

I like Array of TPointArray when using as Result, it balances the black on the function definition line :)

Then in vars I use T2DPointArray because black points out from the other regular sized types.

the scar noob

2008-05-29 15:43:21

kinda like 12 spam-posts of you all.. shame you, I should give you all an infraction!:p

-Tsn.

tarajunky

2008-05-29 16:40:22

Which Dev revision does this most closely resemble?

Wizzup?

2008-05-29 17:34:53

#2246 I recon. :)

XcanadamanX

2008-05-30 16:46:28

it couldn't find the forester for me. it kept clicking the plants and trees

Wizzup?

2008-05-30 16:55:14

From: XcanadamanX
it couldn't find the forester for me. it kept clicking the plants and trees


Yes. Those bugs have now been fixed.

XcanadamanX

2008-05-30 17:40:02

good… i figured you guys fixed it but i thought i might aswell report it.

Sir R. M8gic1an

2008-06-01 04:28:44

missed a certer, the answer was sword and the debug image was completely black.

~RM

nielsie95

2008-06-01 04:53:02

You still have the account?

the scar noob

2008-06-01 05:02:52

You guys still want to solve the scaperune random?:p

Oh, btw, NIelsie is alreyad aware of that:D
I have a 'lil problem with Freddy's plugin. Avast warns me, I say to not take any action and scar simply closes. I never had that problem before.

-Tsn.

Markus

2008-06-01 05:31:13

Means Avast is being gay to UPX, just get a real antivirus or trash freddyplugin :f:

Sir R. M8gic1an

2008-06-01 06:48:11

no i don't nielsie, but i'm bound to get the random again and when i do i'll get the account to you.

~RM

Sir R. M8gic1an

2008-06-01 09:53:45

got another certer, about to pm you. please be careful, it is my main >.>

~RM

Wizzup?

2008-06-01 12:47:09

I really thought masquerader had returned… Same avatar, RM.

Sir R. M8gic1an

2008-06-01 13:22:36

oh… it was quite a work choosing one that wasn't used…. should i change it?

~RM

nielsie95

2008-06-01 13:23:16

You could use the one SKy has now :p

SKy Scripter

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.


No you! :p

My avatar is 1337 :).

Gah and benland and someone else keeps editing it.

n3ss3s

2008-06-02 07:11:33

My avatar is leeter :p (Check Hy's to get the idea…)

Wizzup?

2008-06-02 08:27:31

I thought you added the 'Can' yourself, SKy. :(

Hobbit

2008-06-02 11:07:00

From: Wizzup?
I thought you added the 'Can' yourself, SKy. :(


The can was ben…

… Then i added mustache's and body hair :p (couldn't resist)

Edit: My version is attached :p

SKy Scripter

2008-06-02 13:53:30

wizzup? it was only because you say my avatar with the key board was gay x).

:p

WT-Fakawi

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?



Squig! Finally!

the scar noob

2008-06-04 10:59:14

Sorry fakawi, but what do you mean with your post?

-Tsn.

nielsie95

2008-06-04 11:32:48

Does it look like the Squiq include or something?

Markus

2008-06-04 11:49:38

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;

the scar noob

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;


And what has that to do with squig??:p

-Tsn.

Boreas

2008-06-04 11:51:53

Warning: Trying to comprehend teh Fawks awesome power may have dire consequences.

Markus

2008-06-04 11:53:07

From: the scar noob
And what has that to do with squig??:p

-Tsn.

Comes from the squig include ;)

tarajunky

2008-06-04 12:19:41

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.

Sumilion

2008-06-04 12:25:39

From: WT-Fakawi
Squig! Finally!


Hah, I'm from the newer generation, do you mean it's good or bad that it apparently looks like Squig ?

ZephyrsFury

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.


I just committed a new HandleTrade. Works for me.

Sir R. M8gic1an

2008-06-04 12:28:30

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

Bobarkinator

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


It was the original goal of MSI, but then they stopped, I am currently developing one such function for smelting.

the scar noob

2008-06-04 15:20:52

From: Boreas
Warning: Trying to comprehend teh Fawks awesome power may have dire consequences.


I already saw that episode!<3:p

-Tsn.

WT-Fakawi

2008-06-05 15:00:42

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!

Bobarkinator

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!


A few weeks ago I thought back to when you said that and started developing a high-level function for smithing.