Results 1 to 12 of 12

Thread: Spell bitmaps

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

    Default Spell bitmaps

    I have noticed that the bitmaps for the spells in the spell tab dont seem to work anymore
    I dont have a account with a high enough mage lvl to fix all the bitmaps but i can fix all of them apart from the last 7
    I will post the bitmaps that i get once i have made them

    ~shut

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

    Default

    I don't like the idea of using bitmaps, because they could easily get outdated. What I have thought is to create a box surrounding the spell and check the Luminance value to see if it can be spelled.


  3. #3
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    >.> do you need to check if the runes are there to cast the spell?

    or just the things you can cast for your level?

  4. #4
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Cazax: I actually have a semi updated one made, but I haven't done the Luminance thing. (was before I was dev... should be in public svn)

    @99_
    The spell shows up castable IF you have the runes to cast it - even if your not high enough level (last i knew).

    So really the bitmaps aren't needed. I can probably make it soon as I get a luminance difference figured out. Or if someone else wants a crack at it I'll put it in next Rev.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes I know that, but I'm still confused on what you need to check for

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

    Default

    Quote Originally Posted by Narcle View Post
    Cazax: I actually have a semi updated one made, but I haven't done the Luminance thing. (was before I was dev... should be in public svn)

    @99_
    The spell shows up castable IF you have the runes to cast it - even if your not high enough level (last i knew).

    So really the bitmaps aren't needed. I can probably make it soon as I get a luminance difference figured out. Or if someone else wants a crack at it I'll put it in next Rev.
    Hmm I've been working on a new Cast function that doesn't use bitmaps for the last couple of days. We always seem to work on the same things don't we.

    It also seems that spells that are available have a generic 65536 colour outline whereas the others don't. EDIT: Maybe not...

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

    Default

    Quote Originally Posted by ZephyrsFury View Post
    Hmm I've been working on a new Cast function that doesn't use bitmaps for the last couple of days. We always seem to work on the same things don't we.

    It also seems that spells that are available have a generic 65536 colour outline whereas the others don't. EDIT: Maybe not...
    your right
    if it is unable to cast then the outline color is 131074 and if it is avaliable to cast then it is 65536

    ~shut

  8. #8
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    But one or the other color might be in the picture... So I'd rather be safe then sorry and do a HSL test. Think Zeph has this made already from irc convo.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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

    Default

    Don't do a whole HSL test, just compare the Luminance value. You will get a huge difference.


  10. #10
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Cazax View Post
    Don't do a whole HSL test, just compare the Luminance value. You will get a huge difference.
    Yes i know that's what i meant... U use HSL convert to do the test tho
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  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 Shuttleu View Post
    your right
    if it is unable to cast then the outline color is 131074 and if it is avaliable to cast then it is 65536

    ~shut
    Some spells have a 65536 colour outline regardless of whether you can cast it or not.

    Quote Originally Posted by Cazax View Post
    Don't do a whole HSL test, just compare the Luminance value. You will get a huge difference.
    You're right with the luminance:

    SCAR Code:
    function Cast(Spell: string): Boolean;
    var
      spArr: TStringArray;
      spNo, X, Y, II: Integer;
      B: TBox;
      Lum, H, S, L: Extended;
      colArr: TIntegerArray;
    begin
      spArr := ['lumbridge home teleport', 'wind strike', 'confuse', 'enchant crossbow bolt', 'water strike', 'lvl-1 enchant',
        'earth strike', 'weaken', 'fire strike', 'bones to bananas', 'wind bolt', 'curse', 'bind', 'low level alchemy',
        'water bolt', 'varrock teleport', 'lvl-2 enchant', 'earth bolt', 'lumbridge teleport', 'bounty locate', 'telekinetic grab',
        'fire bolt', 'falador teleport', 'crumble undead', 'teleport to house', 'wind blast', 'superheat item', 'camelot teleport',
        'water blast', 'lvl-3 enchant', 'iban blast', 'snare', 'magic dart', 'ardougne teleport', 'earth blast', 'high level alchemy',
        'charge water orb', 'lvl-4 enchant', 'watchtower teleport', 'fire blast', 'charge earth orb', 'bones to peaches',
        'saradomin strike', 'claws of guthix', 'flames of zamorak', 'trollheim teleport', 'wind wave', 'charge fire orb',
        'teleport to ape atoll', 'water wave', 'charge air orb', 'vulnerability', 'lvl-5 enchant', 'earth wave', 'enfeeble',
        'teleother lumbridge', 'fire wave', 'entangle', 'stun', 'charge', 'teleother falador', 'teleport block', 'lvl-6 enchant',
        'teleother camelot'];
      Spell := Lowercase(Spell);
      if (GetNumbers(Spell) = Spell) and (InRange(StrToIntDef(GetNumbers(Spell), -1), 1, Length(spArr))) then
        spNo := StrToInt(Spell) - 1
      else
      if (not(InStrArrEx(Spell, spArr, spNo))) then
      begin
        srl_Warn('Cast', 'Invalid Spell Name/Number: ''' + Spell + '''', warn_AllVersions);
        Exit;
      end;

      if (GetCurrentTab <> 7) then
      begin
        GameTab(7);
        Wait(500 + Random(500));
      end;
      B.X1 := spNo mod 7 * 24 + 560;
      B.Y1 := spNo div 7 * 24 + 217;
      B.X2 := B.X1 + 23;
      B.Y2 := B.Y1 + 23;
      if (FindColor(X, Y, 2070783, MIX1, MIY1, MIX2, MIY2)) then MouseBox(MMX1, MMY1, MMX2, MMY2, 3);
      if (FindColor(X, Y, 65536, B.X1, B.Y1, B.X2, B.Y2)) then
      begin
        colArr := GetColors(TPAFromBox(B));
        ClearSameIntegers(colArr);
        for II := 0 to High(colArr) do
        begin
          ColorToHSL(colArr[II], H, S, L);
          Lum := MaxE(Lum, L);
        end;
        Result := (Lum > 30.0);
        if (Result) then
        begin
          WriteLn(Lum);
          MouseBox(B.X1, B.Y1, B.X2, B.Y2, 3);
          Wait(500 + Random(500));
        end;
      end;
    end;

    I've searched for the max luminance in the box around the spell and I've checked if its above a certain value (I've set this to 30.0). Hasn't been widely tested yet though.

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

    Default

    Quote Originally Posted by ZephyrsFury View Post
    Some spells have a 65536 colour outline regardless of whether you can cast it or not.



    You're right with the luminance:

    SCAR Code:
    function Cast(Spell: string): Boolean;
    var
      spArr: TStringArray;
      spNo, X, Y, II: Integer;
      B: TBox;
      Lum, H, S, L: Extended;
      colArr: TIntegerArray;
    begin
      spArr := ['lumbridge home teleport', 'wind strike', 'confuse', 'enchant crossbow bolt', 'water strike', 'lvl-1 enchant',
        'earth strike', 'weaken', 'fire strike', 'bones to bananas', 'wind bolt', 'curse', 'bind', 'low level alchemy',
        'water bolt', 'varrock teleport', 'lvl-2 enchant', 'earth bolt', 'lumbridge teleport', 'bounty locate', 'telekinetic grab',
        'fire bolt', 'falador teleport', 'crumble undead', 'teleport to house', 'wind blast', 'superheat item', 'camelot teleport',
        'water blast', 'lvl-3 enchant', 'iban blast', 'snare', 'magic dart', 'ardougne teleport', 'earth blast', 'high level alchemy',
        'charge water orb', 'lvl-4 enchant', 'watchtower teleport', 'fire blast', 'charge earth orb', 'bones to peaches',
        'saradomin strike', 'claws of guthix', 'flames of zamorak', 'trollheim teleport', 'wind wave', 'charge fire orb',
        'teleport to ape atoll', 'water wave', 'charge air orb', 'vulnerability', 'lvl-5 enchant', 'earth wave', 'enfeeble',
        'teleother lumbridge', 'fire wave', 'entangle', 'stun', 'charge', 'teleother falador', 'teleport block', 'lvl-6 enchant',
        'teleother camelot'];
      Spell := Lowercase(Spell);
      if (GetNumbers(Spell) = Spell) and (InRange(StrToIntDef(GetNumbers(Spell), -1), 1, Length(spArr))) then
        spNo := StrToInt(Spell) - 1
      else
      if (not(InStrArrEx(Spell, spArr, spNo))) then
      begin
        srl_Warn('Cast', 'Invalid Spell Name/Number: ''' + Spell + '''', warn_AllVersions);
        Exit;
      end;

      if (GetCurrentTab <> 7) then
      begin
        GameTab(7);
        Wait(500 + Random(500));
      end;
      B.X1 := spNo mod 7 * 24 + 560;
      B.Y1 := spNo div 7 * 24 + 217;
      B.X2 := B.X1 + 23;
      B.Y2 := B.Y1 + 23;
      if (FindColor(X, Y, 2070783, MIX1, MIY1, MIX2, MIY2)) then MouseBox(MMX1, MMY1, MMX2, MMY2, 3);
      if (FindColor(X, Y, 65536, B.X1, B.Y1, B.X2, B.Y2)) then
      begin
        colArr := GetColors(TPAFromBox(B));
        ClearSameIntegers(colArr);
        for II := 0 to High(colArr) do
        begin
          ColorToHSL(colArr[II], H, S, L);
          Lum := MaxE(Lum, L);
        end;
        Result := (Lum > 30.0);
        if (Result) then
        begin
          WriteLn(Lum);
          MouseBox(B.X1, B.Y1, B.X2, B.Y2, 3);
          Wait(500 + Random(500));
        end;
      end;
    end;

    I've searched for the max luminance in the box around the spell and I've checked if its above a certain value (I've set this to 30.0). Hasn't been widely tested yet though.
    i will test it for you

    ~shut

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Tv's Staff Spell Selecter
    By Tv-XxX in forum Research & Development Lounge
    Replies: 6
    Last Post: 06-11-2008, 11:32 AM
  2. world of warcraft cheat? spell editor/stats ect ect
    By solemn wishes in forum Gaming
    Replies: 8
    Last Post: 11-13-2007, 04:49 AM
  3. HoverSpell; Antiban/Spell Casting/Spell checking function.
    By R0b0t1 in forum Research & Development Lounge
    Replies: 14
    Last Post: 08-17-2007, 05:36 PM
  4. Spell Checker...
    By Dankness in forum SRL Site Discussion
    Replies: 4
    Last Post: 11-05-2006, 01:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •