Results 1 to 7 of 7

Thread: Script Help

  1. #1
    Join Date
    Dec 2011
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Script Help

    I'm trying to get it to simply fish and drop. The procedure fishy when executed by itself successfully gets it to fish. When I try to add in everything else it quits clicking the fishing spot and hovers over the backpack inventory tab. I've also tried running it with a full inventory and it doesn't drop anything. Any ideas?


    Simba Code:
    program New;
      {$i SRL\SRL.scar}

    Var
      OldXP, TimeSinceFish: Integer;

    Procedure Fishy;
    var
      SeX, SeY: Integer;

    Begin
      If FindObjCustom(SeX, SeY, ['Cage', 'Fishing'], [7956571, 9998731, 10458507], 5) Then
      WriteLn('Found Spot!');
      Begin
      Case Random(2) Of
        0:  Mouse(SeX,SeY, 5,5, True);
        1: Begin
             Mouse(SeX,SeY,4,4,False);
             WaitOption('Cage',Randomrange(100,300));
           End;
       End;
      End;
    End;

    Procedure DropFish;
    var x, y: integer;
    begin
      if FindObjCustom(x, y, ['Raw'], [2046824, 792619], 25) then
      DropAll;
    end;


    Begin
      SetupSRL;
      Repeat

        If IsXPBarOpen Then
        Begin
          If Not( GetXPBarTotal = OldXP) Then
          Begin
            OldXP := GetXPBarTotal;
            MarkTime( TimeSinceFish);
          End;
        End;

        If TimeFromMark( TimeSinceFish) > 8600 Then
        Begin
          If InvFull Then
            DropFish
          else
          Begin
            Fishy;
            wait(1000);
          End;
        end;
      Until False;
    End.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    FindObj functions are only for the mainscreen, not the inventory.
    Is once piece of advice.

    Also it will only drop if your 'timesincefish' is over 8600 AND inventory is full, that seems a bit odd?
    Based on these lines

    Simba Code:
    If TimeFromMark( TimeSinceFish) > 8600 Then
        Begin
          If InvFull Then

  3. #3
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If you want to use FindObj in Inventory, if my memory is correct you can use FindObjEx and define the parameters yourself.

    Such as MIX1, MIY1, MIX2, MIY2 if you are looking for something in the inventory.

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I'd use DTMs to find stuff fin inventory.

  5. #5
    Join Date
    Dec 2011
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    From the looks of it doesn't dropall, drop everything regardless of the object? If that was the case I wouldn't need to find the object. I tried rearranging things to no avail;

    Simba Code:
    Procedure Fishy;
    var
      SeX, SeY: Integer;

    Begin
      If FindObjCustom(SeX, SeY, ['Cage', 'Fishing'], [7956571, 9998731, 10458507], 5) Then
      WriteLn('Found Spot!');
      Begin
      Case Random(2) Of
        0:  Mouse(SeX,SeY, 5,5, True);
        1: Begin
             Mouse(SeX,SeY,4,4,False);
             WaitOption('Cage',Randomrange(100,300));
           End;
       End;
      End;
    End;


    Begin
      SetupSRL;

      If InvFull Then
      DropAll
      Else

      Repeat

        If IsXPBarOpen Then
        Begin
          If Not( GetXPBarTotal = OldXP) Then
          Begin
            OldXP := GetXPBarTotal;
            MarkTime( TimeSinceFish);
          End;
        End;

        If TimeFromMark( TimeSinceFish) > 8600 Then
          Begin
            Fishy;
            wait(1000);
          End;

      Until False;

    End.

  6. #6
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I'd get rid of the entire main loop, and think about it logically, and piece it together again.
    That main loop is confusing

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I'd get rid of the entire main loop, and think about it logically, and piece it together again.
    That main loop is confusing

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
  •