Results 1 to 3 of 3

Thread: AutoSpell Set

  1. #1
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default AutoSpell Set

    I couldnt work out where to post my procedures that i have develop to contribute to SRL, maybe we need a procedure dump forum or something?
    Please use or modify at will

    Mods please move this to the approiate area.

    Procedure SetSpell(Style: String; Spell: String);
    By: Me_ntal
    Description:
    Sets the style and the spell with a staff equipped.
    Example:
    SetSpell('Normal', 'Fire');


    SCAR Code:
    procedure SetSpell(Style: String; Spell: String);
    var SpellColor, CurTab: integer;
    begin
      CurTab := getcurrenttab;

      if (LowerCase(Spell) = 'air')   then SpellColor:= 12632764;
      if (LowerCase(Spell) = 'water') then SpellColor:= 15610161;
      if (LowerCase(Spell) = 'earth') then SpellColor:= 166658;
      if (LowerCase(Spell) = 'fire')  then SpellColor:= 974;

      GameTab(1);
      if (Style = 'Defence') then
      begin
      Mouse(680, 210, 40, 20, True);
      Wait(500 + Random(500));
      if FindColor(x, y, SpellColor, MIX1,MIY1,MIX2,MIY2) then
       Begin
         Wait(100+Random(100));
         Mouse(x,y,0,0, True);
         Wait(100+Random(100));
       end;
      end;

      if (Style = 'Normal') then
      begin
      Mouse(680, 270, 40, 20, True);
      Wait(500 + Random(500));
      if FindColor(x, y, SpellColor, MIX1,MIY1,MIX2,MIY2) then
       Begin
         Wait(100+Random(100));
         Mouse(x,y,0,0, True);
         Wait(100+Random(100));
       end;
      end;

      gametab(Curtab);
    end;

    Procedure WithdrawRune(Rune : String; Numb : integer);
    By: Me_ntal
    Description:
    Withdraws a speficied amount of any rune.
    Example:
    WithdrawRune('Air', '200');

    SCAR Code:
    Procedure WithdrawRune(Rune : String; Numb : integer);
    var ReqRune, bx, by : integer;
     begin
        case lowercase(rune) of
        'air': ReqRune := BitmapFromString(8, 8, 'z78DA758E510EC3200C43AF' +
            '443698ED4FA0E1FE472A827E803A8864095B2F8E120BB3C08BD5A' +
            '35B9FA1CA0A6CAA32D9E61B413C1A296A4BC71E894E5FFDFE8F7D' +
            '1A13D3EA3FD4BC61E846557EF9997ABAE1BD8D99C6706A674441D' +
            '952A2C1FFF44E2AA0BF2DFDE1427D374E0A8E84B452A7C649DDD8' +
            '475753');
        'blood': ReqRune := BitmapFromString(8, 8, 'z78DA7D8C410EC4200C03' +
            'BF0414D6F6B150F8FF9336DA64A5569588A5C9656C35769E022F0' +
            'E899333782A7171E4998B86B265EAB0648208568AD26FC1CDF06F' +
            '3B966A712E3636EFDEFD68F90EB130ED67260E1E2C7FBE7CDFF9E' +
            '0C28896F3653E58D1D183DEDDFB09762C1014ADAD8F8986F6686D' +
            'FD2FC95355AC');
        'body': ReqRune := BitmapFromString(8, 8, 'z78DA858E410EC3201003B' +
            'FC42650CF1E1B20FF7F525148A54551552CF96079BC185B6AE6A2' +
            '51DDE9F4E9566C1B0AEEDDF72143E8F68CE34BE7DA89C9D8CA439' +
            '72FCD1F0BA053CB752A3BDF9D934299ECF38793E58D91162AB07F' +
            'A8279B341E9B5C4ED6A163A1023B7375159548DDFD979A6AA466F' +
            'E01309351C5');
        'chaos': ReqRune := BitmapFromString(8, 8, 'z78DAB334B430B7307735' +
            '70B43074829226AE8640888B2442A589A589B9812584C4540F15A' +
            '7997A4ADC6F686A6804846012BF7A2C2A31D513E12A0064A656DC' +
            '');
        'cosmic': ReqRune := BitmapFromString(8, 8, 'z78DA858D410E03210CC' +
            '4BE04EDD2788E2C84FF3FA968C501295455249FEC89A7EEF99670' +
            '7CB12A31D494E73DF4C7D9A90B21156EEAA2D169FBCEA1CA18B61' +
            '816A24FE3CD6B6E5DF306851217FE54A18DFE6161AB7E3AD830A7' +
            '9249FBC783F9B16E6DF9A1FA02A715588F');
        'death': ReqRune := BitmapFromString(8, 8, 'z78DAB58D3B0E80300C43' +
            'AF44A0C1CE487FF73F1251C380547542E8492F436CD9BAA9694B4' +
            'D9CC9A2B23BC3ABEF97FC7F9EB70CAC2CBC28DCFC1EDCC373DE84' +
            '202CD11CA2A385575BEC546AB498909179A2A23CDD587CEF36266' +
            '7B46EEDC5566A');
        'earth': ReqRune := BitmapFromString(8, 8, 'z78DACDCF310E80201044' +
            'D12B012ECCA7045CEE7F24292C34363626E627D3BD628A5B0B5E7' +
            'EB314ED1AA029A71109E70E36128EAD26995C235A99BAFA4D5DED' +
            '43915455DFABAFFF1E58CA5814');
        'fire': ReqRune := BitmapFromString(8, 8, 'z78DAD5CDB10DC0200C05D' +
            '19530C4E25C3A04F61F29524C811432409A2B9EAC6F2717513B30' +
            'CC94138F7AB8D1E9B36E8911CE4051132A3564EDDCA95CB4D5691' +
            '4F2E6FE630747481B7FBEBFFD8FBD0179895235');
        'law': ReqRune := BitmapFromString(8, 8, 'z78DA758E4B0AC0201043AF' +
            '54AB76DE2CD5EAFD8F5451170E52025984FC5CBE7DBDDCC15AD47' +
            '554F51D4D63C7E480A21AC924E3572A7571D28B36751A91A80E41' +
            '8C7F342C165ECAF2173CF764E31F0D670F48934AC261FEF71FA16' +
            '3AC1BFD9157CA995ABB2365FC41B2E43DB5F4913D7FFEA5F6C53D' +
            'F501F645551D');
        'mind': ReqRune := BitmapFromString(8, 8, 'z78DA858E410E84300C03B' +
            'FD442BAB68F940DFF7F1288F410542414690E91C78917AA76BF29' +
            'D1E94193A12853AEF59A4A10C13933F3EA32DA4B5BF41845A9B17' +
            '37B7177AE5C826373B0B1E586479E38E0DC5859E6EBD91D9B1FFE' +
            'D8B3351877A7CF69E8E80F2BBBE9CF915F207C5827780C5392');
        'nature': ReqRune := BitmapFromString(8, 8, 'z78DA9D8F410EC4200C0' +
            '3BFD45042EC2350F8FF93166D52896AD5CBCAD288833D80247451' +
            'F98BEC9495C173C539A9D49A58589CD1345CE8240646B0F2C00CC' +
            '3E689BEC060CC204845430DFE78BCBF4E796542716F5F0CD1AF10' +
            '1CE83891822F86FDBF804D1B8FADAFBE8C4EB6662D58ECB2EEABF' +
            'DDEFDCD1F5089547D');
        'soul': ReqRune := BitmapFromString(8, 8, 'z78DAA58F410E80200C04B' +
            'F240AEEF40822FF7F920439688826C634995E76DA2C3BBE4E2110' +
            'CC21D4E931CC0289D829321B11C754F7C2DCF97A0154B4775EDDD' +
            '31A5D1939B12A6BBB59A37B5A2D7FE5D3C731F98778257DC9CFAD' +
            'DA601DD1D65727');
        'water': ReqRune := BitmapFromString(8, 8, 'z78DA8D8E510AC42010C5' +
            'AEA45D675FE6535BBDFF912A9D7E14BA2C2A644412D133425E70D' +
            'C8D46CD965B25E84EA7DFAC9E18F354E61E18E657FBF4EFEA7AC7' +
            'C5C1CEBC24CDF9610BFEF01F7F000DF5E0DB7C57143535BE3AB4F' +
            'FF7836C7279544B7ED25C51ADF8EA32D98A193C0125A45501');
       end;
       if (FindBitMapToleranceIn(ReqRune, bx, by, 25, 60, 455, 300, 20)) then
         begin
           Mouse(bx,by, 0,0, false);
           ChooseOption(bx,by,'Withdraw X');
           TypeSend(Inttostr(Numb));
           FreeBitmap(ReqRune);
         end else
         WriteLn('Rune Not Found');
         FreeBitmap(ReqRune);
     end;

    Procedure ScrollBank(Direction: String);
    By: Me_ntal
    Description:
    Scrolls the bank by one line.
    Example:
    ScrollBank('Up');

    SCAR Code:
    procedure ScrollBank(Direction : String);
    var Uarrow, Darrow, bx, by : integer;
    begin
     Darrow := BitmapFromString(10, 2, 'z78DA333000024303306' +
           '9E26262646C0C210D8810C72471E9C5540900911D1767');
     Uarrow := BitmapFromString(10, 2, 'z78DA33300002430324D' +
           '2C4C5C4C8D818BF88010E5DB8F4628A030080B51767');
           
     case Lowercase(Direction)  of
     'up':begin
            if (FindBitMapToleranceIn(Uarrow, bx, by, MSX1, MSY1, MSX2, MSY2, 20)) then
             begin
               MMouse(bx,by,0,0);
               HoldMouse(bx,by, True);
               Wait(150 + Random(50));
               ReleaseMouse(bx,by, True);
             end;
           end;
     'down':begin
            if (FindBitMapToleranceIn(Darrow, bx, by, MSX1, MSY1, MSX2, MSY2, 20)) then
             begin
               MMouse(bx,by,0,0);
               HoldMouse(bx,by, True);
               Wait(150 + Random(50));
               ReleaseMouse(bx,by, True);
             end;
            end;
     end;
     FreeBitmap(Darrow);
     FreeBitmap(Uarrow);
    end;

    Procedure BareHand:Boolean
    By: Me_ntal
    Description:
    Checks if a weapon is equipped

    SCAR Code:
    Function BareHand:boolean;
    var EmptyHand, Wx, Wy, CurTab:integer;
    begin
      EmptyHand := BitmapFromString(11, 1, '4949452E2B232E2B232E2B2355' +
           '55512E2B232E2B232E2B232E2B2352524D4D4D49');
      CurTab := getcurrenttab;
      GameTab(5);
      wait(100+random(100));
      if (FindBitMapToleranceIn(EmptyHand, Wx, Wy, MIX1,MIY1,MIX2,MIY2, 20)) then Result := True;
      wait(100+random(100));
      GameTab(CurTab);
      FreeBitmap(EmptyHand);
    end;

    Procedure AutoRetaliate(Setting: String);
    By: Me_ntal
    Description:
    Either turns on or off retaliate
    Example:
    AutoRetaliate('on');

    SCAR Code:
    Procedure AutoRetaliate(Setting:String);
    var CurTab: integer;
    begin
     CurTab := getcurrenttab;
     GameTab(1)
     wait(100+Random(100));
     
      If FindColor(x, y, 1777020, 624, 385, 719, 396) and
         (LowerCase(Setting) = 'off') then Mouse(x,y,0,0,true);

      If (FindColor(x, y, 5330261, 624, 385, 719, 396)) and
         (LowerCase(Setting) = 'on') then  Mouse(x,y,0,0,true);

      GameTab(CurTab)
    end;

    Procedure LostPort;
    By: Me_ntal
    Description:
    Call to teleport to lumbridge if your lost.

    SCAR Code:
    procedure LostPort;
    var Mx,MY,curtab:integer;
    begin
      curtab := getcurrenttab;
      Gametab(7);
      Wait(100+Random(100));
      if findcolor(Mx,My,16284282, 570,230,580,245) then Mouse(Mx,My,0,0,True);
      Wait(100+Random(100));
      if InChatMulti('eed','wait','speel') then WriteLn('Need to wait');
      Gametab(curtab);
    end;

  2. #2
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks fine. I would suggest you include a simple getcolor check (against the shield on the defense casting tab or something) to make sure you're actually weilding a staff before clicking anything.

  3. #3
    Join Date
    Mar 2007
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    These are nice procedures! They should properly include these in SRL
    I like them, I included them in my SRL include :P


    -Ashur
    Exam period.

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
  •