Results 1 to 10 of 10

Thread: what am i doing wrong?

  1. #1
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default what am i doing wrong?

    i dont get whats wrong here.. :S

    SCAR Code:
    program New;

    var
    CurrentHp: Integer;
    {.Include SRL/SRL.SCAR}
    {.include SRL\SRL\Skill\Fighting.scar}

    var
    x, y: Integer;
    ColorString: String;

    Const
      monstercolor1 = 7181246;
      monstercolor2 = 1048;
      tolerance = 4;
      monster = 'onk';
      minHP = 10;

    procedure Fight;
    begin
      if(InFight) then
      begin
        wait(Random(1000)+500);
      end else if(not InFight) then
      begin
        FindObjCustom(x, y, ['ttac', monster], [monstercolor1, monstercolor2], tolerance);
        If(IsUpText(monster)) then Mouse(x, y, 2, 2, True)
        else
        begin
          Mouse(x, y, 2, 2, False);
          ChooseOption('ttac');
        end;
        Wait(1000);
        Status('Waiting for fight...');
        Flag;
        Wait(1000)
        Status('Fighting...');
        repeat
          Wait(500);
          CurrentHP := GetMMLevels('hp', ColorString);
        until((not InFight) or (CurrentHp < minHP));
      end;
    end;

    begin
      repeat
        Fight;
      until(false);
    end.
    Lance. Da. Pants.

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;

    var
    CurrentHp: Integer;
    {.Include SRL/SRL.SCAR}
    {.include SRL\SRL\Skill\Fighting.scar}

    var
    x, y: Integer;
    ColorString: String;

    Const
      monstercolor1 = 7181246;
      monstercolor2 = 1048;
      tolerance = 4;
      monster = 'onk';
      minHP = 10;

    procedure Fight;
    begin
      if(InFight) then
      begin
        wait(Random(1000)+500);
      end else if(not InFight) then
      begin
        FindObjCustom(x, y, ['ttac', monster], [monstercolor1, monstercolor2], tolerance);
        If(IsUpText(monster)) then Mouse(x, y, 2, 2, True)
        else
        begin
          Mouse(x, y, 2, 2, False);
          ChooseOption('ttac');
        end;
        Wait(1000);
        Status('Waiting for fight...');
        Flag;
        Wait(1000)
        Status('Fighting...');
        repeat
          Wait(500);
          CurrentHP := GetMMLevels('hp', ColorString);
        until((not InFight) or (CurrentHp < minHP));
      end;
    end;

    begin
      SetupSRL; //ALWAYS have this as the first thing in main loop :)
      repeat
        Fight;
      until(false);
    end.

  3. #3
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    THANKYOU. im an idiot x]

    Edit: erm.. its still not working even with the setupSRL function properly in place.. =/
    Lance. Da. Pants.

  4. #4
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what's the problem?

    (I thought the problem was that the mouse moved slow)

  5. #5
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wait its working for you? for me it compiles purfectly and runs... but the mouse just dosnt move at all and the status just keeps changing from waiting for fight to fighting

    Edit: nvm.. strangely it just started to work

    but one problem i can already spot... the script is not waiting for the fight to be over before it atacks another monk. why is that? o.O
    Lance. Da. Pants.

  6. #6
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    because it's not waiting long enough

    make the wait longer

  7. #7
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    but.. isnt the whole point of the if(not InFight) so that it will continue fighting when your no longer fighting, and not after a time period?
    Lance. Da. Pants.

  8. #8
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you never repeat the wait for it

  9. #9
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    haha yeah i realized that xD im sorry for my noobishness :S im new to srl lol.
    Lance. Da. Pants.

  10. #10
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    haha it's fine

    glad to help

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. what am i doing wrong ?:P
    By sjlou in forum OSR Help
    Replies: 2
    Last Post: 10-01-2007, 01:52 PM
  2. What am i doing wrong?
    By One Leeter in forum OSR Help
    Replies: 7
    Last Post: 06-15-2007, 10:33 PM
  3. Replies: 8
    Last Post: 03-23-2007, 04:20 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
  •