SRL Archive - OSR Help

Opening doors if they're open.


bam92992

2012-02-29 09:47:40

  begin
If FindObj(x,y,'Open',5393484,5) then
Begin
Writeln('Door is closed.');
ClickMouse2(True);
Writeln('Door is now open.')
end else if FindObj(x,y,'Close',8221554,5) then
Writeln('Door is already opened.');
Exit;
end;

now this is all fine and dandy when the door is closed, it opens it right up, but when it is already opened, it goes crazy looking at all of the other objects that are similar colors. i know that it can work because it goes to the door first every time, but it skips over it and goes through its routine until it goes back to the door a second time, then it realizes that it is opened and stops the script.

is there a better way to get it on the first time it hovers?

Sin

2012-02-29 09:51:18


IF findobj(sdunasid,'Door') then
begin
if IsUptext('Open') then
Mouse;
if isUptext('Close') then
exit;

end;

bam92992

2012-02-29 12:38:32

From: Sin

IF findobj(sdunasid,'Door') then
begin
if IsUptext('Open') then
Mouse;
if isUptext('Close') then
exit;

end;
lol knew that :duh:

thanks. ill fix it once im back from classes. should work now though, almost done :spot:

Harry

2012-02-29 12:40:49

Protip: don't rely on uptext for doors. It's very botlike and slow. Use the info you can LONG before you even consider moving the mouse.

bam92992

2012-02-29 14:18:12

From: Harry
Protip: don't rely on uptext for doors. It's very botlike and slow. Use the info you can LONG before you even consider moving the mouse.


explain

euphemism

2012-02-29 15:46:37

From: bam92992
explain


It seems pretty straightforward to me. Analyze all available information before you revert to mousing over the door to read the uptext. Maybe a simple color count of the door color can tell you if it is open or closed. You could check to see if your dot is on one side or the other of the red line on the minimap. Create a DTM of the center of the building the door leads to- check your distance from it. Do everything you can to only have to mouse once. Moving the mouse an unnecessary amount is just lazy coding.