Results 1 to 9 of 9

Thread: two scripts in one?

  1. #1
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default two scripts in one?

    well here is my question tell me if you need more clarification
    is it possible to put 2 or more scripts into one script and then have the main script have a choice to use either one of those 2 inside of it?

    such as

    SCAR Code:
    program 2scripts;

    const
    usescripta=true;

    program scripta;
    begin
    end.

    program scriptb;
    begin
    end.

    procedure choose;
    begin
    if(usescripta=true)then
    begin
    scripta;
    end else
    begin
    scriptb;
    end
    end;

    begin
    choose;
    end.


    i know that wont work but that is just an example incase you didnt understand my description

  2. #2
    Join Date
    Oct 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes. You set them up as includes. where the 'main' procedure of scripta and scriptb are callable procedures. Then call to them in your main script.

  3. #3
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    could you plz give me an example i think i know what you meen but im not sure

  4. #4
    Join Date
    Oct 2006
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Or you could just set them up as procedures and run them inside one program.

  5. #5
    Join Date
    Nov 2006
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if you look at the giuld miner by wt fakawi ull see that they hav another script for anti randoms and anti ban
    im back----took a long break away but im back and im gonna get into scripting

  6. #6
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok i have started to mess with some stuff and have got the idea working. Thanks!

  7. #7
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Would you mean something like this:
    PHP Code:
    program TwoScripts;
    var  
    x,y:integer;
         
    AScript,BScript:string;

    const 
    Script='BScript';  //Run with AScript or BScript


    //A//A//A//A//A//A//A//A//A//A//A//A
    procedure A1;
    begin
    writeln
    ('A')
    end;

    procedure A2;
    begin
    getmousepos
    (x,y)
    Movemouse(x+50,y+50)
    end;
    //A//A//A//A//A//A//A//A//A//A//A//A


    //B//B//B//B//B//B//B//B//B//B//B//B
    procedure B1;
    begin
    writeln
    ('B')
    end;

    procedure B2;
    begin
    getmousepos
    (x,y)
    ClickMouse(x+20,y+20,true)
    end;
    //B//B//B//B//B//B//B//B//B//B//B//B


    //A//A//A//A//A//A//A//A//A//A//A//A
    procedure A;  //Main loop of A Script
    begin
    A1
    ;
    A2;
    end;
    //A//A//A//A//A//A//A//A//A//A//A//A
    // \\
    //B//B//B//B//B//B//B//B//B//B//B//B
    procedure B;  //Main loop of B Script
    begin
    B1
    ;
    B2;
    end;
    //B//B//B//B//B//B//B//B//B//B//B//B

    procedure Choise;   //Choises A or B script and runs with it
    begin
    case Script of
     
    'AScript'A;
     
    'BScript'B;
    end;
     
    end;

    begin
    Choise
    ;
    end

  8. #8
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, there is no reason you couldn't have two or three or ten scripts inside one. There was a guy working on a PlayVarrock script that would randomly pick out one of like 5 different activities and do that. You could have it fight guards, or have it smith bars, or have it mine at the east mine or the west mine, or you could have it sell items to the store, or have it chop trees/oaks/etc.

    All you need to do is have each of those scripts work correctly on their own, and then lump them all together with a little bit of code to transition between them.

  9. #9
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kk tyvm

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add ranging to chicken killing scripts, or the cow killing scripts
    By canu44 in forum RS3 Outdated / Broken Scripts
    Replies: 0
    Last Post: 12-18-2007, 07:37 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
  •