Results 1 to 8 of 8

Thread: Non-Runescape Script. Help!

  1. #1
    Join Date
    Jul 2008
    Location
    People eat babies EVERYWHERE!
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Non-Runescape Script. Help!

    Hi everyone! I'm extremely new to SCAR scripting and I decided to test my skills by making a completely working auto-login for his site (I'm only using it for my computer). I spent a long time scripting this entire thing, using it and then adding on more and more and more. Finally, I thought, why not make it about as good as possible (for me :P).

    Here's what it's supposed to do:
    Minimize everything (MinimizeAll),
    Open Firefox (if it doesn't open then wait 1000 seconds) (OpenFireFox),
    Type in the site in the search bar and make sure it doesn't give me a "page not found" error (if it does then wait 1000 seconds) (CheckIfSiteLoads),
    Close the AD that tells you to vote when you get to the site (if it doesn't close, wait 1000 seconds) (CloseAd),
    Scroll down, type in my username/password, press enter twice. (Login).

    Here's the code:
    SCAR Code:
    program AutoAeroWebsiteLogin;

    var
    x,y: Integer;

    const
    MinimizeColor= 14145495;
    ServerNotFoundColor= 15790320;
    FireFoxColor= 10707259;
    AeroStoryColor= 4276545;

    Procedure MinimizeAll;

    begin
    if(FindColor(x,y,MinimizeColor,1356,9,1358,11)) then
    begin

       MoveMouse(1357,10);
       ClickMouse(1357,10,true);
       Wait(250);

    end else

      Writeln('Succesfully minimized all windows.');
      Wait(50);

     end;
     
     Procedure OpenFireFox;
     begin
        MoveMouse(36,674);
        ClickMouse(36,674,true);
        Wait(50);
        ClickMouse(36,674,true);
        Wait(1000);
        if(FindColor(x,y,FireFoxColor,35,673,37,675)) then
        begin
        Writeln('FireFox will not open. Please try again, or open FireFox and continue manually.');
        Wait(1000000);
        end else
        Writeln('Succesfully opened Firefox.');
        Wait(50);
       
        end;
       
        Procedure CheckIfSiteLoads;
            begin
            MoveMouse(259,64);
            ClickMouse(259,64,true);
            Wait(1000);

              SendKeys('AeroStory.com'+chr(13));
              Wait(5000);

              if(FindColor(x,y,ServerNotFoundColor,699,599,701,601)) then
              begin
              Wait(1000000);
             
              end else
             
              Writeln('Successfully loaded AeroStory.com');
              Wait(50);

              end;

              Procedure CloseAd;
                begin
                MoveMouse(828,532);
                ClickMouse(828,532,true);
                Wait(1000);
                if(FindColor(x,y,AeroStoryColor,699,599,701,601)) then
                begin
                Writeln('Ad will not close. Please shut down script and try again, or manually close the add.');
                Wait(1000000);
                end else
                Writeln('Ad closed.');
                Wait(50);
                end;

                Procedure Login;
                  begin
                  MoveMouse(1435,250);
                  HoldMouse(1435,250,true);
                  Wait(50);

                  MoveMouse(1435,600);
                  ReleaseMouse(1435,600,true);
                  Wait(50);

                MoveMouse(440,336);
                ClickMouse(440,336,true);
                Wait(500);

              SendKeys('.'); //username here
              Wait(500);

            MoveMouse(439,379);
            ClickMouse(439,379,true);
            Wait(500);

          SendKeys('.'); //password here
          Wait(500);

        SendKeys(chr(13));
        Wait(1000);

      SendKeys(chr(13));

      end;
      begin
      MinimizeAll;
      OpenFireFox;
      CheckIfSiteLoads;
      CloseAd;
      Login;
    end.

    Edit: Okay I fixed my 1st problem, but now I have a new one
    Whenever I start it, it minimizes ONCE (it's supposed to keep minimizing until it gets to my desktop) and then keeps going on with the script. Another problem is, right here:
    SCAR Code:
    Procedure OpenFireFox;
     begin
        MoveMouse(36,674);
        ClickMouse(36,674,true);
        Wait(50);
        ClickMouse(36,674,true);
        Wait(1000);
        if(FindColor(x,y,FireFoxColor,35,673,37,675)) then
        begin
        Writeln('FireFox will not open. Please try again, or open FireFox and continue manually.');
        Wait(1000000);
        end else
        Writeln('Successfully opened Firefox.');
        Wait(50);
       
        end;
    and in parts similar to that, it ignores that fact that it found a color it wasn't supposed to, and then DIDN'T wait the 1000000 miliseconds I asked for if it found that color. It also said "Successfully opened Firefox. Halp agains :3

    PS: I am also trying to make it so if it finds the Firefox icon color after it double clicks Firefox (which means it didn't open), it will say "FireFox will not open. Please try again, or open FireFox and continue manually." in the debug and then stop the script.
    Non-Runescape playing SCAR user.
    *plays with smilies*




    http://www.fenjer.com/adnan/SRL/8/91...Aero-Login.png
    Found that in some random guy's post !^

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Very hard to read with code tags - instead use Scar tags (instead of having code in between [], put scar and the same for the closing tag). That particular error is caused because you have an if then .. else.. but you don't have a begin and end after the if then, so it only runs the on line and gets confused when you use else. This happens on line 36 or there abouts. You have used it correctly in other places, so I assume you just forgot or were unsure there.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Jul 2008
    Location
    People eat babies EVERYWHERE!
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Thanks!

    I love you <3

    Okay, moving on to the next problem !

    Here's my updated script (turns out that problem was in MANY spots and I was missing a few begins in places!):

    SCAR Code:
    program AutoAeroWebsiteLogin;

    var
    x,y: Integer;

    const
    MinimizeColor= 14145495;
    ServerNotFoundColor= 15790320;
    FireFoxColor= 10707259;
    AeroStoryColor= 4276545;

    Procedure MinimizeAll;

    begin
    if(FindColor(x,y,MinimizeColor,1356,9,1358,11)) then
    begin

       MoveMouse(1357,10);
       ClickMouse(1357,10,true);
       Wait(250);

    end else

      Writeln('Succesfully minimized all windows.');
      Wait(50);

     end;
     
     Procedure OpenFireFox;
     begin
        MoveMouse(36,674);
        ClickMouse(36,674,true);
        Wait(50);
        ClickMouse(36,674,true);
        Wait(1000);
        if(FindColor(x,y,FireFoxColor,35,673,37,675)) then
        begin
        Writeln('FireFox will not open. Please shut down script and try again, or manually open FireFox.');
        Wait(1000000);
        end else
        Writeln('Succesfully opened Firefox.');
        Wait(50);
       
        end;
       
        Procedure CheckIfSiteLoads;
            begin
            MoveMouse(259,64);
            ClickMouse(259,64,true);
            Wait(1000);

              SendKeys('AeroStory.com'+chr(13));
              Wait(5000);

              if(FindColor(x,y,ServerNotFoundColor,699,599,701,601)) then
              begin
              Wait(1000000);
             
              end else
             
              Writeln('Successfully loaded AeroStory.com');
              Wait(50);

              end;

              Procedure CloseAd;
                begin
                MoveMouse(828,532);
                ClickMouse(828,532,true);
                Wait(1000);
                if(FindColor(x,y,AeroStoryColor,699,599,701,601)) then
                begin
                Writeln('Ad will not close. Please shut down script and try again, or manually close the add.');
                Wait(1000000);
                end else
                Writeln('Ad closed.');
                Wait(50);
                end;

                Procedure Login;
                  begin
                  MoveMouse(1435,250);
                  HoldMouse(1435,250,true);
                  Wait(50);

                  MoveMouse(1435,600);
                  ReleaseMouse(1435,600,true);
                  Wait(50);

                MoveMouse(440,336);
                ClickMouse(440,336,true);
                Wait(500);

              SendKeys('.'); //username here
              Wait(500);

            MoveMouse(439,379);
            ClickMouse(439,379,true);
            Wait(500);

          SendKeys('.'); //password here
          Wait(500);

        SendKeys(chr(13));
        Wait(1000);

      SendKeys(chr(13));

      end;
      begin
      MinimizeAll;
      OpenFireFox;
      CheckIfSiteLoads;
      CloseAd;
      Login;
    end.

    What it does is this: It minimizes once, then just continues on with the rest of the script. Also, it was supposed to search places for colors and tell me if they were/weren't there (and then wait for 1000 seconds so I could stop the script). But it just kept going.. Halp If you don't understand what I'm saying, just read the beginning thread post thingy, it's more wordy there :P
    Non-Runescape playing SCAR user.
    *plays with smilies*




    http://www.fenjer.com/adnan/SRL/8/91...Aero-Login.png
    Found that in some random guy's post !^

  4. #4
    Join Date
    Jul 2008
    Location
    People eat babies EVERYWHERE!
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default *bumps*

    Yes, I bump if I'm not one of the 1st 5 threads :3
    Non-Runescape playing SCAR user.
    *plays with smilies*




    http://www.fenjer.com/adnan/SRL/8/91...Aero-Login.png
    Found that in some random guy's post !^

  5. #5
    Join Date
    Apr 2007
    Posts
    994
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure OpenWebPage(URL: string);

    That should make your minimizing and opening firefox redundant?
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

  6. #6
    Join Date
    Jul 2008
    Location
    People eat babies EVERYWHERE!
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, but I think it says it up there, the main purpose if this script is just to kind of challenge my self on many things I've learned so far. I don't want to take the easy way out lol.

    But do you know what the problem is? I think it has to do with adding some loop like "keep clicking until X,Y=DesktopColor or something.
    Non-Runescape playing SCAR user.
    *plays with smilies*




    http://www.fenjer.com/adnan/SRL/8/91...Aero-Login.png
    Found that in some random guy's post !^

  7. #7
    Join Date
    Apr 2007
    Posts
    994
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    repeat
      clickmouse(x,y);
    until (getcolor(coords here) = ????);

    I don't understand why you are reinventing wht wheel. OpenWebPage is completely fine, and your clickmouse commands are lacking, but personal preference, I suppose.
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

  8. #8
    Join Date
    Jul 2008
    Location
    People eat babies EVERYWHERE!
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks. I'll try to add it in right now. I'm modding the wheel that's what I'm doing ! Also, it LOGS IN to the site! Not so tough now are ya'! ./end noob ranting
    Non-Runescape playing SCAR user.
    *plays with smilies*




    http://www.fenjer.com/adnan/SRL/8/91...Aero-Login.png
    Found that in some random guy's post !^

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. non runescape Script.
    By seany in forum OSR Help
    Replies: 9
    Last Post: 01-09-2009, 02:32 PM
  2. requesting a non-runescape script have a look!
    By seany in forum RS3 Outdated / Broken Scripts
    Replies: 6
    Last Post: 06-27-2007, 01:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •