Results 1 to 3 of 3

Thread: Need basic help

  1. #1
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need basic help

    Code:
    program PowerChopper;
      {$define SMART}
      {$i SRL/SRL.scar}
      {$i SRL/SRL/Misc/stats.simba}
    
    
    
      Const
    
    
      SRLStats_Username = '';
      SRLStats_Password = '';
    
    
      BreakIn      = 135;
      BreakFor     = 15;
      Version      = 1.0;
      NumbOfPlayers = 1;
      StartPlayer = 0;
    
      Procedure DeclarePlayers;
      begin
        HowManyPlayers := 1;
        NumberOfPlayers(NumbOfPlayers);
        CurrentPlayer := StartPlayer;
        with Players[0] do
        begin
          Name        := '';
          Pass        := '';
          Pin         := '';
          BoxRewards  := ['XP','xp','lamp'];
          LampSkill   := 'Runecrafting';
          Active      := True;
        end;
      end;
    
      Procedure StatsGuise(wat:String);
      begin
        Status(wat);
        Disguise(wat);
      end;
    
    
    
      Procedure Antiban;
    Begin
      Case Random(192) Of
        0: HoverSkill('Woodcut', False);
        1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
        2: ExamineInv;
        3: RandomAngle(1);
        4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
        5: HoverSkill('random', False);
      End;
    End;
    
      Function FindFrog:Boolean;
      Var
        x, y: Integer;
      Begin
    
        If FindObjCustom(x, y, ['Take', 'Swamp', 'toad'], [1991226, 1991226], 5) Then
        WriteLn('Found Frog');
    
      End;
    
    
    
    
    begin
      Repeat
      FindFrog;
      Until(false);
    
    end.


    Im trying to make my script say found frog in the text box when finding a swamp toad. The script compiles and runs but doesent move the mouse or anything. Also it says [Hint] (58:12): Variable 'Result' never used at line 57

  2. #2
    Join Date
    Dec 2011
    Location
    P2P :)
    Posts
    561
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    The reason why it isn't even giving you errors or reacting with the game is because in your main loop you are supposed to put
    Simba Code:
    SetupSRL;
    as the first line.

    So you want something like this
    Simba Code:
    begin
      SetupSRL;//Setups up srl.scar(the file you defined at the top)
      ActivateClient;//Another key line. Sets the targeted window on top if you aren't using SMART
      Repeat
      FindFrog;
      Until(True);//Might want to set it to true to prevent a loop that will attempt to fight you to quit. Basically means it will loop it until it finds the frog.

    end.

    Give that a try and see if you get any motion.

    As the the 'Result' issue. When ever you use a function: Boolean; it has to return a result. So that being said you can try.
    Simba Code:
    Function FindFrog:Boolean;
      Var
        x, y: Integer;

      Begin

        If FindObjCustom(x, y, ['Take', 'Swamp', 'toad'], [1991226, 1991226], 5) Then
            WriteLn('Found frog');
            Result := True;

        If not FindObjCustom(x, y, ['Take', 'Swamp', 'toad'], [1991226, 1991226], 5) Then
            WriteLn('No frogs here.');
            Result := false;

      end;


    I might be 100% wrong or 100% right. The second part might not be proper or right but it is something to go on until someone else chimes in. Good luck.
    Last edited by Hero; 12-21-2011 at 06:26 AM.
    I wear my scars like the rings on a pimp
    I live life like the captain of a sinking ship
    Always sell your product for ATLEAST mid to ensure that the market doesn't drop.

  3. #3
    Join Date
    Nov 2011
    Location
    Sacramento, California
    Posts
    366
    Mentioned
    4 Post(s)
    Quoted
    85 Post(s)

    Default

    If you want it to say something in the bottom I believe you use WriteLn.

    The rest I'm not so sure about ;o

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
  •