Results 1 to 14 of 14

Thread: Scripting Help

  1. #1
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default Scripting Help

    Working on the waterfiend script tonight, I have finding them, banking and the DTM's made. I just need some help determinging if we are in a fight. I know We can sue the target bar, as it instanitly switches when you are done fighting. But how would I go about that? Should I make a TPA or DTM that checks, the Target box? Or is there a way to check if we have a target already? Aslo, how would I keep track of the loot piles I have already checked? I remember reading about converting the red dots on the mini map to piles and checking them and then marking them checked, but how would I go about this? Any help is appreciated! and an example or tutorial link on the idea would be appreciated as well(:

  2. #2
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    For the fighting, before the EOC update, I used pixel shift mainly for mine. That and the chat box. After the EOC, you could use the bar for detirmining I guess. Or you could check if your adrenaline is increasing, or if ther is a blue/red hitmark in the middle of the screen etc.

    I do not understand your second question. If there is something to loot, would you not just turn the screen, if it is found, you loot it?
    ~Rez

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  3. #3
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by Rezozo View Post
    For the fighting, before the EOC update, I used pixel shift mainly for mine. That and the chat box. After the EOC, you could use the bar for detirmining I guess. Or you could check if your adrenaline is increasing, or if ther is a blue/red hitmark in the middle of the screen etc.

    I do not understand your second question. If there is something to loot, would you not just turn the screen, if it is found, you loot it?
    ~Rez
    The second question I meant how would I already know the pile has been checked for loot, somewhere somebody mentioned using the mini map to mark the dots to show that they have been looted >,<

  4. #4
    Join Date
    Jul 2012
    Posts
    279
    Mentioned
    5 Post(s)
    Quoted
    46 Post(s)

    Default

    For the loot thing, you'd first need a very powerful and precise positioning system to be able to record the red dots in an array and still be able to localize them after you move. After that, it's a matter of going through these stacks when they're on screen and removing them from the array once you're done with them (that part would be a bit tricky and difficult to explain if you have to remove a point in the array that isn't at the end). I'd recommend you not to waste too much time with this and focus on the core of the script though.

    As for how to know when you're in fight, I believe most people use the combat tab to see if you have a target. It's fairly simple and effective.

  5. #5
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Checking if your in a fight can be done with Pixelshift
    Simba Code:
    Function Fighting: Boolean;
    var
    PBox: TBox;
    begin
    PBox := IntToBox(245, 130, 285, 195);
    Result := (AveragePixelShift(PBox, 500, 650) > 400);
    Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
    end;


       
    Procedure Fighting;
    begin
    if (Fighting) then
    begin
    writeln('Waiting for you to stop fighting');
    wait(100);
    end else
    begin
    writeln('Lets look for a fight');


    // PUT FIGHTING PART HERE


    end;
    end;

  6. #6
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by xtrapsp View Post
    Checking if your in a fight can be done with Pixelshift
    :S duno if thats the best way to do it, you'll be losing the time it takes for a weapon swing, or what if you dodge or whatever all attacks for that interval?

    would using the new combat inventory thing added in EoC to see if you have a target not be good?

    if they make it that easy for us, why not


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  7. #7
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    :S duno if thats the best way to do it, you'll be losing the time it takes for a weapon swing, or what if you dodge or whatever all attacks for that interval?

    would using the new combat inventory thing added in EoC to see if you have a target not be good?

    if they make it that easy for us, why not
    I thought if you dodged your character moved back.
    If there are pixels inside the box moving out of it then the pixels inside will still move... Just mess around with the numbers or make the box bigger to the left.

  8. #8
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by xtrapsp View Post
    I thought if you dodged your character moved back.
    If there are pixels inside the box moving out of it then the pixels inside will still move... Just mess around with the numbers or make the box bigger to the left.
    your supposed to move back, and get the small blue no damage shield thing, but jagex have balls'd that up with EoC and sometimes, the mob will hit you, and no damage is taken, and nothing is displayed and no animation,

    if the EoC target screen will make it so easy, wouldent bother messing with pixelshift


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  9. #9
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Hmm I don't know if this helps:

    Simba Code:
    Function InCombat() : boolean;
    var
      x,y : integer;
    begin
      if (TimeFromMark(TimeLastClick) > 60000) then
      begin
        result := false
        writeln('May have gotten stuck. Havent attacked something new for 60 sec. Logging Out in 60 sec if true...');
        exit;
      end;
      if not (GetCurrentTab = tab_Combat) then
        GameTab(tab_Combat);
      Result := false
      Result    := not(FindDTM(No_Target, x, y, MIx1, MIy1, MIx2, MIy2));
      if (Result = True) then
      begin
        TimesBeforeTurn := 0;
        MarkTime(LastInCombat);
        exit;
      end;
    end;

    I found it here:

    http://villavu.com/forum/showthread.php?t=93707

    Be sure to credit them if it works

  10. #10
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    I tried usinfb a function like that, but it did not work. I ended up making a custom DTM for the crossbow( their weakness) ad just finding that in the target screen. My script switches targets hecka fast now because it instantly disappears and reappears

  11. #11
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    If you want you can use something like this from my DeadlyRedSpiderSmasher:
    Simba Code:
    Function Fighting: Boolean;
    begin
      if not LoggedIn then Exit;
      if ((GetColor(600,236)) = 2183217) then
      begin
        if Debug then
        WriteLn('Fighting');
        Result := True;
      end else
      begin
        if Debug then
        WriteLn('Not Fighting');
        Result:= False;
      end;
    end;

    Basically looks for the static greenish health-bar color on a pixel right at the end. Idea by Footballjds

    Way faster and less memory hungry than a DTM

  12. #12
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    So many un-necessary things in both those functions...

    Simba Code:
    function InCombat :boolean;  //TimeLastClick and DTM must be script specific vars
    var
      x,y : integer;
    begin
      while TimeFromMark(TimeLastClick) < 60000) do //make roughly time to kill npc
      begin
        if not (GetCurrentTab = tab_Combat) then
          GameTab(tab_Combat);

        Result := not(FindDTM(No_Target, x, y, MIx1, MIy1, MIx2, MIy2));

        if Result then
          Break;
      end;
    end;

    Simba Code:
    function Fighting: Boolean;
    begin
      if not LoggedIn then
        Exit;

      Result := ((GetColor(600,236)) = 2183217);

      if Result then
      begin
        if Debug then
          WriteLn('Fighting');
      end else
        if Debug then
          WriteLn('Not Fighting');
    end;

    In another thread somewhere I helped someone and actually wrote a function that checked for the 'no target' DTM, but I'm not sure where that is at present

  13. #13
    Join Date
    Mar 2006
    Location
    NW US
    Posts
    210
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Check out my AIO fighter, check the InFight Function, you can steal it. Make sure you get the DTM from the LoadDTMs procedure, too!

    the thread p1ng is talking about is this one, definitely visit it. http://villavu.com/forum/showthread.php?t=93697
    Last edited by mr. pali; 12-18-2012 at 07:21 AM.

  14. #14
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by mr. pali View Post
    Check out my AIO fighter, check the InFight Function, you can steal it. Make sure you get the DTM from the LoadDTMs procedure, too!

    the thread p1ng is talking about is this one, definitely visit it. http://villavu.com/forum/showthread.php?t=93697
    I tried it an couldn't get it to work, so I made my own :P. I made it check for the Crossbow of the Waterfiend( weakness is bolts) that way it would only fight them! I wrote the procedure by hand as well!

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
  •