Page 2 of 2 FirstFirst 12
Results 26 to 38 of 38

Thread: New Infight Procedure

  1. #26
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by hunt3rx3 View Post
    Some questions:
    1. That (MSCenter - 60) circle... I guess this procedure will look for the first hit we GET on our players. But what if someone is standing on us. Blue shields have different colors too?
    2. It isnt that fast to detect we are in fight. Sometimes it takes like 2 seconds to GET a hit after we MAKE our first hit. (like ranging)

    Best solution would be to look for the first hit we MAKE, but blue shields... fustrating.

    By the way my method for fighting: waiting till hpbar appears (2 sec max). This needs that no one is around us, so I made a world changing function. Pretty easy and safe botting, but of course cant do this at anywhere.
    Blue shields don't show up as we don't see other people's zeroes.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  2. #27
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    In fact it should be a function rather than a procedure, so that it can result true or false;
    If it gets in the include, it'll go into fighting.simba, and personally I'd have the DTMs loading on fighting setup and freeing on a FreeFighting procedure.

    I'd also consider making a WaitFightEx, which instead of using MSC uses a TPoing provided by the script, so that WaitFightEx can be used by mages & rangers without having to wait for the monster to reach you, including the possibility that it doesn't reach you at all cus it dies on the way or you are safe spotting.

    Other than that, looks good.

    -RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #28
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    In fact it should be a function rather than a procedure, so that it can result true or false;
    If it gets in the include, it'll go into fighting.simba, and personally I'd have the DTMs loading on fighting setup and freeing on a FreeFighting procedure.

    I'd also consider making a WaitFightEx, which instead of using MSC uses a TPoing provided by the script, so that WaitFightEx can be used by mages & rangers without having to wait for the monster to reach you, including the possibility that it doesn't reach you at all cus it dies on the way or you are safe spotting.

    Other than that, looks good.

    -RM
    The facto that you are searching for your own damage bubbles, gives you the freedom to search the whole mainscreen, right? so no need for a WaitFightEx. This should be tested however.

    this is what i did with the code snippet

    Simba Code:
    Function WaitFight: Boolean;
    Var
      Time, x, y, WaitFight_Shield, WaitFight_Damage : integer;
    begin
      WaitFight_Shield := DTMFromString('mrAAAAHic42BgYOAFYgEg5gdiHiBmB2I+IGaBijECMRMQs0LlQOJcUBqkl9XUCS8mBBgJYBgAAK0nBH8=');  //Sets DTMs and Names
      WaitFight_Damage := DTMFromString('mbQAAAHicY2VgYNBmhGAdINYDYn0glgZiBSBWBmI5IJYA4nQ2NoYEPj4wns3DA6a5gPrRMSMWDAYAIPEEVA==');

      MarkTime(Time);  //marks the time
      Repeat
        Wait(50+Random(50));                         //MSCX - 60, MSCY - 70, MSCX + 60, MSCY + 70
        Result := FindDTM(WaitFight_Shield, x, y, MSX1, MSY1, MSX2, MSY2)or
                  FindDTM(WaitFight_Damage, x, y, MSX1, MSY1, MSX2, MSY2);
      Until(TimeFromMark(Time) > 2250)or(Result);  //if it hasn't found either for 2000msec then it exits, (i don't play RS much, is there a very slow weapon that this wouldn't work for?)
      FreeDTM(WaitFight_Shield);
      FreeDTM(WaitFight_Damage);
    end;

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  4. #29
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by JuKKa View Post
    The facto that you are searching for your own damage bubbles, gives you the freedom to search the whole mainscreen, right? so no need for a WaitFightEx. This should be tested however.

    this is what i did with the code snippet

    Simba Code:
    Function WaitFight: Boolean;
    Var
      Time, x, y, WaitFight_Shield, WaitFight_Damage : integer;
    begin
      WaitFight_Shield := DTMFromString('mrAAAAHic42BgYOAFYgEg5gdiHiBmB2I+IGaBijECMRMQs0LlQOJcUBqkl9XUCS8mBBgJYBgAAK0nBH8=');  //Sets DTMs and Names
      WaitFight_Damage := DTMFromString('mbQAAAHicY2VgYNBmhGAdINYDYn0glgZiBSBWBmI5IJYA4nQ2NoYEPj4wns3DA6a5gPrRMSMWDAYAIPEEVA==');

      MarkTime(Time);  //marks the time
      Repeat
        Wait(50+Random(50));                         //MSCX - 60, MSCY - 70, MSCX + 60, MSCY + 70
        Result := FindDTM(WaitFight_Shield, x, y, MSX1, MSY1, MSX2, MSY2)or
                  FindDTM(WaitFight_Damage, x, y, MSX1, MSY1, MSX2, MSY2);
      Until(TimeFromMark(Time) > 2250)or(Result);  //if it hasn't found either for 2000msec then it exits, (i don't play RS much, is there a very slow weapon that this wouldn't work for?)
      FreeDTM(WaitFight_Shield);
      FreeDTM(WaitFight_Damage);
    end;
    I do think that could be quite a speed hogger. In fact I'd love if that coud then return the xy of where it found the fight so that I could then stick it into WaitFightEx and have it run a lot faster.

    -RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  5. #30
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    I do think that could be quite a speed hogger. In fact I'd love if that coud then return the xy of where it found the fight so that I could then stick it into WaitFightEx and have it run a lot faster.

    -RM
    You're wrong. Its very fast

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  6. #31
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by JuKKa View Post
    You're wrong. Its very fast
    Fine, but if I want to check the HP bar to see if there's any green left so that I can change monster as soon as it dies I'd need an x & y.

    -RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  7. #32
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    Fine, but if I want to check the HP bar to see if there's any green left so that I can change monster as soon as it dies I'd need an x & y.

    -RM
    Have a look at the function I just put at the bottom of the OP

  8. #33
    Join Date
    Mar 2012
    Location
    Canada
    Posts
    870
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Working good. Just took your function and manipulated it to fit my need.

    I basicaly use the InFight function to see if the script should use your function. Once it think it might be in fight, it uses your function to confirm if we are the one under attack, or if it is just a false positive.

    I'm using it at LRC in w84 (there is a crap load of people there, if it works there, it works everywhere) and it never fail. It only detect when I am the one under attack and it run to the bank to get the living rock creature off my ass.
    My scripts:
    Advanced Barb Agility Course(outdated), MonkeyThieverV0.11, MahoganyTableV0.4(outdated)
    Questions? I bet that for 98% of those, you'll find answer HERE

  9. #34
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Magician is right.. This is extremely slow on attack starts.. if ur already in a fight, then it's very fast.. but if ur using it to fight a monster, it is very slow as it will always wait that 2.5 seconds. If you lower the timer any more than that well it will start returning false positives. Using InFight to determine whether to use this function or not would be useless.. is this not supposed to remove the limitation and slowness of looking for an HP Bar? :S

  10. #35
    Join Date
    Mar 2012
    Location
    Canada
    Posts
    870
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    Magician is right.. This is extremely slow on attack starts.. if ur already in a fight, then it's very fast.. but if ur using it to fight a monster, it is very slow as it will always wait that 2.5 seconds. If you lower the timer any more than that well it will start returning false positives. Using InFight to determine whether to use this function or not would be useless.. is this not supposed to remove the limitation and slowness of looking for an HP Bar? :S
    No, it's used to eliminate false positive, or at least that's what I'm using it for.

    Simba Code:
    function UnderAttack: Boolean;
    Var
      Time, x, y, WaitFight_Shield, WaitFight_Damage : integer;
    begin
      if InFight then
      begin
        WaitFight_Shield := DTMFromString('mrAAAAHic42BgYOAFYgEg5gdiHiBmB2I+IGaBijECMRMQs0LlQOJcUBqkl9XUCS8mBBgJYBgAAK0nBH8=');  //Sets DTMs and Names
        WaitFight_Damage := DTMFromString('mbQAAAHicY2VgYNBmhGAdINYDYn0glgZiBSBWBmI5IJYA4nQ2NoYEPj4wns3DA6a5gPrRMSMWDAYAIPEEVA==');
        SetDTMName(WaitFight_Shield, 'WaitFight Shield DTM');
        SetDTMName(WaitFight_Damage, 'WaitFight Damage DTM');
        MarkTime(Time);

        repeat
          Wait(50+Random(50));
          if(FindDTM(WaitFight_Shield, x, y, MSCX - 60, MSCY - 70, MSCX + 60, MSCY + 70))
                  or (FindDTM(WaitFight_Damage, x, y, MSCX - 60, MSCY - 70, MSCX + 60, MSCY + 70)) then
          begin
            Result:= True;
            Break;
          end;
        until(TimeFromMark(Time) > 3500);

        FreeDTM(WaitFight_Shield);
        FreeDTM(WaitFight_Damage);
      end;
    end;


    This is the function I added to the LRC script in your thread. It detect if I am under attack by a living rock creature and decided if I should run away of keep mining.

    As you know, LRC is crowded in world 84, and this means that the InFight function will return alot of false positive, since it also detect other's people HP bars.

    With this function, everytime it detect an HP bar, it double check with the damage splash (or shield) and that way I can be 100% sure that I am the one under attack.
    My scripts:
    Advanced Barb Agility Course(outdated), MonkeyThieverV0.11, MahoganyTableV0.4(outdated)
    Questions? I bet that for 98% of those, you'll find answer HERE

  11. #36
    Join Date
    Sep 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Could other players' damage be used to keep from attacking something already in combat with another player? Not sure if there is already a good way to do this.

  12. #37
    Join Date
    Jun 2006
    Posts
    306
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    Umm not sure if you added assigned those DTM's in there just so people can test easy... But you should load/free dtms on every function call..

    Declare them globally and speed will be much better.

    Anyway very nice function, I think it should be added.
    8+ Years:C++, PICBASIC(ASM), Java, PHP, Perl, AHK

    My last hobby (yes i was the dev):Electronic PIC Development And HERE

    SMARTManager 0.91 (Script management/6 Hour limit fix): View thread here

    Like my work? Help me out: http://villavu.com/forum/showthread.php?p=984147#

  13. #38
    Join Date
    Dec 2011
    Posts
    733
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    ^great idea.

    Expanding in the infight proecde, we could get an array of hitsplat locs, and find a monster who is not right next to/on a hit splat. If no matches are found, maybe just click the one farthest from a hitsplat, and hope its not under atk? or could just return false so that it can be called again when a monster has spawned away from hitsplats.
    My scripts: LunarPlanker
    ---
    My Utilities: Cross Platform, Open Source, SPS Path Generator

    Join the Unoficial SRL Skype Group by clicking here, or visiting this thread.

Page 2 of 2 FirstFirst 12

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
  •