Page 2 of 2 FirstFirst 12
Results 26 to 33 of 33

Thread: Starting to Script

  1. #26
    Join Date
    Jan 2008
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Scripting is way to hard for me, I try'd and yes i know i give up fast but i can' do anything about it,


    Please let this topic to rest now.

  2. #27
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's actually pretty easy, you just have to take it slowly. I thought I couldn't do it but, I took the time to read the tuts, and then I eventually got it. Don't give up
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  3. #28
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ok I just want to point out something.

    When declaring something such as x and y for a procedure like you have.

    ex.

    SCAR Code:
    procedure mine;
    var x,y:integer;
    begin
    blah
    blah
    end;

    ^ that means x and y is declared for that procedure only and will only work for that procedure unless you take the time to declare it for every procedure.

    If you want x,y declared to be used in the whole script, do this.

    SCAR Code:
    Program Gold_Digga_0_1;
    {.Include SRL\SRL.Scar}
    {.Include SRL\SRL\Skill\Mining.Scar}

    var
      x, y: Integer;

    procedure yourprocedure;
    begin
    {what your procedure does;}
    end;

    ^ that declares it at the beginning. So it will be declared the whole script.

    Yay for advise!!!
    I do visit every 2-6 months

  4. #29
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah, but Zasz, there is one problem to that!

    If you declare it at the top of the script, then it will be the same throughout the script. If you declare it for each procedure, it will only be declared for that procedure.

    Example:

    SCAR Code:
    procedure mine1;
    var
      x,y:integer;
    begin
      X := 50;
      Y := 50;
      Movemouse(x, y);
    end;

    procedure mine2;
    var
      x,y:integer;
    begin
      X := 100;
      Y := 100;
      Movemouse(x, y);
    end;

    Begin
      Mine1;
      Wait(2500);
      Mine2;
    End.

    That is if it's for two different procedures.


    SCAR Code:
    Var
      X, Y : Integer;

    procedure mine1;
    begin
      X := 50;
      Y := 50;
      Movemouse(x, y);
    end;

    procedure mine2;
    var
      x,y:integer;
    begin
      Movemouse(x, y);
    end;

    Begin
      Mine1;
      Wait(2500);
      Mine2;
    End.

    That's for one. Notice the problem? You could end up with wonky coordinates in a needed procedure.

    ~Sandstorm

  5. #30
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    ummm no?

    SCAR Code:
    Var
      X, Y : Integer;

    procedure mine1;
    begin
      X := 50;
      Y := 50;
      Movemouse(x, y);
    end;

    procedure mine2;
    begin
      X := 100;
      Y := 100;
      Movemouse(x, y);
    end;

    Begin
      Mine1;
      Wait(2500);
      Mine2;
    End.
    I do visit every 2-6 months

  6. #31
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, that's true. But what happens if you're relying on it to find a color, and it doesn't find the color? It will use the coordinates previously stored in the variable.

    ~Sandstorm

  7. #32
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    um i always make it a point to use a different variable to store colors... x,y should be used for default mouse...

    Like if(findcolorspiral(x,y,blah,blah)then begin mouse(x,y,6,6,true); end;

    x,y should only store for direct uses like above.
    I do visit every 2-6 months

  8. #33
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That's exactly what I mean. If it's a global variable, then x and y will be the number found in the FindColorSpiral, unless another procedure changes it.

    ~Sandstorm

Page 2 of 2 FirstFirst 12

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
  •