Results 1 to 16 of 16

Thread: InFight - No Gametab Switch!

  1. #1
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default InFight - No Gametab Switch - Updated!

    SCAR Code:
    {*******************************************************************************
    Function InFight: Boolean;
    By: FrÕzÑ_§ÕµL, based on FindFight by Stupid3ooo.
    Description: Checks for fights without changing game tabs. Prevents multiple runs.
    *******************************************************************************}

    Function InFight: Boolean;
    var
      x, HPTime : Integer;
      ColorSign : String;
     
    Begin
      if Players[CurrentPlayer].level[8] <= 0 then
        Players[CurrentPlayer].level[8] := GetSkillInfo('hitpoints',False);
      if Players[CurrentPlayer].level[8] > HP then
        if TimeFromMark(HPTime) >= 60000 then
        Begin
          x := TimeFromMark(HPTime) - 60000;
          MarkTime(HPTime);
          DecEx(HPTime, x);
          Inc(HP);
        end;
      if FindColor(x, y, 65280, 217, 129, 297, 209) then
      Begin
        x := GetMMLevels('hp', ColorSign);
        if x = -1 then
        Begin
          Result := FindFight;
          Exit;
        end;
        if (x < HP) then
        Begin
          Result := True;
          WriteLn('******** FOUND FIGHTING RANDOM ********');
          WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' + Chr(13));
          TakeScreen('Found Fight');
          Inc(Fights);
          MarkTime(HPTime);
          HP := GetMMLevels('hp', ColorSign);
          if HP = -1 then
            HP := Players[CurrentPlayer].level[8];
        end;
      end;
    end;

    What it does is when it finds the green health bar above your character it checks to see if the HP next to the MM is lower than the one recorded (If none then it does it first) and then returns true. All fights found after this will be checked against your current hp before running away.

    Just tested and works well. I think I have prevented the running away again when it runs back to where it found the fight when another player is fighting, using a mark time - 1min = HP + 1

    I realize it is a simple function but it means we do not have to get unnecessary bans because of this, and also since the old one switches back gametabs after use some players are dead by that time

    Enjoy all

  2. #2
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Good, I think I dropped niels a pm before that FindFight still checks from tabs, which would now be especially detectable.

  3. #3
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah kool, yes I agree thank god for this update lol... well maybe not for all reasons hehe.

  4. #4
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    What if the scripter didn't call GetSkillLevels? It'll fuck up.
    I made a new script, check it out!.

  5. #5
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    I'm not too sure about his but if the HP isn't full isn't the text orange or something? Can't we just check if the text is orange and return true if it is?

  6. #6
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by rikjess View Post
    It can also be red
    Ok... so Result := not(FindColor(x, y, {Green}, {some coords}))?

  8. #8
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'v been using this since update...works well, no annoyning tab switch, or...
    Hmm I have to improve Frosn Souls infight...well example, you got attacked, you ran away...you hp is still lower than 100%, you'll run away again if green bar is above youre head...


    PlayerSetup...
    SCAR Code:
    Players[CurrentPlayer].integers[1]:=GetHP;
    Edit: You may use GetMMstatsinfo or something instead of GetHP, I do GetHP, because it has to get lvls anyways, and GetMMStatsinfo has been failed me few times

    Somewhere in youre randoms finding procedure...
    SCAR Code:
    if InFight then //Don't use Findfight here...try to import Infight to your script
    begin
      HP := GetHpMyWay; //it uses MM stat info, if it fails it gets it manually
      if Players[CurrentPlayer].integers[1] > HP then
        Players[CurrentPlayer].integers[1]:= HP
      else
      begin
        Players[CurrentPlayer].integers[1]:= HP;
        Exit;
      end;
      RunAway('N', True, 1 , 5000 + random(5000));
    end;

    So every time it checks for hp it saves the current hp value to integers[1], if it's higher or same then it exit, if it's lower than on last check then it rans away
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  9. #9
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    You double posted this..

    Anyway:
    Or you could just look at the colorsign.. If Colorsign <> 'green' then Result := True;
    Verrekte Koekwous

  10. #10
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Except for that the health points can be lost in other than fighting, for example gas - who runs away and waits 6 seconds when their pickaxe gets fucked? :S

  11. #11
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Except for that the health points can be lost in other than fighting, for example gas - who runs away and waits 6 seconds when their pickaxe gets fucked? :S
    Well thats why we need a good gas detection function. . Wouldn't this also happen with the normal FindFight?

  12. #12
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    So Piv's and SKy's aren't worthy enough?

    Though when I get a gas I'll give a try making one

  13. #13
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea ok so theres quite a bit that could be changed and made better. I agree on the change of color one, even though for higher levels they will be injured more before it then realizes it is hurt. And yea I know about the second run away, but that is also there in the current FindFight So I was thinking we find how long it takes to recover an hp, and using MarkTime(TempHP) we can then get it all exact. In fact, I'm going to go do that now

    Edit : HP regen is 1/min.

  14. #14
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Updated with new function! Comments please!!!

    No longer need to get HP at start of player login if you don't want. Prevent multiple runs.

  15. #15
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    This function, well the one you gave me over MSN works like a charm.

  16. #16
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yup itst he one I gave you, just with the
    SCAR Code:
    if Players[CurrentPlayer].level[8] <= 0 then
        Players[CurrentPlayer].level[8] := GetSkillInfo('hitpoints',False);
    Added as you said it would be better, and I very much agree

    Does it prevent the multiple runs?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Quick switch
    By rotwyla98 in forum RS3 Outdated / Broken Scripts
    Replies: 3
    Last Post: 01-10-2009, 11:56 PM
  2. Any other way to switch worlds?
    By nobody u kno in forum RuneScape News and General
    Replies: 3
    Last Post: 07-13-2008, 10:44 PM
  3. Function InFight - No Gametab switches!
    By FrÕzÑ_§ÕµL in forum Research & Development Lounge
    Replies: 1
    Last Post: 01-26-2008, 11:19 AM
  4. How do I use InFight
    By Mistagnerd in forum OSR Help
    Replies: 21
    Last Post: 11-17-2007, 08:42 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
  •