Results 1 to 6 of 6

Thread: Why wont thsi work? "if not"

  1. #1
    Join Date
    Mar 2007
    Location
    Under a rock
    Posts
    813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Why wont thsi work? "if not"

    Why wont this work in my script:

    SCAR Code:
    Procedure Blah;
      begin
        if not(LoggedIn) then
        TerminateScript;
          begin
          Makecompass('N');
          Setrun(true);
          HighestAngle;
            end;
            if (FindBitmap(Thecoolestbitmap, x, y))then
              Writeln('Found It');
              MMouse(x,y,1,1);
              GetMousePos(x,y);
              Mouse(x, y, 1, 1, True);
              Flag;
              FreeBitmap(Thecoolestbitmap);
            if not (FindBitmap(Thecoolestbitmap, x, y))then
              Writeln('Didnt find it, using backup bitmap.');
             //backup bitmap thing here (used the same way the one above is)
          //other stuff here.
    end;
    Why wont this if not work, so if it doesnt find the bitmap, it will look for a different bitmap I made?

  2. #2
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For that instead of if not put else
    Also you can change it to:
    Code:
    if (FindBitmap(Thecoolestbitmap, x, y)=true)then
              Writeln('Found It');
              MMouse(x,y,1,1);
              GetMousePos(x,y);
              Mouse(x, y, 1, 1, True);
              Flag;
              FreeBitmap(Thecoolestbitmap);
            if (FindBitmap(Thecoolestbitmap, x, y)=false)then
              Writeln('Didnt find it, using backup bitmap.');

  3. #3
    Join Date
    Jan 2007
    Posts
    526
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if not (FindBitmap(Thecoolestbitmap, x, y))then
              begin
                Writeln('Didnt find it, using backup bitmap.');
                //backup bitmap thing here (used the same way the one above is)
                //other stuff here.
              end;

  4. #4
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    OR!
    SCAR Code:
    if (FindBitmap(Thecoolestbitmap, x, y))then
              Writeln('Found It');
              MMouse(x,y,1,1);
              GetMousePos(x,y);
              Mouse(x, y, 1, 1, True);
              Flag;
              FreeBitmap(Thecoolestbitmap);
            if not (FindBitmap(Thecoolestbitmap, x, y))then
              Writeln('Didnt find it, using backup bitmap.');
             //backup bitmap thing here (used the same way the one above is)
          //other stuff here.

    COULD be changed to

    SCAR Code:
    if (FindBitmap(Thecoolestbitmap, x, y))then
       begin
              Writeln('Found It');
              MMouse(x,y,1,1);
              GetMousePos(x,y);
              Mouse(x, y, 1, 1, True);
              Flag;
              FreeBitmap(Thecoolestbitmap);
         end else
              Writeln('Didnt find it, using backup bitmap.');
             //backup bitmap thing here (used the same way the one above is)
          //other stuff here.

    Like that, Remember to always put begin and end inside your if and then's

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  5. #5
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Or:
    SCAR Code:
    if(not(FindBitmap(Thecoolestbitmap, x, y))) then
    begin
      writeln('blah')
    end;
    Huehuehuehuehue

  6. #6
    Join Date
    Mar 2007
    Location
    Under a rock
    Posts
    813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im using 3garrett3 's way of doing it. Its working the way I want and thanks everyone for the help.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 04-19-2007, 03:44 AM
  2. Replies: 5
    Last Post: 10-26-2006, 11:30 PM

Posting Permissions

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