Results 1 to 12 of 12

Thread: New SetUpAutoCast

  1. #1
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default New SetUpAutoCast

    SCAR Code:
    function SetUpAutoCast(AutoSpell: string; Defensive: Boolean): Boolean;
    var
      X, Y, Col, Row, Msk: Integer;
      TB : TBox;
      Spells, ColArray : TVariantArray;
    begin
      if not GameTab(1) then exit;
      if Defensive then
        Mouse(655, 253, 50, 25, True)
      else Mouse(665, 320, 50, 25, True);
      Wait(2000 + Random(1500));
      Spells := ['', 'wind strike', 'water strike', 'earth strike', 'fire strike',
                'wind bolt', 'water bolt', 'earth bolt', 'fire bolt',
                'wind blast', 'water blast', 'earth blast', 'fire blast',
                'wind wave', 'water wave', 'earth wave', 'fire wave'];
      ColArray := [16579836, 16579836, 3003805, 835570];
      Try Msk := StrToIntDef(AutoSpell, -1) Except end;
      If Msk <> -1 Then
        Row := Trunc(Msk Div 4) + 1
      Else
      For Msk := 0 to High(Spells) Do
      If AutoSpell = Spells[Msk] Then
        Row := Trunc(Msk Div 4) + 1;

      If (Msk Mod 4) = 0 Then Dec(Row);
      Col := Msk Mod 4;
      If Col = 0 Then Col := 4;
      TB.x1 := 571 + 40 * (Col - 1);
      TB.y1 := 229 + 60 * (Row - 1);
      TB.x2 := TB.x1 + 40;
      TB.y2 := TB.y1 + 60;
      For Msk := 0 to High(Spells) Do
      case LowerCase(AutoSpell) of
        Spells[Msk], IntToStr(Msk) : Result := FindColor(X, Y, ColArray[Msk Mod 4], TB.x1, TB.y1, TB.x2, TB.y2);
      end;
      If Result <> True Then
      begin
        srl_Warn('SetUpAutoCast', '"' + AutoSpell + '" is not a valid autocasting spell.', -2);
        Mouse(687, 448, 9, 4, True); // Exits the autocasting spells setup 'popup'.
      end;
      if Result then Mouse(X, Y, 2, 2, True);
    end;

    The old one went through all the find colors. It is also a bit faster. . Moreover, I changed the co-ords a bit so it would actually cancel the pop-up correctly.

    Open to any criticism.

    Also this has only been tested on around 7 prayers as that's all the quick prayers my character can do. Testing would be appreciated
    Last edited by Naum; 06-16-2009 at 01:35 AM.

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

    Default

    and added spell's?!

    atleast I'm pretty sure they weren't in there before.

    Looks nice

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Yeah, The spells were there, I just shoved them in an array and used some math to get the co-ords.

    Now all I need is testing

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

    Default

    oddly enough I am making a maging script right now >.>

    I'm pretty sure I can use this so I will let you know.

  5. #5
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Didn't you speak about user friendlyness like 2 days ago? >;]
    I still love you haha

  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by N1ke! View Post
    Didn't you speak about user friendlyness like 2 days ago? >;]
    I still love you haha
    No it's I still 'less-than 3 you'. And that was reader friendlyness and I really didn't bother, like you, I think it looks reader friendly. And a skilled 'jr.mem' should be able to understand it

    I still <3 you hoho.

    Edit: Updated the code.

  7. #7
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice Nauman Looks very nice.
    :P

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Iroki View Post
    Nice Nauman Looks very nice.
    Woo, your suddenly active . Thanks

  9. #9
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice Nauman

    I'll be using this is my new script.



    ~NS

  10. #10
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Nadeem View Post
    Nice Nauman

    I'll be using this is my new script.



    ~NS
    New Script *tell us*, Great all you people liked it

  11. #11
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    New Script *tell us*, Great all you people liked it
    haha its a secret

    hint: its a fighting script, in a cave :P



    ~NS

  12. #12
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Cool, So is this useful or not?

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
  •