Results 1 to 12 of 12

Thread: New Here And..

  1. #1
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    New Here And..

    Hey I'm kinda new here I have read some guides on scripting in SCAR and came up with this script to open my Internet Explorer (pretty lame, but im just getting used to it)

    Code:
    program OpenInternetExplorer;
    
    var
    x,y: Integer;
    
    procedure FindIE;
    
    begin
     FindColor(x,y,6150864,0,0,99999999,99999999);
    end;
    
    procedure OpenIE;
    
    begin
    Clickmouse(x,y,true);
    SendKeys(chr(13));
    end;
    
    begin
     FindIE;
     OpenIE;
    end.
    It works fine but I was wondering if there is something else to put where I put 999999999 to search the whole screen for a color?

    123 Ancient

  2. #2
    Join Date
    Mar 2007
    Posts
    478
    Mentioned
    4 Post(s)
    Quoted
    4 Post(s)

    Default

    Well besides other number idk... I would also like to know the answer to this question.
    Back from the dead.....

  3. #3
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    If you are using something as simple as FindColor, then there is no need to change it.

    This works for me:
    SCAR Code:
    program OpenInternetExplorer;

    var
    x,y: Integer;

    procedure FindIE;

    begin
     FindColor(x,y,16503916,0,0,6666,6666);
    end;

    procedure OpenIE;

    begin
    Clickmouse(x,y,true);
    SendKeys(chr(13));
    end;

    begin
     FindIE;
     OpenIE;
    end.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  4. #4
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Hy.
    Also, how could I make it find the address bar once IE is open?

  5. #5
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    EDIT: 1 sec

  6. #6
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Huh?

  7. #7
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could make a bitmap of the drop down button and tell it to click at x- 20 or wherever. Then just use typesend to type the url. To make bitmaps press print screen key. go to paint. Paste. zoom in 8x. Cut out the bit you want. paste that into a new paint. save it. open scar click picture to string click open and selecxt you bitmap. Then just use findbitmap(Bitmap : integer, var x, y:integer):Boolean I think it is.

    Or alternatively your browser bar is never going to move so just get the coords for it lol!

  8. #8
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mhm, I have no idea what I was thinking..

    And one more thing, with booleans know how you can say like if x = 0 its true then do this or if it doesnt equal zero and its false it does something else you command it to?

    Well can you do that but so that if it sees a certain color its true and if it doesnt see it it's false, and true does one thing and false does another? If so could you please give me the code?

  9. #9
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    In scar there is an if command:

    SCAR Code:
    if (FindColor(x, y, <color>, 0, 0, 1280, 1024)) then
    begin
    ClickMouse(x, y, True);
    end else
    Writeln('Did not find the bar, stopping');
    TerminateScript;

    In the FindColor, i put 0, 0, 1280, 1024.
    0, 0 = The upper-left corner i believe.
    1280, 1024 Is my screen resolution.
    Ce ne sont que des gueux


  10. #10
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, I just wasn't sure how to word it but you got it clear. What about if it's multiple colors and if it shows any of the colors it clicks on them but if none are found you do something else, is that possible?

  11. #11
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also, anyway to scroll on a web page without it having to find the scroll bar and hold it and go down?

  12. #12
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by 123 Ancient View Post
    Thanks, I just wasn't sure how to word it but you got it clear. What about if it's multiple colors and if it shows any of the colors it clicks on them but if none are found you do something else, is that possible?
    you could... use an array and a for to do loop... sounds hard but it really isn't, it just looks hard.

    SCAR Code:
    procedure GoInBoat;
    var
      RuneShop: Array [0..3] of integer;
      i, x, y: integer;
    begin
      RuneShop[0] := 1808876;  //couldn't use findsymbol due to high number of players
      RuneShop[1] := 3187199;  //in the area
      RuneShop[2] := 3318783;
      RuneShop[3] := 2979583;
      for i := 0 to 3 do
      if FindColorTolerance(x, y, RuneShop[i], MMX1, MMY1, MMX2, MMY2, 10) then
      begin
        Mouse(x, y, 0, 0, True);
        Break;
      end else
      begin
        DoSomethingElse;
      end;
    end;

    This will look for the runeshop colors (with a tolerance, in the mainscreen of runescape) in order from 0-3 and if found it will click it and break the loop, otherwise if it doesn't find the colors it will do something else.

    Quote Originally Posted by 123 Ancient View Post
    Also, anyway to scroll on a web page without it having to find the scroll bar and hold it and go down?
    have it click on the screen somewhere not important, then do:

    KeyDown(VK_Down);
    Wait(1000);
    KeyUp(VK_Down);

    should scroll the screen down for 1 second. or you could do a repeat until it finds a bitmap:

    SCAR Code:
    KeyDown(VK_UP);
    repeat
      Wait(50)
    until(FindBitmap(Bitmap, x, y))
    KeyUp(VK_Up);

    you'll probably want to swap out the findbitmap with some other function like FindBitmapToleranceIn or something

    Good Luck
    -You can call me Mick-



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
  •