SRL Archive - Reflection Help

Interface troubles/possible bug


Brandon

2011-03-14 17:43:59

Not sure if this is a bug or not.. but this interface that its finding is the interface for a farming patch.. I was at a farming patch and decided to test the functions.. What happens is that is will never find the interfaces or anything unless the interface is closed.. When its closed, it returns all interface ID's.. So what I had to do what start the script, let it run, pause the script, open the interface and then unpause it.. thats the only way for it to find the interface :S

try this: Go to a farming patch(I was at trollheim), Right click the leprechaun and get to the withdraw tools window… leave it on screen, start the script below and it will not work.. now close the leprechaun screen and start the script.. it then works..

Why is that??


program InterFaceFinder;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}

const
{---SMART Setup Constants---}
WORLD = 32;
MEMBERS = true;
SIGNED = true;
{---------------------------}

var
NPCs: TNPCArray;
i, ii, x, y: Integer;
FishTP : TPoint;
Me: TMe;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

With Players[0] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 0;
Pin := '';
End;
End;

procedure FindInterfaces;
var
Interfaces: TIntegerArray;
Text: String;
CompID: Integer;
begin
Interfaces:= GetValidInterfaces;
writeln(tostr(Interfaces));


Text:= GetInterfaceText(125, 2);
writeln(Text);

if(ValidInterface(125)=true) then
writeln('The Interface Exists');
end;



procedure MainLoop;
begin
if not LoggedIn then exit;
SetAngle (true);
MakeCompass ('n');
SetRun (true);
wait (random(500));
//repeat
cleardebug;
FindInterfaces;
wait (1000);
//until (false)
end;

begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
DeclarePlayers;
LoginPlayer;
cleardebug;
MainLoop;
end.

rogeruk

2011-03-14 22:56:11

Procedure Test;
Var
NPC : TNPC;
NPCTile : TTile;
E : TPoint;
Begin
If(FindNPC('ool', NPC))Then
E := TileToMS(NPC.Tile, NPC.Height);
Mouse(E.X, E.Y, 3, 3, False);
R_WaitOption('xchange', 1200);
Wait(RandomRange(300, 500));
If(ValidInterface(125))Then Writeln('Good');
End;

You're not able to start scripts with interfaces open etc. (Looks like)

Bad Boy JH

2011-03-15 04:41:27

You didn't call SetupReflection

Home

2011-03-15 06:44:13

For Interfaces i suggest you to use PöwerBot to look for them. (a lot easier)

~Home

Floor66

2011-03-15 14:41:46

Just a question, why don't you use some colour function for this? Not hating on ref; I love it; but this would be piece of cake in colour, no?

rogeruk

2011-03-15 15:29:29

From: Floor66
Just a question, why don't you use some colour function for this? Not hating on ref; I love it; but this would be piece of cake in colour, no?


1 line in reflection.. If(ValidInterface(111))Then

Floor66

2011-03-15 15:51:00

Yeah but as he says; it's not working :P

rogeruk

2011-03-15 16:15:33

It is lol. He didn't script it right. (Or didn't call SetupReflection)

Floor66

2011-03-15 16:24:37

Oh k :p
Btw, wouldn't it be more useful to create consts for these interfaces?
Like INTERFACE_FARMING_LEPRECHAUN or something along those lines.

Brandon

2011-03-15 18:01:38

From: rogeruk
Procedure Test;
Var
NPC : TNPC;
NPCTile : TTile;
E : TPoint;
Begin
If(FindNPC('ool', NPC))Then
E := TileToMS(NPC.Tile, NPC.Height);
Mouse(E.X, E.Y, 3, 3, False);
R_WaitOption('xchange', 1200);
Wait(RandomRange(300, 500));
If(ValidInterface(125))Then Writeln('Good');
End;

You're not able to start scripts with interfaces open etc. (Looks like)


Ty. Didnt notice I didnt call SetupReflection.. and thanks a lot for the help