PDA

View Full Version : Home Port Casting



Tails111
08-10-2007, 03:59 PM
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.


program CastHomePort;

{.include srl/SRL.scar}

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

procedure DeclareBMP;
begin
MagicTab := BitmapFromString2(False, 'a6252478DA458CC11100' +
'2108035B021194A7A8F45FD2191F278F9D4C76021131339D9 B795' +
'0C50EB56E7014306EB601EBFD599D87252E7BFD1B4D7C304C 4979' +
'2137FCB7D5C074D005D6EBB31D03D13B5BE849F6886E124E6 D9B6' +
'82ACB9C12EAF901F9B');
HomePort := BitmapFromString2(False, 'a647A478DA7D8D510AC42' +
'00C05AFF46C4CE27EAA6DEE7FA4FA2A6C05D9253084715400 883E' +
'80560624B85A3A06358C2C64B6D79BB037657F94CC46FBB73 726C' +
'89DA7AE7CCEE5A46FFA9478FD87A937BE80934C01AF5EA3EC 1495' +
'6CD7CAE9791769322ECE3CDDFD6A763FF775FEF7BFFEBD014 21');
HomePortX := BitmapFromString2(False, 'a56F8D78DAEDCDB115C5' + //This is the thing that says you casted too soon.
'200C43D1954CC086DFE224FB8F1444F13344DE2D54E808636 6A51' +
'45BF25E511516E558E9772887B2C5DB474DA50FF5A7FA6334 2D3D' +
'FFAF42436BA94D771DED55D398BE97F6F63F4DFBDC174EED2 3E6C' +
'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.

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.

Tim0suprem0
08-10-2007, 04:17 PM
Or you could just use gametab :p 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 :)

Tails111
08-10-2007, 04:46 PM
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.

JuKKa
08-10-2007, 06:45 PM
ClanChat is GameTab(14).
No need to edit :)

n3ss3s
08-10-2007, 07:47 PM
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 *

Tails111
08-10-2007, 07:51 PM
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.

Tim0suprem0
08-11-2007, 03:12 AM
ClanChat is GameTab(14).
No need to edit :)

ClanChat is Gametab(8)....

Santa_Clause
08-16-2007, 11:56 AM
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...

R0b0t1
08-16-2007, 08:36 PM
Lol, I believe that clanchat is gonna be gametab 14 after the update... or not.

But anyway, I made this.


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:


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.

ShowerThoughts
08-16-2007, 09:07 PM
but nice work lol i thought exactly the same i would make one to so lol :P

Tails111
08-16-2007, 09:12 PM
I don't see how DTMs would work for this spell because ALL of the teleporting spells have the same circle.

R0b0t1
08-17-2007, 01:39 AM
You could use DTM's if you made part of the letter.

rotflmfwao
08-17-2007, 01:54 AM
And IsUpText. Then you could really make it precise.

R0b0t1
08-17-2007, 02:25 AM
Yep. But DTM's are so precise, it would be wasted time :(.

Tails111
08-17-2007, 02:43 PM
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.

rotflmfwao
08-18-2007, 12:30 AM
But they are laaaaaaaaaagy....