Results 1 to 7 of 7

Thread: Not-so-well known SCAR shortcuts.

  1. #1
    Join Date
    Jan 2007
    Location
    Nomming bits in your RAM
    Posts
    385
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Not-so-well known SCAR shortcuts.

    Hello, and welcome to my tutorial.

    This is just a short tutorial on shortcuts/little known things in SCAR scripting/macroing to hopefully make things easier for you.

    With that, let's begin!

    I. Extensive Codehints.
    Can't think of that procedure or function that you were going to put in your script? Don't know if it was FindTPA or FindTPAs? Don't want to search through 4-5 threads just to find it? Here's your shortcut!

    Pressing ctrl+space in SCAR opens up a list of every function you can possibly use at that point, including the functions in your includes. (So if you've included SRL and Reflection, the list will contain all SRL and Reflection procedures/functions.) Not only that, but as you type a name, the list will get smaller; only containing procedures/functions starting with whatever you're typing.

    Another small trick with this: you can click/press enter and the highlighted procedure is typed in automatically for you. This, as some can imagine, is helpful in quite a few cases. (It's far nicer to do ctrl+space, then type in RS_GetComp+enter than RS_GetCompassAngleDegrees)


    II. The Wonderful Land of Oz
    ...Or the wonderful land of SCAR's API. Either one works.

    If you are stuck as to which function to use, then press F1 while SCAR is open [and selected, obviously. ]. This brings up the SCAR API, which has most, if not all, of SCAR's built-in functions. These include the function header, which- for example- is:
    function FindDeformedBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; var accuracy: Extended): Boolean;

    Or whatever procedure's header you're looking for.

    It also includes a description of the method, such as:
    Works similar to FindBitmapToleranceIn but allows searching for partially covered or transformed bitmaps. If range is 0, it checks pixels at positions that match bitmap we are looking for; if Range is 1, it checks neighbor pixels as well, if range is bigger, it checks further. AllowPartialAccuracy allows accuracy that is not 100% match. accuracy returns accuracy of found bitmap to bitmap we are looking for. accuracy = 1.0 means it was 100% perfect match.


    III. HotKeys
    Simple hotkeys section.

    To run a script, Ctrl + alt + R
    To pause a script, Ctrl + alt + A
    To stop a script, Ctrl + alt + S
    To pick a color on the screen, Ctrl + alt + P

    ...Which can all be changed under tools -> redefine hotkeys


    IV. Ms. Tabby. (I have no idea why I named this section that. O.o)
    Ever had to indent about 100 lines of code by 4-6 spaces? I have. It is NOT fun. So, to help ease this pain, tab tricks shall be shown.

    a. Getting 'up to speed'. If your current line is at an indent of 2 spaces, and it's supposed to be at 10 spaces, have no fear. You don't need to spam the space bar multiple times; the tab button brings your indent to the nearest indent in the current procedure that is greater than your current one. So, if I had the most incorrectly formatted minimethod [method, procedure, same thing] possible right here:
    SCAR Code:
    procedure MiniMethod;
    begin
              writeln('hi');
          if(2<9)then
                                       begin
      writeln('I write good.');
          end;

    If you wanted to get writeln('I write good'); flush with begin, then you would tab three times (first to be with if(2<9)then, second to be at writeln('hi')/end;, third to be at begin), as opposed to spamming the "space" key like a squirrel on caffene. No offense intended to the squirrels of the world.

    b. Mass moving. This is where you love the tab key forever and ever and ever and ever!

    Have to move 100 lines of code ahead 2 spaces? Going insane about it? You have 2 options.

    SCAR Code:
    for Iterator:=0 to 100 do
    begin
      Click on line[i];
      Press space twice;
    end;
    Which can take a few minutes...

    Or, you can highlight the text and press 'tab' once. This brings ALL of the highlighted code up 2 spaces. This takes 10 seconds. [The same can be applied to moving the code back; Tab+Shift takes it back 2 spaces.]

    Sabzi - Ctrl+Shift+I / Ctrl+Shift+U also work for indenting/unindenting code.


    And that's about it for this short tutorial. If anyone wants to add anything at all, I will give you full credit and more than happily put it in the post. Happy scripting/macroing!
    Last edited by Macro_FTW; 06-26-2009 at 03:47 AM.
    Current Project: Catching up. XD. Potentially back for the summer, depending on how things go.

  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Nice work, there were actually a couple things in there I didn't know about. XD I'm sure this will help a lot of people

    Rep+

  3. #3
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I figured out the ab thing once, but forgot. nice guide.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  4. #4
    Join Date
    Jan 2007
    Location
    Nomming bits in your RAM
    Posts
    385
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks to both of you. ^_^

    ~Macro_FTW
    Current Project: Catching up. XD. Potentially back for the summer, depending on how things go.

  5. #5
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    CTRL + SHITF + I will always intend selected code one and CTRL + SHIFT + U is the same back. I am using this always. Found in:
    http://www.villavu.com/forum/showthread.php?t=3293
    I knew all of it from others siggys , nice tut though.
    Rep+

  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Most of these are well-known. But I've known about all of them for a while .

  7. #7
    Join Date
    Jan 2007
    Location
    Nomming bits in your RAM
    Posts
    385
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sabzi View Post
    CTRL + SHITF + I will always intend selected code one and CTRL + SHIFT + U is the same back. I am using this always. Found in:
    http://www.villavu.com/forum/showthread.php?t=3293
    I knew all of it from others siggys , nice tut though.
    Rep+
    Thanks. Added your suggestion.

    Quote Originally Posted by Da 0wner View Post
    Most of these are well-known. But I've known about all of them for a while .
    Meh, if a few people learn a few new things, it was worth it anyway.

    ~Macro_FTW
    Current Project: Catching up. XD. Potentially back for the summer, depending on how things go.

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
  •