Results 1 to 3 of 3

Thread: Who can help me to understand this code?

  1. #1
    Join Date
    May 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Who can help me to understand this code?

    Hi guys,

    great site. I found this site randomly. I am not very good when it comes to programming so I face a serious challenge here why I like to plough thorugh this :-))

    I found this old SCAR script, can someone explain to me what it does exactly?!?

    Code:
    program New;
    var
    x,y,i,r,timer1,timer2,xw,xh : integer;
    chakre : Array [1..79] of Integer;
    
    
    begin
    
    chakre[1] := 10987175; // Red
    chakre[2] := 12961221; // Orange
    chakre[3] := 10603178; //black
    chakre[4] := 10603178; //Green
    chakre[5] := 15790830; //Orange
    chakre[6] := 15856375; // Purple
    chakre[7] := 16499899; // blue 2
    chakre[8] := 15790830; // LightBLue
    chakre[9] := 11974326; // Red2
    chakre[10] := 16381681; // Light BLue 2
    timer1 := getsystemtime;
     GetClientDimensions(xw,xh);
     
    repeat
    
    inc(i);
    wait(5);
    if i = 5 then
       i:= 1;
         //search left
         
       if(FindColorTolerance(x,y,16777215,5,5,147,xh-40,15)) then
       begin
       Inc(r);
       ClickMouse(x,y,True);
        WriteLn('BAM');
    
       wait(1000);
       end;
       
        //search right
          if(FindColorTolerance(x,y,16777215,155,5,xw-5,xh-40,15)) then
       begin
       Inc(r);
       ClickMouse(x,y,True);
    
          WriteLn('BAM');
       wait(1000);
       end;
    
    
    until(false);
    WriteLn('Done');
    end.
    For most of you this are basics, but I don't know how to get started .... so thats my 2nd attempt getting up to speed! Thanks guys!

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    It searches for a color on the leftside and clicks it, then does the same for the rightside.

    The array of colors are never used (which is chakre[1] to chakre [10])

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Sep 2012
    Location
    Australia.
    Posts
    839
    Mentioned
    16 Post(s)
    Quoted
    225 Post(s)

    Default

    Quote Originally Posted by tm2k View Post
    Hi guys,

    great site. I found this site randomly. I am not very good when it comes to programming so I face a serious challenge here why I like to plough thorugh this :-))

    I found this old SCAR script, can someone explain to me what it does exactly?!?

    Code:
    program New;
    var
    x,y,i,r,timer1,timer2,xw,xh : integer;
    chakre : Array [1..79] of Integer;
    
    
    begin
    
    chakre[1] := 10987175; // Red
    chakre[2] := 12961221; // Orange
    chakre[3] := 10603178; //black
    chakre[4] := 10603178; //Green
    chakre[5] := 15790830; //Orange
    chakre[6] := 15856375; // Purple
    chakre[7] := 16499899; // blue 2
    chakre[8] := 15790830; // LightBLue
    chakre[9] := 11974326; // Red2
    chakre[10] := 16381681; // Light BLue 2
    timer1 := getsystemtime;
     GetClientDimensions(xw,xh);
     
    repeat
    
    inc(i);
    wait(5);
    if i = 5 then
       i:= 1;
         //search left
         
       if(FindColorTolerance(x,y,16777215,5,5,147,xh-40,15)) then
       begin
       Inc(r);
       ClickMouse(x,y,True);
        WriteLn('BAM');
    
       wait(1000);
       end;
       
        //search right
          if(FindColorTolerance(x,y,16777215,155,5,xw-5,xh-40,15)) then
       begin
       Inc(r);
       ClickMouse(x,y,True);
    
          WriteLn('BAM');
       wait(1000);
       end;
    
    
    until(false);
    WriteLn('Done');
    end.
    For most of you this are basics, but I don't know how to get started .... so thats my 2nd attempt getting up to speed! Thanks guys!
    Simba Code:
    program New;  //Program name
    var   //Global variables
    x,y,i,r,timer1,timer2,xw,xh : integer;
    chakre : Array [1..79] of Integer;


    begin
    chakre[1] := 10987175; // Red
    chakre[2] := 12961221; // Orange
    chakre[3] := 10603178; //black
    chakre[4] := 10603178; //Green
    chakre[5] := 15790830; //Orange
    chakre[6] := 15856375; // Purple
    chakre[7] := 16499899; // blue 2
    chakre[8] := 15790830; // LightBLue
    chakre[9] := 11974326; // Red2
    chakre[10] := 16381681; // Light BLue 2
    timer1 := getsystemtime;  //Sets timer1 to system time.
     GetClientDimensions(xw,xh);  //Gets overall cleitn dimensions (x width, x height)

    repeat

    inc(i);   //Increases i
    wait(5);  //Waits 5ms
    if i = 5 then
       i:= 1;
         //search left

       if(FindColorTolerance(x,y,16777215,5,5,147,xh-40,15)) then  //If it finds these variables within FindColorTolerance
       begin                                                       //It will click it and
       Inc(r);                                                     //Writeln - BAM
       ClickMouse(x,y,True);
        WriteLn('BAM');

       wait(1000);  //Waits for 1000ms (1 second)
       end;

        //search right
          if(FindColorTolerance(x,y,16777215,155,5,xw-5,xh-40,15)) then  //Same as above
       begin
       Inc(r);
       ClickMouse(x,y,True);

          WriteLn('BAM');
       wait(1000);
       end;


    until(false);
    WriteLn('Done');  //Writes Done.
    end.

    If you need any more clarification, please let me know.

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
  •