Results 1 to 11 of 11

Thread: A counting script

  1. #1
    Join Date
    Jun 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default A counting script

    Does anyone know if its possible to write a counting script that counts the number of arrows shot out of, say, a crystal bow? I'm guessing the script would have to look for the "glowing" arrow that the bow shoots, and add that to the count. I haven't really written any scripts yet and I thought this would be a nice first project if it was possible.

    Thanks!

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    You could just count how many ores you have equipped every 2 seconds or so.

  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If you are talking about how many arrows your character has shot, the easiest way would probably be by counting the number of arrows left in your inventory. You could count it using a TPA of FindColorTolerance I guess though, and checking for an arrow like every 2 seconds to make sure it doesn't count the same arrow twice.

    Yes, there would be many methods of doing this.

  4. #4
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Uhh you might be able to, im not to sure if this would work but:
    SCAR Code:
    function CountArrowsShot: integer;
    var
      ArrowsTpa: Tpointarray;
      ArrowsShot: integer;
    begin
      if(FindColorsTolerance(ArrowsTpa, ArrowColor, Msx1, MSy1, MSx2, Msy2, 7))then
      if(Length(ArrowsTpa) >= 25)then inc(ArrowsShot);
      result := ArrowsShot;
    end;

    That might work

    Quote Originally Posted by JAD View Post
    If you are talking about how many arrows your character has shot, the easiest way would probably be by counting the number of arrows left in your inventory. You could count it using a TPA of FindColorTolerance I guess though, and checking for an arrow like every 2 seconds to make sure it doesn't count the same arrow twice.

    Yes, there would be many methods of doing this.
    Quote Originally Posted by NCDS View Post
    You could just count how many ores you have equipped every 2 seconds or so.
    Not if its a crystal Bow.
    Last edited by All that is man; 07-28-2009 at 10:43 AM.

  5. #5
    Join Date
    Jun 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the quick responses!
    But yes, I was talking about a crystal bow =P

    All that is man, I think I get your logic (with my very basic c++ skills haha). So basically, you're using the find color function (Which I assume is part of the library?) and passing in arguments (No idea what half the arguments are though... but I will learn!). Then you check for the length of the arrow.

    Seems easy enough, but I can see that this will run into problems if there is more than one crystal in the area (Or msb special for that matter?)

    Does the color searching function have a area parameter?

    EDIT:
    Oh wow... I assume those variables which I couldn't figure out earlier are actually the coords that specify the area =o
    Last edited by flamer; 07-28-2009 at 11:19 AM.

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by flamer View Post
    EDIT:
    Oh wow... I assume those variables which I couldn't figure out earlier are actually the coords that specify the area =o
    Yes.

    You could also use Reflection if you wanted to to get your Player's animation and while it is shooting the bow, have it find the arrows, that way I don't think if would get confused from other archers.

  7. #7
    Join Date
    Jun 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    reflection? Is that a completely different language or something?

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by flamer View Post
    Then you check for the length of the arrow.
    It doesn't check the length of the arrow, it checks to see if the amount of results for the tpa is greater or equal to 25


    Edit:
    Also, Reflection is not another language, just a different way of using the same language I would say. Instead of using colors, it finds the Tiles on the RS screen so it is more precise. There are plenty of tutorials on it if you look.

    EDT2: http://www.villavu.com/forum/showthread.php?t=46636 is actually a pretty good Reflection tut. I would suggest learning color first though. It would be best in the long run.
    Last edited by NCDS; 07-28-2009 at 11:55 AM.

  9. #9
    Join Date
    Jun 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok thanks =)

    I'll probably start learning colors then sometime this week, and hopefully not screw up too hard =o

    Btw, this is undetectable right? The program isnt actually doing anything for me other than help keeping count so I can swap out my crystal bow every 250 arrows so I can keep one at 10/10 at all times.

    EDIT:
    Lol, I realized, I can make the program do that for me... of course randomized, maybe like every 230-245 arrows it will switch, then switch back once it degrades.
    Last edited by flamer; 07-28-2009 at 12:41 PM.

  10. #10
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by flamer View Post
    Ok thanks =)

    I'll probably start learning colors then sometime this week, and hopefully not screw up too hard =o

    Btw, this is undetectable right? The program isnt actually doing anything for me other than help keeping count so I can swap out my crystal bow every 250 arrows so I can keep one at 10/10 at all times.

    EDIT:
    Lol, I realized, I can make the program do that for me... of course randomized, maybe like every 230-245 arrows it will switch, then switch back once it degrades.
    If your not moving the mouse, there is no way it is detectable.

  11. #11
    Join Date
    Jun 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Cnr Sport aka Camaro View Post
    If your not moving the mouse, there is no way it is detectable.
    Ok thanks

    Thank you all for your help, I hope I can contribute to this community sometime soon

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
  •