SRL Archive - SRL Archives

FireMaking.Scar TinderBoxExists(); and updated .bmp


NCDS

2010-07-01 21:13:05

Updated TinderBox.bmp:

TinderBox := BitmapFromString(7, 3, 'beNoLCrC2stRSZdNVByEDL' +
'XYI8vJ0t7O1VldihYhDpMJCgoKDAgL9/YDI39cbiIIBYsIMuA==');


I couldn't think of any reason this shouldn't be in there.

{*******************************************************************************
function TinderBoxExists(var x, y: Integer): Boolean;
By: NCDS
Description: Checks if there is TinderBox present in inventory. Returns 'x' and 'y' values it is found at.
*******************************************************************************}
function TinderBoxExists(var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindBitmapToleranceIn(TinderBox, x, y, MIx1, MIy1, MIx2, MIy2, 10);
end;

Tested with:

program New;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/firemaking.scar}

function TinderBoxExists(var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindBitmapToleranceIn(TinderBox, x, y, MIx1, MIy1, MIx2, MIy2, 10);
end;

var
x, y: Integer;
begin
SetupSRL;
ActivateClient;
LoadFiremakingBitmaps;
if TinderBoxExists(x, y) then
begin
Writeln('x := '+IntToStr(x)+';');
Writeln('y := '+IntToStr(y)+';');
end;
end.
Output:

New client targeted
Successfully compiled (2060 ms)
SRL Compiled in 16 msec
x := 572;
y := 233;
Successfully executed

i luffs yeww

2010-07-01 22:09:35

The only thing I don't like things like this (and FindRange, etc.) are because it's another aspect to take away from new scripters' learning. They should make their own bitmap, DTM, blacklist, color check, etc. to figure it out, rather than just using things like this.

Good work, but if my opinion mattered, I'd say this shouldn't be commited.

Frement

2010-07-01 22:19:30

I'm gonna support this. Good job fixing the bitmap also.

NCDS

2010-07-01 22:52:43

From: i luffs yeww
The only thing I don't like things like this (and FindRange, etc.) are because it's another aspect to take away from new scripters' learning. They should make their own bitmap, DTM, blacklist, color check, etc. to figure it out, rather than just using things like this.

Good work, but if my opinion mattered, I'd say this shouldn't be commited.


I understand completely what your saying, but the bitmap was in there along with very similar functions so I figured this should be too.

If people want to learn they can easily still make they're own. :)

MylesMadness

2010-07-01 22:58:42

Wouldn't the invslot be more useful then the coords?

NCDS

2010-07-01 23:00:49

From: MylesMadness
Wouldn't the invslot be more useful then the coords?


The other functions return the coords, that's why this does, and you could always just use CoordsToItem();?

i luffs yeww

2010-07-02 00:45:06

Now that I think about it more, I'm not sure how I feel. In some ways, I think it would hurt the learning process. In others, maybe there's a hope that they could spend more time with more advanced (or important) aspects of the script than simply finding a static item. However, that is putting a bit of faith into the scripter to assume he'd strive for difference/greatness/adjective. I'm torn. :p

But I do realize that they don't have to use it, but from past knowledge, people tend to use FindRange rather than making their own function for it.

I also fear this could lead to more and more functions similar to it.

NCDS

2010-07-02 00:50:00

From: i luffs yeww
Now that I think about it more, I'm not sure how I feel. In some ways, I think it would hurt the learning process. In others, maybe there's a hope that they could spend more time with more advanced (or important) aspects of the script than simply finding a static item. However, that is putting a bit of faith into the scripter to assume he'd strive for difference/greatness/adjective. I'm torn. :p

But I do realize that they don't have to use it, but from past knowledge, people tend to use FindRange rather than making their own function for it.

I also fear this could lead to more and more functions similar to it.


I don't care much either way. I don't really see how it's different from any of the other functions in /skill.

I guess I'll just wait for words from the wise :rolleyes:

i luffs yeww

2010-07-02 00:54:14

:< /me isn't wise.

:p

Nava2

2010-07-02 03:24:44

Thanks for the bitmap!

I'd have to say no to the function, I believe it has a better place in the barebones idea for scripts.

Thanks once again for the bitmap though! Remind me and I will commit it tomorrow.

Sir R. M8gic1an

2010-07-02 06:29:59

From: Nava2
Thanks for the bitmap!

I'd have to say no to the function, I believe it has a better place in the barebones idea for scripts.

Thanks once again for the bitmap though! Remind me and I will commit it tomorrow.


Barebones will have to use the include….. hello?

~RM

Gu3st...

2010-07-02 07:01:42

From: Rasta Magician
Barebones will have to use the include….. hello?

~RM
I think he meant it would fit better inside a script, than the include

Sir R. M8gic1an

2010-07-02 08:53:29

From: Zyt3x
I think he meant it would fit better inside a script, than the include


I think we might as well get rid of /skills/ then, no?

The point of /skills/ is to have this sort of thing.

~RM

Gu3st...

2010-07-02 11:07:20

From: Rasta Magician
I think we might as well get rid of /skills/ then, no?

The point of /skills/ is to have this sort of thing.

~RM
I agree with you, add the function to the include

NCDS

2010-07-02 14:43:45

I don't much care what happens to the function. I only made it because it seemed to fit, but someone should at least commit the .bmp.

I have to agree with RM though, if something like this doesn't fit than what use is /skill besides .bmp's?

Edit:
Basically the same function?:

{*******************************************************************************
function WeHaveLogs(var WhereX, WhereY: Integer): Boolean;
By: WT-Fakawi
Description: Checks if there is Logs in your Inventory Returns X,Y Cords of Log
*******************************************************************************}
function WeHaveLogs(var tx, ty: Integer): Boolean;
begin
GameTab(tab_Inv);
Wait(500 + Random(350));
Result := FindBitmapMaskTolerance(LogMask, Tx, Ty, MIX1, MIY1, MIX2, MIY2, 10, 2);
end;

i luffs yeww

2010-07-02 20:32:31

I personally don't think /skills/ should be in SRL, which is why I oppose this. That's all. :)

Bebe

2010-07-03 00:27:50

Updated bitmap. Thank you :)

NCDS

2010-07-03 13:19:15

From: i luffs yeww
I personally don't think /skills/ should be in SRL, which is why I oppose this. That's all. :)

I'm kinda in between on it I guess.

From: Bebe
Updated bitmap. Thank you :)

Thanksss

DeSnob

2010-07-04 08:39:43

From: i luffs yeww
The only thing I don't like things like this (and FindRange, etc.) are because it's another aspect to take away from new scripters' learning. They should make their own bitmap, DTM, blacklist, color check, etc. to figure it out, rather than just using things like this.

Good work, but if my opinion mattered, I'd say this shouldn't be commited.


I understand what you're saying, but to older scripters this saves a bit of valuable time. For example, I'm very lazy therefore making DTMs can take weeks because I never feel like actually creating them. I know how to create DTMs, DDTMS, TPAs, Bitmaps, etc; but this is still extremely useful as I don't have to get off my butt to do something.

NAH, just kidding. I agree with you. Things keep getting easier and easier as time passes. I keep hearing people complain about how we never advance our coding (make things easier such as something like if FindObject(name) then Attack; ). They just don't understand that we are a community that likes to learn and therefore create more advanced and efficient scripts.

Sir R. M8gic1an

2010-07-04 09:11:38

you can only 'advance' once the 'current step' is settled. Otherwise you're leaving things unfinished.

And you're only going to spend x time per script. If you don't spend time on looking for your tinderbox, you can maybe spend the time making a procedure that'll withdraw it from the bank if it isn't in your inv. And BAM, we have advancement because FindTinderbox was in the include.

~RM

i luffs yeww

2010-07-04 15:01:49

^ I mentioned that earlier. The only thing is that you have to assume and trust that the scripter will for some reason advance somewhere else. I don't see any reason why the would. They would be used to just doing FindTinderBox; MakeFire;, etc., and so there's really no psychological reason that I can think of for why they would advance.

We as humans assume and live in the constant, the static, the whatever synonym. An example I use all the time is if one were to look into a box of orange and the first top half was rotten, we wouldn't assume that the last half was fine, as that would "equal it out." We assume the rest would be rotten, as we think in the constant (as previously said). They have simple start; they proceed with simple ways.

That's all.

NCDS

2010-07-04 17:06:07

From: i luffs yeww
^ I mentioned that earlier. The only thing is that you have to assume and trust that the scripter will for some reason advance somewhere else. I don't see any reason why the would. They would be used to just doing FindTinderBox; MakeFire;, etc., and so there's really no psychological reason that I can think of for why they would advance.

We as humans assume and live in the constant, the static, the whatever synonym. An example I use all the time is if one were to look into a box of orange and the first top half was rotten, we wouldn't assume that the last half was fine, as that would "equal it out." We assume the rest would be rotten, as we think in the constant (as previously said). They have simple start; they proceed with simple ways.

That's all.


But there is no 'MakeFire;', it stops at TinderBoxExists();, so they really don't have a choice but to advance.

From what I see, /skill is made for assistance for the skills not to do the skills. That's why I feel it fit's. It help's complete a certain skill, but does not actually do the skill. There is plenty still left to the scripter's themselves.

Sir R. M8gic1an

2010-07-04 17:07:19

From: i luffs yeww
^ I mentioned that earlier. The only thing is that you have to assume and trust that the scripter will for some reason advance somewhere else. I don't see any reason why the would. They would be used to just doing FindTinderBox; MakeFire;, etc., and so there's really no psychological reason that I can think of for why they would advance.

We as humans assume and live in the constant, the static, the whatever synonym. An example I use all the time is if one were to look into a box of orange and the first top half was rotten, we wouldn't assume that the last half was fine, as that would "equal it out." We assume the rest would be rotten, as we think in the constant (as previously said). They have simple start; they proceed with simple ways.

That's all.


Then why do we bother having the tinderbox "anywhere" in the inv, rather than just "on the first spot" ?

Simplest would be on the first spot and coord click it.

~RM

Coh3n

2010-07-07 17:19:16

http://villavu.com/forum/showthread.php?t=57783