Results 1 to 6 of 6

Thread: Script Help

  1. #1
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Script Help

    Ok, I'm making a script. It powermines in Rimmington. I need people to test it out, tell me what I should add, and as well what I should take out. I'm not releasing it, just releasing the pre-stages. Tell me what you think, please. I'm taking all criticism. Here it is:

    SCAR Code:
    program RimmingtonPowerMiner;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\Skill\Mining.scar}

    const
      LoadsToDo = 1;
    var
      x, y, Loads: integer;
      RockColor: array [0..5] of integer;


    procedure SetupPlayers;
    begin
      //MAKE SURE TO CHANGE THE ROCK COLORS!
      RockColor[0] := 0;
      RockColor[1] := 0;
      RockColor[2] := 0;
      RockColor[3] := 0;
      RockColor[4] := 0;
      RockColor[5] := 0;
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := '';        //Username
      Players[0].Pass := '';        //Password
      Players[0].Nick := '';        //3-4 Letters of Username
      Players[0].Strings[0] := '';  //EXACT Name Of The Ore! Eg. Copper, Tin, Iron
      Players[0].Active := True;    //Leave this
    end;

    procedure AntiRandoms;
    begin
      if FindFight then
      begin
        RunAway('N', True, 1, 7000);
      end;
      FindNormalRandoms;
    end;

    procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case Random(10) of
        1: RandomRClick;
        2: HoverSkill('Random', False);
        3: RandomMovement;
        4: BoredHuman;
        5: AlmostLogout;
        6: DoEmote(Random(5));
      end;
    end;

    procedure DropOres;
    begin
      repeat
        if FindBitmap(Ore, x, y) then
          MMouse(x, y, 2, 2);
          if IsUpText(Players[CurrentPlayer].Strings[0]) then
            Mouse(x, y, 3, 3, false);
            ChooseOption('rop');
      until(not FindBitmap(Ore, x, y));
    end;

    procedure RockMining;
    var Tries, CountIt, i, MineClick, fx, fy : integer;
    begin
      if not LoggedIn then Exit;
      Wait(100 + Random(100));
      Tries := Tries + 1;
      if(Tries=20)then
      begin
        Logout;
        Exit;
      end else
        for i := 0 to 5 do
        repeat
        Wait(1000 + Random(100));
        if FindObjCustom(x, y, ['Min', 'ine'], [RockColor[i]], 25) then
            case Random(2) of
              0: begin
                  AntiRandoms;
                  CountIt := InvCount;
                  if GasFound(fx, fy) then
                  begin
                    repeat
                    Wait(100);
                    until not GasFound;
                  end;
                  Mouse(x, y, 4, 4, False);
                  ChooseOption('ine');
                  FindPick;
                  MarkTime(MineClick);
                  repeat
                    Wait(100);
                    if TimeFromMark(MineClick) > 7000 then
                      RockMining;
                  until(CountIt<InvCount);
                 end;
              1: begin
                  AntiRandoms;
                  CountIt := InvCount;
                  if GasFound(fx, fy) then
                  begin
                    repeat
                    Wait(100);
                    until not GasFound;
                  end;
                  Mouse(x, y, 4, 4, True);
                  FindPick;
                  MarkTime(MineClick);
                  repeat
                    Wait(100);
                    if TimeFromMark(MineClick) > 7000 then
                      RockMining;
                  until(CountIt<InvCount);
                 end;
            end;
           until(InvFull);
      DropOres;
      Loads := Loads + 1;
    end;

    begin
      SetupSRL;
      SetupMining;
      SetupPlayers;
      ActivateClient;
      Wait(1000 + Random(1500));
      repeat
        if not LoggedIn then
          begin
            LoginPlayer;
          end;
        FindPickHeadColor;
        SetAngle(True);
        MakeCompass('N');
        AntiRandoms;
        RockMining;
        Antiban;
      until(Loads=LoadsToDo);
      Logout;
    end.

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    perhaps first script section would fit you better? Or put it in JM?

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, it's not my first script. I'm asking what should be removed or added. I'm not releasing the script.

  4. #4
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    add in gas checker, pickaxe head finder, pickaxe head attacher, perhaps your own way of finding the rocks?

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  5. #5
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    K, tell me how she is now.

  6. #6
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    To imrove this script, add TPA object finding/use FindObjTPA in object.scar (there even is a tutorial about it by RM, I think.)
    Furthermore, you could add dynamic arrays for the colors. Pure1993 has a tutorial.

    In your antiban procedure, "DoEmote(Random(5))" should be "DoEmote(Random(36) + 1);"

    And, LogInPlayer already has "If not loggedIn then.." No need for that. Simply, all you need is "LogInPlayer".

    As far as I see, you don't have a progress report?
    Add multiplayer.
    Your object finder could be shortened much. And add a break when it finds the object.

    All I can think of for now, that is the most important.

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
  •