Results 1 to 11 of 11

Thread: SetupAutoCast

  1. #1
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default SetupAutoCast

    Newer version of what I had before:

    SCAR Code:
    Procedure SetupAutoCast(Spell: String; Defensive: Boolean);
    Var
      SpellNames: Array [0..1] of Array [0..3] of String;
      TSA: TStringArray;
      i, x, y, xb, yb: Integer;
      ii, SpellInt, Colours: TIntegerArray;
    Begin
      if not GameTab(1) then Exit;
      SpellNames[0] := ['wind', 'water', 'earth', 'fire'];
      SpellNames[1] := ['strike', 'bolt', 'blast', 'wave'];
      Colours := [];
      Mouse(655, ((Integer(not(Defensive)) * 33) + 253), 50, 25, True);
      TSA := srl_Explode(Spell, ' ');
      For i := 0 to 1 do
        For ii[i] := 0 to 3 do
          If (TSA[ii[i]] = SpellNames[i][ii[i]]) then
            SpellInt[i] := ii[i];
      xb := ((SpellInt[0] * 40) + 503)
      yb := ((SpellInt[1] * 61) + 124)
      If FindColorTolerance(x, y, Colours[SpellInt[0] * SpellInt[1]], xb + 5, yb + 5, xb - 5, yb - 5, 20) then
        Mouse(xb, yb, 3, 3, True);
    end;

    This only works in theory, there is no way to check if the opening of auto cast setup works, or any of the spells works as of yet. Could someone with the spells active please do this?

    Thanks

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

    Default

    It looks good Should work though as it seems.



    ~NS

  3. #3
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    You should use InStrArrEx to get which element your spell is, and then again for which style, so you get your row and column in only 2 lines...

  4. #4
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    You should use InStrArrEx to get which element your spell is, and then again for which style, so you get your row and column in only 2 lines...
    Thanks, I'll implement that now.

    SCAR Code:
    Procedure SetupAutoCast(Spell: String; Defensive: Boolean);
    Var
      SpellNames: Array [0..1] of Array [0..3] of String;
      TSA: TStringArray;
      i, x, y, xb, yb: Integer;
      SpellInt, Colours: TIntegerArray;
    Begin
      if not GameTab(1) then Exit;
      SpellNames[0] := ['wind', 'water', 'earth', 'fire'];
      SpellNames[1] := ['strike', 'bolt', 'blast', 'wave'];
      Colours := [];
      Mouse(655, ((Integer(not(Defensive)) * 33) + 253), 50, 25, True);
      TSA := srl_Explode(Spell, ' ');
      For i := 0 to 1 do
        If not(InStrArrEx(TSA[i], SpellNames[i], SpellInt[i])) then
        Begin
          srl_Warn(SetupAutoCast, ' Invalid spell name', warn_AllVersion);
          Exit;
        end;
      xb := ((SpellInt[0] * 40) + 503)
      yb := ((SpellInt[1] * 61) + 124)
      If FindColorTolerance(x, y, Colours[SpellInt[0] * SpellInt[1]], xb + 5, yb + 5, xb - 5, yb - 5, 20) then
        Mouse(xb, yb, 3, 3, True);
    end;

    Now also yells at you for bad spells.
    Last edited by Richard; 07-21-2009 at 12:34 AM.

  5. #5
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    If you made a version that worked, I'd commit it.
    Looks really nice IMO.

  6. #6
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    [Runtime Error] : Could not call proc

    its the first string line
    Last edited by JPHamlett; 08-25-2009 at 09:36 AM.

  7. #7
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Never had that problem, guessing its another one of the 3.20+ problems.

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

    Default

    Quote Originally Posted by Richard View Post
    Never had that problem, guessing its another one of the 3.20+ problems.
    You can't set static arrays like that in 3.15 or 3.20+. However it never errored in 3.15, just terminated the script.

  9. #9
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    If you made a version that worked, I'd commit it.
    Looks really nice IMO.
    Nauman did have a working version, but it would appear he deleted his post...

  10. #10
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Richard View Post
    Nauman did have a working version, but it would appear he deleted his post...
    He just moved it.

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

    Default

    Quote Originally Posted by Sabzi View Post
    He just moved it.
    Seeing as no one really paid attention to this post I made another thread, with a bit more shortenings:

    http://www.villavu.com/forum/showthr...369#post621369

    I hope people pay attention to that.

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
  •