SRL Archive - OSR Help

Open/close door at varrock magic shop?


m34tcode

2012-03-18 18:17:48

I have been brainstorming for a nice way to make sure that door is open while my script is runecrafting.

the best i can think of is a 2 part solution.

1) check if a flag disappears when set towards the bank.
2) if it disappears, click south of the magic shop, so the char stops at the door, and click inside a predefined box, if uptext confirms the doors is closed.

This is the solution i have been working on, but does anyone have any better ideas?

Abu

2012-03-18 18:28:11

Make your player stop outside the door, then check for the uptext.
If it says 'open door', it means the door is closed so you need to click it.
If it says 'close door', then you don't because the door is already open.
Then just continue as normal I guess.

m34tcode

2012-03-18 18:35:49

Yea, Even with SPS it is hard to stop on an exact tile, and if the door is open, I wont get the uptext because my mouse isn't on it. That's were I lose faith in the strategy, because if the character was checking the door from the wrong tile, it would think the door is open when it really isn't. =\

Abu

2012-03-18 18:49:02

Yeh the door color is too hard to find….

Here's an idea. You could just loop your walking function. That way your player will keep trying to enter the Shop until someone opens the door for you.

begginer

2012-03-18 18:51:59

Why not making a dtm and then findDtmRotated

masterBB

2012-03-18 18:54:25

Didn't wizzups old popular ess miner had the same problem? I suggest that flag method. But I know it's not ideal.

Abu

2012-03-18 18:57:34

From: begginer
Why not making a dtm and then findDtmRotated


Clever Guy!!!!


Here's a DTM that will only detect the door:
DTM := DTMFromString('mFQEAAHic42VgYLBjZGAIBeJgIPYDYmcgtgBiPSDWgmIdILYEYgcg9gLiJ0B9l4H4ERB/AOIvSPgVEN8F4gtQfAmKw3wMGII8dBl8XbQZPB00GKIDjOA4OUSbIT7YlKEwwRCMY4OMwerJAYxkYBQAADigGdY=');

m34tcode

2012-03-18 19:00:09

@beginner: I did consider DTMs, but using a DTM on the main screen is asking for the script to fail. DTMs are better use for @d images, like the mini-map and inventory items. I cant trust finding a door with one. Too many variables.

@abu I don't want to wait for humans to assist me, as that would be very botlike. I cant call the script stable until it can fend for itself. =\

I may just have to stick with my flag detection. It seems to work fine right now, but its only half developed lol.

This is the last obstacle the script will have I think.

My saving grace may be, that if i do a color search with the camera all the way down, ther will be a single rectangle of brown, which will either be the door, or the floor.

EDIT: OH ma GOD simba crashed ='[[[


Not positive whether i should create a rectangle and search the door in that, or do a color search with the camera all the way down >.>

EDIT2: im done scripting for today. Started that script last night, been writing it all day, and neither me nor crov saved it =\.

This was going to be my members app >.>, Probably would have passed too lol oh well =[[[

Abu

2012-03-18 19:22:50

But I just wrote you up such a nice function :(

procedure FindDoor;
var
x, y, Door: Integer;
begin
Door := DTMFromString(Make a DTM in your own time);
begin
if not FindDTM(Door, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Door DTM not found!');
end;
if FindDTM(Door, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x, y, 2, 2);
if IsUpText('Open') then
begin
Writeln('Door is Closed!');
Mouse(x, y, 0, 0, True);
end else
Writeln('Did not Find Door');
end;
end;
FreeDTM(Door);
end;

m34tcode

2012-03-18 19:30:52

Let me try that. If it works it will be my backup function lol

Edit: yea not found lol. DTMS wont work well in the 3D window =[

Im still working on it. It will take me till 2 in the morning to get back to where i was if i work just as fast lol

bg5

2012-03-18 19:45:16

What I use in my scripts is to find door (atpa ,not dtm),then hover mouse on it and check uptext (close/open). But checking if flag disappears sounds good too.

Sin

2012-03-18 19:47:37

NEVER EVER EVER EVER USE 'IsUptext', always use WaitUptext, much more accurate.

m34tcode

2012-03-18 19:47:53

The problem with that, is the floor around the door is the 'Exact' same color. So even colortolerancespeed 2 will be useless.

While color searching for the door will probably work, it will take like 30 seconds to actually find the door, and check whether it is opened or close.

In 30 seconds I could have mined a whole load of ess and been halfway to the bank ;]

EDIT: I use pos(mysearchhere,RS_GetUpText) > 0

Harry

2012-03-18 20:10:21

open dohr

The best way to do it is to click inside store. If flag isn't where you clicked in center of store, click a bit more south so you end up at door and handle it then.

m34tcode

2012-03-18 20:14:39

Yup. Havent gotten to going in, but my open door to get out of shop function was working fairly well before i lost it lol. Roughly 1/4 way back to were i was before

Abu

2012-03-18 20:25:13

Hmmm, maybe SRL Developers could work on a built-in function for this…

It's a wonder its never been addressed before

m34tcode

2012-03-18 21:50:22

Its too specific a problem to be incorporated in srl. If they did that SRL, would be big, bulky, and slow lol. ;]

The devs arent gods though, and are only as good as the community. The real solution is to get reflection back u, which may or may not be possible at this point.

The only reason we are the only community still running at full steam, is our non-reliance on Reflection.

Abu

2012-03-19 02:13:19

I found the srl include for doors :p

Go to:
C:\Simba\Includes\SRL\srl\misc then select door profiles.simba

It looks as though it should do the job….

m34tcode

2012-03-20 13:18:39

I think that uses minimap detection . let me check, hadnt realized SRL had this included lol.

hoopla

2012-04-05 18:42:29

Hmmm, please let me know if you have any success….I'll be peering at it myself.