Page 1 of 2 12 LastLast
Results 1 to 25 of 27

Thread: Adding Randoms to Your Scripts

  1. #1
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Adding Randoms to Your Scripts

    Updated, 1/31/06 due to SRL changes. RAWRR.
    Adding Randoms to Your Scripts By WhiteShadow


    This tutorial will cover how and where to add randoms to your scripts.

    Alright, so you first have to include the include. Obviously :

    SCAR Code:
    program New;
    {.include SRL/SRL.Scar}

    begin
      SetUpSRL; //Loads
    end.

    There now you have access to all the functions in SRL's core folder. Thankfully the only function you need to call is FindNormalRandoms; Since it summed all the randoms up for you already..

    SCAR Code:
    {*******************************************************************************
    function FindNormalRandoms: Boolean;
    by: The SRL Developers Team!... all time sexiness by Mutant
    Description: Calls the 'normal' random checks.
    *******************************************************************************}


    function FindNormalRandoms: Boolean;
    var
      i: Integer;
    begin
      for i := 1 to 16 do
      begin
        case I of
          1: CloseWindow;
          2: if FindTalk then
              Result := True;
          3: if FindDead then
              Result := True;
          4: if FindMod then
              Result := True;
          5: if FindMime then
              Result := True;
          6: if FindMaze then
              Result := True;
          7: if FindQuiz then
              Result := True;
          8: if FindDemon then
              Result := True;
          9: if FindScapeRune then
              Result := True;
          10: if FindTalk then // Call it twice
              Result := True;
          11: if FindLamp(LampSkill) then // Maybe we missed it?
              Result := True;
          12: if (FindNewBox) then
            begin
              Result := True;
              if (UseBoxSolver) then
                SolveBox
              else
                GambleNewBox;
            end;
          13: if FindTrade then
              Result := True;
          14:
            begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          15: SaveToChatLog;
          16: if RC then
              Result := True;
        end;
        Wait(1);
      end;
    end;


    Before that though, I want you all to know something.

    Nick, is important, very important. Why? Because your going to get ownd by randoms the whole time, and then complain about how SRL doesn't solve randoms correctly. All talking randoms are solved by looking for a bitmap mask of your Nick in the mainscreen!

    What is Nick?! It's 3 - 4 letters of your username, so if my username was Isamcool then a good Nick would be amco. Yeah so grab a 3 -4 letter chunk out of the center of your username.

    Here's one way to set nicks. Multiple player preferably. So DeclarePlayers; saves all the information on the characters. Then you use LoginPlayer, thankfully LoginPlayer; creates the bitmapmask of the Nick everytime you use it, so this is all you need to do.
    SCAR Code:
    program New;
    {.include SRL/SRL.Scar}

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; //Number of players
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:= 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;

    begin
      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
    end.

    Then there's also just this.

    SCAR Code:
    program New;
    {.include SRL/SRL.Scar}

    const
      Nickk = 'ern';

    begin
      SetUpSRL;
      NickNameBMP := CreateBitmapMaskFromText(Nickk, UpChars);
    end.

    Create the bitmapmask of the current player's Nick with the variable NickNameBMP. That's all that matters.

    After all the setup with the includes, and Nicks just call FindNormalRandoms everywhere you see needed.

    Bits
    SCAR Code:
    procedure WaitisChopping;
    begin
      while(Chopping)do
      begin
        Wait(200);
        FindNormalRandoms;
      end;
    end;

    procedure WaitisMining;
    var
      TimeMark : Integer;
    begin
      MarkTime(TimeMark);
      repeat
        Wait(200);
        FindNormalRandoms;
        if(TimeFromMark(TimeMark) > 30000)then
          Exit;
      until(isChatMessage('succ'))
    end;

    Never not call FindNormalRandoms in a 2 second range. You should always have your script scanning for randoms continously for best results.


    The END.
    Sorry, I'm rly busy atm. Quick-wrte, eeek. :P

  2. #2
    Join Date
    Feb 2006
    Location
    California-Foster City
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Also we will have findnormalrandoms in version 1. Which finds all normal randoms un skill related.
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  3. #3
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sdcit
    Also we will have findnormalrandoms in version 1. Which finds all normal randoms un skill related.
    Let's save the will have's for later.

  4. #4
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Good job. It's good someone finally made one of these tutorials. Alot of new people to scar always ask this question

  5. #5
    Join Date
    Feb 2006
    Location
    Las Vegas, NV
    Posts
    939
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by XxKanexX
    Good job. It's good someone finally made one of these tutorials. Alot of new people to scar always ask this question
    yeah like me nah i dont ask.. i just figure it out myself.. trial and error.. thats how 1 of my accounts got banned.. tryin too many things that messed up on it..

    great tut whiteshadow!!
    Busy with real life. I'll still be around occasionally.
    Current Mood:


  6. #6
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @Kane -Yea, many beginers ask this alot. The reason why I made it. :P

    @PhantomBmx -Thanks.

  7. #7
    Join Date
    Apr 2006
    Posts
    710
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great tut I'm going to use it in my future scripts hahaha

  8. #8
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by c0de
    Great tut I'm going to use it in my future scripts hahaha
    Good to hear.

  9. #9
    Join Date
    May 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot! Great tut!

  10. #10
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by SamTheSam
    Thanks alot! Great tut!
    Yea but since SRL has been updated it's a bit unaccurate, let me update right now.

  11. #11
    Join Date
    Apr 2006
    Location
    California
    Posts
    555
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I might use it as well. Thanks

  12. #12
    Join Date
    Jan 2007
    Location
    Canada
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you for this, it has been a great help and what I once thought was going to be complicated proved to be very simple, thanks to the work of many others...now to learn more about using this so I can make an anti-evilbob random procedure...

  13. #13
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Updated.

  14. #14
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GREAT tut! i have been wondering how to put randoms in scripts.. this tut will help me a lot in future scripts. thanks man.

  15. #15
    Join Date
    Dec 2006
    Posts
    374
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hey man awsome tut. but my problem is how can i make it search for randoms with out clicking on invbag?? cuz for my script if it goes spellbook-->castspell-->invbag-->spellbook-->repeat, then its not human like at all! its need to just do spellbook-->cast--Cast--Cast and ya u get the point. could i do like if(Findtalk) then
    begin
    findnormalrandoms;
    end;

    or sometin so like if the box guy comes and sais hey (username) here ya go! then it will search? im not quite sure how help is needed thanks!
    Another awsome scripting forum! Check it out: www.Uberbroproductions.net/forums
    TRY MY VARROCK ZAMMY MAGE CURSER/CONFUSER/WEAKENER! THE LINK IS BELOW
    http://www.srl-forums.com/forum/varr...56.html?t=6356
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~


  16. #16
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    after reading the tutorial over a few times, theres 1 thing i don't get. what does
    until(isChatMessage('succ'))
    mean? when would you ever get the chatmessage('succ')? thats the only thing that confused me, great tut though.

  17. #17
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    successfully mined or something like that. :P

  18. #18
    Join Date
    Apr 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks this Tut is going to come in handy when i start scripting.

  19. #19
    Join Date
    Dec 2006
    Location
    Latvia
    Posts
    97
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a lot I will include these when I will start scripting...

  20. #20
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  21. #21
    Join Date
    Apr 2007
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this this helped me with randoms a bit. good job.

  22. #22
    Join Date
    Mar 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh my freaking god thank you!

    I asked some guys at sythe bout how to make an anti random or just give me one and a tut.
    they gave me links to already made flax picker and spinner.
    Which ruins the whole point of trying to learn it.
    I'll be more active here since i am still learning and all.

  23. #23
    Join Date
    Mar 2007
    Location
    Finland, Espoo
    Posts
    96
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    where that FindNormalRandoms function
    suposed to put, i'm still noob xD


    here?
    Code:
    program new;
    {.include SRL/SRL.Scar}
    
    
    function FindNormalRandoms: Boolean;
    var
      i: Integer;
    begin
      for i := 1 to 16 do
      begin
        case I of
          1: CloseWindow;
          2: if FindTalk then
              Result := True;
          3: if FindDead then
              Result := True;
          4: if FindMod then
              Result := True;
          5: if FindMime then
              Result := True;
          6: if FindMaze then
              Result := True;
          7: if FindQuiz then
              Result := True;
          8: if FindDemon then
              Result := True;
          9: if FindScapeRune then
              Result := True;
          10: if FindTalk then // Call it twice
              Result := True;
          11: if FindLamp(LampSkill) then // Maybe we missed it?
              Result := True;
          12: if (FindNewBox) then
            begin
              Result := True;
              if (UseBoxSolver) then
                SolveBox
              else
                GambleNewBox;
            end;
          13: if FindTrade then
              Result := True;
          14:
            begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          15: SaveToChatLog;
          16: if RC then
              Result := True;
        end;
        Wait(1);
      end;
    end;

  24. #24
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL/SRL.Scar}

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; // Total players?
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0; // Start Player.

      Players[0].Name:= 'Username';
      Players[0].Pass:= 'Password';
      Players[0].Nick:= 'Nick';
      Players[0].Active:= True;
    end;


    begin
      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
      // ^^ in case we were already logged in
    end.

    Then just call FindNormalRandoms; whereever you want your script to scan for randoms, remember user set up was important because talking randoms, are found by scanning your screen for your nick!

    So no, you do not have to paste in FindNormalRandoms function into your script. Simple write "FindNormalRandoms;" where ever needed.

    I hope that clears it up a little, reread my tutorial a bit.

  25. #25
    Join Date
    Mar 2007
    Posts
    674
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    are there amny special randoms i need to add the choipping?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding Randoms And Antiban
    By RudeBoiAlex in forum OSR Intermediate Scripting Tutorials
    Replies: 17
    Last Post: 10-10-2008, 11:03 PM
  2. help with adding antiban and anti randoms
    By chip111 in forum OSR Help
    Replies: 1
    Last Post: 11-06-2007, 01:38 PM
  3. Adding Anti-randoms!!!!
    By marre in forum OSR Help
    Replies: 2
    Last Post: 05-13-2007, 11:28 PM
  4. Adding Emotes to scripts!!
    By Plugster in forum Bot Information and Spottings
    Replies: 12
    Last Post: 03-02-2007, 03:53 PM
  5. Adding randoms to scripts
    By xMichael in forum OSR Help
    Replies: 6
    Last Post: 01-04-2007, 12:00 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
  •