Results 1 to 2 of 2

Thread: More help for a noob :)

  1. #1
    Join Date
    May 2012
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default More help for a noob :)

    I'm having more trouble with my fight monster function. Though I have put others in fight and used it properly it still decides to try and fight the cow even though someone else is attacking it.

    Code:
    Function FightCow: Boolean;
    var
      X, Y: Integer;
    begin
    if not loggedIn then exit;
      repeat
      if InFight then
      begin
      x := MSCX;
      y := MSCY;
        repeat
          FindNormalRandoms;
        until (not (OthersInFight) or (not LoggedIn) or (not InFight))
      end;
      if(FindObject([Colour(8623000, 29, 0.02, 0.16), Colour(12370887, 9, 0.22, 0.46), Colour(5733790, 11, 0.02, 0.23), Colour(6717077, 12, 0.05, 0.82), Colour(5265762, 8, 0.12, 0.44)], ['Attack C', 'ack Cow', 'Attack Cow'], Point(MSCX, MSCY), mouse_Right, 3, 3, 5, False, False))then
      begin
        if not (IsFightAt(X, Y) and not InFight) then
      begin
       if WaitOptionMulti(['Attack C', 'ack Cow', 'Attack Cow'], 200) then
            begin
            Writeln('Fighting')
            end;
      Result := True
      end;
      end;
      until (true)
    end;
    I have put InFight and OtherInFight functions in my script to make sure they are working, I have played around with it a bit but cant seem to get it to work properly.
    Any advice is welcome Im pretty sure I have set it up properly.

    I am also using this for the fight and looting in the main loop, I haven't added positioning yet to move around the field when it cant find a cow what do you guys think?
    Code:
    Procedure Mainloop;
    begin
    Repeat
      Repeat
        Repeat
        FightCow;
        Until (True)
          If (True) then
          begin
            wait(RandomRange(5000,7000));
            If not (Killing) then
            FindLoot;
          end;
      until (InvFull)
      if (InvFull) then
      Begin
      CowsToBank;
      BankToCows;
      end;
    until(false)
    FreeDTM(HTele);
    FreeDTM(LumSymbol);
    FreeDTM(AlkSymbol);
    end;
    Last edited by cadet54; 06-25-2012 at 08:49 PM.

  2. #2
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I think your parenthesis are screwing you up on this line. I would take a look at this if I were you.

    Simba Code:
    if not (IsFightAt(X, Y) and not InFight) then

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

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
  •