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

Thread: How To Make A Flawless Script!!!

  1. #1
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default How To Make A Flawless Script!!!

    How To Make a Script Run Flawlessly.


    [Warning] This tutorial has some quotes from Chuck Norris, those who are not worthy must NOT look!, Or Fear Death![/Warning]

    Table Of Contents:
    I - Beginning Notes.
    II - Intoduction.
    III - Improvisations.
    IV - Failsafes.
    V - TimeMarks!!
    VI - End Notes.

    I - Beginning Notes.

    Welcome to NaumanAkhlaQ's tutorial on How To Make a Script Run Flawlessly. SO why did I make this tutorial??
    Well a script without [u]Failsafes, , TimeMarks and Improvisation[/i] techniques is like Chuck Norris without his roundhouse kicks. <-- Freaky, no?
    Every script needs this criteria for it to run flawlessly. N.B, I believe that there is no such thing a flawless becuase nothing is perfect flawless just means good.
    Ok so lets begin!!!


    II - Introduction.

    SO what are Failsafes, TimeMarks and Improvisations.
    Well they are what makes a script run Flawlessly.
    Ok that this scenario for instance.
    Your right outside the general store and you need to get inside, just one problem your in world 1, and it's really crowded.
    What could you do?




    No Problem you say just use
    SCAR Code:
    If FindSymbol(x,y,'store') Then..
    . But how will S.C.A.R manage to find the symbol when there are loads of player dots crowding the symbol???
    Chuck Norris says "RoundHouse kick all of them in their Faces!!!" Alas it isn't that easy.


    III - Improvisations.


    Ok so returning to the problem we encountered in chapter II, what could we use?
    Ok SO Our Options:

    1: Co-ord Clicking.
    2: Color Finding;
    3: Make it repeat until it finds the symbol.

    Ok so I'll put them in order of non-detectability:
    2: Color Finding;
    3: Make it repeat until it finds the symbol
    1: Co-ord Clicking.

    So how can we use them in our script, here is an example:



    SCAR Code:
    If (not(FindSymbol(x,y,'store'))) Then
      Begin
        WriteLn('General Store Not found, Trying another tack');
        If FindColorSpiral(x,y,47587,Co-ords here) Then
          Mouse(x,y,1,1,true)
          FFlag(0)
        If (Not(FindColorSpiral( x,y,47587,Co-ords here) Then
          WriteLn('Couldnt Find Color, now going to co-ord click')
        Begin
          Mouse(657,655,5,5,true);
          FFlag(0)  
        If (not(FlagPresent)) Then
          WriteLn('We have died')
          TerminateScript;
       end;
    end;

    ^ Thats Just an example, but hounostly it looks very messy so hows about we put it in a seperate Procedure ^

    SO here
    SCAR Code:
    Procedure TryAgain;
    Begin
      WriteLn('General Store Not found, Trying another tack');
        If FindColorSpiral(x,y,47587,Co-ords here) Then
          Mouse(x,y,1,1,true)
          FFlag(0)
        If (Not(FindColorSpiral( x,y,47587,Co-ords here) Then
          WriteLn('Couldnt Find Color, now going to co-ord click')
        Begin
          Mouse(657,655,5,5,true);
          FFlag(0)
        If (not(FlagPresent)) Then
          WriteLn('We have died')
          TerminateScript;
        end;
    end;

    Procedure FindStore;
    Begin
     If (not(FindSymbol(x,y,'store'))) Then
      Begin
        TryAgain;
        Begin
          BuyBuckets; //e.t.c  if our script hasn't terminated //
       end;
     end;
    end;

    That Looks much better and less messier.
    Thats that covered, now what about makeing it repeat until it finds the symbol
    Well we could do something like this.

    SCAR Code:
    If (Not (FindSymbol(x,y,'store'))) then
    Begin
    Repeat
      If FindSymbol(x,y,'store') then
        Result := True;
        Mouse(x,y,1,1,true);
    Until(Result);
    FFlag(0);
    end;
    ^ But what if it doesn't find it wouldn't that be a waste of time, that leads us on to the next chapter on FailSafes.


    IV - Failsafes.

    Ok so scenario 2 - we can't let it keep trying to find it, we need to make it stop after doing ten tries or something...
    And Failsafes do exactly that.
    So First we make a variable called Tries as an Integer; .



    SCAR Code:
    Procedure FindStore;
    var
    Tries: Integer; <---- Here!!!
    Begin
    If (Not (FindSymbol(x,y,'store'))) then
    Begin
    Repeat
      If FindSymbol(x,y,'store') then
        Result := True;
        Mouse(x,y,1,1,true);
    Until(Result);
     FFlag(0);
     end;
    end;

    OK SO we made an Integer called tries, now what do we do?
    One good thing about an Integer as it will always start at 0 unless specified not to. So we can keep adding on one in a loop until it will get to 10 as they say so our code could look something like this:

    SCAR Code:
    Procedure FindStore;
    var
    Tries: Integer; <---- Here!!!
    Begin
    If (Not (FindSymbol(x,y,'store'))) then
    Begin
    Repeat
      If FindSymbol(x,y,'store') then
        Tries:=Tries+1;
        Result := True;
        Mouse(x,y,1,1,true);
    Until(Result) or (Tries = 10);
     FFlag(0);
     end;
    end;

    SO what we are doing there is basically telling it to add one onto zero each time until it gets to ten meaning it will try to find then symbol 10 times. so Tries:=Tries+1; is basically 0:=0+1 and it a second time is 1:=1+1; e.t.c

    SO what does
    SCAR Code:
    Tries = 10
    do? What it does is that it will stop after Tries is equal to 10 meaning it will try and find the symbol store until it finds it or it tires 10 times.
    Simple huh....
    But Chuck Norris isn't impressed, "So wouldn't it time out just as it reaches ten meaning it might not click???".
    Well guess what folks Chucks right again!!!

    SCAR Code:
    Procedure FindStore;
    var
    Tries: Integer; <---- Here!!!
    Begin
    If (Not (FindSymbol(x,y,'store'))) then
    Begin
    Repeat
      If FindSymbol(x,y,'store') then
        Tries:=Tries+1 <--// Will stop here! if it finds it the tenth time//
        Result := True;
        Mouse(x,y,1,1,true);
    Until(Result) or (Tries = 10);
     FFlag(0);
     end;
    end;

    So it should look like:
    SCAR Code:
    Until(Result) or (Tries > 10);

    Becuase when its over ten meaning it will stop after it's clicked the symbol. Thats about all and you can use it if you want to repeat a procedure so you could do (Just for Chuck Norris' pleasure
    SCAR Code:
    Repeat
      DoRoundHouseKicksOnBadGuys;
      i:=i+1;
    Until(i> 6{Number Of Bad Guys!})

    SO there we go we have made a working Failsafe whilst satisying Chuck Norris


    V - TimeMarks!!


    Ok SO what are TimeMarks?
    Well stupid Question lets ask the all knowing Chuck.
    Chuck Norris says: "Some code used in a script to make a loop stop after a certain amount of time";
    Ok How you use time marks is just declare them a variable first ok lets do Chuck Norris as an Integer.

    N.B You must declare the
    SCAR Code:
    MarkTime
    Before the loop begins.

    Example (this would be wrong):
    SCAR Code:
    Procedure Chuck;
    var Chuck_Norris : Integer;
    Begin
    Repeat
      MarkTime(Chuck_Norris)
    Until(TimeFromMark(Chuck_Norris) > (8000))

    ^That would be wrong as it will start it again from zero so it will never get to 8 seconds, this is what you call an endless loop^

    So this would be right:
    SCAR Code:
    Procedure Chuck;
    var Chuck_Norris : Integer;
    Begin
    MarkTime(Chuck_Norris)
    Repeat
      RoundHouseKicks;
    Until(TimeFromMark(Chuck_Norris) > (8000))

    A good way of reminding you that you should never declare it in a loop is that: Chuck Norris always comes first.

    So now you wonder what this does??
    SCAR Code:
    Until(TimeFromMark(Chuck_Norris) > (8000))
    Well it tells S.C.A.R that it will repeat RoundHouseKicks; for 8 seconds( Not enough time??? Too much time for Chuck Norris.!)
    Remember the code that goes Inbetween the brackets must be declared as an Integer!!!.


    SO you could use it for something else:
    Scenario 3:
    Your Mining some coal rocks, with your own script, but sometimes the ore goes when your still waiting and the pickaxe might break
    So how would you solve this:
    Well what the WaitWhileMining procedure looks like is:

    SCAR Code:
    procedure WaitWhileMining;
    begin
      repeat
        NAutoRespond;
        FindFastRandoms;
        PickChecker;
        Check;
        if GasFound(fx, fy) then
        begin
          RunTo('E', False)
            wait(7000 + Random(3000))
            writeln('We avoided Gas!!! :P')
            RunBack;
        end;
        NAutoRespond;
        AntiBan;
    until (FindBlackChatMessage('You manage to mine some'))
    end;

    So we can add a timemark.
    SCAR Code:
    procedure WaitWhileMining;
    var
    Mark : Integer;
    begin
    MarkTime(Mark);  
     repeat
        NAutoRespond;
        FindFastRandoms;
        PickChecker;
        Check;
        if GasFound(fx, fy) then
        begin
          RunTo('E', False)
            wait(7000 + Random(3000))
            writeln('We avoided Gas!!! :P')
            RunBack;
        end;
        NAutoRespond;
        AntiBan;
    until (FindBlackChatMessage('You manage to mine some')) or (TimeFromMark(mark) > 20000))
    end;
    What this will do is it will time out after 20 seconds from when the pick touches the rock to when 20 secs is up.
    See TimeMarks are used everywhere!!!!

    VI - End Notes:

    The reason why I wrote Chuck Norris in bold was becuase if you don't show him respect then you will die, simple!
    If you liked this tutorial then you can Rep++ me

    Hope you learned something .

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    I don't really need this tut, my scripts are already flawless (A).

    Well, good job, IDK what to say with this E-Gun against my head
    Nauman says:
    http://www.villavu.com/forum/showthr...646#post384646
    Nauman says:
    "thanks man"


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Lol you missed out what you wrote and the disturbing emotes , Thanks for the comments Hy .

  4. #4
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    theres alot of Begins missing in the tutorial examples.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  5. #5
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Well the examples aren't meant to compile there only mean't to show the person roughly how it's done.
    But nevertheless maybe you can point out the areas .

  6. #6
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Wahey. I can add a wait whilst chopping now
    Jus' Lurkin'

  7. #7
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    procedure WaitWhilstChopping; //Kudos to Naum and his "Flawless Script" tutorial
    var
    CuttingMark : Integer;
    begin
    MarkTime(CuttingMark);
    repeat
    AntiBan;
    FindRandoms;
    CheckAxe;
    EntFinder;
    AntiBan;
    until (FindBlackChatMessage('cut some logs')) or (TimeFromMark(CuttingMark) > 200000));
    end;
    Identifier Expected? 0_o
    Jus' Lurkin'

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Here you go:
    SCAR Code:
    procedure WaitWhilstChopping; //Kudos to Naum and his "Flawless Script" tutorial
    var
    CuttingMark : Integer;
    begin
    MarkTime(CuttingMark);
     repeat
      AntiBan;
      FindRandoms;
      CheckAxe;
      EntFinder;
      AntiBan;
     until (FindBlackChatMessage('cut some logs')) or (TimeFromMark(CuttingMark) > (200000));
    end;
    Need to correct my brackets thanks .

    Updated Tutorial .

  9. #9
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nauman good tutorial, change the examples to work else your a fagg
    ~Hermen

  10. #10
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    ^.^ Thanks to you too =D
    Jus' Lurkin'

  11. #11
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Yeah I changed them

  12. #12
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Failed when compiling
    [Error] (1337:1337): shop not found chucknorisroundhousekickbadguys smashed the baddies thru the walls the shop is no longer standing in script D:\Program Files\SCAR 3.15\Scripts\my scripts\scripts\entershop.scar

    help with this error pl0x
    Blank!

  13. #13
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Hahaha =P
    Jus' Lurkin'

  14. #14
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Lol waddoo you funny but always put chuck norris in bold or he will round house kick you in the face >.<

  15. #15
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    he spelt Chuck Norris wrong anyway. Chuck Noris is an imposter!
    Jus' Lurkin'

  16. #16
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Omg call chuck !!!

  17. #17
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    AMGZ! CHUCK Where are you?!?
    Jus' Lurkin'

  18. #18
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Dunoo probely wrestling with a tiger.

  19. #19
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Nice tut Knew most of this already but still well done I think you'd deserve a tut writers cup, but I'm not the one to decide about these things.

    E: Except the chuck norris parts. Adds too much gayness to the tut.

    Quote Originally Posted by Hermpie View Post
    Nauman good tutorial, change the examples to work else your a fagg
    Your mom.

  20. #20
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Ahh as usual GoF pwns, Thanks alot GoF but chuck is the hero

  21. #21
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    whoah... very nice tut!
    another one from you
    i learned a bit of it
    thanks a lot
    and rep++ for you

  22. #22
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Thanks No Problem .

  23. #23
    Join Date
    Jul 2007
    Location
    Ohio
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    WOWZURS!! I am now rewriting most of my procedures lol. Thanks a ton, rep for you!!

  24. #24
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Thanks No Problem .

  25. #25
    Join Date
    Oct 2007
    Location
    brooklyn, new york
    Posts
    258
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow man great TUT. It has honestly helped me a lot...gonna start my first script based off this.

    However...We all know Chuck Norris has the best of the best scipts/TUTS.

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. I Need Flawless Great Money$$$
    By Sgt Soul in forum RS3 Outdated / Broken Scripts
    Replies: 23
    Last Post: 05-21-2008, 08:37 AM
  2. Making a Flawless script
    By The Claw in forum Outdated Tutorials
    Replies: 14
    Last Post: 10-13-2007, 01:18 PM
  3. 100% Flawless detection eh...
    By BenLand100 in forum RuneScape News and General
    Replies: 22
    Last Post: 06-09-2006, 10:05 PM

Posting Permissions

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