Results 1 to 20 of 20

Thread: strings

  1. #1
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default strings

    OK is it possible to store information like "mouse(x, y, 10, true);" in a varible and have scar run it?

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    what exactly do you mean?

    you can use procedures and functions to store things:

    Code:
    procedure minerock;
    var
      clayTPA : TPointArray;
      clayATPA : T2DPointArray;
      i,h,mousex,mousey : Integer;
    begin
      if (findcolorstolerance(clayTPA,findclaycolor, msx1+2, msy1+2, msx2-2, msy2-2,20)) then
      begin
        clayATPA:=TPAtoATPA(clayTPA,20);
        h:= high(clayATPA);
        for i := 0 to h do
        begin
          MiddleTPAEX(clayATPA[i],x,y);
          mmouse(x,y,3,3);
          wait(100+random(50));
          if isuptext('ine') then
          begin
            mouse(x,y,3,3,true);
            getmousepos(mousex,mousey);
            Wait(100+random(50));
            mmouse(random(x),random(y),3,3);
            while (findcolortolerance(x,y,findclaycolor, mousex-7, mousey-7, mousex+7, mousey+7,20)) do
            begin
              wait(500+random(100));
            end;
            exit;
          end;
        end;
      end;
    end;
    
    procedure mining;
    begin
      while not (invfull) do
      begin
        wait(1400+random(150));
        minerock;
      end;
    end;
    notice how "mine rock" is the first procedure, and then i call the procedure during "mining"

    is this what your are talking about?

  3. #3
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by boredGamer View Post
    OK is it possible to store information like "mouse(x, y, 10, true);" in a varible and have scar run it?
    Yes, check out my tutorial named "Ultimate Type Tutorial - A must read", then look in the contents and click on "Procedural Types"

    If, that's what you mean..
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  4. #4
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I mean, lets say s := "mouse(x, y, 10, true);"
    then you do a fucntion or somthing that tells scar to run what s equals is this possible?

    (also does anyone know why a saved scar file would go blank!?)

  5. #5
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    umm if you REALLY need to have S only run "mouse(x,y,3,3,true);" then i would just use a procedure.

    Code:
    procedure s;
    begin
      mouse(x,y,3,3,true);
      fflag(2);
    end;
    
    procedure findS;
    begin
      if (findcolortolerance(x,y,findcolor, msx1, msy1, msx2, msy2,20)) then  
      begin
        s;
      end;
    end;
    edit: you could use types and assign the variable the procedure... but i don't understand how that would be more helpful
    Last edited by x[Warrior]x3500; 08-29-2009 at 03:11 PM.

  6. #6
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok but do you know if it's possible i wanted to know for grabbing code using the getpage() fuction so theres no need to update but ok

  7. #7
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    it is possible. use the guide provided by Dan. but i still don't see why regular procs/functions won't work xD

  8. #8
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok also umm is there any reaosn a scar script would go blank without you deleeting it becouse i think i have to redo it becouse my whole script wont show up ):

  9. #9
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    highlight everything and see if it works

    that sometimes happens to me

  10. #10
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;

    var s: Procedure;

    Procedure DoShit;
    var x, y: Integer;
    begin
      Mouse(x, y, 5, 5, True);
      Blah...Blah;
    emd;
       
    begin
      s := @DoShit;
      s;
    end.

    if this is what you meant (procedure/function variables)
    “Ignorance, the root and the stem of every evil.”

  11. #11
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    SCAR Code:
    program New;

    var s: Procedure;

    Procedure DoShit;
    var x, y: Integer;
    begin
      Mouse(x, y, 5, 5, True);
      Blah...Blah;
    emd;
       
    begin
      s := @DoShit;
      s;
    end.

    if this is what you meant (procedure/function variables)
    lol this is why i am confused. i think u are correct in that he is wanting that... but why do u need to do that?? just:

    SCAR Code:
    program New;


    Procedure DoShit;
    var x, y: Integer;
    begin
      Mouse(x, y, 5, 5, True);
      Blah...Blah;
    ed;
       
    begin
      doshit;
    end.

  12. #12
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    gahh doesnt matter i got to redo a weeks worth of scipting -_-

  13. #13
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    lol this is why i am confused. i think u are correct in that he is wanting that... but why do u need to do that?? just:

    SCAR Code:
    program New;


    Procedure DoShit;
    var x, y: Integer;
    begin
      Mouse(x, y, 5, 5, True);
      Blah...Blah;
    ed;
       
    begin
      doshit;
    end.
    simple reasoning, say you have a multi-tasking script, or multi-location now you can have a variable that holds a function and have 5 different functions for each skill/location. Now you can set the variable to the function that is equivelant to the task/loc and viola saves lines and time, and looks confusing

    really, there isnt much point to it, it just looks nice and sometimes can help for organization purposes/ save lines.
    “Ignorance, the root and the stem of every evil.”

  14. #14
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    ahh kk... i am understanding now... but u could also use cases inside of a function one(num:integer): integer; with num being the case number. lol i will stop.

  15. #15
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    ahh kk... i am understanding now... but u could also use cases inside of a function one(num:integer): integer; with num being the case number. lol i will stop.
    sure you would declare it the same but then it would look like so:

    SCAR Code:
    program New;

    var s: Function(Index:Integer): Boolean;

    Function DoThisOrThat(Index: Integer): Boolean;
    begin
      case Integer of
        0: dothis;
        1: dothat;
      end;
      Result := Dothis or Dothat;
    end;
       
    begin
      s := @DoThisOrThat;
      s(0);
    end.
    “Ignorance, the root and the stem of every evil.”

  16. #16
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    xD lol kk. it would save 2 lines by just getting rid of S and putting dothisorthat(0); :P alright i am off for the night

  17. #17
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no i mean ok I make a site that says Mouse(x, y, 10, true); then i use s := getpage(); then theres a code that runs what s equals is this possible?

  18. #18
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    oh! ok. so originally you were giving S a valueless procedure ( mouse(); )... but you are saying that you want to give S a function with a value and then present that value to the user.

    yes setting a string to := getpage() would work
    Last edited by x[Warrior]x3500; 08-30-2009 at 04:52 AM.

  19. #19
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes but is it possible to run that value so that a page can have many lines of code
    and have the code on it be ran?
    also is silent mouse possible still.(not for cheating has other purpose)

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

    Default

    Quote Originally Posted by boredGamer View Post
    yes but is it possible to run that value so that a page can have many lines of code
    and have the code on it be ran?
    also is silent mouse possible still.(not for cheating has other purpose)
    You would have to go back to SCAR 2.03 or below. It was disabled in the Divi versions.
    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

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
  •