Results 1 to 3 of 3

Thread: I cant get a procedure to work - help

  1. #1
    Join Date
    May 2013
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default I cant get a procedure to work - help

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


    Code:
    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.

  2. #2
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default

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

  3. #3
    Join Date
    May 2013
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    It doesnt click the target at all

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •