Results 1 to 5 of 5

Thread: "not" doesn't work.

  1. #1
    Join Date
    Jul 2008
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default "not" doesn't work.

    I made a macro to automatically pot and feed my character. Instead I just ended up taking 5 mana pots, 5 health pots, and got too full (you get digestive problems and need to take medicine). I used 'not' in my if statements and I believe that's where it went wrong. Take a look-

    Code:
    program LazyHunter;
    var
       health, mana, hunger, healthc, manac, hungerc, cycle: integer;
    procedure SetBeginningVariables;
    begin
         health := GetColor(130, 66);
         mana := GetColor(130, 78);
         hunger := GetColor(149, 32);
    end;
    procedure CheckCurrentVariables;
    begin
         healthc := GetColor(130, 66);
         manac := GetColor(130, 78);
         hungerc := GetColor(149, 32);
    end;
    procedure CheckHealth;
    begin
              if not(healthc = health)then
                 wait(100);
                 KeyDown(VK_F1);
                 wait(50);
                 KeyUp(VK_F1);
    end;
    procedure CheckMana;
    begin
              if not(manac = mana)then
                 wait(100);
                 KeyDown(VK_F2);
                 wait(50);
                 KeyUp(VK_F2);
    end;
    procedure CheckHunger;
    begin
              if not(hungerc = hunger)then
                 wait(100);
                 KeyDown(VK_F3);
                 wait(50);
                 KeyUp(VK_F3);
    end;
    begin
         SetBeginningVariables;
         writeln(IntToStr(health) + ' ' + IntToStr(mana) + ' ' + IntToStr(hunger));
         cycle := 0;
         repeat
               CheckCurrentVariables;
               CheckHealth;
               CheckMana;
               CheckHunger;
               wait(1500);
               cycle := cycle + 1;
               writeln('The macro has cycled through ' + IntToStr(cycle) + ' times.');
         until(1=2);
    end.
    What it up?

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    not should work fine. But if you want, you can replace your not...= with <>. So that first one would become
    SCAR Code:
    if healthc <> health

    Edit: Found your problem. Your if statements only correspond to the wait statements directly after them. You need to add a begin and an end; around the block of code you want connected to the if statement.

  3. #3
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    EDIT:

    Just disregard everything i said lol... i thought this was for rs
    METAL HEAD FOR LIFE!!!

  4. #4
    Join Date
    Jul 2008
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahh! Perfect! Thank you very much

  5. #5
    Join Date
    Jul 2008
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    EDIT:

    Just disregard everything i said lol... i thought this was for rs
    It really doesn't mater. Helped anyway.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. action="www.site.com" method="post"
    By Jason2gs in forum General
    Replies: 4
    Last Post: 05-17-2007, 11:50 PM
  2. Replies: 3
    Last Post: 04-19-2007, 03:44 AM
  3. Why wont thsi work? "if not"
    By Rune Hacker in forum OSR Help
    Replies: 5
    Last Post: 04-09-2007, 07:42 PM
  4. 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
  •