SRL Archive - OSR Help

I cant get a procedure to work - help


superfonz

2015-05-08 09:54:08

I need help with the Target_Shooter, it works with find_Judge.


program Range_Guild;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}

var
loginName, password : string;

procedure setupPlayer;
begin
loginName := ''; // UserName
password := ''; // Pasword
end;

procedure declarePlayer;
begin
numberOfPlayers(1);
currentPlayer := 0;
players[0].name := loginName;
players[0].pass := password;
players[0].active := true;
end;
procedure find_judge;
var
Judge: TNPC;
Tp: TPoint;
begin
if R_FindNpc('Competition Judge', Judge) then
begin
if not R_NearTile(point(2671, 3419), 2) then
exit;
Tp := Judge.Tile;
Tp := R_TileToMs(Tp);
Mmouse(Tp.x, Tp.y, 2, 2);
if R_WaitUpText('Competition Judge', 100) then
ClickMouse2(Mouse_left);
repeat
wait(50);
until (findNPCChatText('Competition', nothing));
if findNPCChatText('Click here', Clickleft) then
findNPCChatText('ure', Clickleft);
wait(RandomRange (200, 400));
findNPCChatText('Click here', Clickleft);
wait(RandomRange (200, 400));
findNPCChatText('Click here', Clickleft);
wait(RandomRange (200, 400));
findNPCChatText('Click here', Clickleft);
end;
end;
Procedure Wield_arrows;
var
items:TInventoryItemArray;
i : integer;
Coords: Tpoint;
begin
items := R_GetInventoryItems;
for i:=0 to high(items) do begin
if(items[i].ID = 883)then
begin
Coords := itemCoords(items[i].Slot);
Mmouse(Coords.x, Coords.y, 1, 1);
if R_WaitUpText('Wield', 100) then
ClickMouse2(Mouse_left);
end;
end;
end;
Procedure target_shooter;
var
Target: TNPC;
Tp: TPoint;
begin
if R_FindNpc('Target', Target) then
begin
Tp := Target.Tile;
Tp := R_TileToMs(Tp);
Mmouse(Tp.x, Tp.y, 2, 2);
if R_WaitUpText('Target', 100) then
ClickMouse2(Mouse_left);
end;
end;
begin
setupsrl;
SetupReflection;
setupPlayer;
declarePlayer;
//R_MakeCompass(RandomRange( , ));
repeat
find_judge;
Wield_arrows;
target_shooter;
until (false)
end.

Clutch

2015-05-08 12:05:39

What exactly is your issue? Can it not find the NPC? Mis-clicking?

superfonz

2015-05-08 16:06:23

It doesnt click the target at all