Results 1 to 6 of 6

Thread: AntiRandoms

  1. #1
    Join Date
    Jul 2008
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default AntiRandoms

    Hi, my script:


    SCAR Code:
    program Fletcher;
    {.include SRL\SRL.scar}
     
    //SIMPLE FLETCHER
    //Start near bank slot (Varrock West Recommended)
    //Logs in first few bank slots
    //Knife first inv
    //Make sure you have knife idiot!
     
    Const
     
    {******************* Overall Maximum Values (Not per player) *******************
    ************** Script finishes when any max limit has been reached. ************
    ***************************** enter 0 for infinite ****************************}

     
    TCut  = 0; //Total number of bows to be cut
    TTime = 0; //Total time wanted on script
         
         
    {***************************** Change Player after *****************************
    ********** Player will bank and change when any value has been reached. ********
    **************************** default value are best ****************************
    ***************************** enter 0 for infinite ****************************}

     
    SCut  = 0; //Total number of bows to be cut
    STime = 0; //Total time wanted on script
     
     
    { ******************************************
     **************** SRL STATS ****************
     *******************************************}

    UseSRL =  True; //Do you want to record your stats?
    YourID   = '';
    YourPass = '';
         
     
     
     {******************************************
     **************** Colors *******************
     *******************************************}

     
      MBank = 1760756; //The bank icon in minimap if lost (probably wont happen)
      Bank1 = 3757412;
      Bank2 = 7702419;
      Bank3 = 4812418;
     
      //If all else fails...
      BlindX = 244;
      BlindY = 127;
     
                   
    var BankX, BankY, Log, x, y, MyBanks, antis, TotalTime: Integer;
    var Banker, Booth, StoreAll, WithdrawAll, Examine, MakeX: Integer;
     
    procedure Ln(Text:String);
    begin
      WriteLn(Players[CurrentPlayer].Name + ': ' + Text);
    end;
     
    function TotalCut: Integer;
    var i, x: integer;
    begin
     for i := 0 to HowManyPlayers - 1 do
     begin
       x := x + Players[i].Integers[1];
     end;
     result := x;
    end;
     
    procedure Report;
    begin
    ClearReport;
    if(UseSRL) then
    begin
      ReportVars[0] := HowManyPlayers;
      ReportVars[1] := TotalCut;
      ReportVars[2] := MyBanks;
      ReportVars[3] := Antis;
      ReportVars[4] := Players[CurrentPlayer].level[13];
      SRLRandomsReport;
    end;
    //Ln('Gathering Report');
    AddToReport('#########################');
    AddToReport('#      Pro Fletcher     #');
    AddToReport('#         v 1.2         #');
    AddToReport('#  Players: ' + intToStr(HowManyPlayers));
    AddToReport('#  Current: ' + Players[CurrentPlayer].Name);
    AddToReport('#  Running: ' + TimeRunning);
    AddToReport('#      Cut: ' + intToStr(Players[CurrentPlayer].Integers[1]));
    AddToReport('#    Total: ' + intToStr(TotalCut));
    AddToReport('#    Banks: ' + intToStr(MyBanks));
    AddToReport('# AntiBans: ' + intToStr(antis));
    AddToReport('#    Level: ' + intToStr(Players[CurrentPlayer].level[13]));
    AddToReport('#########################');
     
    if(TCut > 0) and (TotalCut >= TCut) then TerminateScript;
    if(SCut > 0) and (Players[CurrentPlayer].Integers[1] >= SCut) then Logout;
     
    end;
     
    Procedure DeclarePlayers;
    begin
      NumberOfPlayers(2);
      CurrentPlayer := 0;
     
      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Integers[0] := 0;  // 0 = AUTO, 1 = ShortBow, 2= LongBow
      Players[0].Active := True;
     
      Players[1].Name :='';
      Players[1].Pass :='';
      Players[1].Nick :='';
      Players[1].Integers[0] := 0;
      Players[1].Active := True;
      end;
     
    function CheckForAllRandoms: boolean;
    begin
        if Pos('tch sp', lowercase(GetTalkingNPCName)) > 0 then ClickContinue(true, true);
        if FindNormalRandoms then result := true;
        if FindInventoryRandoms then result := true;
        if FindNonInventoryRandoms then result := true;
        if FindTalk then result := true;
        if Pos('arnav', lowercase(GetTalkingNPCName)) > 0 then
        begin
            result := false;
            exit;
        end;
        if FindFight then
        begin
          RunTo('N', True);
        end;
    end;
     
    {procedure NoRandoms;
    var
      x, y, i, h:integer;
      s:string;
    begin
      ln('Finding randoms');
      if not LoggedIn then exit;
      GetMousePos(x, y);
      FindNormalRandoms;
      if ClickToContinue then MMouse(x, y, 2, 2);
      if(HPPercent < 20) then
       begin
         ln('HP less than 20%');
         ln('NextPlayer');
         NextPlayer(True);
       end;
      if FindFight then
      begin
      ln('Found fight');
        //none of the run aways check for randoms....
        case random(4) of
          0: s:= 'N';
          1: s:= 'E';
          2: s:= 'S';
          3: s:= 'W';
        end;
        RunTo(s, True);
      end;
     
    end;}

     
    procedure NoRandoms;
    begin
     Ln('Checking for randoms');
     CheckForAllRandoms;
    end;
     
    procedure ActHuman(MS: Integer);
    var Started, MoS, q: Integer;
    begin
      antis := antis + 1;
      Report;
      q := 0;
      ln('Acting human #' + intToStr(antis) + ' for ' + intToStr(MS) + ' ms');
      MoS := MouseSpeed;
      MouseSpeed := 10;
      MarkTime(Started);
      repeat
      q := q + 1; if(q = 2) then q := 0;
      if(q = 0) then NoRandoms;
      MouseSpeed := 10 + random(15);
         if(random(3) = 0) then MMouse(random(1000), random(900), 1, 1);
         Case random(14) of
           0: Mouse(random(772), random(490), 1, 1, false);
           1: SleepAndMoveMouse(500 + random(750));
           3: MouseItem(random(InvCount) + 1, false);
           4: begin
                ln('Examine random');
                MouseItem(random(InvCount) + 1, false);
                Wait(100);
                if(FindBitmap(Examine, x, y)) then Mouse(x, y, 1, 1, True);
                if(random(10) = 1) then
                begin
                  ln('Shake over examine text');
                  MouseSpeed := 28;
                  MMouse(13, 446, 2, 2);
                  MMouse(178, 450, random(2), random(2));
                  MMouse(13, 446, random(2), random(2));
                  MMouse(178, 450, random(2), random(2));
                  MMouse(13, 446, random(2), random(2));
                  MMouse(178, 450, random(2), random(2));
                  MMouse(13, 446, random(2), random(2));
                  MMouse(178, 450, random(2), random(2));
                  MouseSpeed := 10;
                end;
              end;
           5,11,12: begin
                ln('Random Gametab');
                GameTab(1 + random(11));
                Wait(500 + random(1200));
                GameTab(4);
              end;
            6, 7, 13: HoverSkill('fletching', false);
            8: RandomRClick;
            9,10: HoverSkill('random', false);
              end;
         
      until(TimeFromMark(Started) >= MS)
      ln('ActHuman expired');
      MouseSpeed := MoS;
    end;
     
    procedure GetLevels;
    var lvl: integer;
    begin
      ln('Finding stat');
      lvl := GetSkillInfo('fletching',False);
      if(lvl > Players[CurrentPlayer].level[13]) then
      Players[CurrentPlayer].level[13] := lvl;
      Ln('Player has fletching: ' + intToStr(Players[CurrentPlayer].level[13]));
    end;
     
    procedure ReLocate;
    var mX, mY: integer;
    begin
     ln('Finding bank sumbol');
     if(FindColor(mX, mY, MBank, MMX1, MMY1, MMX2, MMY2)) then Mouse(mX,mY, 5, 5,True);
     Flag;
    end;
     
    procedure GetBankPos;
    begin
    ln('Finding bank position');
    if(not FindObj(BankX, BankY, 'ooth', Bank1, 5)) then
        begin
         Ln('Bank1 not found; Try Bank2');
          if(not FindObj(BankX, BankY, 'ooth', Bank2, 10)) then
            begin
            Ln('Bank2 not found; Try Bank3');
              if not(FindObj(BankX, BankY, 'ooth', Bank3, 15) = False) then
                begin
                  Ln('Bank3 not found; Blind Mouse!');
                  BankX:= BlindX;
                  BankY:= BlindY;
                end else ln('Bank found at ' + intToStr(BankX) + ',' + intToStr(BankY));
            end else ln('Bank found at ' + intToStr(BankX) + ',' + intToStr(BankY));
        end else ln('Bank found at ' + intToStr(BankX) + ',' + intToStr(BankY));
    end;
     
    procedure SetupPlayer;
    begin
      If(Players[CurrentPlayer].Integers[0] = 0) then getLevels;
      SetAngle(True);
      ReLocate;
      GetBankPos;
    end;
     
    function GetLog(UpText: String): LongInt;
    begin
      if(Pos('ak', UpText) > 0) then result := 1;
      if(Pos('illow', UpText) > 0) then result := 2;
      if(Pos('aple', UpText) > 0) then result := 3;
      if(Pos('ew', UpText) > 0) then result := 4;
      if(Pos('agic', UpText) > 0) then result := 5;
      if not(result > 0) then result := 0;
    end;
     
    procedure FletchWait;
    var i, q, item: integer;
    cancelIt: boolean;
    up: string;
    begin
    q := 0;
      for i:=2 to 28 do
        begin
          q := q + 1; if(q = 3) then
            begin
              q := 0;
            end;
         if not(cancelIt) then
          begin
          if(q = 0) then NoRandoms;
          if not(ExistsItem(i)) then Break;
          MarkTime(item);
          MMouseItem(i);
          wait(150);
          if(IsUpText('ogs')) then
          begin
          up := rs_getuptext;
          repeat
            wait(100);
            if(random(5) = 0) then ActHuman(5000);
            MMouseItem(i)
            if (IsUpText('ogs')) and(TimeFromMark(item) > 10000) then cancelIt := True;
            if(cancelIt) then Ln('Fletching canceled; 10 Seconds exceeded');
          until(isUpText('ogs')=false) or not(rs_getuptext = up) or (cancelIt);
     
        if not(isUpText('og')) then Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + 1;
     
        end else Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + 1;
        end;
        end;
    end;
     
    procedure AutoFType;
    var EndType: LongInt;
    begin
    EndType := 0;
    Ln('Determining best bow to cut..');
    Ln('Level: ' + IntToStr(Players[CurrentPlayer].level[13]));
     Case log of
       0: begin
            Ln('Log: Tree');
            if(Players[CurrentPlayer].level[13] > 9) then EndType := 2;
            if(Players[CurrentPlayer].level[13] < 10) then EndType := 1;
          end;
       1: begin
            Ln('Log: Oak');
            if(Players[CurrentPlayer].level[13] > 24) then EndType := 2;
            if(Players[CurrentPlayer].level[13] < 25) then EndType := 1;
          end;
       2: begin
            Ln('Log: Willow');
            if(Players[CurrentPlayer].level[13] > 39) then EndType := 2;
            if(Players[CurrentPlayer].level[13] < 40) then EndType := 1;
          end;
       3: begin
            Ln('Log: Maple');
            if(Players[CurrentPlayer].level[13] > 54) then EndType := 2;
            if(Players[CurrentPlayer].level[13] < 55) then EndType := 1;
          end;
       4: begin
            Ln('Log: Yew');
            if(Players[CurrentPlayer].level[13] > 69) then EndType := 2;
            if(Players[CurrentPlayer].level[13] < 70) then EndType := 1;
          end;
       5: begin
            Ln('Log: Magic');
            if(Players[CurrentPlayer].level[13] > 84) then EndType := 2;
            if(Players[CurrentPlayer].level[13] < 85) then EndType := 1;
          end;
     end;
     Case EndType of
            1: Mouse(110 + random(5), 417 + random(5), 5, 5, false);
            2: Mouse(253 + random(5), 421 + random(5), 5, 5, false);
            0: begin
               Ln('Level not high enough? NextPlayer;.');
               Logout;
               end;
          end;
    end;
     
    function OpenMyBank: Boolean;
    begin
      MyBanks := MyBanks + 1;
      Mouse(BankX, BankY, 1, 1, False);
      if(FindBitmap(Banker, x, y))then //finds the bitmap
        begin
          Ln('String: Bank Banker'); //sends a message if the bitmap is found
          Mouse(x, y + random(5), 1, 1, True); //left clicks the bitmap
          result := True;
          exit;
        end;
     
      if(FindBitmap(Booth, x, y))then //finds the bitmap
        begin
          Ln('String: Bank Booth'); //sends a message if the bitmap is found
          Mouse(x, y, 1, 1, True); //left clicks the bitmap
          result := True;
          exit;
        end else
        begin
          Ln('Banker or Booth not found!');
          Ln('Blind Mouse'); //sends a message if the bitmap is found
          Mouse(BlindX, BlindY, 1, 1, False); //blind right click
     
          if(FindBitmap(Banker, x, y))then //finds the bitmap
        begin
          Ln('String: Bank Banker'); //sends a message if the bitmap is found
          Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
          result := True;
          exit;
        end;
     
      if(FindBitmap(Booth, x, y))then //finds the bitmap
        begin
          Ln('String: Bank Booth'); //sends a message if the bitmap is found
          Mouse(x, y, 1, 1, True); //left clicks the bitmap
          result := True;
          exit;
        end else result := false;
        end;
      end;
     
    function TakeLogs: Boolean;
    var Z: Integer;
    begin
      GameTab(4);
      ln('Opening Bank..');
      if not(OpenMyBank) then result := false;
      MarkTime(Z);
      repeat
      wait(500);
      until(TimeFromMark(Z) > 10000) or (Bankscreen);
      ln('Bank took ' + IntToStr(TimeFromMark(Z)) + ' ms');
      FixBank;
     
      wait(800);
      if(ExistsItem(2)) then
        begin
          Mouse(620, 231, 3, 3, false);
          wait(400);
          if(FindBitmap(StoreAll, x, y))then //finds the bitmap
           begin
          ln('Storing from slot 2');
          Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
           end else Ln('"Store All" not found!');
          wait(500);
        end else Ln('Nothing to store');
      MMouse(91, 78, 1, 1);
      wait(500);
      if(IsUpText('ogs')) then
      begin
        ln('Detecting log');
        log := GetLog(rs_GetUpText);
        Mouse(91, 78, 1, 1, False);
        Wait(800);
        ln('Withdrawing logs');
        if(FindBitmap(WithdrawAll, x, y))then //finds the bitmap
           begin
          Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
           end else Ln('"Withdraw All" not found!');
        wait(600);
        ln('Closing bank');
        CloseBank;
        result := true;
      end else
      begin
        Ln(rs_getUptext + ' is not a log');
        ln('Closing Bank');
        CloseBank;
        result := false;
      end;
      CloseBank;
    end;
     
    procedure loop;
    var Timer, MyTime:Integer;
    begin
    MarkTime(MyTime);
      repeat
          if(STime > 0) and (TimeFromMark(MyTime) >= ((STime / 1000) / 60)) then Exit;
          if(TTime > 0) and (TimeFromMark(TotalTime) >= ((TTime / 1000) / 60)) then TerminateScript;
          ln('Writing report - Please Wait');
          Report;
          ln('Focusing window');
          Mouse(483, -75, 0, 0, True);
          if not LoggedIn then Exit;
          NoRandoms;
          ln('Finding bank');
          GetBankPos;
          wait(700);
          ln('Retreiving logs from bank');
          if not(TakeLogs) then exit;
          wait(500);
          ln('Select Knife');
          MouseItem(1, true);
          wait(500);
          ln('Select Log');
          MouseItem(random(InvCount - 1) + 2, true);
          MarkTime(Timer);
          repeat
            wait(100);
          until(GetColor(483, 372) = 7238703) or(TimeFromMark(Timer) > 5000);
          if(GetColor(483, 372) = 7238703) then
            begin
          Case Players[CurrentPlayer].Integers[0] of
            1: Mouse(110 + random(5), 417 + random(5), 1, 1, false);
            2: Mouse(253 + random(5), 421 + random(5), 1, 1, false);
            3: Mouse(407 + random(5), 423 + random(5), 1, 1, false);
            0: AutoFType;
          end;
          wait(500);
          if(FindBitmap(MakeX, x, y))then //finds the bitmap
           begin
          Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
           end else Ln('"Make X" not found!');
          Timer := 0;
          MarkTime(Timer);
          repeat
            wait(100);
            if(GetColor(2258, 430) = 8388608) then
            begin
            Break;
            Ln('Found color of *');
            end else if(TimeFromMark(Timer) > 1000) then Break;
          until(GetColor(258, 429) = 8388608);
          if(GetColor(258, 429) = 8388608) then
            begin
           
          Ln('* Found');
          ln('Typing X Ammount');
          case random(5) of
          0: TypeSend(intToStr(27 + random(500)));
          1: TypeSend(intToStr(111));
          2: TypeSend(intToStr(100));
          3: TypeSend(intToStr(99));
          4: TypeSend(intToStr(999));
          5: TypeSend(intToStr(50));
          end;
          ln('Has began fletching');
          FletchWait;
            end else Ln('"X" Interface lost');
            end else Ln('Interface lost, misclick on bank?');
          If(Players[CurrentPlayer].Integers[0] = 0) then getLevels;
          ln('Repeat');
          until(not LoggedIn);
    end;
     
    procedure ScriptTerminate;
    begin
      Ln('Ending script');
      WriteLn('####################################');
      WriteLn('####################################');
      Writeln('# Thankyou for using Pro Fletcher! #');
      WriteLn('####################################');
      WriteLn('####################################');
      Report;
    end;
     
    begin
      ClearDebug;
      ClearReport;
      SetupSRL;
      ScriptID := '913';
      if(UseSRL) then
       begin
          SRLID := YourID;
          SRLPassword := YourPass;
       end;
      Writeln('Setting up Bitmaps');
      Banker := BitmapFromString(25, 2, 'beNr7/x8ZMIBBbIg7ECGLQ' +
           '0TQBLGKQ0xAlsUvDpFCFwcAHVRkOg==');
      Booth := BitmapFromString(150, 2, 'beNqlUkEOwCAI6+/2gV33/2c' +
           '4NjJEGIiRcKgNQrEC7Q0A13lQNhXMCMk1ph4udA1FdLeCjQDpmav6' +
           '7fBIJfLjNe5HybGG17D8KCYflAuoYNNBS/L76pf3trZY+dTxfQcr/' +
           '2rVwYlTEVbWrA7ad7DjG3uFo54=');
      StoreAll := BitmapFromString(57, 1, 'beNpjYIgNcf8PBnAGAxggc' +
           '4FsCEIWwcVGUwkHcCmsphE2HAAUfVYX');
      WithdrawAll := BitmapFromString(78, 1, 'beNr7/x8CGBgYMBmxIe4QN' +
           'pABZzPAAFwEWRdEJbJiTNPghqCZidUurFxMW5BNQDMZygYADhqE7w' +
           '==');
      Examine := BitmapFromString(54, 1, 'beNoLcY8Ncf8PBgwMDEA2Go' +
           'JLIcv+RwUQKTgbk4FmBbKZBNXEAgDq5Vo2');
      MakeX := BitmapFromString(46, 5, 'beNp9UskNACAIYzsX8Ov+Y6iR' +
           'hFQKbXyQclPnWHPsBzNj43ojwOEMZyU+kfwiPbogeW13IYMpWB87R' +
           'sEuuByDA9IFmNk/sGnaq1xBTyL6dgXLWwlp+PisS6e4nqSzWTIDiB' +
           '/y2Qdr83wv');
      DeclarePlayers;
      WriteLn('####################################');
      WriteLn('####################################');
      Writeln('# Thankyou for using Pro Fletcher! #');
      WriteLn('####################################');
      WriteLn('####################################');
      if not (LoggedIn) then LoginPlayer;
        MarkTime(TotalTime);
        repeat
        Ln('Setting up player consts');
        SetupPlayer;
        Ln('Running loop');
        Loop;
        Ln('Loop stopped, next please..');
        NextPlayer(True);
        until(false);
    end.






    I obtained my AntiRandoms function by copying other threads, but it doesn't work with anything at all!??

    Please someone make and explain to me a good, yet simple AntiRandoms checker function


    Thanks, Foss

  2. #2
    Join Date
    Feb 2007
    Location
    @ SRL
    Posts
    402
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is just a simple randoms checker, It will solve all currently solvable randoms.

    Havn't tested, but it should work fine, just make sure you call it in your mainloop often

    SCAR Code:
    Procedure CheckRandoms;
    Begin
      FindNormalRandoms;
      FTWait(4);
      If FindFight Then
      Begin
        RunAway('N', True, 1, 5000 + Random(5000));
      End;
      If ClickToContinue Then ClickContinue(True, True);
      If FindMod Then
      Begin
        WriteLn('Found a Moderator.');
        // DO other stuff here if u want..
      End;
      FindNormalRandoms;
      FTWait(4);
    End;
    The game has an unexplainable attraction that convinces the player they are having fun, despite the fact that all they are doing is performing repetitive tasks to increase their statistics. "The game is actually a graphical nightmare and its gameplay is simple at best. Yet something, perhaps by subliminal means, forces the player - against his will - to play the game, and to believe that they are having fun".

  3. #3
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by turbobk View Post
    This is just a simple randoms checker, It will solve all currently solvable randoms.

    Havn't tested, but it should work fine, just make sure you call it in your mainloop often

    SCAR Code:
    Procedure CheckRandoms;
    Begin
      FindNormalRandoms;
      FTWait(4);
      If FindFight Then
      Begin
        RunAway('N', True, 1, 5000 + Random(5000));
      End;
      If ClickToContinue Then ClickContinue(True, True);
      If FindMod Then
      Begin
        WriteLn('Found a Moderator.');
        // DO other stuff here if u want..
      End;
      FindNormalRandoms;
      FTWait(4);
    End;
    You wont find fights in fletching. Otherwise heres a big tip...

    USE PEST CONTROL BANK!
    Why? there are no randoms there! i checked, got 99 fletching from that =p

  4. #4
    Join Date
    Jul 2008
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  5. #5
    Join Date
    Feb 2007
    Location
    @ SRL
    Posts
    402
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by deathscytex View Post
    You wont find fights in fletching. Otherwise heres a big tip...

    USE PEST CONTROL BANK!
    Why? there are no randoms there! i checked, got 99 fletching from that =p
    What if FindNormalRandoms; misses a fighting random and it starts to attack you?.. Just stand there until you die?

    Also, Pest control bank has randoms... You may want to check again
    The game has an unexplainable attraction that convinces the player they are having fun, despite the fact that all they are doing is performing repetitive tasks to increase their statistics. "The game is actually a graphical nightmare and its gameplay is simple at best. Yet something, perhaps by subliminal means, forces the player - against his will - to play the game, and to believe that they are having fun".

  6. #6
    Join Date
    Jul 2008
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've been there for a while and havent got any.. ill still test that theory tho

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Antirandoms
    By Adamb_135 in forum OSR Help
    Replies: 1
    Last Post: 04-24-2007, 11:58 PM
  2. AntiRandoms
    By antibinki in forum OSR Help
    Replies: 3
    Last Post: 04-02-2007, 01:58 AM
  3. Need help with antirandoms
    By Johura in forum OSR Help
    Replies: 1
    Last Post: 03-28-2007, 11:29 AM

Posting Permissions

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