Results 1 to 4 of 4

Thread: Random Clicking

  1. #1
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Random Clicking

    I have a script here that is supposed to cut and drop yews. However, I am having a problem where the program will click one yew, then it will start clicking the inventory tab. I'm not sure what is going on. I have everything up to date. Also, IsUpText doesn't seem to be working for me.

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    const
      German = False;
    var
      MoreColors: TIntegerArray;
     
    procedure DeclarePlayers;
    begin
      CurrentPlayer  := 0;
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);

      Players[0].Name        := ''; //username
      Players[0].Pass        := ''; //Password
      Players[0].Nick        := ''; //3-4 letters of user name
      Players[0].Active      := True;  //Player active
    end;

    procedure SetupColors;
    begin
      MoreColors := [3239009, 2384725, 467995, 1258284, 5212029, 2583904];
      SetupSRL;
      ActivateClient;
      DeclarePlayers;
      Wait(1000+random(200));
      if not LoggedIn then LoginPlayer;
    end;

    function MMouseIsText(x, y, ranx, rany: integer; UpText:string): boolean;
    begin
      if not LoggedIn then Exit;
      MMouse(x, y, ranx, rany);
      Wait(50+random(11));
      if German then
        Result := IsUpText('au')
      else
        Result := IsUpTextMultiCustom(['ew', 'Ye', 'Yew']);
    end;

    function ReturnYew: TPoint;
    var
      MorePoints: TPointArray;
      ATPA: T2DPointArray;
      t, m, w, cu, time: integer;
      APoint: TPoint;
    begin
      if not LoggedIn then Exit;
      ColorToleranceSpeed(2);
      MarkTime(time);
      m := High(MoreColors);
      for t:=0 to m do
      begin
        if FindColorsSpiralTolerance(MSCX, MSCY, MorePoints, MoreColors[t], MSX1, MSY1, MSX2, MSY2, 15) then
          Break;
      end;
      ATPA := SplitTPA(MorePoints, 15);
      SortATPAFrom(ATPA, Point(MSCX, MSCY));
      cu := High(ATPA);
      for w:=0 to cu do
      begin
        Result := MiddleTPA(ATPA[0]);
        Writeln('Time: '+ IntToStr(TimeFromMark(time)));
        Writeln('Done');
        ColorToleranceSpeed(1);
        Exit;
      end;
    end;

    procedure Cut;
    var ThePoint: TPoint;
    begin
      repeat
        if not LoggedIn then Exit;
        MakeCompass('N');
        ThePoint := ReturnYew;
        Mouse(ThePoint.x, ThePoint.y, 6, 6, true);
        Wait(4000+random(900));
      until(InvFull);
    end;

    procedure Drop;
    begin
      DropAllExcept([1]);
    end;

    procedure MainLoop;
    begin
      Cut;
      Drop;
    end;

    begin
      SetupColors;
      MainLoop;
    end.

    Thanks
    Formerly known as Cut em2 it

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

    Default

    Well, SRL shouldn't click a gametab if its already on that gametab
    (If inventory tab is already clicked, it shouldn't be clicking it any more)

    Make sure your SRL is SVNed to :
    Also, uptext is broken in older versions of scar
    It is only working in the pre-release version so SVN your SCAR folder to:

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it happens when your gametab.scar isn't up to date, it doesn't think it's in the proper tab. (atleast that's what happened to me when I wasn't up to date) So you need SRL-open Dev (like Yohojo provided).
    “Ignorance, the root and the stem of every evil.”

  4. #4
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    For Uptext, try a longer wait than 50ms. I *think* that should be enough, but try something like 200 + Random(100).

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
  •