Results 1 to 16 of 16

Thread: Home Port Casting

  1. #1
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Home Port Casting

    Well since SRL isn't up to date yet I was just messing around with some bitmaps and code and I found a way to still cast spells. I had developed this home port caster for my lumbridge oak seller(The script isn't complete and i can't continue until SRL works)

    Well here is it. It will also open gametab. It uses bitmaps.

    SCAR Code:
    program CastHomePort;

    {.include srl/SRL.scar}

    var tx, ty, MagicTab, HomePortX, HomePort: Integer;

    procedure DeclareBMP;
     begin
      MagicTab := BitmapFromString2(False, 'a6252478DA458CC11100' +
           '2108035B021194A7A8F45FD2191F278F9D4C76021131339D9B795' +
           '0C50EB56E7014306EB601EBFD599D87252E7BFD1B4D7C304C4979' +
           '2137FCB7D5C074D005D6EBB31D03D13B5BE849F6886E124E6D9B6' +
           '82ACB9C12EAF901F9B');
      HomePort := BitmapFromString2(False, 'a647A478DA7D8D510AC42' +
           '00C05AFF46C4CE27EAA6DEE7FA4FA2A6C05D9253084715400883E' +
           '80560624B85A3A06358C2C64B6D79BB037657F94CC46FBB73726C' +
           '89DA7AE7CCEE5A46FFA9478FD87A937BE80934C01AF5EA3EC1495' +
           '6CD7CAE9791769322ECE3CDDFD6A763FF775FEF7BFFEBD01421');
       HomePortX := BitmapFromString2(False, 'a56F8D78DAEDCDB115C5' + //This is the thing that says you casted too soon.
           '200C43D1954CC086DFE224FB8F1444F13344DE2D54E8086366A51' +
           '45BF25E511516E558E9772887B2C5DB474DA50FF5A7FA63342D3D' +
           'FFAF42436BA94D771DED55D398BE97F6F63F4DFBDC174EED23E6C' +
           'A2BF79700000000000000000000000000000000BEEA01218');
     end;

    {=====================================================]
    [Procedure OpenMagicTab is used to open the magic     ]
    [tab to cast lumbridge port,  by me. Uses bitmaps     ]
    [=====================================================}



    procedure OpenMagicTab;
    begin
     If(FindBitmap(MagicTab, tx, ty)) then
      begin
        wait(100 + Random(150));
        Mouse(tx, ty, 6, 6, True);
        wait(1000);
      end else
       begin
        WriteLn('Didn''t Find The Magic Tab! ');
        wait(3000);
       end;
     end;

    {=====================================================]
    [Procedure CastHomePort is used to cast the home      ]
    [port spell to lumbridge, Created by me. Uses bitmaps ]
    [=====================================================}


    Procedure CastHomePort;
     begin
      If(FindBitmap(HomePort, tx, ty)) Then
       begin
        wait(100 + Random(150));
        Mouse(tx, ty, 5, 5, True);
        wait(15000);
        WriteLn('Successfully Teleported "Home"!');
      end;

      If(FindBitmap(HomePortX, tx, ty)) Then
       begin
        WriteLn('You have used Home Port too Recently! Logging Out!');
      end;

       If Not(FindBitmap(HomePort, tx, ty)) Then
        begin
          WriteLn('We did not find the Spell!  Check the Deatail select, please restart.');
        end;
       end;

    Begin
     SetupSRL;
     ClearDebug;
     Activateclient;
     DeclareBMP;
     OpenMagicTab;
     CastHomePort;
     end.
    It can be used for any spell just you would need to find the bitmap.

    I also have a Run option thing. It works but it doesn't check to see if the Run is on or Off so It will turn it off if you have it on... I think.

    SCAR Code:
    program Run;

    {.include srl/SRL.scar}

    var tx, ty, OptionTab, Runon, Runoff: Integer;

    {=====================================================]
    [Procedure OpenOptTab is used to open the options tab ]
    [to set run to on. Created by me. Uses bitmaps        ]
    [=====================================================}


    procedure OpenOptionsTab;
     begin
      If(FindBitmap(OptionTab, tx, ty)) then
       begin
        Mouse(tx, ty, 6, 6, true);
        wait(100);
        WriteLn('Found Options Tab!');
        wait(1500 + random(500));
      end else
        WriteLn('Couldn''t find Options Tab!');
      end;

    {=====================================================]
    [Procedure Runon is used to check if the run option   ]
    [is set to run on. Created by me. Uses bitmaps        ]
    [=====================================================}


    procedure CheckRunOn;
     begin
      If(FindBitmap(Runoff, tx, ty)) then
       begin
        WriteLn('Setting run on!');
        Mouse(tx, ty, 6, 6, true);
        wait(1000 + random(500));
       end;
      end;

    {=====================================================]
    [Procedure Runoff is used to check if the run option  ]
    [is set to run off. Created by me. Uses bitmaps       ]
    [=====================================================}

    procedure CheckRunOff;
     begin
      If(FindBitmap(Runon, tx, ty)) then
       begin
       WriteLn('Run is being set off!');
       Mouse(tx, ty, 6, 6, true);
       wait(1000 + random(500));
      end;
     end;


    Begin
     SetupSRL;
     Activateclient;
     ClearDebug;
     DeclareBMP;
     OpenOptTab;
     CheckRunOn;
     Wait(2000);
     CheckRunOff;
    end.

    I didn't bother with antirandoms due to the point during my testing I didn't get any for the homeport. I also doubt you can get the Abyss with Homeport. Well If anyone uses don't bother with credit because it is pretty much right out of the book, well manual. I didn't steal from anyone, although other people may have this in there script. I did it all without looking at someone else's script.

  2. #2
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Or you could just use gametab since there has been a fix posted. And then all you need to do is add 1 to all the gametabs on the bottom because there's an extra tab.

    These are nice though

  3. #3
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh cool didn't know about the gametab fix. I never trusted the normal gametab origianlly in SRL. I don't know why but when I looked at it's code I didn't like it. So I used something like these.

    Anyways thanks for the compliment.

  4. #4
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    ClanChat is GameTab(14).
    No need to edit

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

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

    Default

    You should try using "FreeBitmap(Bitmap: Integer)" because that frees the bitmap from the memory of scar and makes less lag... Imagine if you'd everytime you use that would load that bitmap into memory... In half an hour...

    * The nuclear explosion video clip here *

  6. #6
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know about FreeBitmap but I didn't feel I need it cause this script has 0 lag for me. But when I do use bigger bitmaps or more bitmaps I do free them.

  7. #7
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by JuKKa View Post
    ClanChat is GameTab(14).
    No need to edit
    ClanChat is Gametab(8)....

  8. #8
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Tails111 View Post
    I know about FreeBitmap but I didn't feel I need it cause this script has 0 lag for me. But when I do use bigger bitmaps or more bitmaps I do free them.
    If you keep loading without freeing, I believe you'd get an error with the DIB handle after a while...

    Also, if you could use a DTM or DDTM, it would be much more efficient and have less lag...
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  9. #9
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Lol, I believe that clanchat is gonna be gametab 14 after the update... or not.

    But anyway, I made this.

    SCAR Code:
    program HoverMagic;
    {.Include SRL/SRL.scar}
     
    Function HoverSpell(Which: Integer; Cast:Boolean): Boolean;
     Var xm, ym, xz, yz:Integer;
     begin;
      If (not (GameTab(7)))Then
       GameTab(7);
      GetMousePos(xz, yz);
      Case Which of
       1: begin;         //Home tele  //Row 1
           xm:= 575;
           ym:= 235;
          end;
       2: begin;
           xm:= 600;
           ym:= 235;
          end;
       3: begin;
           xm:= 623;
           ym:= 240;
          end;
       4: begin;
            xm:= 650;
            ym:= 240;
           end;
       5: begin;
            xm:= 674;
            ym:= 235;
           end;
       6: begin;
            xm:= 697;
            ym:= 240;
           end;
       7: begin;
            xm:= 720;
            ym:= 238
           end;
       8: begin;      //Row 2
            xm:= 577;
            ym:= 262;
           end;
       9: begin;
            xm:= 600;
            ym:= 262;
           end;
       10: begin;
            xm:= 622;
            ym:= 261;
           end;
       11: begin;
            xm:= 649;
            ym:= 261;
           end;
       12: begin;
            xm:= 670;
            ym:= 263;
           end;
       13: begin;
            xm:= 696;
            ym:= 265;
           end;
       14: begin;
            xm:= 721;
            ym:= 265;
           end;
       15: begin; //Row 3
            xm:= 579;
            ym:= 286;
           end;
       16: begin;
            xm:= 600;
            ym:= 286;
           end;
       17: begin;
            xm:= 623;
            ym:= 286;
           end;
       18: begin;
            xm:= 647;
            ym:= 286;
           end;
       19: begin;
            xm:= 671;
            ym:= 287;
           end;
       20: begin;
            xm:= 697;
            ym:= 285;
           end;
       21: begin;
            xm:= 718;
            ym:= 286;
           end;
       22: begin; //Row 4
            xm:= 580;
            ym:= 311;
           end;
       23: begin;
            xm:= 600;
            ym:= 311;
           end;
       24: begin;
            xm:= 627;
            ym:= 313;
           end;
       25: begin;
            xm:= 646;
            ym:= 309;
           end;
       26: begin;
            xm:= 627;
            ym:= 312;
           end;
       27: begin;
            xm:= 694;
            ym:= 310;
           end;
       28: begin;
            xm:= 721;
            ym:= 309;
           end;
       29: begin;  //Row 5
            xm:= 577;
            ym:= 335;
           end;
       30: begin;
            xm:= 601;
            ym:= 334;
           end;
       31: begin;
            xm:= 624;
            ym:= 338;
           end;
       32: begin;
            xm:= 649;
            ym:= 336;
           end;
       33: begin;
            xm:= 673;
            ym:= 334;
           end;
       34: begin;
            xm:= 697;
            ym:= 335;
           end;
       35: begin;
            xm:= 720;
            ym:= 335;
           end;
       36: begin; //Row 6
            xm:= 572;
            ym:= 356;
           end;
       37: begin;
            xm:= 599;
            ym:= 359;
           end;
       38: begin;
            xm:= 624;
            ym:= 356;
           end;
       39: begin;
            xm:= 649;
            ym:= 359;
           end;
       40: begin;
            xm:= 671;
            ym:= 362;
           end;
       41: begin;
            xm:= 649;
            ym:= 362;
           end;
       42: begin;
            xm:= 720;
            ym:= 361;
           end;
       43: begin; //Row 7
            xm:= 704;
            ym:= 544;
           end;
       44: begin;
            xm:= 731;
            ym:= 552;
           end;
       45: begin;
            xm:= 755;
            ym:= 550;
           end;
       46: begin;
            xm:= 781;
            ym:= 550;
           end;
       47: begin;
            xm:= 800;
            ym:= 552;
           end;
       48: begin;
            xm:= 827;
            ym:= 552;
           end;
       49: begin;
            xm:= 851;
            ym:= 550;
           end;
       50: begin; //Row 8
            xm:= 705;
            ym:= 573;
           end;
       51: begin;
            xm:= 731;
            ym:= 571;
           end;
       52: begin;
            xm:= 752;
            ym:= 572;
           end;
       53: begin;
            xm:= 781;
            ym:= 572;
           end;
       54: begin;
            xm:= 801;
            ym:= 572;
           end;
       55: begin;
            xm:= 826;
            ym:= 572;
           end;
       56: begin;
            xm:= 851;
            ym:= 562;
           end;
       57: begin; //Row 9
            xm:= 704;
            ym:= 598;
           end;
       58: begin;
            xm:= 729;
            ym:= 597;
           end;
       59: begin;
            xm:= 753;
            ym:= 598;
           end;
       60: begin;
            xm:= 776;
            ym:= 599;
           end;
       61: begin;
            xm:= 802;
            ym:= 599;
           end;
       62: begin;
            xm:= 822;
            ym:= 599;
           end;
       63: begin;
            xm:= 850;
            ym:= 599;
           end;
      end;
      If (FindColorTolerance(x, y, 65280, 680, 440, 870, 456, 5) or
          FindColorTolerance(x, y, 65280, 680, 600, 870, 625, 5)) Then
       begin;
        Result:= True;
       end else
        begin;
        Result:= False;
       end;
      If (Cast) Then
       begin;
        MMouse(xm, ym, 5, 5);
        Wait(500+Random(1000));
        Mouse(xm, ym, 5, 5, True);
       end else
        begin;
        MMouse(xm, ym, 5, 5);
        Wait(3000+Random(3000));
        MMouse(xz, yz, 5, 5);
       end;
     end;
     
    begin
     WriteLn('spell 36 makes the box to top');
     WriteLn('Green spell color is: 65280');
     HoverSpell(36, False);
     If not (HoverSpell(36, False)) Then
      Writeln('TEST COMPLETE');
    end.

    Or this way:

    SCAR Code:
    program New;
    {.Include SRL/SRL.scar}
     
    Function HoverSpell(Row, Column: Integer; Cast: Boolean): Boolean;
     Var i, b, xm, ym: Integer;
     begin;
      If not (GetCurrentTab = 7)Then
       begin;
        MouseBox(730, 175, 740, 205, 1);
        Wait(500+Random(1000));
       end;
      xm:= 575;
      ym:= 235;
      For I:=1 to Row do
       begin;
        ym:= ym + 30 - 2;
       end;
      For B:=1 to Column do
       begin;
        xm:= xm + 25 - 2;
       end;
      If (FindColorTolerance(x, y, 65280, 680, 440, 870, 456, 5) or
          FindColorTolerance(x, y, 65280, 680, 600, 870, 625, 5)) Then
       begin;
        Result:= True;
       end else
        begin;
        Result:= False;
       end;
      If (Cast) Then
       begin;
        MMouse(xm, ym, 3, 3);
        Wait(500+Random(1000));
        Mouse(xm, ym, 3, 3, True);
       end else
       begin;
        MMouse(xm, ym, 3, 3);
        Wait(3000+Random(3000));
        MMouse(xm, ym, 3, 3);
       end;
     end;
     
    begin
     BenMouse:= True;
     HoverSpell(1, 3, False);
     If (HoverSpell(1, 3, False)) Then  //Wind bolt
      WriteLn('YAY!');
    end.


    Also, as a note, people won't use a script that doesn't free bitmaps, and you may be trashed for it.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  10. #10
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    but nice work lol i thought exactly the same i would make one to so lol :P
    ~Hermen

  11. #11
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't see how DTMs would work for this spell because ALL of the teleporting spells have the same circle.

  12. #12
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    You could use DTM's if you made part of the letter.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  13. #13
    Join Date
    Jun 2007
    Location
    I'm not sure...
    Posts
    581
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And IsUpText. Then you could really make it precise.
    ---------------------------------------------------------


    Pm me if you need any math functions made. Me = l0ving t3h mathz

    ---------------------------------------------------------

  14. #14
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Yep. But DTM's are so precise, it would be wasted time .
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  15. #15
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Heh, I could have done the H but too late know and I am already off to work on my script, so I won't update this, I personally love bitmaps.

  16. #16
    Join Date
    Jun 2007
    Location
    I'm not sure...
    Posts
    581
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    But they are laaaaaaaaaagy....
    ---------------------------------------------------------


    Pm me if you need any math functions made. Me = l0ving t3h mathz

    ---------------------------------------------------------

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Int to char casting?
    By Macro_FTW in forum OSR Help
    Replies: 2
    Last Post: 01-20-2009, 01:08 AM
  2. Mage casting - goes to inven
    By HarryJames in forum OSR Help
    Replies: 7
    Last Post: 01-16-2009, 09:52 PM
  3. got some problem with casting
    By ShowerThoughts in forum OSR Help
    Replies: 14
    Last Post: 10-27-2007, 04:46 PM
  4. HoverSpell; Antiban/Spell Casting/Spell checking function.
    By R0b0t1 in forum Research & Development Lounge
    Replies: 14
    Last Post: 08-17-2007, 05:36 PM

Posting Permissions

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