Results 1 to 7 of 7

Thread: Help! Please

  1. #1
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default Help! Please

    im making a script for Mafiadeath and i just need a quick hand.

    Ive got the script to move to one of the bars when it needs too.


    but is it possible make the script see how much energy etc ive got like some:

    if number 10< then? lol

    basically i want it to train my player when my person has enough energy etc.

  2. #2
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  3. #3
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    dtms will find the 102/102 [100%] bit?

    any help with how to make them?

    i know how to make Dtms but usually they for items on Runescape not different Numbers lol.

  4. #4
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Counting the colors in the HP box(the yellow color) and converting it to a percent:
    SCAR Code:
    HPPercent := (NumberOfColorsFound * 100) Div TotalNumberOfColors;
    Supposing you have 1/4 of the bar left, then the result will be 25%


  5. #5
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Cazax View Post
    Counting the colors in the HP box(the yellow color) and converting it to a percent:
    SCAR Code:
    HPPercent := (NumberOfColorsFound * 100) Div TotalNumberOfColors;
    Supposing you have 1/4 of the bar left, then the result will be 25%

    Now thats just got me confused lol!

    sadly i am abit of a noob!

    HELP!

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Well ... let me break it down for you ..

    the bar represents the percentage of Energy, yes ? A full bar = 100%, half full = 50%, makes sense... so how do we let the script detect where the bar is ? When the bar is full, there are x pixels of yellow, I didn't count them but it looks like there are about 400 pixels then, lets assume there are. So 400px of yellow = 100%, then 200px of yellow must mean 50%, 12px of yellow means (12 / 400) * 100 %.

    There is this function called CountColor, comes in real handy.

    CountColor(YELLOWCOLOR, x1, y1, x2, y2);

    you do need to fill in those parameters yourself though, but I think this should get you started ?
    Administrator's Warning:


  7. #7
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    okay yes thats alot more clearer thankyou.

    ill give this a whack and see what happens.

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
  •