Results 1 to 4 of 4

Thread: TBox Question

  1. #1
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default TBox Question

    Quick question this may be very simple.
    createaccButton := intToBox(269,527,532,547); // Is this just creating a variable for the TBox which it is using below? Ex. Now that it's declared if I need to use it again I use what is below?
    mouseBox(createaccButton, MOUSE_LEFT);
    wait(3000);

    random code doing whatever go back to process
    mouseBox(createaccButton, MOUSE_LEFT); // this probably makes no sense but basically to the left would be code to do whatever in the script and then instead of doing what I did above I can just call on the mousebox again for that TBox variable correct?

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    not really sure what u are asking, but ur code seems right.
    u could also call MouseBox(IntToBox(...), MOUSE_LEFT) directly unless the box is used multiple times

  3. #3
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by OzoneClutch View Post
    Quick question this may be very simple.
    createaccButton := intToBox(269,527,532,547); // Is this just creating a variable for the TBox which it is using below? Ex. Now that it's declared if I need to use it again I use what is below?
    mouseBox(createAccButton, MOUSE_LEFT);
    wait(3000);

    random code doing whatever go back to process
    mouseBox(createaccButton, MOUSE_LEFT); // this probably makes no sense but basically to the left would be code to do whatever in the script and then instead of doing what I did above I can just call on the mousebox again for that TBox variable correct?
    Depends on the scope of the variable.

    Simba Code:
    createaccButton := intToBox(269,527,532,547);
    Does not create the variable,
    Simba Code:
    var
      createAccButton:TBox;
    does.

    intToBox() accepts xs, ys, xe, ye parameters and spits out a TBox (which is the practical usage of xs, ye, xe, ye)

    Now for a quick explanation about scope ... read though the first part of this post: https://villavu.com/forum/showthread...81#post1305181

    If createAccButton is a global TBox, it can be accessed anywhere without having to declare it again or even assign it a value.

    If it's local, it can only be accessed by the routine in which it was declared.

    e.g.

    Simba Code:
    program new;

    procedure someProcedure();
    var
      someLocalVariable:integer;
    begin
      writeln(someLocalVariable); //works
    end;

    procedure someOtherProcedure();
    begin
      writeln(someLocalVariable); //does not work
    end;

    begin
    end.

    and...

    Simba Code:
    program new;

    var
      someGlobalVariable:integer;

    procedure someProcedure();
    begin
      writeln(someGlobalVariable); //works
    end;

    procedure someOtherProcedure();
    begin
      writeln(someGlobalVariable); //also works
    end.

    begin
    end.
    Last edited by KeepBotting; 03-09-2015 at 02:08 AM.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  4. #4
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default

    @KeepBotting;

    That's not what I said but what I meant, used the wrong terminology it wasn't a variable but depicting what the value was for that TBox. Thanks for the clarification.

    @riwu;
    Quote Originally Posted by riwu View Post
    not really sure what u are asking, but ur code seems right.
    u could also call MouseBox(IntToBox(...), MOUSE_LEFT) directly unless the box is used multiple times
    Yes that is what I had done on my script, I just started out with the above and as I am learning am trying to put 2 and 2 together so that it = 4 not some other number :P

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
  •