Code:
program alerter; //by Evil Kukka or HISTORY
//Drag the crosshir over the runescape client
const
UseForm='true';//"true" to use form, anythign else not to.
//set up line 34 and 35 if not using form
type
TUser = record
Name: string; // * User Name
Nick: string; // * Screen Name for random detection
end;
var
Players :TUser;
Sounddirectory : string;
minhp,x,y,ax,ay,NickNameBMP, ScapeRune : Integer;
var
frmDesign : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Username : TEdit;
Edit2 : TEdit;
Button1 : TButton;
Edit1 : TEdit;
procedure setup;
var a,b:string;
begin
if(not(UseForm='true'))then
begin
soundDirectory:='C:\Windows\';
Players.Name:='username';
minhp:=5;
end;
a:=UpperCase(Copy(Players.Name,1,1));
b:=Copy(Players.Name,2,2);
Players.Nick:=a+b;
end;
procedure buttonclick(sender: TObject);
begin
Players.Name:=Username.Text;
soundDirectory:=Edit2.Text;
minhp:=StrToInt(Edit1.Text);
frmDesign.ModalResult:= mrOk;
end;
procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.BorderStyle := bsDialog;
frmDesign.Caption := 'Alerter by Evil Kukka aka HISTORY';
frmDesign.ClientHeight := 65;
frmDesign.ClientWidth := 272;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 133;
Label1.Top := 9;
Label1.Width := 48;
Label1.Height := 13;
Label1.Caption := 'Username';
Label2 := TLabel.Create(frmDesign);
Label2.Parent := frmDesign;
Label2.Left := 133;
Label2.Top := 30;
Label2.Width := 78;
Label2.Height := 30;
Label2.Caption := 'Link to music file';
Label3 := TLabel.Create(frmDesign);
Label3.Parent := frmDesign;
Label3.Left := 56;
Label3.Top := 51;
Label3.Width := 58;
Label3.Height := 13;
Label3.Caption := 'Minimum Hp';
Username := TEdit.Create(frmDesign);
Username.Parent := frmDesign;
Username.Left := 6;
Username.Top := 3;
Username.Width := 121;
Username.Height := 21;
Username.TabOrder := 8;
Username.Text := 'Username';
Username.Text :=LoadSetting('alerter','username');
Edit2 := TEdit.Create(frmDesign);
Edit2.Parent := frmDesign;
Edit2.Left := 6;
Edit2.Top := 27;
Edit2.Width := 121;
Edit2.Height := 21;
Edit2.ParentShowHint := False;
Edit2.ShowHint := False;
Edit2.TabOrder := 9;
Edit2.Text := 'Sound Directory';
Edit2.Text:=LoadSetting('alerter','directory');
Button1 := TButton.Create(frmDesign);
Button1.OnClick:= @buttonclick;
Button1.Parent := frmDesign;
Button1.Left := 212;
Button1.Top := 8;
Button1.Width := 52;
Button1.Height := 38;
Button1.Caption := 'OK';
Button1.TabOrder := 10;
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 7;
Edit1.Top := 49;
Edit1.Width := 44;
Edit1.Height := 16;
Edit1.TabOrder := 11;
Edit1.Text := '5';
Edit1.Text := LoadSetting('alerter','minhp');
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
procedure theform;
begin
SafeInitForm;
SafeShowFormModal;
end;
function GetHpAmount: Integer;
var
T: TPoint;
TmpResult: string;
i: Integer;
begin
t.x := 650;
t.y := 210;
tmpResult := GetTextAtEx(T.x, T.y, 100, StatChars, False, True, 0, 5, -1, 2,
True, tr_Digits);
if (Trim(tmpResult) = '') then
for i := 1 to 5 do
begin
tmpResult := GetTextAtEx(T.x + i, T.y, 100, StatChars, False, True, 0, 5,
-1, 2, True, tr_Digits);
if (Trim(tmpResult) <> '') then
Exit;
end
else
Result := StrToInt(Trim(tmpResult));
end;
const gTalkOldComputer = False;
var
gtalksBox, YelSkipBoxs: array of TBox;
function FindTalk: Boolean;
var
ax, ay, yCount, zCount, Count2, x1, y1, x2, y2, Count1: Integer;
begin
begin
if FindColor(ax, ay, 65535, 0, 0, 515, 334) then
begin
SetArrayLength(gtalksBox, 0);
SetArrayLength(YelSkipBoxs, 0);
while FindColorSkipBoxArray(ax, ay, 65535, 0, 0, 515, 334, YelSkipBoxs) do
begin
y1 := ay;
if ( ( ay + 5 ) > 334 ) then y2 := 334 else y2 := ay + 5;
x1 := ax; x2 := x1;
zCount := 0;
repeat
if FindColor(ax, ay, 65535, x2, y1 + 2, x2 + 3, y2 + 3) then
zCount := 0
else
zCount := zCount + 1;
if ( zCount = 4 ) then Break;
x2 := x2 + 3;
until ( x2 + 3 > 515 );
if ( x2 + 3 <= 515 ) then x2 := x2 - 12;
if (x2 - x1 >= length(Players.Nick) * 4) then
begin
x1 := x1 - 8;
y1 := y1 - 8;
x2 := x2 + 8;
y2 := y2 + 8;
if ( x1 < 0 ) then x1 := 0;
if ( y1 < 0 ) then y1 := 0;
if ( x2 > 515 ) then x2 := 515;
if ( y2 > 334 ) then y2 := 334;
Count2 := Count2 + 1;
Count1 := Count1 + 1;
SetArrayLength(gtalksBox, Count2);
gtalksBox[Count2 - 1].x1 := x1;
gtalksBox[Count2 - 1].y1 := y1;
gtalksBox[Count2 - 1].x2 := x2;
gtalksBox[Count2 - 1].y2 := y2 + 6;
SetArrayLength(YelSkipBoxs, Count1);
YelSkipBoxs[Count1 - 1].x1 := x1;
YelSkipBoxs[Count1 - 1].y1 := y1;
YelSkipBoxs[Count1 - 1].x2 := x2;
YelSkipBoxs[Count1 - 1].y2 := y2;
end else
begin
y1 := y1 - 2;
y2 := y2 + 8;
x1 := x1 - 5;
x2 := x2 + 5;
if ( x1 < 0 ) then x1 := 0;
if ( y1 < 0 ) then y1 := 0;
if ( x2 > 515 ) then x2 := 515;
if ( y2 > 334 ) then y2 := 334;
Count1 := Count1 + 1;
SetArrayLength(YelSkipBoxs, Count1);
YelSkipBoxs[Count1 - 1].x1 := x1;
YelSkipBoxs[Count1 - 1].y1 := y1;
YelSkipBoxs[Count1 - 1].x2 := x2;
YelSkipBoxs[Count1 - 1].y2 := y2;
end;
end;
if ( GetArrayLength(gtalksBox) <> 0 ) then
begin
for yCount := 0 to GetArrayLength(gtalksBox) - 1 do
begin
if FindBitmapMaskTolerance(NickNameBMP, ax, ay, gtalksBox[yCount].x1, gtalksBox[yCount].y1, gtalksBox[yCount].x2, gtalksBox[yCount].y2, 0, 40) then
begin
WriteLn('Found your name');
PlaySound(SoundDirectory);
Result:=true;
end;
end;
end;
end;
end;
end;
function FindName:boolean;
var
tmpx, tmpy: Integer;
begin
if (FindColor(tmpx, tmpy, 65535, 10, 25, 511, 334)) then
begin
if (FindBitmapMaskTolerance(NickNameBMP, x, y, 3, 3, 515, 336, 0, 40)) then
Result:=true;
end;
end;
function LoggedIn: Boolean;
begin
Result := (GetColor(421, 480) = 16777215);
end;
procedure importantrandoms; begin writeln('A script made by Evil Kukka');writeln('Made for a request on sythe.org');writeln('may be reposted on other sites');writeln('Credits:SRL Anti-Randoms Sub include coders, ripped it totally=p');end;
begin
theform;
Setup;
SaveSetting('alerter','directory',soundDirectory);
SaveSetting('alerter','username',Players.Name);
SaveSetting('alerter','minhp',IntToStr(minhp));
NickNameBMP := CreateBitmapMaskFromText(Players.Nick,upchars);
if (ScapeRune = 0) then
ScapeRune := CreateBitmapMaskFromText('ScapeRune', SmallChars);
importantrandoms;
repeat
if(GetHpAmount<=minhp)then PlaySound(SoundDirectory);
if(FindName)then PlaySound(SoundDirectory);
if (GetColor(30, 418) = 0) and (GetColor(72, 429) = 0) then PlaySound(SoundDirectory);
//dead
if (FindColor(ax, ay, 11503238, 10, 350, 479, 433)) then PlaySound(SoundDirectory);
//mime
if (FindColorTolerance(ax, ay, 15395562, 129, 34, 129, 34, 4)) and
(FindColorTolerance(ax, ay, 15395562, 378, 39, 378, 39, 4)) then PlaySound(SoundDirectory);
//maze
if FindBitmapMaskTolerance(ScapeRune, x, y, 17, 355, 300, 434, 10, 50) then PlaySound(SoundDirectory);
//scaperune
if ((GetColor(83, 431) = 0) and (GetColor(88, 418) = 0)) or
((GetColor(83, 430) = 0) and (GetColor(88, 417) = 0)) or
((GetColor(151, 426) = 0) and (GetColor(470, 393) = 0) and
(GetColor(372, 370) = 128)) then PlaySound(SoundDirectory);
//pinball
if (FindColorTolerance(x, y, 11034756, 200, 90, 315, 200, 25)) or
(FindColorTolerance(x, y, 617041, 200, 90, 315, 200, 25)) then PlaySound(SoundDirectory);
//plant
FindTalk;
//talking randoms
if(not(LoggedIn))then PlaySound(SoundDirectory);
until(False)
end.