SRL Archive - Archive

almost - SRL Member Application Form


almost

2008-03-01 14:34:42

<!– BEGIN TEMPLATE: formanswers –>
almost - SRL Member Application Form
almost

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
no


Programming Knowledge
Learning c++

Other Communitys


How Long have You Played Runescape
5 years

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

I have been autoing since i started playing RS and i love RS cheating.
I don't auto on RS anymore so my guild miner, woodcutter, and fisher are probably a little outdated.
So i am just putting up some procedures and a form i made.
I hope you guys like this and accept me :)

ps it won't let me put up attachments so i will do it all with scar tags…


CHECK OUT MY OTHER POST
I PUT UP SOME RS SCRIPTS

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

program New;


const
BackGround = 65280;
FontColor = ClBlue;


var
frmDesign: TForm;

Pic: TImage;

Hu, Sat, Lum, Col, LR, LG, LB, LX, LY, LZ, Tol, CMode, NCMode: TLabel;

ColorL, Hue, Saturation, Luminance, Red, Green, Blue, Tolerance, XBox,
YBox, ZBox, Mag, x1, y1, x2, y2: TEdit;

ChangeColor, Go, Capture, HUp, HDown, SUp, SDown, SetCords, Magnify,
LUp, LDown, RUp, RDown, GUp, GDown, BUp, BDown, TUp, TDown, XUp, XDown,
YUp, YDown, ZUp, ZDown: TSpeedButton;

H, S, L, VX, VY, VZ: extended;

R, G, B, Height, Width, bmp, UndoBmp, CustomBmp, x, y: integer;

Up, Down, ColorPicker, AreaPicker, GoArrow, ScreenShot, Lens: integer; //Bitmaps

Canvas, BC: TCanvas;

UseColor, ChangeMode, NonChangeMode: TCheckBox;

TheMenu: TMainMenu;

Menu1, Menu2, Menu3, Menu4, Menu1Sub, Menu1Sub2, Menu1Sub3, Menu2Sub,
Menu3Sub3, Menu3Sub, Menu3Sub2, Menu3Sub3Sub, Menu3Sub3Sub2, Menu3Sub3Sub3,
Menu4Sub, Menu4Sub2, Menu4Sub3, Menu4Sub4, Menu3Sub2Sub, Menu3Sub2Sub2,
Menu3Sub2Sub3, Menu2Sub2, Menu2Sub2Sub, Menu2Sub2Sub2, Menu2Sub2Sub3,
Menu2Sub2Sub4, Menu2Sub2Sub5, Menu2Sub3: TMenuItem;

Pasted, GetScreen: boolean;

OpenedFile: string;




procedure LoadButtonPics;
begin
Up := BitmapFromString(8, 9, 'z78DA55904112C4200804BF144320' +
'7A9441FEFFA41DA3BBB5B97459D80EE028A3E7408D9A8E238EBC3' +
'D30C80A4FF31B3DD505772ACB960D1A9A60DD791EE119E8D1C8A7' +
'4E0A6F0773E01DC86B997E2298DFD8058BDB71F68A4DD097D51D1' +
'1FD6B5E61A5EAA2B799B3B9FC6742CE6FE9FFE6EB953173BE72FA' +
'176ADAFFEDDE2838F92BC1152DA507240DE7DC8BD42FBDC735FF6' +
'1D639EACC2F4C162E7DF2C7D67623CA8F8FE9C6B3CFD51E5F53C2' +
'8764E56FB73C39213B6E0AD374B3C068369AF601BFB56950');
Down := BitmapFromString(8, 9, 'z78DA558F491203210C03BF143603' +
'476CE1FF3F2962A964E6A2A26421B7D16772D160E24993352F57B' +
'B753A471B3542996C4C164FC3CD5C5510A815C94D27DF7FFDB80D' +
'B3C89EC0B6959FBFE440E6F788F250FA03B648CADA9821A195A30' +
'A4ED5CA4ABEFCCC6621A1925056FF73FA546B90B5DD06798CE4EB' +
'2ED0D9FA4A7634F2000456B0B3DEBCF28DABFBBA9BDCAA71B7559' +
'274E5D99E6FA6ACBB0E39CFEBCE46281B76F2F8B484BF9255B21D' +
'C2C6A99CEDF6614F257F739D610E9F5F6F1C6950');
ColorPicker := BitmapFromString(15, 14, 'z78DAA594E1AE83200C855F0941' +
'5AFAB3B4E5FD1F692D2CB93AB32DD779E20991FAE5A445C73692B' +
'5114E1FBDBDF306A1AA3557050B8D3477C3EB2F8E7B68F1A1D4EC' +
'37EE52F11ECDF3E560841673F1177397D0CD9C1CF20EB88E39179' +
'F30E47566FB67B7F1E79C439A42CF0E9F727EA75DC9DC4236AFB5' +
'6E69AA87AEE4F956FEEC2BE7A0D033EDD424AC9AED8DBF6736363' +
'6955893F67DE604E4C5BC47E6EC9C2C7D9074288A2DD5DC09E8C8' +
'FC4236D3B34736524215B0AA92E20B209FD0DC4DD77AE7883F5F6' +
'E277FA904930A86BB8A9FCF57E67FC86A5D6DB94A080AE78AB4B1' +
'3538EEFEEE92A477FA9D83ECC79C4907796FB751686BC97C5EC89' +
'6913D34FA3FC6CF1A1014EF52999DD78A9D2A3EDDE7125FA2CFB7' +
'1CC90F85E83215');
AreaPicker := BitmapFromString(17, 13, 'z78DA737576B574B170A50B6900' +
'06C86C6A89E0B285162E771DA010A39D99A321361A62F40C31DAE' +
'57D5A93003932410A');
GoArrow := BitmapFromString(11, 16, 'z78DAA5906B6AC6201045B7A47E' +
'46C79FA37367FF4BAAAF525331A494C021E03D270F75EA003DD1A' +
'A854C9E4EFBFD25D95FB2F20F85461E9644D5620667C7B4D349FB' +
'C4B5C0D00F856234B1BB75DE148C6A4E4CB560066F9D53C1A8411' +
'A9B9255194C402BFCF0D7FBD4FD42BA15AEBA2476DDDD78E88C42' +
'9885BE498218F9C4AD13D6424EFA4992225CDD3FD217CABEEC050' +
'6906CDFF81377175AB5EF0221524E564ADD6F1C6EDF5F1B67A17E' +
'A923435962F42B1FDD0B52AFF967FAB3B8590183D345DB1CB9142' +
'87437BC76B7C2B0A62B2FDCC1822CFA1F7E018E18FF95');
ScreenShot := BitmapFromString(15, 15, 'z78DA85535BDA5B2108DC12E005' +
'79E4A2FB5F524793FE2FFDDA1E128F21380C039E7DFE657EE29C5' +
'3D8D9E9E73EF6563D5259B6BAF8FB3DF14D9822AA8E3CDFDF3161' +
'75925743942403B3B0E377E662B4A241A4F0267CE39C2FDE389CA' +
'2FD0FC4CBF05AC00C5CAAF6EEB3CBC5E7AC87D01E069BCBE28D98' +
'B5E371EE3986C8489DD9DA7F906FDDAFD6DDD23ACB07C10FBDB8B' +
'30B3B7B766A55B877E11B23F51B279FD5ABB77E2C6EA2CB126FDD' +
'EBEAC38B84A8A67AE35C73364D6A479CE93E88FDD473D17D43D3B' +
'42A68434B67A9ADA95DFBD2C55801A9654387CADA3A5A3526D3EC' +
'4232BD2D524DDE445C0FB9BD1A375859273F8324779714C0B421B' +
'6715ADA4E8166BBB3D3DED694672D78A88C430C218B4F11D8661E' +
'EE3263B5B607341730464F857634C78A3AC5B77250EEC1DE46219' +
'0483E65CAD5800CDF9C41875B310FEE59D86B2EBAF801A588956E' +
'0F3077A2E04302C525645488F20A788181B875A055C780489E393' +
'C7D0DCCC9E4D64D7BE719C99D3436771E31C18A184CC018F32FB3' +
'B62CD4A8C0EC65E2A298A6D173A6424F5C122067658EEDE6632C6' +
'BEB00A121B7C702CF1DC28DBBE70FF2BD3DF36AC55B38B74CA662' +
'6451433399C55A9B272A796A8C18C36C5EA6C807D427920641137' +
'19C64480AFE80C5E74E86B2E7442F229730145364E9683C14BE87' +
'6782E71EDDD87A3F0BB323D23AB2FBEAE842F82427F7460122F5B' +
'2ED2F6774CC431659BEBC513C19A3CEA791575B5F6EF775F9407D' +
'CE516C57083E6456D787350825BDFFE97510AC99A7006DC5E0043' +
'26A60755C63B26884FE78D0E4B48D55FCE66860D81EDAA1B07139' +
'0293B82BCE7E6FEF7937F8BCBB06B06DB63DCC3C7CD8F085357DF' +
'A40B99F7D7A77C6EF6507ABD942289BC29B76366DC634BF3BF2E9' +
'E02FEFA53B65');
Lens := BitmapFromString(17, 18, 'z78DA737576B574B1701D50D200' +
'07A0AEC9CE3820253642745980A11B06C0B40BA29254BB20EAF19' +
'B8CCB5FC49B0FD145BCF9A4DA457F5BC88383C716F2EC82842D79' +
'690C923E89311F392543D8D4CA95E8E63BB92193D42D612066226' +
'2841A76E173C348B28B5635052DCDC74F0200F816B1D2');
UndoBmp:= BitmapFromString(799, 599, '');
CustomBmp:= BitmapFromString(799, 599, '');
end;




procedure FreeButtonPics;
begin
FreeBitmap(Up);
FreeBitmap(Down);
FreeBitmap(ColorPicker);
FreeBitmap(AreaPicker);
FreeBitmap(GoArrow);
FreeBitmap(ScreenShot);
FreeBitmap(Lens);
FreeBitmap(UndoBmp);
FreeBitmap(CustomBmp);
end;




function IntToFloat(Int: integer): extended;
begin
Result:= StrToFloat(IntToStr(Int) + '.0');
end;





function AbsVal(Int: integer): Integer;
begin
Result:= Int;
if (Int < 0) then
Result:= Int + (Int * -2);
end;




procedure PasteScreen;
begin
if Pasted then
begin
frmDesign.WindowState:= WsMaximized;
Menu3Sub.Checked:= false;
Pic.SetBounds(134, 0, 665, 553);
SafeCopyCanvas(GetBitmapCanvas(bmp), Pic.Canvas, 0, 0, 799, 599, 0, 0, 799, 599);
end;
end;




procedure MagnifyPic(Magnification: integer);
begin
if Pasted then
begin
frmDesign.WindowState:= WsMaximized;
Menu3Sub.Checked:= false;
Pic.SetBounds(134, 0, 665, 553);
SafeCopyCanvas(Pic.Canvas, Pic.Canvas, 0, 0, 799, 599, 0, 0,
799 + Magnification, 599 + Magnification);
end;
end;




procedure Exits(Sender: TObject);
begin
if NonChangeMode.Checked = false then
begin
if (Sender = x1) or
(Sender = y1) or
(Sender = x2) or
(Sender = y2) then
begin
x:= StrToInt(x1.Text);
y:= StrToInt(y1.Text);
Height:= (StrToInt(y2.Text) - StrToInt(y1.Text));
Width:= (StrToInt(x2.Text) - StrToInt(x1.Text));
if (Height > 300) or (Width > 300) then
begin
GetApplication.Messagebox('The height or width is too large and could cause your ' +
'computer to freeze', 'Error', 0);
x1.Text:= '0';
x2.Text:= '0';
y1.Text:= '0';
y2.Text:= '0';
x:= 0;
y:= 0;
Height:= 0;
Width:= 0;
end;
end;
Exit;
end;
if (Sender = Hue) or
(Sender = Saturation) or
(Sender = Luminance) then
begin
H:= StrToFloat(Hue.Text);
S:= StrToFloat(Saturation.Text);
L:= StrToFloat(Luminance.Text);
ColorL.Text:= IntToStr(HSLToColor(H, S, L));
ColorToRGB(StrToInt(ColorL.Text), R, G, B);
Red.Text:= IntToStr(R);
Green.Text:= IntToStr(G);
Blue.Text:= IntToStr(B);
ColorToXYZ(StrToInt(ColorL.Text), VX, VY, VZ);
XBox.Text:= IntToStr(Round(VX));
YBox.Text:= IntToStr(Round(VY));
ZBox.Text:= IntToStr(Round(VZ));
end;
if (Sender = Red) or
(Sender = Green) or
(Sender = Blue) then
begin
R:= StrToInt(Red.Text);
G:= StrToInt(Green.Text);
B:= StrToInt(Blue.Text);
ColorL.Text:= IntToStr(RGBToColor(R, G, B));
ColorToHSL(StrToInt(ColorL.Text), H, S, L);
Hue.Text:= IntToStr(Round(H));
Saturation.Text:= IntToStr(Round(S));
Luminance.Text:= IntToStr(Round(L));
ColorToXYZ(StrToInt(ColorL.Text), VX, VY, VZ);
XBox.Text:= IntToStr(Round(VX));
YBox.Text:= IntToStr(Round(VY));
ZBox.Text:= IntToStr(Round(VZ));
end;
if (Sender = XBox) or
(Sender = YBox) or
(Sender = ZBox) then
begin
VX:= StrToFloat(XBox.Text);
VY:= StrToFloat(YBox.Text);
VZ:= StrToFloat(ZBox.Text);
ColorL.Text:= IntToStr(XYZToColor(VX, VY, VZ));
ColorToRGB(StrToInt(ColorL.Text), R, G, B);
Red.Text:= IntToStr(R);
Green.Text:= IntToStr(G);
Blue.Text:= IntToStr(B);
ColorToHSL(StrToInt(ColorL.Text), H, S, L);
Hue.Text:= IntToStr(Round(H));
Saturation.Text:= IntToStr(Round(S));
Luminance.Text:= IntToStr(Round(L));
end;
if (Sender = ColorL) then
begin
ColorToHSL(StrToInt(ColorL.Text), H, S, L);
Hue.Text:= IntToStr(Round(H));
Saturation.Text:= IntToStr(Round(S));
Luminance.Text:= IntToStr(Round(L));
ColorToRGB(StrToInt(ColorL.Text), R, G, B);
Red.Text:= IntToStr(R);
Green.Text:= IntToStr(G);
Blue.Text:= IntToStr(B);
ColorToXYZ(StrToInt(ColorL.Text), VX, VY, VZ);
XBox.Text:= IntToStr(Round(VX));
YBox.Text:= IntToStr(Round(VY));
ZBox.Text:= IntToStr(Round(VZ));
end;
if (Sender = x1) or
(Sender = y1) or
(Sender = x2) or
(Sender = y2) then
begin
x:= StrToInt(x1.Text);
y:= StrToInt(y1.Text);
Height:= (StrToInt(y2.Text) - StrToInt(y1.Text));
Width:= (StrToInt(x2.Text) - StrToInt(x1.Text));
if (Height > 300) or (Width > 300) then
begin
GetApplication.Messagebox('The height or width is too large and could cause your ' +
'computer to freeze', 'Error', 0);
x1.Text:= '0';
x2.Text:= '0';
y1.Text:= '0';
y2.Text:= '0';
x:= 0;
y:= 0;
Height:= 0;
Width:= 0;
end;
end;
frmDesign.Canvas.Brush.Color:= StrToInt(ColorL.Text);
frmDesign.Canvas.Rectangle(75, 5, 120, 50);
end;





procedure Change;
var
Color, cx, cy, c, i: integer;
begin
SafeCopyCanvas(Pic.Canvas, GetBitmapCanvas(UndoBmp), 0, 0, 665, 553, 0, 0, 665, 553);
cx:= x;
cy:= y;
repeat
Color:= Pic.Canvas.pixels[cx, cy];
if UseColor.Checked = true then
if (SimilarColors(Color, StrToInt(ColorL.Text),
StrToInt(Tolerance.Text))) then
begin
ColorToHSL(Color, H, S, L);
//Too high
if (h + IntToFloat(StrToInt(Hue.Text)) > 100) then
h:= 100 - StrToInt(Hue.Text);
if (s + IntToFloat(StrToInt(Saturation.Text)) > 100) then
s:= 100 - StrToInt(Saturation.Text);
if (l + IntToFloat(StrToInt(Luminance.Text)) > 100) then
l:= 100 - StrToInt(Luminance.Text);
//Too low
if (h + IntToFloat(StrToInt(Hue.Text)) < 0) then
h:= Abs(StrToInt(Hue.Text));
if (s + IntToFloat(StrToInt(Saturation.Text)) < 0) then
s:= Abs(StrToInt(Saturation.Text));
if (l + IntToFloat(StrToInt(Luminance.Text)) < 0) then
l:= Abs(StrToInt(Luminance.Text));
//Converts to HSL
Color:= HSLToColor(h + IntToFloat(StrToInt(Hue.Text)),
s + IntToFloat(StrToInt(Saturation.Text)), l + IntToFloat(StrToInt(Luminance.Text)));
ColorToRGB(Color, R, G, B);
//Too high
if (r + StrToInt(Red.Text) > 255) then
r:= 255 - StrToInt(Red.Text);
if (g + StrToInt(Green.Text) > 255) then
g:= 255 - StrToInt(Green.Text);
if (b + StrToInt(Blue.Text) > 255) then
b:= 255 - StrToInt(Blue.Text);
//Too low
if (r + StrToInt(Red.Text) < 0) then
r:= AbsVal(StrToInt(Red.Text));
if (g + StrToInt(Green.Text) < 0) then
g:= AbsVal(StrToInt(Green.Text));
if (b + StrToInt(Blue.Text) < 0) then
b:= AbsVal(StrToInt(Blue.Text));
//Converts to RGB
Color:= RGBToColor(r + StrToInt(Red.Text),
g + StrToInt(Green.Text), b + StrToInt(Blue.Text));
Pic.Canvas.Pixels[cx, cy]:= Color;
cx:= cx + 1;
if (cx >= (x + Width)) then
begin
cy:= cy + 1;
cx:= x;
end;
end else
begin
cx:= cx + 1;
if (cx >= (x + Width)) then
begin
cy:= cy + 1;
cx:= x;
end;
end;
//If checkbox is not checked
if UseColor.Checked = false then
begin
ColorToHSL(Color, H, S, L);
//Too high
if (h + IntToFloat(StrToInt(Hue.Text)) > 100) then
h:= 100 - StrToInt(Hue.Text);
if (s + IntToFloat(StrToInt(Saturation.Text)) > 100) then
s:= 100 - StrToInt(Saturation.Text);
if (l + IntToFloat(StrToInt(Luminance.Text)) > 100) then
l:= 100 - StrToInt(Luminance.Text);
//Too low
if (h + IntToFloat(StrToInt(Hue.Text)) < 0) then
h:= Abs(StrToInt(Hue.Text));
if (s + IntToFloat(StrToInt(Saturation.Text)) < 0) then
s:= Abs(StrToInt(Saturation.Text));
if (l + IntToFloat(StrToInt(Luminance.Text)) < 0) then
l:= Abs(StrToInt(Luminance.Text));
//Converts to HSL
Color:= HSLToColor(h + IntToFloat(StrToInt(Hue.Text)),
s + IntToFloat(StrToInt(Saturation.Text)), l + IntToFloat(StrToInt(Luminance.Text)));
ColorToRGB(Color, R, G, B);
//Too high
if (r + StrToInt(Red.Text) > 255) then
r:= 255 - StrToInt(Red.Text);
if (g + StrToInt(Green.Text) > 255) then
g:= 255 - StrToInt(Green.Text);
if (b + StrToInt(Blue.Text) > 255) then
b:= 255 - StrToInt(Blue.Text);
//Too low
if (r + StrToInt(Red.Text) < 0) then
r:= AbsVal(StrToInt(Red.Text));
if (g + StrToInt(Green.Text) < 0) then
g:= AbsVal(StrToInt(Green.Text));
if (b + StrToInt(Blue.Text) < 0) then
b:= AbsVal(StrToInt(Blue.Text));
//Converts to RGB
Color:= RGBToColor(r + StrToInt(Red.Text),
g + StrToInt(Green.Text), b + StrToInt(Blue.Text));
Pic.Canvas.Pixels[cx, cy]:= Color;
cx:= cx + 1;
if (cx >= (x + Width)) then
begin
cy:= cy + 1;
cx:= x;
end;
end;
until(cy >= (y + Height));
end;




procedure DrawLines(Color, Size: integer);
begin
frmDesign.Canvas.Pen.Color:= Color;
frmDesign.Canvas.Pen.Width:= Size;
//First line
frmDesign.Canvas.MoveTo(0, 55);
frmDesign.Canvas.LineTo(134, 55);
//Color/ Tolerance line
frmDesign.Canvas.MoveTo(0, 143);
frmDesign.Canvas.LineTo(134, 143);
//HSL Line
frmDesign.Canvas.MoveTo(0, 265);
frmDesign.Canvas.LineTo(134, 265);
//RGB Line
frmDesign.Canvas.MoveTo(0, 390);
frmDesign.Canvas.LineTo(134, 390);
//XYZ Line
frmDesign.Canvas.MoveTo(0, 505);
frmDesign.Canvas.LineTo(134, 505);
//Up and down line
frmDesign.Canvas.MoveTo(134, 0);
frmDesign.Canvas.LineTo(134, 700);
end;





procedure ButtonClick(Sender: TObject);
var
Color, c, d: integer;
begin
case Sender of
Magnify:
MagnifyPic(StrToInt(Mag.Text));
SetCords:
begin
GetScreen:= true;
NonChangeMode.Checked:= false;
ChangeMode.Checked:= true;
end;
Capture:
begin
frmDesign.WindowState:= WsMinimized;
bmp:= BitMapFromString(799, 599, '');
Wait(500);
Canvas:= GetClientCanvas;
bc:= GetBitmapCanvas(bmp);
SafeCopyCanvas(Canvas, bc, 0, 0, 799, 599, 0, 0, 799, 599);
frmDesign.WindowState:= WsMaximized;
Menu3Sub.Checked:= false;
Pasted:= true;
PasteScreen;
end;
ChangeColor:
begin
PickColor(Color, c, d);
ColorL.Text:= IntToStr(Color);
frmDesign.Canvas.Brush.Color:= StrToInt(ColorL.Text);
frmDesign.Canvas.Rectangle(75, 5, 120, 50);
if ChangeMode.Checked then
Exit;
ColorToHSL(Color, H, S, L);
ColorToRGB(Color, R, G, B);
ColorToXYZ(Color, VX, VY, VZ);
Hue.Text:= IntToStr(Round(H));
Saturation.Text:= IntToStr(Round(S));
Luminance.Text:= IntToStr(Round(L));
Red.Text:= IntToStr(R);
Green.Text:= IntToStr(G);
Blue.Text:= IntToStr(B);
XBox.Text:= IntToStr(Round(VX));
YBox.Text:= IntToStr(Round(VY));
ZBox.Text:= IntToStr(Round(VZ));
end;
Go:
Change;
end;
end;




procedure ChangeNumber(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
Color, c: integer;
First: boolean;
begin
First:= true;
repeat
if (First = false) then
begin
if (Sender = RUp) or (Sender = RDown) or
(Sender = Gup) or (Sender = GDown) or
(Sender = BUp) or (Sender = BDown) then
begin
Wait(25);
end else
Wait(100);
end;
//If HSL is above 100 or RGB is above 255 or either is below 0
Case Sender of
HUp:
if (StrToInt(Hue.Text) >= 100) then
begin PlaySound('a'); Exit; end;
HDown:
if (StrToInt(Hue.Text) <= 0) then
begin PlaySound('a'); Exit; end;
SUp:
if (StrToInt(Saturation.Text) >= 100) then
begin PlaySound('a'); Exit; end;
SDown:
if (StrToInt(Saturation.Text) <= 0) then
begin PlaySound('a'); Exit; end;
LUp:
if (StrToInt(Luminance.Text) >= 100) then
begin PlaySound('a'); Exit; end;
LDown:
if (StrToInt(Luminance.Text) <= 0) then
begin PlaySound('a'); Exit; end;
RUp:
if (StrToInt(Red.Text) >= 255) then
begin PlaySound('a'); Exit; end;
RDown:
if (StrToInt(Red.Text) <= 0) then
begin PlaySound('a'); Exit; end;
GUp:
if (StrToInt(Green.Text) >= 255) then
begin PlaySound('a'); Exit; end;
GDown:
if (StrToInt(Green.Text) <= 0) then
begin PlaySound('a'); Exit; end;
BUp:
if (StrToInt(Blue.Text) >= 255) then
begin PlaySound('a'); Exit; end;
BDown:
if (StrToInt(Blue.Text) <= 0) then
begin PlaySound('a'); Exit; end;
{XUp:
if (StrToInt(XBox.Text) >= 100) then
begin PlaySound('a'); Exit; end;}
XDown:
if (StrToInt(XBox.Text) <= 0) then
begin PlaySound('a'); Exit; end;
{YUp:
if (StrToInt(YBox.Text) >= 100) then
begin PlaySound('a'); Exit; end;}
YDown:
if (StrToInt(YBox.Text) <= 0) then
begin PlaySound('a'); Exit; end;
{ZUp:
if (StrToInt(ZBox.Text) >= 100) then
begin PlaySound('a'); Exit; end; }
ZDown:
if (StrToInt(ZBox.Text) <= 0) then
begin PlaySound('a'); Exit; end;
TDown:
if (StrToInt(Tolerance.Text) <= 0) then
begin PlaySound('a'); Exit; end;
end;
//Changing the number in the edit box
case Sender of
HUp:
Hue.Text:= FloatToStr(Round(StrToFloat(Hue.Text) + 1));
HDown:
Hue.Text:= FloatToStr(Round(StrToFloat(Hue.Text) - 1));
SUp:
Saturation.Text:= FloatToStr(Round(StrToFloat(Saturation.Text) + 1));
SDown:
Saturation.Text:= FloatToStr(Round(StrToFloat(Saturation.Text) - 1));
LUp:
Luminance.Text:= FloatToStr(Round(StrToFloat(Luminance.Text) + 1));
LDown:
Luminance.Text:= FloatToStr(Round(StrToFloat(Luminance.Text) - 1));
RUp:
Red.Text:= IntToStr(StrToInt(Red.Text) + 1);
RDown:
Red.Text:= IntToStr(StrToInt(Red.Text) - 1);
GUp:
Green.Text:= IntToStr(StrToInt(Green.Text) + 1);
GDown:
Green.Text:= IntToStr(StrToInt(Green.Text) - 1);
BUp:
Blue.Text:= IntToStr(StrToInt(Blue.Text) + 1);
BDown:
Blue.Text:= IntToStr(StrToInt(Blue.Text) - 1);
XUp:
XBox.Text:= FloatToStr(Round(StrToFloat(XBox.Text) + 1));
XDown:
XBox.Text:= FloatToStr(Round(StrToFloat(XBox.Text) - 1));
YUp:
YBox.Text:= FloatToStr(Round(StrToFloat(YBox.Text) + 1));
YDown:
YBox.Text:= FloatToStr(Round(StrToFloat(YBox.Text) - 1));
ZUp:
ZBox.Text:= FloatToStr(Round(StrToFloat(ZBox.Text) + 1));
ZDown:
ZBox.Text:= FloatToStr(Round(StrToFloat(ZBox.Text) - 1));
TUp:
Tolerance.Text:= IntToStr(StrToInt(Tolerance.Text) + 1);
TDown:
Tolerance.Text:= IntToStr(StrToInt(Tolerance.Text) - 1);
end;
if ChangeMode.Checked = true then
Exit;
if (Sender = HUp) or (Sender = HDown) or
(Sender = Sup) or (Sender = SDown) or
(Sender = LUp) or (Sender = LDown) then
begin
ColorToHSL(Color, H, S, L);
ColorL.Text:= IntToStr(HSLToColor(H + IntToFloat(StrToInt(Hue.Text)),
S + IntToFloat(StrToInt(Saturation.Text)), L + IntToFloat(StrToInt(Luminance.Text))));
ColorToRGB(StrToInt(ColorL.Text), R, G, B);
Red.Text:= IntToStr(R);
Green.Text:= IntToStr(G);
Blue.Text:= IntToStr(B);
ColorToXYZ(StrToInt(ColorL.Text), VX, VY, VZ);
XBox.Text:= IntToStr(Round(VX));
YBox.Text:= IntToStr(Round(VY));
ZBox.Text:= IntToStr(Round(VZ));
end;
if (Sender = RUp) or (Sender = RDown) or
(Sender = Gup) or (Sender = GDown) or
(Sender = BUp) or (Sender = BDown) then
begin
ColorToRGB(Color, R, G, B);
ColorL.Text:= IntToStr(RGBToColor(r + StrToInt(Red.Text),
g + StrToInt(Green.Text), b + StrToInt(Blue.Text)));
ColorToHSL(StrToInt(ColorL.Text), H, S, L);
Hue.Text:= IntToStr(Round(H));
Saturation.Text:= IntToStr(Round(S));
Luminance.Text:= IntToStr(Round(L));
ColorToXYZ(StrToInt(ColorL.Text), VX, VY, VZ);
XBox.Text:= IntToStr(Round(VX));
YBox.Text:= IntToStr(Round(VY));
ZBox.Text:= IntToStr(Round(VZ));
end;
if (Sender = XUp) or (Sender = XDown) or
(Sender = Yup) or (Sender = YDown) or
(Sender = ZUp) or (Sender = ZDown) then
begin
ColorToXYZ(Color, VX, VY, VZ);
ColorL.Text:= IntToStr(XYZToColor(VX + StrToInt(XBox.Text),
VY + StrToInt(YBox.Text), VZ + StrToInt(ZBox.Text)));
ColorToHSL(StrToInt(ColorL.Text), H, S, L);
Hue.Text:= IntToStr(Round(H));
Saturation.Text:= IntToStr(Round(S));
Luminance.Text:= IntToStr(Round(L));
ColorToRGB(StrToInt(ColorL.Text), R, G, B);
Red.Text:= IntToStr(R);
Green.Text:= IntToStr(G);
Blue.Text:= IntToStr(B);
end;
frmDesign.Canvas.Brush.Color:= StrToInt(ColorL.Text);
frmDesign.Canvas.Rectangle(75, 5, 120, 50);
if First then
begin
repeat
c:= c + 1;
until((IsMouseButtonDown(true) = false) or (c > 4000));
if (IsMouseButtonDown(true) = false) then
Exit;
First:= false;
end;
until(IsMouseButtonDown(true) = false);
end;




procedure Start(Sender: TObject);
begin
frmDesign.Canvas.Pen.Width:= 2;
frmDesign.Canvas.Rectangle(75, 5, 120, 50);
DrawLines(255, 3);
end;




procedure CheckBox(Sender: TObject);
begin
Case Sender of
ChangeMode:
begin
NonChangeMode.Checked:= false;
ChangeMode.Checked:= false;
Hue.Text:= '0';
Saturation.Text:= '0';
Luminance.Text:= '0';
Red.Text:= '0';
Green.Text:= '0';
Blue.Text:= '0';
end;
NonChangeMode:
ChangeMode.Checked:= false;
end;
end;




function SaveDialog: string;
var
TheDialog: TSaveDialog;
begin
result:= 'nil';
try
TheDialog := TSaveDialog.Create(nil);
TheDialog.Filter:= 'All Files|*.*';
TheDialog.Title:= 'Color Editor - Save as...';
if TheDialog.Execute then
begin
result:= ExtractFilePath(TheDialog.FileName)+ExtractFileName(TheDialog.FileName);
OpenedFile:= result;
frmDesign.Caption:= 'Color Changer- ' + ExtractFileName(TheDialog.FileName);
end;
except
Writeln('Could not open dialog');
end;
TheDialog.Free;
end;




function OpenDialog: string;
var
TheDialog: TOpenDialog;
begin
result:= 'nil';
try
TheDialog := TOpenDialog.Create(nil);
TheDialog.Filter:= 'All Files|*.*';
TheDialog.Title:= 'Color Editor - Open...';
if TheDialog.Execute then
begin
result:= ExtractFilePath(TheDialog.FileName)+ExtractFileName(TheDialog.FileName);
OpenedFile:= result;
frmDesign.Caption:= 'Color Changer- ' + ExtractFileName(TheDialog.FileName);
end;
except
Writeln('Could not open dialog');
end;
TheDialog.Free;
end;




procedure EditArea;
begin
SafeCopyCanvas(Pic.Canvas, GetBitmapCanvas(CustomBmp), 0, 0, 665, 553, 0, 0, 665, 553);
Wait(1000);
repeat
Pic.Canvas.Rectangle(x, y, x + Width, y + Height);
Wait(100);
SafeCopyCanvas(Pic.Canvas, Pic.Canvas, 0, 0, 665, 553, 0, 0, 665, 553);
until(IsKeyDown('a'));
MoveMouse(50, 50);
SafeCopyCanvas(GetBitmapCanvas(CustomBmp), Pic.Canvas, 0, 0, 665, 553, 0, 0, 665, 553);
end;




procedure MenuClick(Sender: TObject);
var
Picture: integer;
PicCanvas: TCanvas;
TheDialog: TColorDialog;
begin
case Sender of
//Menu2Sub3:
//SafeCopyCanvas(GetBitmapCanvas(UndoBmp), Pic.Canvas, 0, 0, 665, 553, 0, 0, 665, 553);
Menu2Sub2Sub:
begin
x1.Text:= IntToStr(StrToInt(x1.Text) - Width);
x2.Text:= IntToStr(StrToInt(x2.Text) - Width);
end;
Menu2Sub2Sub2:
begin
x1.Text:= IntToStr(StrToInt(x1.Text) + Width);
x2.Text:= IntToStr(StrToInt(x2.Text) + Width);
end;
Menu2Sub2Sub3:
begin
y1.Text:= IntToStr(StrToInt(y1.Text) + Height);
y2.Text:= IntToStr(StrToInt(y2.Text) + Height);
end;
Menu2Sub2Sub4:
begin
y1.Text:= IntToStr(StrToInt(y1.Text) - Height);
y2.Text:= IntToStr(StrToInt(y2.Text) - Height);
end;
Menu2Sub2Sub5:
EditArea;
Menu4Sub:
begin
GetApplication.Messagebox('First hit the "Capture Screen" button. You need to make a box'+
' around the area you want to start changing. Hold down your mouse on the'+
' top left corner of the box and drag it to the bottom right corner and let'+
' go.', 'Selecting an area of the screen', 0);
frmDesign.Show;
end;
Menu4Sub2:
begin
GetApplication.Messagebox('Single mode is used for editing the screen. When you put ' +
'in a number in a box the other boxes won''t change. When "Go!" is ' +
'pressed, the numbers in the boxes will add to the HSL and RGB of the colors ' +
'inside the selected area. MultiMode is for experimenting with the color ' +
'in the color box. When one box changes the others change to correspond ' +
'with the change.', 'Single mode and Multi mode', 0);
frmDesign.Show;
end;
Menu4Sub3:
begin
GetApplication.Messagebox('Hue is the overall color. Change the Saturation to 100, ' +
'the Luminance to 50, and the Hue to 0. Hold down the up arrow on the ' +
'Hue to see what hue is. Saturation is pretty much how grey the color ' +
'is. It is also how "true" the color is. So yellow with Saturation 100 ' +
'is pure yellow. As it goes down it looks more mucky and less like ' +
'yellow. Luminance is basicly how bright the color is. 100 is pure ' +
'white and 0 is pure black, no matter what.' , 'HSL', 0);
frmDesign.Show;
end;
Menu4Sub4:
begin
GetApplication.Messagebox('RGB stands for Red, Green, and Blue. There''s not much more ' +
'to explain. I like to think of it as paint. You get the color from ' +
'adding a certain amount of drops of Red, Green, and Blue. So RGB(128, ' +
'0, 255) would give us purple. 128 drops of Red paint mixed with 255 ' +
'drops of blue paint. This isn''t always 100% accurate but it usually is.'
, 'RGB', 0);
frmDesign.Show;
end;
Menu3Sub3Sub3:
PasteScreen;
Menu3Sub3Sub:
MagnifyPic(30);
Menu3Sub3Sub2:
MagnifyPic(-30);
Menu1Sub3:
begin
Picture:= BitMapFromString(665, 552, '');
PicCanvas:= GetClientCanvas;
SafeCopyCanvas(PicCanvas, GetBitmapCanvas(Picture), 134, 47, 799, 599, 0, 47, 665, 599);
if OpenedFile <> '' then
begin
SaveBitmap(Picture, OpenedFile + '.bmp');
end else
begin
SaveBitmap(Picture, SaveDialog + '.bmp');
end;
PasteScreen;
end;
Menu3Sub2Sub:
begin
TheDialog := TColorDialog.Create(nil);
TheDialog.Color:= StrToInt(ColorL.Text);
if TheDialog.Execute then
frmDesign.Color:= TheDialog.Color;
TheDialog.Free;
end;
Menu3Sub2Sub2:
begin
TheDialog := TColorDialog.Create(nil);
TheDialog.Color:= StrToInt(ColorL.Text);
if TheDialog.Execute then
begin
Hu.Font.Color:= TheDialog.Color;
Sat.Font.Color:= TheDialog.Color;
Lum.Font.Color:= TheDialog.Color;
LR.Font.Color:= TheDialog.Color;
LG.Font.Color:= TheDialog.Color;
LB.Font.Color:= TheDialog.Color;
LX.Font.Color:= TheDialog.Color;
LY.Font.Color:= TheDialog.Color;
LZ.Font.Color:= TheDialog.Color;
Tol.Font.Color:= TheDialog.Color;
Col.Font.Color:= TheDialog.Color;
CMode.Font.Color:= TheDialog.Color;
NCMode.Font.Color:= TheDialog.Color;
end;
TheDialog.Free;
end;
Menu3Sub2Sub3:
begin
TheDialog := TColorDialog.Create(nil);
TheDialog.Color:= StrToInt(ColorL.Text);
if TheDialog.Execute then
DrawLines(TheDialog.Color, StrToInt(InputBox('Guideline Size', 'Set the size of' +
' the lines.', IntToStr(frmDesign.Canvas.Pen.Width))));
TheDialog.Free;
end;
Menu1Sub:
begin
Pic.SetBounds(134, 0, 665, 553);
Pasted:= true;
Picture:= LoadBitmap(OpenDialog);
PicCanvas:= GetBitmapCanvas(Picture);
SafeCopyCanvas(PicCanvas, Pic.Canvas, 0, 0, 799, 599, 0, 0, 799, 599);
end;
Menu1Sub2:
begin
Picture:= BitMapFromString(665, 552, '');
PicCanvas:= GetClientCanvas;
SafeCopyCanvas(PicCanvas, GetBitmapCanvas(Picture), 134, 47, 799, 599, 0, 47, 665, 599);
SaveBitmap(Picture, SaveDialog + '.bmp');
PasteScreen;
end;
Menu2Sub:
PasteScreen;
Menu3Sub:
begin
if Menu3Sub.Checked = true then
begin
Menu3Sub.Checked:= false;
frmDesign.WindowState:= WsMaximized;
PasteScreen;
end else
begin
Menu3Sub.Checked:= true;
frmDesign.WindowState:= WsNormal;
end;
end;
end;
x:= StrToInt(x1.Text);
y:= StrToInt(y1.Text);
end;




procedure ScreenCords1(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; a, b: Integer);
begin
if not GetScreen then
Exit;
x:= a;
y:= b;
end;




procedure ScreenCords2(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; a, b: Integer);
begin
if not GetScreen then
Exit;
Width:= a - x;
Height:= b - y;
x1.Text:= IntToStr(x);
y1.Text:= IntToStr(y);
x2.Text:= IntToStr(a);
y2.Text:= IntToStr(b);
GetScreen:= false;
if (Height > 300) or (Width > 300) then
begin
GetApplication.Messagebox('The height or width is too large and could cause your ' +
'computer to freeze', 'Error', 0);
x1.Text:= '0';
x2.Text:= '0';
y1.Text:= '0';
y2.Text:= '0';
x:= 0;
y:= 0;
Height:= 0;
Width:= 0;
end;
end;




procedure Undo(Sender: TObject);
begin
SafeCopyCanvas(GetBitmapCanvas(UndoBmp), Pic.Canvas, 0, 0, 665, 553, 0, 0, 665, 553);
end;





procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Caption := 'Color Changer';
frmDesign.Color := BackGround;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
frmDesign.Height:= 600;
frmDesign.Width:= 144;
frmDesign.OnPaint:= @Start;

Pic := TImage.Create(frmDesign);
Pic.SetBounds(0, 0, 0, 0);
Pic.Parent := frmDesign;
Pic.OnMouseDown:= @ScreenCords1;
Pic.OnMouseUp:= @ScreenCords2;

Col := TLabel.Create(frmDesign);
with Col do
begin
Col.Parent := frmDesign;
Col.Caption := 'Color';
Col.Left := 10;
Col.Top := 57;
Col.Width := 120;
Col.Height := 13;
Font.Color:= FontColor;
end;


ColorL := TEdit.Create(frmDesign);
ColorL.Parent := frmDesign;
ColorL.Font.Size := 10;
ColorL.Left := 10;
ColorL.Top := 70;
ColorL.Width := 78;
ColorL.Height := 30;
ColorL.OnExit:= @Exits;
ColorL.Text := '0';

ChangeColor := TSpeedButton.Create(frmDesign);
ChangeColor.Parent := frmDesign;
ChangeColor.Top := 26;
ChangeColor.Left := 2;
ChangeColor.Height := 25;
ChangeColor.Width := 35;
ChangeColor.Glyph.Width := 14;
ChangeColor.Glyph.Height := 15;
ChangeColor.Layout := blGlyphLeft;
ChangeColor.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(ColorPicker), ChangeColor.Glyph.Canvas, 0, 0, 14, 15, 0, 0, 14, 15);
ChangeColor.ShowHint := true;
ChangeColor.Hint := 'Picks a color';
ChangeColor.OnClick := @ButtonClick;

Go := TSpeedButton.Create(frmDesign);
Go.Parent := frmDesign;
Go.Top := 2;
Go.Left := 2;
Go.Height := 25;
Go.Width := 35;
Go.Glyph.Width := 11;
Go.Glyph.Height := 16;
Go.Layout := blGlyphLeft;
Go.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(GoArrow), Go.Glyph.Canvas, 0, 0, 11, 16, 0, 0, 11, 16);
Go.ShowHint := true;
Go.Hint := 'Changes colors in area selected';
Go.OnClick := @ButtonClick;

SetCords := TSpeedButton.Create(frmDesign);
SetCords.Parent := frmDesign;
SetCords.Top := 2;
SetCords.Left := 36;
SetCords.Height := 25;
SetCords.Width := 35;
SetCords.Glyph.Width := 14;
SetCords.Glyph.Height := 13;
SetCords.Layout := blGlyphLeft;
SetCords.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(AreaPicker), SetCords.Glyph.Canvas, 0, 0, 17, 13, 0, 0, 14, 13);
SetCords.ShowHint := true;
SetCords.Hint := 'Selects the area that changes when "Go!" is pressed';
SetCords.OnClick := @ButtonClick;

Capture := TSpeedButton.Create(frmDesign);
Capture.Parent := frmDesign;
Capture.Top := 26;
Capture.Left := 36;
Capture.Height := 25;
Capture.Width := 35;
Capture.Glyph.Width := 15;
Capture.Glyph.Height := 15;
Capture.Layout := blGlyphLeft;
Capture.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(ScreenShot), Capture.Glyph.Canvas, 0, 0, 20, 20, 0, 0, 20, 20);
Capture.ShowHint := true;
Capture.Hint := 'Captures the client and pastes it';
Capture.OnClick := @ButtonClick;

HUp := TSpeedButton.Create(frmDesign);
HUp.Parent := frmDesign;
HUp.Top := 163;
HUp.Left := 90;
HUp.Height := 8;
HUp.Width := 9;
HUp.Glyph.Width := 8;
HUp.Glyph.Height := 9;
HUp.Layout := blGlyphLeft;
HUp.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Up), HUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
HUp.OnMouseDown := @ChangeNumber;

HDown := TSpeedButton.Create(frmDesign);
HDown.Parent := frmDesign;
HDown.Top := 172;
HDown.Left := 90;
HDown.Height := 8;
HDown.Width := 9;
HDown.Glyph.Width := 8;
HDown.Glyph.Height := 9;
HDown.Layout := blGlyphLeft;
HDown.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Down), HDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
HDown.OnMouseDown := @ChangeNumber;

SUp := TSpeedButton.Create(frmDesign);
SUp.Parent := frmDesign;
SUp.Top := 201;
SUp.Left := 90;
SUp.Height := 8;
SUp.Width := 9;
SUp.Glyph.Width := 8;
SUp.Glyph.Height := 9;
SUp.Layout := blGlyphLeft;
SUp.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Up), SUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
SUp.OnMouseDown := @ChangeNumber;

SDown := TSpeedButton.Create(frmDesign);
SDown.Parent := frmDesign;
SDown.Top := 210;
SDown.Left := 90;
SDown.Height := 8;
SDown.Width := 9;
SDown.Glyph.Width := 8;
SDown.Glyph.Height := 9;
SDown.Layout := blGlyphLeft;
SDown.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Down), SDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
SDown.OnMouseDown := @ChangeNumber;

LUp := TSpeedButton.Create(frmDesign);
LUp.Parent := frmDesign;
LUp.Top := 239;
LUp.Left := 90;
LUp.Height := 8;
LUp.Width := 9;
LUp.Glyph.Width := 8;
LUp.Glyph.Height := 9;
LUp.Layout := blGlyphLeft;
LUp.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Up), LUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
LUp.OnMouseDown := @ChangeNumber;

LDown := TSpeedButton.Create(frmDesign);
LDown.Parent := frmDesign;
LDown.Top := 248;
LDown.Left := 90;
LDown.Height := 8;
LDown.Width := 9;
LDown.Glyph.Width := 8;
LDown.Glyph.Height := 9;
LDown.Layout := blGlyphLeft;
LDown.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Down), LDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
LDown.OnMouseDown := @ChangeNumber;

RUp := TSpeedButton.Create(frmDesign);
RUp.Parent := frmDesign;
RUp.Top := 287;
RUp.Left := 90;
RUp.Height := 8;
RUp.Width := 9;
RUp.Glyph.Width := 8;
RUp.Glyph.Height := 9;
RUp.Layout := blGlyphLeft;
RUp.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Up), RUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
RUp.OnMouseDown := @ChangeNumber;

RDown := TSpeedButton.Create(frmDesign);
RDown.Parent := frmDesign;
RDown.Top := 296;
RDown.Left := 90;
RDown.Height := 8;
RDown.Width := 9;
RDown.Glyph.Width := 8;
RDown.Glyph.Height := 9;
RDown.Layout := blGlyphLeft;
RDown.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Down), RDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
RDown.OnMouseDown := @ChangeNumber;

GUp := TSpeedButton.Create(frmDesign);
GUp.Parent := frmDesign;
GUp.Top := 325;
GUp.Left := 90;
GUp.Height := 8;
GUp.Width := 9;
GUp.Glyph.Width := 8;
GUp.Glyph.Height := 9;
GUp.Layout := blGlyphLeft;
GUp.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Up), GUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
GUp.OnMouseDown := @ChangeNumber;

GDown := TSpeedButton.Create(frmDesign);
GDown.Parent := frmDesign;
GDown.Top := 334;
GDown.Left := 90;
GDown.Height := 8;
GDown.Width := 9;
GDown.Glyph.Width := 8;
GDown.Glyph.Height := 9;
GDown.Layout := blGlyphLeft;
GDown.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Down), GDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
GDown.OnMouseDown := @ChangeNumber;

BUp := TSpeedButton.Create(frmDesign);
BUp.Parent := frmDesign;
BUp.Top := 363;
BUp.Left := 90;
BUp.Height := 11;
BUp.Width := 16;
BUp.Height := 8;
BUp.Width := 9;
BUp.Glyph.Width := 8;
BUp.Glyph.Height := 9;
BUp.Layout := blGlyphLeft;
BUp.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Up), BUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
BUp.OnMouseDown := @ChangeNumber;

BDown := TSpeedButton.Create(frmDesign);
BDown.Parent := frmDesign;
BDown.Top := 372;
BDown.Left := 90;
BDown.Height := 8;
BDown.Width := 9;
BDown.Glyph.Width := 8;
BDown.Glyph.Height := 9;
BDown.Layout := blGlyphLeft;
BDown.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Down), BDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
BDown.OnMouseDown := @ChangeNumber;

TUp := TSpeedButton.Create(frmDesign);
TUp.Parent := frmDesign;
TUp.Top := 111;
TUp.Left := 48;
TUp.Height:= 8;
TUp.Width:= 9;
TUp.Glyph.Width := 8;
TUp.Glyph.Height := 9;
TUp.Layout := blGlyphLeft;
TUp.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Up), TUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
TUp.OnMouseDown := @ChangeNumber;

TDown := TSpeedButton.Create(frmDesign);
TDown.Parent := frmDesign;
TDown.Top := 120;
TDown.Left := 48;
TDown.Height:= 8;
TDown.Width:= 9;
TDown.Glyph.Width := 8;
TDown.Glyph.Height := 9;
TDown.Layout := blGlyphLeft;
TDown.Margin := -2;
SafeCopyCanvas(GetBitmapCanvas(Down), TDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);
TDown.OnMouseDown := @ChangeNumber;

XUp := TSpeedButton.Create(frmDesign);
with XUp do
begin
Parent := frmDesign;
Top := 408;
Left := 90;
Height:= 8;
Width:= 9;
Glyph.Width := 8;
Glyph.Height := 9;
Layout := blGlyphLeft;
Margin := -2;
OnMouseDown := @ChangeNumber;
end;
SafeCopyCanvas(GetBitmapCanvas(Up), XUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);

XDown := TSpeedButton.Create(frmDesign);
with XDown do
begin
Parent := frmDesign;
Top := 417;
Left := 90;
Height:= 8;
Width:= 9;
Glyph.Width := 8;
Glyph.Height := 9;
Layout := blGlyphLeft;
Margin := -2;
OnMouseDown := @ChangeNumber;
end;
SafeCopyCanvas(GetBitmapCanvas(Down), XDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);

YUp := TSpeedButton.Create(frmDesign);
with YUp do
begin
Parent := frmDesign;
Top := 443;
Left := 90;
Height:= 8;
Width:= 9;
Glyph.Width := 8;
Glyph.Height := 9;
Layout := blGlyphLeft;
Margin := -2;
OnMouseDown := @ChangeNumber;
end;
SafeCopyCanvas(GetBitmapCanvas(Up), YUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);

YDown := TSpeedButton.Create(frmDesign);
with YDown do
begin
Parent := frmDesign;
Top := 452;
Left := 90;
Height:= 8;
Width:= 9;
Glyph.Width := 8;
Glyph.Height := 9;
Layout := blGlyphLeft;
Margin := -2;
OnMouseDown := @ChangeNumber;
end;
SafeCopyCanvas(GetBitmapCanvas(Down), YDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);

ZUp := TSpeedButton.Create(frmDesign);
with ZUp do
begin
Parent := frmDesign;
Top := 478;
Left := 90;
Height:= 8;
Width:= 9;
Glyph.Width := 8;
Glyph.Height := 9;
Layout := blGlyphLeft;
Margin := -2;
OnMouseDown := @ChangeNumber;
end;
SafeCopyCanvas(GetBitmapCanvas(Up), ZUp.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);

ZDown := TSpeedButton.Create(frmDesign);
with ZDown do
begin
Parent := frmDesign;
Top := 487;
Left := 90;
Height:= 8;
Width:= 9;
Glyph.Width := 8;
Glyph.Height := 9;
Layout := blGlyphLeft;
Margin := -2;
OnMouseDown := @ChangeNumber;
end;
SafeCopyCanvas(GetBitmapCanvas(Down), ZDown.Glyph.Canvas, 0, 0, 8, 9, 0, 0, 8, 9);

Magnify := TSpeedButton.Create(frmDesign);
with Magnify do
begin
Parent := frmDesign;
Top := 514;
Left := 75;
Height:= 26;
Width:= 22;
Glyph.Width := 17;
Glyph.Height := 18;
Layout := blGlyphLeft;
Margin := -2;
ShowHint:= true;
Hint:= 'Click to zoom in or out';
OnClick := @ButtonClick;
end;
SafeCopyCanvas(GetBitmapCanvas(Lens), Magnify.Glyph.Canvas, 0, 0, 17, 18, 0, 0, 17, 18);

Mag := TEdit.Create(frmDesign);
Mag.Parent := frmDesign;
Mag.Font.Size := 10;
Mag.Left := 94;
Mag.Top := 515;
Mag.Width := 38;
Mag.Height := 25;
Mag.OnExit:= @Exits;
Mag.Text := '0';

Hue := TEdit.Create(frmDesign);
Hue.Parent := frmDesign;
Hue.Font.Size := 10;
Hue.Left := 10;
Hue.Top := 160;
Hue.Width := 78;
Hue.Height := 30;
Hue.ShowHint:= true;
Hue.Hint:= 'The overall color';
Hue.OnExit:= @Exits;
Hue.Text := '0';

Saturation := TEdit.Create(frmDesign);
Saturation.Parent := frmDesign;
Saturation.Font.Size := 10;
Saturation.Left := 10;
Saturation.Top := 198//240;
Saturation.Width := 78;
Saturation.Height := 30;
Saturation.ShowHint:= true;
Saturation.Hint:= 'How grey or "true" the color is';
Saturation.OnExit:= @Exits;
Saturation.Text := '0';

Luminance := TEdit.Create(frmDesign);
Luminance.Parent := frmDesign;
Luminance.Font.Size := 10;
Luminance.Left := 10;
Luminance.Top := 236;
Luminance.Width := 78;
Luminance.Height := 30;
Luminance.ShowHint:= true;
Luminance.Hint:= 'How bright the color is';
Luminance.OnExit:= @Exits;
Luminance.Text := '0';

Red := TEdit.Create(frmDesign);
Red.Parent := frmDesign;
Red.Font.Size := 10;
Red.Left := 10;
Red.Top := 283;
Red.Width := 78;
Red.Height := 30;
Red.ShowHint:= true;
Red.Hint:= 'How red the color is';
Red.OnExit:= @Exits;
Red.Text := '0';

Green := TEdit.Create(frmDesign);
Green.Parent := frmDesign;
Green.Font.Size := 10;
Green.Left := 10;
Green.Top := 321;
Green.Width := 78;
Green.Height := 30;
Green.ShowHint:= true;
Green.Hint:= 'How green the color is';
Green.OnExit:= @Exits;
Green.Text := '0';

Blue := TEdit.Create(frmDesign);
Blue.Parent := frmDesign;
Blue.Font.Size := 10;
Blue.Left := 10;
Blue.Top := 359;
Blue.Width := 78;
Blue.Height := 30;
Blue.ShowHint:= true;
Blue.Hint:= 'How blue the color is';
Blue.OnExit:= @Exits;
Blue.Text := '0';

Tolerance := TEdit.Create(frmDesign);
Tolerance.Parent := frmDesign;
Tolerance.Font.Size := 10;
Tolerance.Left := 10;
Tolerance.Top := 108;
Tolerance.Width := 36;
Tolerance.Height := 30;
Tolerance.ShowHint:= true;
Tolerance.Hint:= 'Tolerance of changing the color';
Tolerance.OnExit:= @Exits;
Tolerance.Text := '0';

Hu := TLabel.Create(frmDesign);
Hu.Parent := frmDesign;
Hu.Caption := 'Hue';
Hu.Left := 10;
Hu.Top := 147;
Hu.Width := 120;
Hu.Height := 13;
Hu.Font.Color:= FontColor;

Sat := TLabel.Create(frmDesign);
Sat.Parent := frmDesign;
Sat.Caption := 'Saturation';
Sat.Left := 10;
Sat.Top := 185;
Sat.Width := 120;
Sat.Height := 13;
Sat.Font.Color:= FontColor;

Lum := TLabel.Create(frmDesign);
Lum.Parent := frmDesign;
Lum.Caption := 'Luminance';
Lum.Left := 10;
Lum.Top := 223;
Lum.Width := 120;
Lum.Height := 13;
Lum.Font.Color:= FontColor;

LR := TLabel.Create(frmDesign);
LR.Parent := frmDesign;
LR.Caption := 'Red';
LR.Left := 10;
LR.Top := 270;
LR.Width := 120;
LR.Height := 13;
LR.Font.Color:= FontColor;

LG := TLabel.Create(frmDesign);
LG.Parent := frmDesign;
LG.Caption := 'Green';
LG.Left := 10;
LG.Top := 308;
LG.Width := 120;
LG.Height := 13;
LG.Font.Color:= FontColor;

LB := TLabel.Create(frmDesign);
LB.Parent := frmDesign;
LB.Caption := 'Blue';
LB.Left := 10;
LB.Top := 346;
LB.Width := 120;
LB.Height := 13;
LB.Font.Color:= FontColor;

LX:= TLabel.Create(frmDesign);
with LX do
begin
Parent := frmDesign;
Caption := 'X';
Left := 12;
Top := 393;
Width := 120;
Height := 13;
Font.Color:= FontColor;
end;

XBox:= TEdit.Create(frmDesign);
with XBox do
begin
Parent := frmDesign;
Text := '0';
Left := 10;
Top := 406;
Width := 78;
Height := 13;
ShowHint:= true;
OnExit:= @Exits;
end;

LY:= TLabel.Create(frmDesign);
with LY do
begin
Parent := frmDesign;
Caption := 'Y';
Left := 12;
Top := 428;
Width := 120;
Height := 13;
Font.Color:= FontColor;
end;

YBox:= TEdit.Create(frmDesign);
with YBox do
begin
Parent := frmDesign;
Text := '0';
Left := 10;
Top := 441;
Width := 78;
Height := 13;
ShowHint:= true;
OnExit:= @Exits;
end;

LZ:= TLabel.Create(frmDesign);
with LZ do
begin
Parent := frmDesign;
Caption := 'Z';
Left := 12;
Top := 462;
Width := 120;
Height := 13;
Font.Color:= FontColor;
end;

ZBox:= TEdit.Create(frmDesign);
with ZBox do
begin
Parent := frmDesign;
Text := '0';
Left := 10;
Top := 475;
Width := 78;
Height := 13;
ShowHint:= true;
OnExit:= @Exits;
end;

Tol := TLabel.Create(frmDesign);
Tol.Parent := frmDesign;
Tol.Caption := 'Tolerance';
Tol.Left := 10;
Tol.Top := 95;
Tol.Width := 120;
Tol.Height := 13;
Tol.Font.Color:= FontColor;

CMode := TLabel.Create(frmDesign);
CMode.Parent := frmDesign;
CMode.Caption := 'Single Mode';
CMode.Left := 0;
CMode.Top := 510;
CMode.Width := 120;
CMode.Height := 13;
CMode.Font.Color:= FontColor;

NCMode := TLabel.Create(frmDesign);
NCMode.Parent := frmDesign;
NCMode.Caption := 'Multi Mode';
NCMode.Left := 6;
NCMode.Top := 528;
NCMode.Width := 120;
NCMode.Height := 13;
NCMode.Font.Color:= FontColor;

UseColor := TCheckBox.Create(frmDesign);
UseColor.Parent := frmDesign;
UseColor.Left := 92;
UseColor.Top := 73;
UseColor.Width := 15;
UseColor.Height := 17;
UseColor.ShowHint:= true;
UseColor.Hint:= 'Check to only change this color when Go! is pressed';

ChangeMode := TCheckBox.Create(frmDesign);
ChangeMode.Parent := frmDesign;
ChangeMode.Left := 60;
ChangeMode.Top := 510;
ChangeMode.Width := 15;
ChangeMode.Height := 17;
ChangeMode.ShowHint:= true;
ChangeMode.OnEnter:= @CheckBox;
ChangeMode.Hint:= 'Edit each box without the others changing';

NonChangeMode := TCheckBox.Create(frmDesign);
NonChangeMode.Parent := frmDesign;
NonChangeMode.Left := 60;
NonChangeMode.Top := 527;
NonChangeMode.Width := 15;
NonChangeMode.Height := 17;
NonChangeMode.ShowHint:= true;
NonChangeMode.State := true;
NonChangeMode.OnEnter:= @CheckBox;
NonChangeMode.Hint:= 'When one box is changed the others are changed';

x1 := TEdit.Create(frmDesign);
x1.Parent := frmDesign;
x1.Font.Size := 10;
x1.Left := 79;
x1.Top := 96;
x1.Width := 27;
x1.ShowHint:= true;
x1.Hint:= 'x1 Coordinate of the change area';
x1.OnExit:= @Exits;
x1.Text := '0';

y1 := TEdit.Create(frmDesign);
y1.Parent := frmDesign;
y1.Font.Size := 10;
y1.Left := 105;
y1.Top := 96;
y1.Width := 27;
y1.ShowHint:= true;
y1.Hint:= 'y1 Coordinate of the change area';
y1.OnExit:= @Exits;
y1.Text := '0';

x2 := TEdit.Create(frmDesign);
x2.Parent := frmDesign;
x2.Font.Size := 10;
x2.Left := 79;
x2.Top := 117;
x2.Width := 27;
x2.ShowHint:= true;
x2.Hint:= 'x2 Coordinate of the change area';
x2.OnExit:= @Exits;
x2.Text := '0';

y2 := TEdit.Create(frmDesign);
y2.Parent := frmDesign;
y2.Font.Size := 10;
y2.Left := 105;
y2.Top := 117;
y2.Width := 27;
y2.ShowHint:= true;
y2.Hint:= 'y2 Coordinate of the change area';
y2.OnExit:= @Exits;
y2.Text := '0';

//Creates the main menu
TheMenu:= TMainMenu.Create(frmDesign);

//Making the main menu buttons
Menu1 := TMenuItem.Create(frmDesign);
Menu1.Caption := 'File';
Menu2 := TMenuItem.Create(frmDesign);
Menu2.Caption := 'Edit';
Menu3 := TMenuItem.Create(frmDesign);
Menu3.Caption := 'View';
Menu4 := TMenuItem.Create(frmDesign);
Menu4.Caption := 'Help';

//Adds them to the main menu
TheMenu.Items.Add(Menu1);
TheMenu.Items.Add(Menu2);
TheMenu.Items.Add(Menu3);
TheMenu.Items.Add(Menu4);

//Creating sub menus on the menu buttons
Menu1Sub := TMenuItem.Create(frmDesign);
Menu1Sub.Caption := 'Open';
Menu1Sub.Onclick:= @MenuClick;

Menu1Sub2 := TMenuItem.Create(frmDesign);
Menu1Sub2.Caption := 'Save As...';
Menu1Sub2.Onclick:= @MenuClick;

Menu1Sub3 := TMenuItem.Create(frmDesign);
Menu1Sub3.Caption := 'Save';
Menu1Sub3.Onclick:= @MenuClick;

Menu2Sub:= TMenuItem.Create(frmDesign);
Menu2Sub.Caption := 'Re-paste Screen';
Menu2Sub.Onclick:= @MenuClick;

Menu2Sub2:= TMenuItem.Create(frmDesign);
Menu2Sub2.Caption := 'Move Area';
Menu2Sub2.Onclick:= @MenuClick;

Menu2Sub2Sub:= TMenuItem.Create(frmDesign);
Menu2Sub2Sub.Caption := 'Left';
Menu2Sub2Sub.Onclick:= @MenuClick;

Menu2Sub2Sub2:= TMenuItem.Create(frmDesign);
Menu2Sub2Sub2.Caption := 'Right';
Menu2Sub2Sub2.Onclick:= @MenuClick;

Menu2Sub2Sub3:= TMenuItem.Create(frmDesign);
Menu2Sub2Sub3.Caption := 'Down';
Menu2Sub2Sub3.Onclick:= @MenuClick;

Menu2Sub2Sub4:= TMenuItem.Create(frmDesign);
Menu2Sub2Sub4.Caption := 'Up';
Menu2Sub2Sub4.Onclick:= @MenuClick;

Menu2Sub2Sub5:= TMenuItem.Create(frmDesign);
Menu2Sub2Sub5.Caption := 'Custom';
Menu2Sub2Sub5.Onclick:= @MenuClick;

Menu3Sub:= TMenuItem.Create(frmDesign);
Menu3Sub.Caption := 'Small Size';
Menu3Sub.Checked:= true;
Menu3Sub.Onclick:= @MenuClick;

Menu3Sub2:= TMenuItem.Create(frmDesign);
Menu3Sub2.Caption := 'Form Colors';

Menu3Sub2Sub:= TMenuItem.Create(frmDesign);
Menu3Sub2Sub.Caption := 'Background Color';
Menu3Sub2Sub.Onclick:= @MenuClick;

Menu3Sub2Sub2:= TMenuItem.Create(frmDesign);
Menu3Sub2Sub2.Caption := 'Font Color';
Menu3Sub2Sub2.Onclick:= @MenuClick;

Menu3Sub2Sub3:= TMenuItem.Create(frmDesign);
Menu3Sub2Sub3.Caption := 'Lines Color';
Menu3Sub2Sub3.Onclick:= @MenuClick;

Menu3Sub3:= TMenuItem.Create(frmDesign);
Menu3Sub3.Caption := 'Zoom';

Menu3Sub3Sub:= TMenuItem.Create(frmDesign);
Menu3Sub3Sub.Caption := 'In';
Menu3Sub3Sub.Onclick:= @MenuClick;

Menu3Sub3Sub2:= TMenuItem.Create(frmDesign);
Menu3Sub3Sub2.Caption := 'Out';
Menu3Sub3Sub2.Onclick:= @MenuClick;

Menu3Sub3Sub3:= TMenuItem.Create(frmDesign);
Menu3Sub3Sub3.Caption := 'Actual Size';
Menu3Sub3Sub3.Onclick:= @MenuClick;

Menu4Sub:= TMenuItem.Create(frmDesign);
Menu4Sub.Caption := 'Selecting a screen area';
Menu4Sub.Onclick:= @MenuClick;

Menu4Sub2:= TMenuItem.Create(frmDesign);
Menu4Sub2.Caption := 'Single/ Multi mode';
Menu4Sub2.Onclick:= @MenuClick;

Menu4Sub3:= TMenuItem.Create(frmDesign);
Menu4Sub3.Caption := 'HSL';
Menu4Sub3.Onclick:= @MenuClick;

Menu4Sub4:= TMenuItem.Create(frmDesign);
Menu4Sub4.Caption := 'RGB';
Menu4Sub4.Onclick:= @MenuClick;

Menu2Sub3:= TMenuItem.Create(frmDesign);
Menu2Sub3.Caption := 'Undo';
Menu2Sub3.Onclick:= @Undo;

//Adds them to the menu buttons
TheMenu.Items.Items[0].Add(Menu1Sub);
TheMenu.Items.Items[0].Add(Menu1Sub3);
TheMenu.Items.Items[0].Add(Menu1Sub2);
TheMenu.Items.Items[1].Add(Menu2Sub3);
TheMenu.Items.Items[1].Add(Menu2Sub);
TheMenu.Items.Items[1].Add(Menu2Sub2);
TheMenu.Items.Items[1].Items[2].Add(Menu2Sub2Sub4);
TheMenu.Items.Items[1].Items[2].Add(Menu2Sub2Sub3);
TheMenu.Items.Items[1].Items[2].Add(Menu2Sub2Sub);
TheMenu.Items.Items[1].Items[2].Add(Menu2Sub2Sub2);
TheMenu.Items.Items[1].Items[2].Add(Menu2Sub2Sub5);
TheMenu.Items.Items[2].Add(Menu3Sub);
TheMenu.Items.Items[2].Add(Menu3Sub2);
TheMenu.Items.Items[2].Items[1].Add(Menu3Sub2Sub);
TheMenu.Items.Items[2].Items[1].Add(Menu3Sub2Sub2);
TheMenu.Items.Items[2].Items[1].Add(Menu3Sub2Sub3);
TheMenu.Items.Items[2].Add(Menu3Sub3);
TheMenu.Items.Items[2].Items[2].Add(Menu3Sub3Sub);
TheMenu.Items.Items[2].Items[2].Add(Menu3Sub3Sub2);
TheMenu.Items.Items[2].Items[2].Add(Menu3Sub3Sub3);
TheMenu.Items.Items[3].Add(Menu4Sub);
TheMenu.Items.Items[3].Add(Menu4Sub2);
TheMenu.Items.Items[3].Add(Menu4Sub3);
TheMenu.Items.Items[3].Add(Menu4Sub4);
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;





begin
LoadButtonPics;
SafeInitForm;
SafeShowFormModal;
FreeForm(frmDesign);
FreeButtonPics;
end.


program New;

{Text Procedures}



//Makes a word backwards
function Backwards(Characters:string):string;
var
i:integer;
Final:string;
CharsArray:array [1..100] of string;
begin
for i:= 1 to Length(Characters) do
CharsArray[i]:= Copy(Characters, (Length(Characters) - i + 1), 1);
for i:= 1 to Length(Characters) do
Final:= Final + CharsArray[i];
WriteLn('');
WriteLn(Characters + ' backwards is- ' + Final);
WriteLn('');
Result:= Final;
end;




//Takes the spaces out of a sentence to make it one long string
function UnSpace(Text:string):string;
var
CharsArray: array [1..1000] of string;
i, Subtract:integer;
Change, Space:boolean;
Final:string;
begin
for i:= 1 to Length(Text) do
CharsArray[i]:= Copy(Text, i, 1);
repeat
Change:= false;
for i:= 1 to Length(Text) do
begin
if Change= true then
begin
CharsArray[i-1]:= CharsArray[i]
end else
if CharsArray[i] = ' ' then
begin
Subtract:= Subtract + 1;
Change:= true;
end;
end;
Space:= false;
for i:= 1 to Length(Text) do
if CharsArray[i] = ' ' then
Space:= true;
until(not (space));
for i:= 1 to Length(Text) - Subtract do
begin
Final:= Final + CharsArray[i];
end;
Result:= Final;
end;




//Complicated... But if you know what "bible decoders" are, thats what
//this does.
//Use f5 to change the amount of letters skipped.
procedure Decode(Text: string);
var
BText, SText, Final, SFinal:string;
Letter, Skip:integer;
begin
Text:= 'Rips explained that each code is a case of adding every fourth or twelfth or fiftieth letter to form a word';
BText:= Backwards(Text);
SText:= UnSpace(Text);
WriteLn('==========================================================================');
repeat
Skip:= Skip + 1;
Letter:= 1;
repeat
Final:= Final + Copy(Text, Letter, 1);
SFinal:= SFinal + Copy(SText, Letter, 1);
Letter:= Letter + Skip;
until(Letter > Length(Text));
WriteLn('Skips- ' + IntToStr(Skip));
WriteLn(Final);
WriteLn(Backwards(Final));
WriteLn(SFinal);
WriteLn(Backwards(SFinal));
WriteLn('==========================================================================');
Final:= '';
SFinal:= '';
repeat
wait(1);
until(IsFKeyDown(5));
repeat
wait(1);
until not (IsFKeyDown(5));
until(false);
end;




//Used in AltKeys \/
function GetKeyNumber(Key:string):integer;
begin
case Key of
'0': result:= 96;
'1': result:= 97;
'2': result:= 98;
'3': result:= 99;
'4': result:= 100;
'5': result:= 101;
'6': result:= 102;
'7': result:= 103;
'8': result:= 104;
'9': result:= 105;
end;
end;





//Holds down Alt and presses "Number" which makes some pretty cool
//symbol thingys :)
//1-31 are symbols, 32-126 are common things, 127-254 are more symbols
procedure AltKeys(Number:string);
var
i:integer;
begin
KeyDown(18);
for i:= 1 to Length(Number) do
begin
KeyDown(GetKeyNumber(Copy(Number, i, 1)));
KeyUp(GetKeyNumber(Copy(Number, i, 1)));
end;
KeyUp(18);
end;




//Used in "LagPercent"
//(I did not make this)
procedure UnSafeDisguiseScar(disguise: String);
begin
GetApplication.Title:= disguise;
GetSelf.Caption:= disguise;
end;




//Used in "LagPercent"
//(I did not make this)
procedure DisguiseScar(disguise: String);
var
t: TVariantArray;
begin
SetArrayLength(t,1);
t[0] := disguise;
ThreadSafeCall('UnSafeDisguiseScar',t);
end;




//Shows you how much your computer is lagging
procedure LagPercent(HowOften: integer);
var
ST, ET, c, t: Integer;
Average: Extended;
Lag: String;
begin
t:= HowOften;
repeat
C:= 0;
ST:= GetSystemTime;
repeat
Wait(1);
c:= c + 1;
until(c = t * 100);
ET:= GetSystemTime;
Lag:= FloatToStr(((ET - ST) - (t * 1000)) * 0.001);
WriteLn('Your speed delay is ' + FloatToStr(((ET - ST) - (t * 1000))
* 0.001) + ' seconds.');
WriteLn('Your computer is lagging ' + Lag + ' %');
WriteLn(' ');
WriteLn('==========================================================');
WriteLn(' ');
if Average = 0 then
begin
Average:= Abs((((t * 1000) /(ET - ST)) * 100) - 100);
end else
Average:= (Average + Abs((((t * 1000) /(ET - ST)) * 100) - 100)) / 2;
Status(FloatToStr(Average) + ' % lag on average.');
Delete(Lag, 4, 13);
DisguiseScar('Lag: ' + Lag + ' %');
until(false);
end;




//Guesses every combination of letters.
//This is set for a 9 character password so you will have tochange it to
//guess other amounts of letters.
procedure GuessPass;
var
d, e, f, g, h, i, j, k, l, Guess: integer;
Pass: string;
c: array [1..26] of string;
begin
c[1] := 'a';
c[2] := 'b';
c[3] := 'c';
c[4] := 'd';
c[5] := 'e';
c[6] := 'f';
c[7] := 'g';
c[8] := 'h';
c[9] := 'i';
c[10] := 'j';
c[11] := 'k';
c[12] := 'l';
c[13] := 'm';
c[14] := 'n';
c[15] := 'o';
c[16] := 'p';
c[17] := 'q';
c[18] := 'r';
c[19] := 's';
c[20] := 't';
c[21] := 'u';
c[22] := 'v';
c[23] := 'w';
c[24] := 'x';
c[25] := 'y';
c[26] := 'z';
for d:= 1 to 26 do
begin
for e:= 1 to 26 do
begin
for f:= 1 to 26 do
begin
for g:= 1 to 26 do
begin
for h:= 1 to 26 do
begin
for i:= 1 to 26 do
begin
for j:= 1 to 26 do
begin
for k:= 1 to 26 do
begin
for l:= 1 to 26 do
begin
Guess:= Guess + 1;
Pass:= Pass + c[d] + c[e] + c[f] + c[g] + c[h] + c[i] + c[j] + c[k] + c[l];
WriteLn(Pass);
WriteLn('Guesses made- ' + IntToStr(Guess));
//Change this to what happens when you guess right
if false then
begin
WriteLn('It guessed the pass right!!!');
WriteLn(Pass);
terminatescript;
end;
Pass:= '';
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;





//Guesses random passwords. Not for use on runescape because it won't work.
//Set Chars and the C array to the number of characters you set
procedure RandomGuess(PassLength, Chars, KillScript: integer);
var
t, i: integer;
d, p: string;
C: array[1..26] of string; //The number of chars to select from
Letter: array[1..1000] of string;
begin
c[1] := 'a';
c[2] := 'b';
c[3] := 'c';
c[4] := 'd';
c[5] := 'e';
c[6] := 'f';
c[7] := 'g';
c[8] := 'h';
c[9] := 'i';
c[10] := 'j';
c[11] := 'k';
c[12] := 'l';
c[13] := 'm';
c[14] := 'n';
c[15] := 'o';
c[16] := 'p';
c[17] := 'q';
c[18] := 'r';
c[19] := 's';
c[20] := 't';
c[21] := 'u';
c[22] := 'v';
c[23] := 'w';
c[24] := 'x';
c[25] := 'y';
c[26] := 'z';
{c[27] := '1';
c[28] := '2';
c[29] := '3';
c[30] := '4';
c[31] := '5';
c[32] := '6';
c[33] := '7';
c[34] := '8';
c[35] := '9';
c[36] := '0';
c[36] := '0';
c[37] := '@';
c[38] := '#';
c[39] := '$';
c[40] := '%';
c[41] := '^';
c[42] := '&';
c[43] := '*';
c[44] := '(';
c[45] := ')';
c[46] := '-';
c[47] := '_';
c[48] := '+';
c[49] := '=';
c[50] := '`';
c[51] := '`';
c[52] := '~';
c[53] := '{';
c[54] := '}{';
c[55] := '[';
c[56] := ']';
c[57] := '|';
c[58] := '\';
c[59] := ':';
c[60] := ';';
c[61] := '?';
c[62] := '"';
c[63] := ',';
c[64] := '<';
c[65] := '.';
c[66] := '>';
c[67] := '/';
c[68] := '!';
c[69] := '-';
c[70] := '-'; }
//////////////////////////////////////////////////////////////////////////
repeat
p:= 'Guess- ';
t:= t+1;
for i:= 1 to PassLength do
begin
d:= (c[random(Chars-1)+1]);
sendkeys(d);
Letter[i]:= d
end;
SendKeys(Chr(13));
for i:= 1 to PassLength do
begin
p:=(p+letter[i]);
end;
writeln((p)+(' Guesses Made- ' ) + IntToStr(t));
wait(50);
//Replace this with what will happen if it guesses it right
if (false) then
begin
writeln('W00t Password H4x3d!');
end;
if (KillScript>0) then
terminatescript;
wait(10);
until(false);
end;





//Tells you the key you are pressing
function GetKeyDown:string;
begin
if IsKeyDown('a') then
begin
repeat
wait(1);
until not IsKeyDown('a');
result:=('a');
exit;
end;
if IsKeyDown('b') then
begin
repeat
wait(1);
until not IsKeyDown('b');
result:=('b');
exit;
end;
if IsKeyDown('c') then
begin
repeat
wait(1);
until not IsKeyDown('c');
result:=('c');
exit;
end;
if IsKeyDown('d') then
begin
repeat
wait(1);
until not IsKeyDown('d');
result:=('d');
exit;
end;
if IsKeyDown('e') then
begin
repeat
wait(1);
until not IsKeyDown('e');
result:=('e');
exit;
end;
if IsKeyDown('f') then
begin
repeat
wait(1);
until not IsKeyDown('f');
result:=('f');
exit;
end;
if IsKeyDown('g') then
begin
repeat
wait(1);
until not IsKeyDown('g');
result:=('g');
exit;
end;
if IsKeyDown('h') then
begin
repeat
wait(1);
until not IsKeyDown('h');
result:=('h');
exit;
end;
if IsKeyDown('i') then
begin
repeat
wait(1);
until not IsKeyDown('i');
result:=('i');
exit;
end;
if IsKeyDown('j') then
begin
repeat
wait(1);
until not IsKeyDown('j');
result:=('j');
exit;
end;
if IsKeyDown('k') then
begin
repeat
wait(1);
until not IsKeyDown('k');
result:=('k');
exit;
end;
if IsKeyDown('l') then
begin
repeat
wait(1);
until not IsKeyDown('l');
result:=('l');
exit;
end;
if IsKeyDown('m') then
begin
repeat
wait(1);
until not IsKeyDown('m');
result:=('m');
exit;
end;
if IsKeyDown('n') then
begin
repeat
wait(1);
until not IsKeyDown('n');
result:=('n');
exit;
end;
if IsKeyDown('o') then
begin
repeat
wait(1);
until not IsKeyDown('o');
result:=('o');
exit;
end;
if IsKeyDown('p') then
begin
repeat
wait(1);
until not IsKeyDown('p');
result:=('p');
exit;
end;
if IsKeyDown('q') then
begin
repeat
wait(1);
until not IsKeyDown('q');
result:=('q');
exit;
end;
if IsKeyDown('r') then
begin
repeat
wait(1);
until not IsKeyDown('r');
result:=('r');
exit;
end;
if IsKeyDown('s') then
begin
repeat
wait(1);
until not IsKeyDown('s');
result:=('s');
exit;
end;
if IsKeyDown('t') then
begin
repeat
wait(1);
until not IsKeyDown('t');
result:=('t');
exit;
end;
if IsKeyDown('u') then
begin
repeat
wait(1);
until not IsKeyDown('u');
result:=('u');
exit;
end;
if IsKeyDown('v') then
begin
repeat
wait(1);
until not IsKeyDown('v');
result:=('v');
exit;
end;
if IsKeyDown('w') then
begin
repeat
wait(1);
until not IsKeyDown('w');
result:=('w');
exit;
end;
if IsKeyDown('x') then
begin
repeat
wait(1);
until not IsKeyDown('x');
result:=('x');
exit;
end;
if IsKeyDown('y') then
begin
repeat
wait(1);
until not IsKeyDown('y');
result:=('y');
exit;
end;
if IsKeyDown('z') then
begin
repeat
wait(1);
until not IsKeyDown('z');
result:=('z');
exit;
end;
if IsKeyDown('1') then
begin
repeat
wait(1);
until not IsKeyDown('1');
result:=('1');
exit;
end;
if IsKeyDown('2') then
begin
repeat
wait(1);
until not IsKeyDown('2');
result:=('2');
exit;
end;
if IsKeyDown('3') then
begin
repeat
wait(1);
until not IsKeyDown('3');
result:=('3');
exit;
end;
if IsKeyDown('4') then
begin
repeat
wait(1);
until not IsKeyDown('4');
result:=('4');
exit;
end;
if IsKeyDown('5') then
begin
repeat
wait(1);
until not IsKeyDown('5');
result:=('5');
exit;
end;
if IsKeyDown('6') then
begin
repeat
wait(1);
until not IsKeyDown('6');
result:=('6');
exit;
end;
if IsKeyDown('7') then
begin
repeat
wait(1);
until not IsKeyDown('7');
result:=('7');
exit;
end;
if IsKeyDown('8') then
begin
repeat
wait(1);
until not IsKeyDown('8');
result:=('8');
exit;
end;
if IsKeyDown('9') then
begin
repeat
wait(1);
until not IsKeyDown('9');
result:=('9');
exit;
end;
if IsKeyDown('0') then
begin
repeat
wait(1);
until not IsKeyDown('0');
result:=('0');
exit;
end;
if IsKeyDown(Chr(13)) then
begin
repeat
wait(1);
until not IsKeyDown(Chr(13));
result:=(Chr(13));
exit;
end;
if IsKeyDown(' ') then
begin
repeat
wait(1);
until not IsKeyDown(' ');
result:=(' ');
exit;
end;
if IsKeyDown('.') then
begin
repeat
wait(1);
until not IsKeyDown('.');
result:=('.');
exit;
end;
result:= '';
end;





//Scrambles up text like eggs
//Leave chars blank for it to ask you what to put in.
function Scramble(Chars:string): string;
var
FinalText, StartText:string;
i, n:integer;
Text: array [0..100] of string;
EndText: array [0..100] of string;
Used: array [0..100] of boolean;
begin
if Chars = '' then
Chars:= ReadLn('Text-');
StartText:= Chars;
for i:= 0 to Length(Chars) - 1 do
Text[i]:= Copy(Chars, i + 1, 1);
for i:= 0 to Length(Chars) - 1 do
Chars:= Chars + Text[i];
for i:= 0 to Length(Chars) - 1 do
Used[i]:= false;
for i:= 0 to Length(Chars)-2 do
begin
repeat
n:= Random(Length(Chars) - 1);
until(Used[n] = false);
EndText[i]:= Text[n];
Used[n]:= true;
end;
for i:= 0 to Length(Chars) do
begin
FinalText:= FinalText + EndText[i];
end;
WriteLn('====================================================================');
WriteLn(StartText + ' scrambled is-');
WriteLn(FinalText);
WriteLn('====================================================================');
Result:= FinalText;
end;








/////////////////////////////////////////////////////////////////////////////////////////
//Color Procedures///////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////






//Returns a point half way between (x1, y1) and (x2, y2)
procedure HalfPoint(var x, y:integer; x1, y1, x2, y2:integer);
begin
if (x2>x1) then
begin
x:= x1+((x2-x1)/2);
end else
x:= x1-((x1-x2)/2);
if (y2>y1) then
begin
y:= y1+((y2-y1)/2);
end else
y:= y1-((y1-y2)/2);
end;





//Starts a search for a color in the center of the search area
procedure SpiralFromCenter(var x, y: integer; Color, x1, y1, x2, y2, Tol:integer);
begin
HalfPoint(x, y, x1, y1, x2, y2);
FindColorSpiralTolerance(x, y, Color, x1, y1, x2, y2, Tol);
end;




//Finds the point between 2 colors
procedure BetweenColors(var x, y: integer; Color1, Color2, x1, y1, x2, y2, Tol:integer);
var x3, y3, x4, y4:integer;
begin
SpiralFromCenter(x3, y3, Color1, x1, y1, x2, y2, Tol);
SpiralFromCenter(x4, y4, Color2, x1, y1, x2, y2, Tol);
HalfPoint(x, y, x3, y3, x4, y4);
end;




//Finds the point between 3 colors
procedure Between3Colors(x, y, Color1, Color2, Color3, x1, y1, x2, y2, Tol:integer);
var x3, y3, x4, y4, x5, y5:integer;
begin
SpiralFromCenter(x, y, Color1, x1, y1, x2, y2, Tol);
x3:= x; y3:= y;
SpiralFromCenter(x, y, Color2, x1, y1, x2, y2, Tol);
x4:= x; y4:= y;
SpiralFromCenter(x, y, Color3, x1, y1, x2, y2, Tol);
x5:= x; y5:= y;
HalfPoint(x, y, x3, y3, x4, y4);
HalfPoint(x, y, x, y, x5, y5);
end;





//Uses the map to find the object on the screen
//Ex. ffm(color1, tol1, color2, tol2, RandomAmountX, RandomAmountY, textAtTop);
//cx,cy= where the color is on MM
//a,b= the center of map
//c,d= the distance that color is from the center
//e,f= the center of the rs screen
//x,y= about where the MM color is on the RS screen
function FindFromMap(var x, y: integer; MMcolor, MMtolerance, ScreenColor, ScreenTolerance:integer):boolean;
var a, b, c, d, e, f: integer;
begin
FindColorSpiralTolerance(x, y, MMColor, 600, 50, 700, 120, MMTolerance);
a:= 648
b:= 82
c:= x - a
d:= y - b
e:= 257
f:= 167
x:= e + c * 9
y:= f + d * 9
if (x < 1) or (y < 1) or (x > 527) or (y > 430) then
begin
WriteLn('object is off screen');
Result:= false;
end;
end;






//Works like RadialMapWalk but with more ways of searching.
//Searches from left to right or from right to left
//Searches from inside to outside or outside to inside
function AngleMapWalk(xMod, yMod, Color, Tol, Rx, Ry, StartAngle, EndAngle,
StartRadius, EndRadius, FFlagDis:integer):boolean;
var
i, c, x2, y2, x, y:integer;
begin
Result:= false;
/////////////////////////////////////////////////////////////////////////
//Moving Clockwise
/////////////////////////////////////////////////////////////////////////
if (StartAngle<EndAngle) and (StartRadius>EndRadius) then
begin
repeat
if result= true then break;
for i := StartAngle to EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 648;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then
begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius - 5;
until(StartRadius<=EndRadius);
end;
/////////////////////////////////////////////////////////////////////////
//Moving Counter Clockwise
/////////////////////////////////////////////////////////////////////////
if (StartAngle>EndAngle) and (StartRadius>EndRadius)then
begin
repeat
if result= true then
break;
for i := StartAngle downto EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 648;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then
begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius - 5;
until(StartRadius<=EndRadius);
end;
/////////////////////////////////////////////////////////////////////////
//For searching from center out
////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//Moving Clockwise
/////////////////////////////////////////////////////////////////////////
if (StartAngle<EndAngle) and (StartRadius<EndRadius) then
begin
repeat
if result= true then
break;
for i := StartAngle to EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 648;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then
begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius + 5;
until(StartRadius>=EndRadius);
end;
/////////////////////////////////////////////////////////////////////////
//Moving Counter Clockwise
/////////////////////////////////////////////////////////////////////////
if (StartAngle>EndAngle) and (StartRadius<EndRadius) then
begin
repeat
if result= true then
break;
for i := StartAngle downto EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 648;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then
begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius + 5;
until(StartRadius>=EndRadius);
end;
if result=false then
begin
x:=0;
y:=0;
end;
/////////////////////////////////////////////////////////////////////////
//Mouse/Flag part
/////////////////////////////////////////////////////////////////////////
ClickMouseSpline(x, y, Rx, Ry, true);
getmousepos(x,y);
wait(500);
if not findcolor(x, y, 255, 563, 5, 728, 161) and
not findcolor(x, y, 284358, 563, 5, 728, 161) then
repeat
c:=c+1;
if (c>10) then
begin
writeln('Cant walk there!');
exit;
end;
if (c>10) then
exit;
wait(100+random(50));
if findcolor(x, y, 255, 563, 5, 728, 161) or
findcolor(x, y, 284358, 563, 5, 728, 161) then
break;
x:= x+xMod;
y:= y+yMod;
ClickMouseSpline(x, y, 0, 0, true);
until(false);
end;




//If one of the set colors isnt found then the result is true
//Use to see if your player is lost
//Leave a color at -1 to not use that color slot.
function Lost(C1, C2, C3, C4, Tol:integer): boolean;
var
c, x, y, NotFound: integer;
begin
Result:= false;
c:= 0;
NotFound:= 0;
if (C1<0) then
c:=c+1;
if (C2<0) then
c:=c+1;
if (C3<0) then
c:=c+1;
if (C4<0) then
c:=c+1;
repeat
if (C1>=0) then
if FindColorTolerance(x, y, C1, 562, 6, 724, 163, Tol) then
c:=c+1;
if (C2>=0) then
if FindColorTolerance(x, y, C2, 562, 6, 724, 163, Tol) then
c:=c+1;
if (C3>=0) then
if FindColorTolerance(x, y, C3, 562, 6, 724, 163, Tol) then
c:=c+1;
if (C4>=0) then
if FindColorTolerance(x, y, C4, 562, 6, 724, 163, Tol) then
c:=c+1;
if (c>=4) then
break;
if (c<4) then
wait(2000);
NotFound:= NotFound+1;
if (NotFound>5) then
begin
if not FindColorTolerance(x, y, C1, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c1) + ' was not found');
if not FindColorTolerance(x, y, C2, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c2) + ' was not found');
if not FindColorTolerance(x, y, C3, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c3) + ' was not found');
if not FindColorTolerance(x, y, C4, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c4) + ' was not found');
end;
if (NotFound>5) then
begin
Result:= true;
break;
end;
until(false);
end;




//Checks to see if there is black text at (x, y)
//If this line has blue text (other players talking) it will move up
//to the next line and so on.
//So it basicly finds the last line that isnt a player talking then
//Checks for black in (x, y)
function FindBlackInChat(x, y:integer):boolean;
var Line:integer;
begin
Line:= 0;
if not(FindColor(x, y, 16711680, 46, 421, 185, 432)) then
Line:= 1;
if Line= 0 then
if not(FindColor(x, y, 16711680, 44, 407, 176, 413)) then
Line:= 2;
if Line= 0 then
if not(FindColor(x, y, 16711680, 39, 392, 190, 398)) then
Line:= 3;
if Line= 0 then
if not(FindColor(x, y, 16711680, 56, 376, 200, 386)) then
Line:= 4;
if Line= 0 then
if not(FindColor(x, y, 16711680, 36, 360, 183, 372)) then
Line:= 5;
if Line= 1 then
if GetColor(x, y)= 0 then
Result:= true;
if Line= 2 then
if GetColor(x-14, y)= 0 then
Result:= true;
if Line= 3 then
if GetColor(x-28, y)= 0 then
Result:= true;
if Line= 4 then
if GetColor(x-42, y)= 0 then
Result:= true;
if Line= 5 then
if GetColor(x-56, y)= 0 then
Result:= true;
end;




//Returns the most common color in the box (x1, y1, x2, y2)
function MostCommonColor(x1, y1, x2, y2, Skip:integer):integer;
var i, Length, BestCount, CurrentColor, x, y:integer;
Percent: extended;
begin
x:= x1; y:= y1;
Length:= ((x2-x1)*(y2-y1));
for i:= 1 to (Length * Skip) do
begin
CurrentColor:= GetColor(x, y);
if (CountColorTolerance(CurrentColor, x1, y1, x2, y2, 10)>BestCount) then
begin
Result:= CurrentColor;
BestCount:= CountColorTolerance(CurrentColor, x1, y1, x2, y2, 10);
end;
x:= x+Skip;
if (y<y2) then
if (x>x2) then
y:= y+Skip;
if (x>x2) then
x:= x1;
movemouse(x, y);
//wait(10);
end;
Percent:= ((BestCount / Length) * 100);
WriteLn('The most common color (' + IntToStr(Result) +
') makes up around ' + FloatToStr(Round(Percent)) + ' % of the area.');
WriteLn('(' + IntToStr(BestCount) + ' Pixels out of ' +
IntToStr(Length) + ')');
end;







begin

end.


program New;

var
x, y: integer;


//Moves the mouse in a segment of a circle
procedure CircleMouse(cx, cy, StartAngle, EndAngle, Radius, Speed:integer);
var
i: integer;
begin
if (StartAngle < EndAngle) then
for i := StartAngle to EndAngle do
begin
MoveMouse(Round(Sin(i * Pi / 180) * Radius) + cx,
Round(Cos(i * Pi / 180) * -Radius) + cy);
Wait(Random(Speed));
end;
if (StartAngle > EndAngle) then
for i := StartAngle downto EndAngle do
begin
MoveMouse(Round(Sin(i * Pi / 180) * Radius) + cx,
Round(Cos(i * Pi / 180) * -Radius) + cy);
Wait(Random(Speed));
end;
end;





//Finds the angle between two points if there were a line drawn connecting them
function FindAngle(cx, cy, x, y, Radius: integer): integer;
var
i: integer;
begin
for i:= 1 to 10 do
for Result := 0 to 360 do
if Abs(((Round(Sin(Result * Pi / 180) * Radius) + cx) - x)) < i then
if Abs(((Round(Cos(Result * Pi / 180) * -Radius) + cy) - y)) < i then
Exit;
Result:= -1;
WriteLn('Error finding angle.');
end;





//Finds the point where two circles will intersect if they are drawn with
//their centers at (x1, y1) and (x2, y2)
function FindPoint(x1, y1, x2, y2: integer; Curve: Extended; Left: boolean): TPoint;
var
Distance, x3, y3, Radius: integer;
begin
Radius:= (Round(Sqrt(Sqr(x1 - x2) + Sqr(y1 - y2)) * Curve));
Distance:= Round(Sqrt(Sqr(x2-x1) + Sqr(y2-y1)));
x3:= ((x1 + x2) / 2);
y3:= ((y1 + y2) / 2);
case Left of
True:
begin
Result.x:= Round(x3 + Sqrt(Sqr(Radius) - (Sqr(Distance / 2))) * (y1 - y2) / Distance);
Result.y:= Round(y3 + Sqrt(Sqr(Radius) - (Sqr(Distance / 2))) * (x2 - x1) / Distance);
end;
False:
begin
Result.x:= Round(x3 - Sqrt(Sqr(Radius) - (Sqr(Distance / 2))) * (y1 - y2) / Distance);
Result.y:= Round(y3 - Sqrt(Sqr(Radius) - (Sqr(Distance / 2))) * (x2 - x1) / Distance);
end;
end;
end;



//Returns a random extended number between High and Low with Digits amount of digits
function RandomExtended(Low, High, Digits: integer): Extended;
var
Number: string;
i: integer;
begin
Number:= '0.' + FloatToStr(RandomRange(Low, High));
for i:= 1 to (Digits - 1) do
Number:= Number + IntToStr(Random(10));
Result:= StrToFloat(Number);
end;





//Moves the mouse between two points using segments of circles.
//Points is how many circle segments it will go through
//Gravity is how random the path is
//Curve is how flat or curved the circle segments are
procedure CircleMousePath(x, y, rx, ry, Points, Speed, Gravity: integer; Curve: Extended);
var
sx, sy, Distance, i, mx, my: integer;
SAngle, EAngle, Cpx, Cpy, r: array [1..10] of integer;
Point: array [1..10] of TPoint;
Left: boolean;
begin
case Random(2) of
0:
Left:= true;
1:
Left:= false;
end;
GetMousePos(sx, sy);
Distance:= Round(Sqrt(Sqr(x - sx) + Sqr(y - sy)));
Cpx[1]:= sx;
Cpy[1]:= sy;
mx:= (x - sx) / Points;
my:= (y - sy) / Points;
for i:= 2 to Points + 1 do
begin
Curve:= Curve - 0.3 + (RandomExtended(0, 3, 2) * 2);
if (Curve <= 0.5) then
Curve:= 0.6;
if (i <> Points + 1) then
begin
Cpx[i]:= Cpx[i - 1] + mx - Gravity + Random(Gravity * 2);
Cpy[i]:= Cpy[i - 1] + my - Gravity + Random(Gravity * 2);
end else
begin
Cpx[i]:= x + Random(rx);
Cpy[i]:= y + Random(ry);
end;
r[i]:= (Round(Sqrt(Sqr(Cpx[i] - Cpx[i - 1]) + Sqr(Cpy[i] - Cpy[i - 1])) * Curve));
Point[i]:= FindPoint(Cpx[i], Cpy[i], Cpx[i - 1], Cpy[i - 1], Curve, Left);
SAngle[i]:= FindAngle(Point[i].x, Point[i].y, cpx[i - 1], cpy[i - 1], r[i]);
EAngle[i]:= FindAngle(Point[i].x, Point[i].y, cpx[i], cpy[i], r[i]);
if Left then
Left:= false else
Left:= true;
end;
for i:= 2 to Points + 1 do
begin
if Abs(SAngle[i] - EAngle[i]) <= 180 then
CircleMouse(Point[i].x, Point[i].y, SAngle[i], EAngle[i], r[i], Speed) else
if (SAngle[i] < EAngle[i]) then
CircleMouse(Point[i].x, Point[i].y, SAngle[i], -(360 - EAngle[i]), r[i], Speed) else
CircleMouse(Point[i].x, Point[i].y, SAngle[i], 360 + EAngle[i], r[i], Speed);
end;
end;





//This throws everything togther
procedure MMCircle(x, y, rx, ry: integer; Curve, Gravity: Extended);
var
Points, Speed, Distance: Extended;
sx, sy: integer;
begin
if (rx < 0) then
x:= x - Random(Round(Abs(rx)));
if (rx > -1) then
x:= x + Random(rx);
if (ry < 0) then
y:= y - Random(Round(Abs(ry)));
if (ry > -1) then
GetMousePos(sx, sy);
Distance:= Sqrt(Sqr(x - sx) + Sqr(y - sy));
Points:= (1 * Distance) / 100;
Speed:= (1.5 * Distance) / 100;
if (Points < 1) then
Points:= 1;
if (Gravity < 5) then
Gravity:= 5;
if (Curve < 0.7) then
Curve:= 0.7;
if (Speed < 1) then
Speed:= 1;
CircleMousePath(x, y, 0, 0, Round(Points), Round(Speed), Round(Gravity), Round(Curve));
end;




//Another procedure for moving the mouse
//Simulates the way your hand rotates around the center point of your wrist
//when you move the mouse
//Gravity is how random the path is
//Winds are random times in the path where it is much more random
//Simulating the shaking of a hand
//It is a 1 out of Winds chance that Winds will be used.
procedure AlmMousePath(x, y, rx, ry, Speed, RandomSpeed, Gravity,
MouseJumps, Winds:integer);
var
x1, y1, sx, sy, nx, ny, cx, cy, Distance1, DistX, DistY, Moves,
StartSpeed, t, C, p, Time, tx, ty:integer;
Wind:boolean;
begin
Wind:= false;
c:= 1;
Speed:= Speed + Random(RandomSpeed);
StartSpeed:= Speed;
Time:= Speed;
if (rx<0) then
x:= x-random(round(abs(rx)));
if (rx>-1) then
x:= x+random(rx);
if (ry<0) then
y:= y-random(round(abs(ry)));
if (ry>-1) then
y:= y+random(ry);
repeat
C:= C+1;
getmousepos(sx, sy);
Distance1:=round(sqrt(sqr(sx-x)+sqr(sy-y)));
Moves:= Distance1/MouseJumps;
DistX:= x-sx;
DistY:= y-sy;
if (Moves<1) then break;
nx:= DistX/Moves;
ny:= DistY/Moves;
begin
if random(4000)=1 then
begin
repeat
t:= t+1;
getmousepos(x1,y1);
wait(50+random(50));
if random(15)=1 then
movemouse(x1-1+random(2), y1-1+random(2));
until(t>20+random(50));
end;
getmousepos(cx, cy);
if random(Winds)=1 then
begin
if Wind=false then
begin
p:= random(10)+2;
Wind:=true;
end;
end;
if Wind=true then
begin
p:=p-1;
if (p<0) then
Wind:= False;
end;
if Wind= true then
begin
movemouse(nx+cx-Gravity*3+random(Gravity*6), ny+cy-Gravity*3+random(Gravity*6));
end else
begin
movemouse(nx+cx-Gravity+random(Gravity*2), ny+cy-Gravity+random(Gravity*2));
end;
GetMousePos(tx, ty);
if Distance(tx, ty, x, y) < 100 then
if Random(8) = 0 then
Speed:= Speed + 1;
Wait(Speed + Random(RandomSpeed));
end;
until(false);
movemouse(x, y);
end;




begin
MMCircle(450, 450, 0, 0, 2 + Random(2), 15);
AlmMousePath(450, 450, 0, 0, 1, 1, 1, 5, 100);
end.

——————————————————
<!– END TEMPLATE: formanswers –>

Harry

2008-03-01 14:39:25

Those are some nice procedures :), I am won't vote for now.. Please make some RuneScape scripts. :rolleyes:

almost

2008-03-01 15:39:51

Oh does having a RuneScape script affect your chances?
Because like i said my actual scripts are outdated and not to mention run on the SRL include plus my own include.
So it would be lots of trouble posting my RS scripts…

Harry

2008-03-01 15:42:17

RS scripts are usually the best type of scripts to post, along with those other ones :D

[-jesus-]

2008-03-01 15:43:53

Rs scripts would definitly help… Srl mainly wants ppl who dont just stop scripting & sorta go quiet once they reach members(I kind of did this & then quit rs after =/, still try to be active tho)

almost

2008-03-01 16:10:00

Ok here are some scripts i used to use.
Im getting back into RS autoing now and updating them.
So im not sure what works and doesnt right now.
So it is for viewing purposes.

These are the only scripts i used, so they all worked great
They are multiplayer and use SRL

WoodCutter-
program MegaChopper;

var
LogDTM, AxeDTM, ChopDTM, BankerDTM, BankDTM, LogsDropped, Exp, Tx, Ty,
c1, c2, c3, c4, c5, Ents, Bank, TimesBanked, BrokenAxes, AxesAttached:integer;
NewAxe, FightCheck:boolean;
Loc:string;

const
TreeType= 'Willow';
TreeColor= 2971728;
StartingPlayer= 0;
Loads= 50;
BankLogs= true;
Banking= true;



procedure SetUpPlayers;
begin

//i took this out to post the script

end;



procedure TreeExp;
begin
if TreeType= 'Evergreen' then Exp := 25;
if TreeType= 'Tree' then Exp := 25;
if TreeType= 'Oak' then Exp := 37;
if TreeType= 'Willow' then Exp := 62;
if TreeType= 'Maple' then Exp := 100;
if TreeType= 'Mahogany' then Exp := 125;
if TreeType= 'Yew' then Exp := 175;
if TreeType= 'Magic' then Exp := 250;
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure ProgressReport;
begin
WriteLn(' ');
WriteLn(' ');
WriteLn(' ');
WriteLn('<==== Mega Chopper Progress Report ====>');
writeln('Current Player- '+ PlayerName[CurrentPlayer]);
writeln('Worked for ' + TimeRunning);
WriteLn('Current player banked '+IntToStr(Banked[CurrentPlayer])+' loads.');
WriteLn('Total banks- '+IntToStr(TimesBanked)+'.');
if BankLogs = false then
writeln('Dropped ' + IntToStr(LogsDropped) + ' logs.');
if BankLogs = false then
writeln('Gained ' + IntToStr(LogsDropped * Exp) + ' Exp.');
if BankLogs = true then
writeln('Gained ' + IntToStr((Banks * 28) * Exp) + ' Exp.');
if Ents>0 then
writeln('Ents encountered- ' + IntToStr(Ents));
if Talked>0 then
writeln('Talked '+IntToStr(Talked)+' times.');
if Emotes>0 then
writeln('Used and emote '+IntToStr(Emotes)+' times.');
if Songs>0 then
writeln('Changed songs '+IntToStr(Songs)+' times.');
if AxesAttached>0 then
writeln('Attached axe head ' + IntToStr(AxesAttached) + ' times.');
if BrokenAxes>0 then
writeln('Broke ' + IntToStr(BrokenAxes) + ' axes.');
WriteLn('<=======================================>');
SRLRandomsReport;
end;





procedure SetLocation;
begin
if FindColorTolerance(x, y, Bank, 627, 79, 670, 113, 20) then
begin
Loc:= 'bank';
Writeln('You are at the bank.');
end else
begin
Loc:= 'trees';
Writeln('You are at the trees.');
end;
end;





procedure FindAxe;
var c, AxeHeadDTM, AxeHandleDTM, BrokenAxeDTM, Tries:integer;
Found:boolean;
begin
AxeHeadDTM := DTMFromString('78DA632C616060506640014559590C2780342' +
'310FF070246901A350634C0C820025503E6E5010915026A40E6C8' +
'1350530E241408A8A9C47433869A3220A14A404D0111FE02A951C' +
'2AF060009D50C11');

AxeHandleDTM := DTMFromString('78DA635CC8C0C0A0C48002EAE2F9184E00694' +
'620FE0F048C20351A0C6880914104AA06CC5B0A24E409A8590924' +
'4409A8590224A408A8990F249409A89943849B416A7409A859002' +
'4B408A859012424F0AB0100B19B0E26');

BrokenAxeDTM := DTMFromString('78DA63EC6460605067400175A5A50C2780342' +
'310FF0702C63E20438D010D3032C841D580793D404293809A5E20' +
'A145404D07116A9A808432013575404297809A7A20614E849B75F' +
'0AB0100064A0D78');

c := CreateBitmapMaskFromText('not have an axe', SmallChars);
if (FindBitmapMaskTolerance(c, x, y, 7, 352, 176, 438, 10, 85)) then
begin
MakeCompass('w');
wait(50);
MakeCompass('w');
CurrentAngle:= 'w';
Tries:= 0;
if EquipAxe= true then
begin
GameTab(5);
if FindDTM(BrokenAxeDTM, x, y, 570, 285, 615, 325) then
begin
WriteLn('Axe is broken.');
NewAxe:= true;
exit;
end;
if FindDTM(AxeDTM, x, y, 560, 280, 625, 330) then
begin
exit;
end else
cl(582, 296, 10, 10, true);
end;
if EquipAxe= false then
begin
GameTab(4);
if FindDTM(BrokenAxeDTM, x, y, 545, 200, 750, 475) then
begin
WriteLn('Axe is broken.');
NewAxe:= true;
BrokenAxes:= BrokenAxes + 1;
exit;
end;
if FindDTM(AxeDTM, x, y, 560, 281, 625, 332) then
exit;
end;
GameTab(4);
//Main Repeat\\
repeat
if InvFull then
begin
repeat
FindDTM(LogDTM, x, y, 552, 200, 748, 466);
cl(x, y, 3, 3, false);
w(300, 300);
ChooseOption(x, y, 'rop');
w(1000, 500);
until(not(InvFull));
end;
if (Tries>0) then
begin
if SpiralColor(648, 83, 241, 0, 15) then
begin
cl(x+2, y+2, 3, 3, true);
wait(1000);
Flag;
wait(500);
end;
end;
if FindObjSpiralMulti(267, 171, Head, Head2, Head3, 18, 6, 'axe') then
begin
cl(x, y, 1, 1, true);
w(500, 0);
Flag;
w(800, 500);
if FindDTM(AxeHeadDTM, x, y, 550, 208, 746, 469) then
begin
WriteLn('Found axe head!');
Found:= true;
break;
end;
end else
begin
WriteLn('Axe head not found, rotating camera.');
Tries:= Tries+1;
RandomAngle;
end;
if (Tries>0) then
WriteLn('Tried ' + IntToStr(Tries) + ' times.');
if (Tries>5) then
WriteLn('Took too many tries.');
until(Tries>5);
//Ending Main Repeat\\
if Found then
begin
GameTab(4);
c:= 0;
//Attaching head loop\\
repeat
c:= c+1;
if (c>10) then
begin
WriteLn('Tried attaching head too many times.');
TerminateScript;
end;
FindDTM(AxeHeadDTM, x, y, 550, 208, 746, 469);
cl(x, y, 3, 3, true);
FindDTM(AxeHandleDTM, x, y, 550, 208, 746, 469);
cl(x, y, 3, 3, true);
w(1000, 600);
if FindDTM(AxeDTM, x, y, 550, 208, 746, 469) then
begin
WriteLn('Axe head attached!');
AxesAttached:= AxesAttached + 1;
end;
until(FindDTM(AxeDTM, x, y, 550, 208, 746, 469));
//Ending attaching head loop\\
end else
begin
WriteLn('Could not find axe head.');
NewAxe:= true;
end;
end;
FreeDTM(AxeHandleDTM);
FreeDTM(AxeHeadDTM);
FreeDTM(BrokenAxeDTM);
MakeCompass('w');
w(100, 50);
MakeCompass('w');
end;





procedure SetTreeSpot;
begin
GetMousePos(Tx, Ty);
c1:= GetColor(Tx, Ty);
c2:= GetColor(Tx-5, Ty);
c3:= GetColor(Tx+5, Ty);
c4:= GetColor(Tx, Ty+5);
c5:= GetColor(Tx, Ty-5);
end;




procedure Ent;
var c:integer;
begin
if FindColorTolerance(x, y, 518891, 4, 4, 124, 28, 50) then
begin
GetMousePos(x, y);
Cl(x, y, 1, 1, false);
w(700, 300);
if FindDTM(ChopDTM, x, y, x-200, y-200, x+200, y+200) then
begin
writeln('Ent found!');
Ents:= Ents+1;
repeat
c:= c+1;
cl(645, 79, 10, 10, true);
wait(150+random(50));
if (c>10) then
begin
writeln('Too many clicks.');
TerminateScript;
end;
until(Findcolor(x, y, 255, 623, 68, 679, 105));
Talk('ent');
c:= 0;
repeat
c:= c+1;
w(500, 50);
//RandomStuff('woodcutting');
until(c>50);
end else
ChooseOption(x, y, 'Examine');
end;
end;




function TreeIsGone: Boolean;
begin
if FindColorTolerance(x, y, 518891, 4, 4, 124, 28, 50) then
Ent;
if not FindColorTolerance(x, y, 14277637, 4, 4, 162, 40, 50) then
Result:= true;
end;




function TreeIsGone2: Boolean;
begin
if not FindColorTolerance(x, y, c1, Tx-2, Ty-2, Tx+2, Ty+2, 10) then
Result:= true;
if not FindColorTolerance(x, y, c2, Tx-7, Ty-2, Tx-3, Ty+2, 10) then
Result:= true;
if not FindColorTolerance(x, y, c3, Tx+3, Ty-2, Tx+7, Ty+2, 10) then
Result:= true;
if not FindColorTolerance(x, y, c4, Tx-2, Ty+3, Tx+2, Ty+7, 10) then
Result:= true;
if not FindColorTolerance(x, y, c5, Tx-2, Ty-7, Tx+2, Ty-3, 10) then
Result:= true;
end;




procedure GetAxeColors;
begin
GameTab(4);
w(300, 100);
if FindDTM(AxeDTM, x, y, 551, 206, 752, 467) then
begin
Head := GetColor(x+1, y);
Head2 := GetColor(x-2, y);
Head3 := GetColor(x+1, y+1);
EquipAxe:= False;
WriteLn('Axe Colors- ' + IntToStr(Head) + ', ' + IntToStr(Head2) +
', ' + IntToStr(Head3) + '.');
end
else
begin
GameTab(5);
w(300, 100);
if FindDTM(AxeDTM, x, y, 560, 281, 625, 332) then
begin
Head := GetColor(x+1, y);
Head2 := GetColor(x-2, y);
Head3 := GetColor(x+1, y+1);
EquipAxe:= True;
WriteLn('Axe Colors- ' + IntToStr(Head) + ', ' + IntToStr(Head2) +
', ' + IntToStr(Head3) + '.');
end
else
begin
WriteLn('Axe not found.');
TerminateScript;
end;
end;
GameTab(4);
end;





function HeadIsGone:boolean;
begin
if FindBlackInChat(404, 426) then
if FindBlackInChat(338, 418) then
if FindBlackInChat(191, 430) then
if FindBlackInChat(338, 417) then
if FindBlackInChat(362, 419) then
begin
writeln('Axe head is gone!');
Result:= true;
end;
end;




procedure FindColors;
var c:integer;
begin
SymbolAccuracy:=0.5;
repeat
c:=c+1;
if (c>10) then
begin
writeln('Bank Color not found.');
TerminateScript;
end;
Bank:= GetSymbolColor(x, y, 'bank');
if Bank=0 then
wait(1000);
until(Bank>0);
writeln('Bank Color- ' + inttostr(Bank));
FindWaterColor;
end;





//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure PowerChop;
var c:integer;
begin
if not FindColorTolerance(x, y, TreeColor, 50, 42, 468, 294, 10) then
begin
writeln('Waiting for the tree to come back.');
repeat
c:= c+1;
w(500, 50);
//RandomStuff('woodcutting');
if not LoggedIn then
begin
writeln('Logged out while waiting');
LogIn;
end;
if (c>80) then
begin
writeln('No trees found, timed out.');
TerminateScript;
end;
until (FindColorTolerance(x, y, TreeColor, 50, 42, 468, 294, 10));
end;
if Fighting then
begin
FightCheck:= true;
exit;
end;
if FindObjSpiral(250, 174, TreeColor, 10, 15, TreeType) then
if FindColorTolerance(x, y, 518891, 4, 4, 124, 28, 50) then
begin
Ent;
end else
begin
//SetTreeSpot;
cl(x, y, 1, 1, true);
flag;
w(500, 300);
Ent;
repeat
c:= c+1;
w(100, 10);
Chat;
if Fighting then
begin
FightCheck:= true;
exit;
end;
//RandomStuff('woodcutting');
GainedLvl;
if InvFull then
break;
Run;
if (c>200) then
writeln('waited too long for tree');
until TreeIsGone or (c>200);
FindAxe;
end
else
w(3000, 3000);
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure DropLogs;
var i, Row, Col, lx, ly: integer;
begin
if BankLogs = false then
begin
if NewAxe then
if not FindDTM(AxeDTM, x, y, 551, 206, 752, 467) then
begin
WriteLn('No axes left.');
TerminateScript;
end;
repeat
for i:= 1 to 28 do
begin
row := i div 4;
col := i - (row * 4) - 1;
if (col < 0) then
begin
col := 3;
row := row - 1;
end;
lx := 536 + ((col + 1) * 42) + Random(7);
ly := 184 + ((row + 1) * 36) + Random(7);
if FindDTM(LogDTM, x, y, lx-20, ly-20, lx+20, ly+20) then
begin
LogsDropped:= LogsDropped+1;
cl(x-5, y-5, 10, 10, false);
w(50, 50);
if (y<402) then
cl(x-5, y+40, 10, 5, true);
if (y>402) and (y<419) then
cl(x-5, y+15, 10, 5, true);
if (y>432) and (y<459) then
cl(x-5, y-15, 10, -5, true);
w(50, 50);
end;
end;
until not FindDTM(LogDTM, x, y, 557, 206, 747, 464);
ProgressReport;
end;
end;




procedure PSBank;
var c:integer;
Bank: boolean;
begin
move(100, 100, 0, 0);
if FindDTM(BankDTM, x, y, 70, 5, 414, 205) then
begin
cl(x-5, y-5, 30, 10, false);
w(100, 50);
if (ChooseOption(x, y, 'quickly')) then
begin
writeln('Found the bank!');
Bank:= true;
Flag;
w(300, 300);
end;
end;
if not (Bank) then
begin
Flag;
w(100, 100);
repeat
c:= c+1;
NeilBank(5593184);
until(c>4) or (BankScreen);
end;
end;




procedure ChangePlayers;
var c:integer;
begin
repeat
c:= c+1;
CurrentPlayer:= CurrentPlayer+1;
if CurrentPlayer>=6 then
CurrentPlayer:= StartingPlayer;
if (c>10) then
begin
writeln('No active players.');
Terminatescript;
end;
until(Active[CurrentPlayer]=true);
SetLocation;
LogNextPlayer;
SetScreenName(NickName[CurrentPlayer]);
banked[CurrentPlayer]:=0;
GetAxeColors;
MakeCompass('w');
w(100, 100);
MakeCompass('w');
Run;
end;





procedure TreesToBank;
var c:integer;
begin
if BankLogs = true then
begin
MakeCompass('w');
w(50, 50);
MakeCompass('w');
if not FindColorTolerance(x, y, Bank, mmx1, mmy1, mmx2, mmy2, 10) or
not FindDTM(BankerDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
cl(672, 80, 15, 15, true);
wait(500);
NFlag(0);
end;
FindColorTolerance(x, y, Bank, mmx1, mmy1, mmx2, mmy2, 10);
FindDTM(BankerDTM, x, y, x-50, y-50, x+20, y+20);
cl(x+5, y+6, 8, 8, true);
wait(500);
NFlag(0);
w(100, 500);
//PSBank;
repeat
c:= c+1;
NeilBank(5593184);
until(c>4) or (BankScreen);
if NewAxe then
begin
if (InvFull) then
begin
repeat
FindDTM(LogDTM, x, y, 550, 193, 742, 471);
cl(x, y, 3, 3, true);
w(1000, 400);
until(not (InvFull));
end;
cl(577, 222, 3, 3, true);
if FindDTM(AxeDTM, x, y, 57, 54, 489, 301) then
begin
repeat
cl(x, y, 3, 3, true);
w(2000, 600);
until(FindDTM(AxeDTM, x, y, 550, 193, 742, 471));
end else
begin
writeln('No axes left.');
TerminateScript;
end;
end;
if Banking= true then
if EquipAxe= false then
begin
OptionItemExcept(1, 'All');
end else
OptionItemExcept(0, 'All');
Banked[CurrentPlayer]:= Banked[CurrentPlayer]+1;
TimesBanked:= TimesBanked+1;
if (Banked[CurrentPlayer]>=Loads) then
writeln('Enough loads done, switching players.');
if (Banked[CurrentPlayer]>=Loads) then
ChangePlayers;
if (Banked[CurrentPlayer]>=Loads) then
exit;
ProgressReport;
Loc:= 'bank';
end;
end;




procedure BankToTrees;
begin
FindColorTolerance(x, y, Bank, mmx1, mmy1, mmx2, mmy2, 10);
FindDTM(BankerDTM, x, y, x-50, y-50, x+20, y+20);
cl(x-15, y-15, -10, -10, true);
wait(500);
NFlag(2+random(3));
if NewAxe then
begin
NewAxe:= false;
GetAxeColors;
if EquipAxe then
begin
FindDTM(AxeDTM, x, y, 554, 204, 742, 471);
cl(x, y, 3, 3, true);
end;
end;
Loc:= 'trees';
end;





//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure SetUp;
begin
ChopDTM := DTMFromString('78DA636C60606050654001FFFF33308800694' +
'630FBFF7FC61620431DB71A10600499A3CB800150D45403096D02' +
'E6541161571BA6391876B512615707905021A0A69308355D40428' +
'D807B40E6E81030A71748681250D387195F18764D20C2AEC94042' +
'8F012B80AB99863D9C51D44C02121A04EC9A4084BF6601092D027' +
'6CD20C2AE9944C4FB1C22D4CC25C2CDF3B0A77964370300434936' +
'BA');

LogDTM := DTMFromString('78DA63AC60606038C480026AE22D184E00694' +
'620FE0F048CA540C6560634C0884402E974207190809A2A20719C' +
'809A0620B18D809A16207198809A6C20B193809A7C207112BF1A0' +
'0E8880F95');

AxeDTM := DTMFromString('78DA636C66606030634001D545450C2780342' +
'310FF0702C62620C38A010D3032C841D580796D40C29A809A7620' +
'614A404D1D903022A0A68208BBAA80842301352540C20DBF1A004' +
'3820CD7');

BankerDTM := DTMFromString('78DA639CC1C0C0A0CD00062C108AE1CF1F260' +
'61120CD08C4FF8180710E7E3520C0B8840835D38184327E35000A' +
'D20F60');

{BankDTM := DTMFromString('78DA63BCCEC0C0D0C700061C108A212122944' +
'10E483302F17F20605C0964F8A3AA11151282AB0101C67340C20D' +
'55CDF973C751D52800593604D4BC0012DDA86A7CAD3851D51CC37' +
'473901DAA1A006D4B12B9');}

BankDTM := DTMFromString('78DA6364636460E86200033608C5909010CDA' +
'001A481320CFF8180F13690E189AA46545010AE06041899812C07' +
'5435D7AE9D4751030068700A53');

SetUpSRL;
SetUpPlayers;
LogIn;
MakeCompass('w');
w(100, 100);
MakeCompass('w');
SetLocation;
Run;
FindColors;
SetScreenName(NickName[CurrentPlayer]);
GetAxeColors;
TreeExp;
LoadSkill('woodcutting');
CurrentPlayer:= StartingPlayer;
end;





begin
SetUp;
repeat
if Loc= 'trees' then
begin
ResumeFindingRandoms;
repeat
PowerChop;
if NewAxe then
break;
if FightCheck then
break;
until(InvFull);
StopFindingRandoms;
end;
if Loc= 'trees' then
DropLogs;
if Loc= 'trees' then
TreesToBank;
if Loc= 'bank' then
BankToTrees;
until(false);
end.


Guild Miner-
program GuildMiner;
{<====================================================>
Worked for 1 Day, 16 Hours, 33 Minutes and 50 Seconds
Banked 4552 Ores.
| OldMen Solved : 3 |
| Pickaxe[s] Attached : 5 |
| Dwarf[s] Solved : 6 |
| Rick[s] Solved : 2 |
| Fight Random[s] : 6 |
| Boxe[s] Solved : 3 |
| SandWich[es] Solved : 1 |
| Capn Hand[s] Solved : 2 |
| Certer[s] Missed : 1 |
| Lamp[s] Solved : 2 |
<=====================================================>}



const
StartWait = 0; //Minutes to wait for script to begin
Loads = 500; //Number of loads before switching user.

const
RotateTime= 1;
ChatTime= 15;
RightClickTime= 8;
SwitchTabTime= 10;
MoveTime= 8;
SongTime= 15;
EmoteTime= 30;
TalkTime= 15;
CheckExpTime= 10;


var
CurrentPlayer, StartTime, RunTime, Mark, RightClickM, Ore,
SwitchTabM, MoveM, SongM, EmoteM, TalkM, ChatM, CheckExpM, Fight,
hc1, hc2, hc3, hc4, hc5, PickAxeAttached, Fights, ST, fb1,
fb2, fb3, Banks, TotalOres, Gasses, RotateM, CurrentLevel: integer;

//Colors
MapOreColor, LadderColor, RoadColor, WaterColor, BankColor,
MapPickColor: integer;

SymbolAccuracy: Extended;

Change, NoPick: boolean;

SkillFight, CurrentSkill: string;

PlayerName: Array [0..6] of string;
Pass: Array [0..6] of string;
NickName: Array [0..6] of string;
Location: Array [0..6] of string;
Active: Array [0..6] of boolean;
Equip: Array [0..6] of boolean;
Banked: Array [0..6] of integer;


procedure SetUpPlayers;
begin
//i took this out to post it
end;




function Distance(x1, y1, x2, y2: Integer): Integer;
begin
Result := Round(Sqrt(Sqr(x1 - x2) + Sqr(y1 - y2)));
end;




procedure CircleMouse(cx, cy, StartAngle, EndAngle, Radius, Speed:integer);
var
i: integer;
begin
if (StartAngle < EndAngle) then
for i := StartAngle to EndAngle do
begin
MoveMouse(Round(Sin(i * Pi / 180) * Radius) + cx,
Round(Cos(i * Pi / 180) * -Radius) + cy);
Wait(Random(Speed));
end;
if (StartAngle > EndAngle) then
for i := StartAngle downto EndAngle do
begin
MoveMouse(Round(Sin(i * Pi / 180) * Radius) + cx,
Round(Cos(i * Pi / 180) * -Radius) + cy);
Wait(Random(Speed));
end;
end;




function FindAngle(cx, cy, x, y, Radius: integer): integer;
var
i: integer;
begin
for i:= 1 to 10 do
for Result := 0 to 360 do
if Abs(((Round(Sin(Result * Pi / 180) * Radius) + cx) - x)) < i then
if Abs(((Round(Cos(Result * Pi / 180) * -Radius) + cy) - y)) < i then
Exit;
Result:= -1;
WriteLn('Error finding angle.');
end;




function FindPoint(x1, y1, x2, y2: integer; Curve: Extended; Left: boolean): TPoint;
var
Dist, x3, y3, Radius: integer;
begin
Radius:= (Round(Sqrt(Sqr(x1 - x2) + Sqr(y1 - y2)) * Curve));
Dist:= Round(Sqrt(Sqr(x2-x1) + Sqr(y2-y1)));
x3:= ((x1 + x2) / 2);
y3:= ((y1 + y2) / 2);
case Left of
True:
begin
Result.x:= Round(x3 + Sqrt(Sqr(Radius) - (Sqr(Dist / 2))) * (y1 - y2) / Dist);
Result.y:= Round(y3 + Sqrt(Sqr(Radius) - (Sqr(Dist / 2))) * (x2 - x1) / Dist);
end;
False:
begin
Result.x:= Round(x3 - Sqrt(Sqr(Radius) - (Sqr(Dist / 2))) * (y1 - y2) / Dist);
Result.y:= Round(y3 - Sqrt(Sqr(Radius) - (Sqr(Dist / 2))) * (x2 - x1) / Dist);
end;
end;
end;




function RandomExtended(Low, High, Digits: integer): Extended;
var
Number: string;
i: integer;
begin
Number:= '0.' + FloatToStr(RandomRange(Low, High));
for i:= 1 to (Digits - 1) do
Number:= Number + IntToStr(Random(10));
Result:= StrToFloat(Number);
end;




procedure CircleMousePath(x, y, rx, ry, Points, Speed, Gravity: integer; Curve: Extended);
var
sx, sy, Dist, i, mx, my: integer;
SAngle, EAngle, Cpx, Cpy, r: array [1..10] of integer;
Point: array [1..10] of TPoint;
Left: boolean;
begin
case Random(2) of
0:
Left:= true;
1:
Left:= false;
end;
GetMousePos(sx, sy);
Dist:= Round(Sqrt(Sqr(x - sx) + Sqr(y - sy)));
Cpx[1]:= sx;
Cpy[1]:= sy;
mx:= (x - sx) / Points;
my:= (y - sy) / Points;
for i:= 2 to Points + 1 do
begin
Curve:= Curve - 0.3 + (RandomExtended(0, 3, 2) * 2);
if (Curve <= 0.5) then
Curve:= 0.6;
if (i <> Points + 1) then
begin
Cpx[i]:= Cpx[i - 1] + mx - Gravity + Random(Gravity * 2);
Cpy[i]:= Cpy[i - 1] + my - Gravity + Random(Gravity * 2);
end else
begin
Cpx[i]:= x + Random(rx);
Cpy[i]:= y + Random(ry);
end;
r[i]:= (Round(Sqrt(Sqr(Cpx[i] - Cpx[i - 1]) + Sqr(Cpy[i] - Cpy[i - 1])) * Curve));
Point[i]:= FindPoint(Cpx[i], Cpy[i], Cpx[i - 1], Cpy[i - 1], Curve, Left);
SAngle[i]:= FindAngle(Point[i].x, Point[i].y, cpx[i - 1], cpy[i - 1], r[i]);
EAngle[i]:= FindAngle(Point[i].x, Point[i].y, cpx[i], cpy[i], r[i]);
if Left then
Left:= false else
Left:= true;
end;
for i:= 2 to Points + 1 do
begin
if Abs(SAngle[i] - EAngle[i]) <= 180 then
CircleMouse(Point[i].x, Point[i].y, SAngle[i], EAngle[i], r[i], Speed) else
if (SAngle[i] < EAngle[i]) then
CircleMouse(Point[i].x, Point[i].y, SAngle[i], -(360 - EAngle[i]), r[i], Speed) else
CircleMouse(Point[i].x, Point[i].y, SAngle[i], 360 + EAngle[i], r[i], Speed);
end;
end;





procedure MMCircle(x, y, rx, ry: integer);
var
Points, Gravity, Speed, Dist, Curve: Extended;
sx, sy: integer;
begin
if (rx < 0) then
x:= x - Random(Round(Abs(rx)));
if (rx > -1) then
x:= x + Random(rx);
if (ry < 0) then
y:= y - Random(Round(Abs(ry)));
if (ry > -1) then
GetMousePos(sx, sy);
Dist:= Sqrt(Sqr(x - sx) + Sqr(y - sy));
Points:= (1 * Dist) / 100;
Gravity:= (3 * Dist) / 100;
Curve:= (1 * Dist) / 100;
Speed:= (1.5 * Dist) / 100;
if (Points < 1) then
Points:= 1;
if (Gravity < 5) then
Gravity:= 5;
if (Curve < 0.7) then
Curve:= 0.7;
if (Speed < 1) then
Speed:= 1;
CircleMousePath(x, y, 0, 0, Round(Points), Round(Speed), Round(Gravity), Round(Curve));
end;




procedure AlmMousePath(x, y, rx, ry, Speed, RandomSpeed, Gravity,
MouseJumps, Winds:integer);
var
x1, y1, sx, sy, nx, ny, cx, cy, Distance1, DistX, DistY, Moves,
StartSpeed, t, C, p, Time, tx, ty:integer;
Wind:boolean;
begin
Wind:= false;
c:= 1;
Speed:= Speed + Random(RandomSpeed);
StartSpeed:= Speed;
Time:= Speed;
if (rx<0) then
x:= x-random(round(abs(rx)));
if (rx>-1) then
x:= x+random(rx);
if (ry<0) then
y:= y-random(round(abs(ry)));
if (ry>-1) then
y:= y+random(ry);
repeat
C:= C+1;
getmousepos(sx, sy);
Distance1:=round(sqrt(sqr(sx-x)+sqr(sy-y)));
Moves:= Distance1/MouseJumps;
DistX:= x-sx;
DistY:= y-sy;
if (Moves<1) then break;
nx:= DistX/Moves;
ny:= DistY/Moves;
begin
if random(4000)=1 then
begin
repeat
t:= t+1;
getmousepos(x1,y1);
wait(50+random(50));
if random(15)=1 then
movemouse(x1-1+random(2), y1-1+random(2));
until(t>20+random(50));
end;
getmousepos(cx, cy);
if random(Winds)=1 then
begin
if Wind=false then
begin
p:= random(10)+2;
Wind:=true;
end;
end;
if Wind=true then
begin
p:=p-1;
if (p<0) then
Wind:= False;
end;
if Wind= true then
begin
movemouse(nx+cx-Gravity*3+random(Gravity*6), ny+cy-Gravity*3+random(Gravity*6));
end else
begin
movemouse(nx+cx-Gravity+random(Gravity*2), ny+cy-Gravity+random(Gravity*2));
end;
GetMousePos(tx, ty);
if Distance(tx, ty, x, y) < 100 then
if Random(8) = 0 then
Speed:= Speed + 1;
Wait(Speed + Random(RandomSpeed));
end;
until(false);
movemouse(x, y);
end;




procedure Move(x, y, rx, ry:integer);
begin
if (rx >= 0) then
x:= x + Random(rx);
if (ry >= 0) then
y:= y + Random(ry);
if (rx < 0) then
x:= x - Random(Round(Abs(rx)));
if (ry < 0) then
y:= y - Random(Round(Abs(ry)));
case Random(3) of
0:
AlmMousePath(x, y, 0, 0, 1, 1, 1, 5, 100);
1:
MMCircle(x, y, 0, 0);
2:
MoveMouseSpline(x, y, 0, 0);
end;
end;





procedure Click(a, b, rx, ry: integer; Side: boolean);
begin
Move(a, b, rx, ry);
Wait(120 + Random(80));
GetMousePos(a, b);
HoldMouse(a, b, Side);
Case (Random(30)) of
1: a:= a + 1;
2: a:= a - 1;
3:
begin
a:= a + 1;
b:= b + 1;
end;
4:
begin
a:= a - 1;
b:= b - 1;
end;
5: b:= b - 1;
6: b:= b + 1;
7:
begin
a:= a - 1;
b:= b + 1;
end;
8:
begin
a:= a + 1;
b:= b - 1;
end;
end;
Wait(5 + Random(20));
MoveMouse(a, b);
Wait(5 + Random(20));
ReleaseMouse(a, b, Side);
Wait(80 + Random(80));
end;




function GetCurrentTab: Integer;
begin
if GetColor(542, 174) = 1778795 then
Result := 1;
if GetColor(572, 174) = 1778795 then
Result := 2;
if GetColor(599, 174) = 1976437 then
Result := 3;
if GetColor(632, 173) = 1976437 then
Result := 4;
if GetColor(665, 183) = 1647204 then
Result := 5;
if GetColor(698, 174) = 1976437 then
Result := 6;
if GetColor(732, 173) = 1976437 then
Result := 7;
if GetColor(567, 473) = 1910385 then
Result := 8;
if GetColor(600, 473) = 1910385 then
Result := 9;
if GetColor(629, 470) = 1778795 then
Result := 10;
if GetColor(667, 471) = 1910385 then
Result := 11;
if GetColor(699, 480) = 1647204 then
Result := 12;
if GetColor(731, 470) = 1910385 then
Result := 13;
end;




function GameTab(tabnumber: Integer): Boolean;
var
c: Integer;
begin
if GetCurrentTab = tabnumber then
begin
Result := True;
Exit;
end;
if not IsTextAtEx(185, 34, 'T', 30, upchars, True, False, 0, 0, -1) then
begin
case tabnumber of
1: if GetCurrentTab <> TabNumber then
begin
repeat Click(537, 179, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
2: if GetCurrentTab <> TabNumber then
begin
repeat Click(572, 179, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
3: if GetCurrentTab <> TabNumber then
begin
repeat Click(603, 178, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
4: if GetCurrentTab <> TabNumber then
begin
repeat Click(638, 179, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
5: if GetCurrentTab <> TabNumber then
begin
repeat Click(670, 179, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
6: if GetCurrentTab <> TabNumber then
begin
repeat Click(703, 177, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
7: if GetCurrentTab <> TabNumber then
begin
repeat Click(737, 179, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
8: if GetCurrentTab <> TabNumber then
begin
repeat Click(572, 477, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
9: if GetCurrentTab <> TabNumber then
begin
repeat Click(605, 478, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
10: if GetCurrentTab <> TabNumber then
begin
repeat Click(637, 479, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
11: if GetCurrentTab <> TabNumber then
begin
repeat Click(669, 476, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
12: if GetCurrentTab <> TabNumber then
begin
repeat Click(705, 478, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
13: if GetCurrentTab <> TabNumber then
begin
repeat Click(736, 476, 5, 5, True);
c := c + 1;
until (GetCurrentTab = tabnumber) or (c >= 3)
end;
end;
if (c < 3) then
begin
Result:= True;
Wait(500 + Random(700));
end;
end;
end;




procedure SetRun(run: Boolean);
begin
GameTab(11);
case run of
True: if (GetColor(657, 424) = 4606281) then
Click(647, 428, 8, 8, True);
False: if (GetColor(655, 425) = 2106253) then
Click(647, 428, 8, 8, True);
end;
GameTab(4);
end;




function LoggedIn: boolean;
begin
Result:= GetColor(760, 26) = 1848378;
end;




procedure W(Time, RandomTime: integer);
begin
Wait(Time + Random(RandomTime));
end;




procedure TypeByte(k: Byte);
begin
KeyDown(k);
Wait(10 + Random(50));
KeyUp(k);
end;




procedure TypeSend(Text: string);
var
i: Integer;
Shift: Boolean;
begin
for i := 1 to Length(Text) do
begin
Shift:= (Copy(Text,i,1)=':')or(Copy(Text,i,1)='!')or(Copy(Text,i,1)='+')or
(Copy(Text,i,1)='?')or(Copy(Text,i,1)='<')or(Copy(Text,i,1)='>')or
(Copy(Text,i,1)='@')or(Copy(Text,i,1)='#')or(Copy(Text,i,1)='$')or
(Copy(Text,i,1)='&')or(Copy(Text,i,1)='%')or(Copy(Text,i,1)='*');
if(Shift)then
begin
KeyDown(VK_Shift);
Wait(5 + Random(20));
end
TypeByte(GetKeyCode(Text[i]));
if(Shift)then
begin
KeyUp(VK_Shift);
Wait(5 + Random(20));
end
Wait(50 + Random(120));
end;
Wait(170 + Random(300));
TypeByte(13);
end;





procedure LogIn;
begin
if (not (LoggedIn)) then
begin
Click(433, 285, 10, 10, true);
w(200,300);
typesend(PlayerName[CurrentPlayer]);
w(200,300);
typesend(Pass[CurrentPlayer]);
Click(276, 315, 10, 10, true);
repeat
w(100,0);
until(getcolor(363, 332)=16777215);
Click(348, 325, 10, 10, true);
w(2000, 2000);
end;
end;





procedure LogNextPlayer;
begin
writeln('Logging in ' + (PlayerName[CurrentPlayer])+'.');
if GetColor(482, 40)=4282212 then
begin
move(482, 40, 3, 3);
w(100,100);
Click(482, 40, 3, 3, true);
wait(1000+random(500));
end;
GameTab(10);
Click(600, 371, 20, 10, true);
wait(10000+random(5000));
if not getcolor(312, 249)= 65535 then
begin
writeln('Could not find log in screen.');
TerminateScript;
end;
LogIn;
end;





procedure ChangePlayers;
var
c: integer;
begin
repeat
c:= c + 1;
CurrentPlayer:= CurrentPlayer + 1;
if (CurrentPlayer >= 6) then
CurrentPlayer:= 1;
if (c>10) then
begin
WriteLn('No active players.');
TerminateScript;
end;
until(Active[CurrentPlayer] = true);
LogNextPlayer;
SetRun(true);
end;




procedure MarkTime(var TimeMarker: Integer);
begin
TimeMarker := GetSystemTime;
end;





function TimeFromMark(var TimeMarker: Integer): Integer;
begin
Result := GetSystemTime - TimeMarker;
end;




function BankScreen: Boolean;
begin
Result := IsTextAtEx(184, 34, 'The Bank', 30, upchars, True, False, 0, 0,
-1);
end;




procedure Run;
begin
if (TimeFromMark(RunTime)>300000+random(10000)) or
(TimeFromMark(RunTime)=0) then
begin
SetRun(True);
w(0, 500);
GameTab(4);
w(0, 500);
MarkTime(RunTime);
end;
end;




function IsUpText(UpText: string): Boolean;
var
tempx, tempy: Integer;
begin
if (IsTextInAreaEx(1, 1, 334, 20, tempx, tempy, UpText, 100, upchars, True,
True, 0, 2, -1)) then
Result := True;
end;




function FindObj(var cx, cy: Integer; Text: string; color, tolerance: Integer):
Boolean;
var
x, y, a, c, i, x1, y1, x2, y2: Integer;
begin
if (FindColorTolerance(x, y, color, 5, 5, 515, 338, tolerance)) then
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (GetColor(422, 480) = 16777215)) then
break;
a := a + 1;
if (a = 1) then
c := c + 1;
if (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
end;
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end;
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end;
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
if (FindColorTolerance(x, y, color, x1, y1, x2, y2, tolerance)) then
begin
Move(x, y, 0, 0)
cx := x;
cy := y;
wait(50+random(50));
if (IsUpText(Text)) then
begin
Result := True;
Break;
end;
end;
end;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result = True);
end;
end;




function LoadingWait: boolean;
var
c: integer;
begin
Result:= false;
if (GetColor(11, 14) <> 16777215) or
(GetColor(12, 14) <> 0) then
begin
Result:= false;
Exit;
end;
repeat
Wait(1);
c:= c + 1;
if (c > 30000) then
begin
WriteLn('Loaded too long');
Result:= false;
Exit;
end;
until((GetColor(11, 14) <> 16777215) and (GetColor(12, 14) <> 0));
Wait(300 + Random(300));
Result:= true;
end;





function Lost(C1, C2, C3, C4, Tol: integer): boolean;
var
c, NotFound, x, y: integer;
begin
result:=false;
c:=0;
NotFound:=0;
if (C1<0) then
c:=c+1;
if (C2<0) then
c:=c+1;
if (C3<0) then
c:=c+1;
if (C4<0) then
c:=c+1;
repeat
if (C1>=0) then
if FindColorTolerance(x, y, C1, 562, 6, 724, 163, Tol) then
c:=c+1;
if (C2>=0) then
if FindColorTolerance(x, y, C2, 562, 6, 724, 163, Tol) then
c:=c+1;
if (C3>=0) then
if FindColorTolerance(x, y, C3, 562, 6, 724, 163, Tol) then
c:=c+1;
if (C4>=0) then
if FindColorTolerance(x, y, C4, 562, 6, 724, 163, Tol) then
c:=c+1;
if (c>=4) then
break;
if (c<4) then
wait(2000);
NotFound:= NotFound+1;
if (NotFound>5) then
begin
if not FindColorTolerance(x, y, C1, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c1) + ' was not found');
if not FindColorTolerance(x, y, C2, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c2) + ' was not found');
if not FindColorTolerance(x, y, C3, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c3) + ' was not found');
if not FindColorTolerance(x, y, C4, 562, 6, 724, 163, Tol) then
writeln('Player lost- Color ' + inttostr(c4) + ' was not found');
end;
if (NotFound>5) then
begin
Result:= true;
break;
end;
until(false);
end;




function RightColor(color:integer): boolean;
var
x, y, a, b: integer;
begin
getmousepos(a, b);
if findcolortolerance(x,y,color,a,b,a,b,50) then
Result := True;
end;




function SpiralColor(var x, y: integer; sx, sy, Color, Tolerance,
SearchSize:integer):boolean;
begin
if findcolorspiraltolerance(sx, sy, Color, sx-SearchSize, sy-SearchSize,
sx+SearchSize, sy+SearchSize, Tolerance) then
begin
result:=true;
x:= sx;
y:= sy;
end;
end;




procedure NFlag(Distance: integer);
var
x, y, c: integer;
SouthWalk: boolean;
begin
wait(150);
repeat
c:= c + 1;
wait(50);
if SpiralColor(x, y, 648, 83, 255, 0, 4) then
SouthWalk:= true;
if SouthWalk= true then
if (Distance>0) then
begin
if SpiralColor(x, y, 648, 83, 284358, 0, Distance) then
begin
wait(100+random(40));
exit;
end;
end;
if SouthWalk= false then
begin
if SpiralColor(x, y, 648, 83, 284358, 0, Distance) then
begin
wait(20+random(10));
exit;
end;
end;
if random(40)=1 then
move(470, 0, 300, 220);
until(c>300) or not findcolor(x, y, 284358, 563, 5, 728, 161);
end;




function FindText(var cx, cy: Integer; txt: string; font, xs, ys, xe, ye:
Integer): Boolean;
var
S: Integer;
begin
S := CreateBitmapMaskFromText(txt, font);
if xs <= 0 then xs := 0;
if ys <= 0 then ys := 0;
Result := FindBitmapMaskTolerance(S, cx, cy, xs, ys, xe, ye, 10, 50);
FreeBitmap(S);
end;




function ChooseOption(x, y: Integer; txt: string): Boolean;
var
x1, y1, x2, y2, LeftCorner, RightCorner: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
begin
Result := True;
Click(x + Length(txt) * 3, y + 3, 2, 2, True);
end
else
begin
GetMousePos(x, y);
Move(x - 20, y - 30, 40, -20);
W(500, 500);
end;
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;




function FindCompassAngle: integer; // By Tarajunky
var
x, y, i, Radius, X1, Y1: Integer;
begin
Radius:=7;
repeat
for i := 1 to 360 do
begin
x1 := Round(Radius * Sin(i)) + 561;
y1 := Round(-Radius * Cos(i)) + 20;
if i>180 then x1:=x1-1;
if (FindColor(x, y, 723587, X1, Y1, X1+1, Y1+1)) then
begin
Result:=360-i;
Exit;
end;
end;
Radius := Radius - 1;
until Radius <= 2;
WriteLn(IntToStr(result));
Writeln('Error detecting Compass Angle.');
Result:=-1;
end;




procedure AllignPerfect(North: boolean);
var
c, x, y, Left, Right: integer;
begin
repeat
if not North then
begin
x:= 561;
y:= 7;
if FindColorSpiral(x, y, 920735, 545, 1, 579, 13) then
begin
if (x = 561) then
Exit;
if (x > 561) then Left:= (Round(Sqrt(Sqr(x - 561) + Sqr(y - 7))) * 22)
else Right:= (Round(Sqrt(Sqr(x - 561) + Sqr(y - 7))) * 22);
end else
Exit;
end else
begin
x:= 561;
y:= 36;
if FindColorSpiral(x, y, 920735, 542, 27, 578, 39) then
begin
if (x = 561) then
Exit;
if (x > 561) then Right:= (Round(Sqrt(Sqr(x - 561) + Sqr(y - 33))) * 22)
else Left:= (Round(Sqrt(Sqr(x - 561) + Sqr(y - 33))) * 22);
end else
Exit;
end;
if (Left > 0) then
SendArrowWait(3, Left);
if (Right > 0) then
SendArrowWait(1, Right);
Wait(80 + Random(100));
if North then
if FindColor(x, y, 7176587, 559, 4, 564, 9) then
Exit;
if not North then
if FindColor(x, y, 7176587, 559, 32, 564, 37) then
Exit;
c:= c + 1;
if (c > 4) then
Exit;
until(false);
end;




{*******************************************************************************
function MakeCompass(Side: String);
By: Wizzup?
Description: Aligns RS to specified direction
direction: set to: North='n', South='s', East='e', West='w'
*******************************************************************************}

function MakeCompass(Side: string): Boolean;
var
Fx, Fy, dx, dy, StartPos, EndPos: Integer;
ComMark: Integer;
Left_Right: Boolean;
begin
StartPos := FindCompassAngle;
MarkTime(ComMark);
case LowerCase(Side) of
'n':
begin
Fx := 561;
Fy := 13;
if StartPos > 180 then EndPos := 360 else EndPos := 0;
end;
'e':
begin
Fx := 554;
Fy := 20;
if StartPos < 270 then EndPos := 90 else EndPos := 450;
end;
's':
begin
Fx := 561;
Fy := 27;
EndPos := 180;
end;
'w':
begin
Fx := 567;
Fy := 20;
if StartPos < 90 then EndPos := -90 else EndPos := 270;
end;
end;
if FindColor(dx, dy, 723587, Fx-2, Fy-2, Fx+2, Fy+2) then
begin
Result := True;
Exit;
end
if StartPos > EndPos then Left_Right := True
else if StartPos < EndPos then Left_Right := False
else exit;
if Left_Right then KeyDown(VK_RIGHT)
else KeyDown(VK_Left);
repeat
Wait(1);
if (FindColor(dx, dy, 723587, Fx, Fy, Fx, Fy)) then
begin
Result := True;
break;
end;
until (TimeFromMark(ComMark) > 7000);
if Left_Right then KeyUp(VK_Right)
else KeyUp(VK_Left);
Wait(100 + Random(80));
if Side = 'n' then
AllignPerfect(true) else
AllignPerfect(false);
end;




procedure PauseFindingRandoms;
begin
WriteLn(' ');
KeyDown(118);
wait(20);
KeyUp(118);
wait(20);
end;


procedure ResumeFindingRandoms;
begin
WriteLn(' ');
KeyDown(116);
wait(20);
KeyUp(116);
wait(20);
end;


procedure StopFindingRandoms;
begin
WriteLn('Turning off Find Randoms...');
WriteLn(' ');
KeyDown(117);
wait(20);
KeyUp(117);
wait(20);
end;




procedure ClickFF(x, y, rx, ry, mx, my: integer);
var
c: integer;
begin
repeat
Click(x, y, rx, ry, true);
Wait(80 + Random(50));
if FindColor(x, y, 255, 563, 6, 717, 159) then
Exit;
x:= x + mx;
y:= y + my;
until(c > 10);
end;




procedure FindMiddle(var x, y: integer; sx, sy, Color, x1, y1, x2, y2, Ht, Wt, Tol, Tol2: integer);
var
cx, cy, Left, Right, Top, Bottom, c: integer;
TheSaturation, H, S, L: extended;
begin
FindColorSpiralTolerance(sx, sy, Color, x1, y1, x2, y2, Tol);
cx:= sx;
cy:= sy;
ColortoHSL(GetColor(cx, cy), H, TheSaturation, L);
for c:= cx to (cx + Wt) do
begin
ColorToHSL(GetColor(c, cy), H, S, L);
if Round(Abs(TheSaturation - S)) > Tol2 then
begin
Right:= c;
Break;
end;
end;
for c:= cx downto (cx - Wt) do
begin
ColorToHSL(GetColor(c, cy), H, S, L);
if Round(Abs(TheSaturation - S)) > Tol2 then
begin
Left:= c;
Break;
end;
end;
x:= Left + ((Right - Left) / 2);
for c:= cy downto (cy - Ht) do
begin
ColorToHSL(GetColor(x, c), H, S, L);
if Round(Abs(TheSaturation - S)) > Tol2 then
begin
Top:= c;
Break;
end;
end;
for c:= cy to (cy + Ht) do
begin
ColorToHSL(GetColor(x, c), H, S, L);
if Round(Abs(TheSaturation - S)) > Tol2 then
begin
Bottom:= c;
Break;
end;
end;
y:= Top + ((Bottom - Top) / 2);
end;




function AngleMapWalk(xMod, yMod, Color, Tol, Rx, Ry,
StartAngle, EndAngle, StartRadius, EndRadius, NFlagDis:integer):boolean;
var
i, x2, y2, x, y:integer;
begin
result:=false;
if (StartAngle<EndAngle) and (StartRadius>EndRadius) then begin
repeat
if result= true then break;
for i := StartAngle to EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 643;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then
begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius - 5;
until(StartRadius<=EndRadius);
end;
if (StartAngle>EndAngle) and (StartRadius>EndRadius)then
begin
repeat
if result= true then break;
for i := StartAngle downto EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 643;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius - 5;
until(StartRadius<=EndRadius);
end;
if (StartAngle<EndAngle) and (StartRadius<EndRadius) then begin
repeat
if result= true then break;
for i := StartAngle to EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 643;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then
begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius + 5;
until(StartRadius>=EndRadius);
end;
if (StartAngle>EndAngle) and (StartRadius<EndRadius)then
begin
repeat
if result= true then break;
for i := StartAngle downto EndAngle do
begin
x2:= round (Sin(i * Pi / 180) * StartRadius) + 643;
y2:= round (cos(i * Pi / 180) * -StartRadius) + 83;
if findcolortolerance(x, y, Color, x2, y2, x2+1, y2+1, Tol) then begin
result:=true;
break;
end;
end;
StartRadius:= StartRadius + 5;
until(StartRadius>=EndRadius);
end;
if result=false then begin
x:=0; y:=0; end;
writeln(inttostr(x));
writeln(inttostr(x));
ClickFF(x, y, Rx, Ry, xMod, yMod);
NFlag(NFlagDis);
end;




procedure WM(Wait, RWait: integer);
var
a, m: integer;
begin
MarkTime(m);
repeat
w(300,200);
a:=random(4);
if a=3 then
move(42,42,600,350);
until TimeFromMark(m) > (wait + random(rwait));
end;




procedure song;
var
x, y: integer;
begin
Click(734,477,10,10,true);
w(800,800);
repeat
Click(726,290,10,100,true);
w(800,1000);
until(findcolor(x,y,65280,560,271,593,438));
Click(x,y+5,60,0,true);
wm(800,1000);
Click(635,177,10,10,true);
wm(800,1000);
end;




procedure Emote;
begin
gametab(12);
w(600, 800);
Click(572, 226, 140, 218, true);
w(100, 200);
gametab(4);
WriteLn('Used an emote!');
end;





procedure talk(skill:string);
var
a: integer;
Say: array [1..50] of string;
begin
if skill='mining' then
begin
Say[1] := 'mining lvls?';
Say[2] := 'mining levels?';
Say[3] := 'lvls?';
Say[4] := 'is rune the best pick?';
Say[5] := 'i need 1k coal...';
Say[6] := '....';
Say[7] := 'alskgjwareng';
Say[8] := 'i love stealing coal!';
Say[9] := 'mwahaha i steal coal!';
Say[10] := 'noobs';
Say[11] := ' ';
Say[12] := 'lol';
Say[13] := 'i own rocks';
Say[14] := 'i realy need to lvl up';
Say[15] := 'smithing lvls?';
Say[16] := 'yayz0rz!';
Say[17] := ' ';
Say[18] := 'w00t';
Say[19] := 'are rune bars the best';
Say[20] := 'what comes after coal';
Say[21] := 'i h8 mining';
Say[22] := 'mining is pretty boring';
Say[23] := 'i might make iron bars soon';
Say[24] := 'uggh';
Say[25] := 'slow rocks today';
Say[26] := 'bock bock!';
Say[27] := '+-=-+-=-+-=-+';
Say[28] := 'dumb roks';
Say[29] := 'cant wait to sell all my coal';
Say[30] := 'smith and mining lvls?';
a := Random(29) + 1;
TypeSend(Say[a]);
writeln('random chatted! ' + Say[a]);
w(200,100);
end;

if skill='fight' then
begin
Say[1] := 'aaahhh! a';
Say[2] := 'its a';
Say[3] := 'flee from the';
Say[4] := 'noo!!';
Say[5] := 'n000!!';
Say[6] := 'not a';
Say[7] := 'another';
Say[8] := 'uggh stupid';
Say[9] := 'uggh...';
Say[10] := 'i h8 u';
Say[11] := 'i hate you';
Say[12] := '!';
Say[13] := 'stupid ';
Say[14] := '';
Say[15] := 'im not fighting a';
Say[16] := 'i cant beat a';
Say[17] := 'you win mr';
Say[18] := 'scary';
Say[19] := 'its a scary';
Say[20] := 'omg a';
a := Random(20) + 1;
TypeSend(Say[a] + ' ' + SkillFight);
writeln('random chatted! ' + Say[a]);
w(200,100);
end;

if skill='buying' then
begin
Say[1] := 'no!!';
Say[2] := 'me buy too!';
Say[3] := 'ill never sell!';
Say[4] := 'not selling';
Say[5] := 'someone was selling... no nvm';
Say[6] := 'ur mom buys';
Say[7] := 'your mom buys';
Say[8] := 'you wish you could buy that!';
Say[9] := 'selling for 1m each';
Say[10] := 'no one sell!';
a := Random(9) + 1;
TypeSend(Say[a]);
writeln('Response- ' + Say[a]);
w(200,100);
end;


if skill='selling' then
begin
Say[1] := 'no!!';
Say[2] := 'me sell too!';
Say[3] := 'ill never buy!';
Say[4] := 'not buying';
Say[5] := 'someone was buying... no nvm';
Say[6] := 'ur mom sells';
Say[7] := 'your mom sells';
Say[8] := 'you wish you could sell that!';
Say[9] := 'buying for 1m each';
Say[10] := 'no one buy!';
a := Random(9) + 1;
TypeSend(Say[a]);
writeln('Response- ' + Say[a]);
w(200,100);
end;


if skill='name' then
begin
Say[1] := 'whachoo want?';
Say[2] := 'allo';
Say[3] := 'hello';
Say[4] := 'hi';
Say[5] := '?';
Say[6] := '!';
Say[7] := '!!';
Say[8] := 'no!!';
Say[9] := 'rarrrhghghhh!!';
Say[10] := 'rrarrghhhhhh!!';
Say[11] := ' ';
Say[12] := 'hu';
Say[13] := 'hu?';
Say[14] := 'wadup';
Say[15] := 'wadup?';
Say[16] := 'dats my name!';
Say[17] := 'yo';
Say[18] := 'y0';
Say[19] := 'what up';
Say[20] := '-';
a := Random(19) + 1;
TypeSend(Say[a]);
writeln('Response- ' + Say[a]);
w(200,100);
end;


if skill='lvl' then
begin
Say[1] := 'im the master of ' + CurrentSkill;
Say[2] := 'im lvl ' + IntToStr(CurrentLevel) + '!';
Say[3] := 'im lvl ' + IntToStr(CurrentLevel) + ' fooz!';
Say[4] := 'im lvl ' + IntToStr(CurrentLevel) + ' beat that';
Say[5] := 'im ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill;
Say[6] := 'almost ' + IntToStr(CurrentLevel + 1);
Say[7] := '10k from ' + IntToStr(CurrentLevel + 1);
Say[8] := 'im lvl ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill;
Say[9] := 'im level 1 ' + CurrentSkill;
Say[10] := 'im lvl 99 ' + CurrentSkill;
Say[11] := 'im lvl -1 ' + CurrentSkill;
Say[12] := 'ur all lvl 1 ' + CurrentSkill;
Say[13] := 'im lvl 100 ya! ' + CurrentSkill;
Say[14] := 'almost lvl ' + IntToStr(CurrentLevel + 1) + ' ' + CurrentSkill;
Say[15] := 'close to lvl ' + IntToStr(CurrentLevel + 1) + ' ' + CurrentSkill;
Say[16] := 'im pretty low ' + CurrentSkill;
Say[17] := 'not saying my ' + CurrentSkill + ' level';
Say[18] := 'you cant make me say my ' + CurrentSkill + ' level!';
Say[19] := 'my ' + CurrentSkill + ' is bad';
Say[20] := 'im a low lvl ' + CurrentSkill;
a := Random(19) + 1;
TypeSend(Say[a]);
writeln('Response- ' + Say[a]);
w(200,100);
end;

if skill='gainedlvl' then
begin
Say[1] := 'w00t ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill + '!';
Say[2] := 'woot' + IntToStr(CurrentLevel) + ' ' + CurrentSkill
Say[3] := 'finally' + IntToStr(CurrentLevel) + ' ' + CurrentSkill + '!!';;
Say[4] := 'woooot! lvl ' + IntToStr(CurrentLevel);
Say[5] := 'w00t! lvl ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill;
Say[6] := IntToStr(CurrentLevel) + ' ' + CurrentSkill + ' ftw!';
Say[7] := 'im ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill + ' ftw';
Say[8] := IntToStr(CurrentLevel) + ' ' + CurrentSkill + '! oh ya';
Say[9] := 'oh ya!' + IntToStr(CurrentLevel) + ' ' + CurrentSkill;
Say[10] := 'w00t! lvl ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill;
Say[11] := 'gained a ' + CurrentSkill + ' lvl';
Say[12] := 'gained a ' + CurrentSkill + ' lvl!!';
Say[13] := 'finally a ' + CurrentSkill + ' lvl';
Say[14] := 'up a ' + CurrentSkill + ' lvl woot!';
Say[15] := 'im ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill + '!';
Say[16] := 'i got' + IntToStr(CurrentLevel) + ' ' + CurrentSkill + '!';
Say[17] := 'now im ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill + '!';
Say[18] := IntToStr(99-CurrentLevel) + ' more lvls til 99 ' + CurrentSkill;
Say[19] := 'woot only ' + IntToStr(99-CurrentLevel) + ' more '
+ CurrentSkill + ' lvls until 99!';
Say[20] := 'w00t lvl ' + IntToStr(CurrentLevel) + ' ' + CurrentSkill + ' =p';;
a := Random(20) + 1;
TypeSend(Say[a]);
writeln('random chatted! ' + Say[a]);
w(200,100);
end;
end;




function GetLastChatText(var chat: string): Boolean;
var
textx, texty: Integer;
begin
if (IsTextInAreaEx(40, 415, 130, 415, textx, texty, ':', 0, smallchars, False,
True, 0, 0, 0)) then
begin
chat := LowerCase(Trim(GetTextAtEx(textx + 8, 415, 0, SmallChars, False,
False, 0, 1, 16711680, 40, False, tr_allChars)))
Result := True;
end;
end;




function LastChatter(var name: string): Boolean;
var
i: Integer;
begin
name := LowerCase(Trim(GetTextAtEx(21, 415, 0, SmallChars, False, False, 0, 0,
0, 50, False, tr_allChars)))
i := Pos(':', name)
if (i <> 0) then
begin
Delete(name, i, i);
Result := True;
end;
end;




function GetNewChatMsg: string;
begin
if (not (GetLastChatText(Result))) then
LastChatter(Result)
end;


function IsChatMessage(S: string): Boolean;
var
temp: string;
begin
temp := GetNewChatMsg;
if (Pos(S, temp) <> 0) then
Result := True
end;


function InChatMulti(Text1, Text2, Text3: string): Boolean;
var
temp: string;
begin
temp := GetNewChatMsg;
if (Pos(Text1, temp) <> 0) or (Pos(Text2, temp) <> 0) or (Pos(Text3, temp) <>
0) then
Result := True
end;



function FindChat:String;
begin
Result:= 'None';
if IsChatMessage('selling') then
Result:= 'selling';
if IsChatMessage('buying') then
Result:= 'buying';
if InChatMulti('lev', 'lvl', 'lvs') then
Result:= 'lvl';
if InChatMulti(NickName[CurrentPlayer], PlayerName[CurrentPlayer], NickName[CurrentPlayer]) then
Result:= 'name';
end;


procedure Chat;
var
ChatType: string;
begin
ChatType:= FindChat;
if ChatType = 'None' then
exit;
writeln('Responding to "' + GetNewChatMsg + '"');
wm(1000, 1000);
Talk(ChatType);
end;


function SkillCoords(row, column: Integer): TPoint;
begin
case Column of
1: Result.x := 586;
2: Result.x := 650;
3: Result.x := 714;
end;
case row of
1: Result.y := 210;
2: Result.y := 241;
3: Result.y := 272;
4: Result.y := 303;
5: Result.y := 334;
6: Result.y := 365;
7: Result.y := 396;
8: Result.y := 429;
end;
end;


function SkillToCoords(skill: string): TPoint;
begin
case LowerCase(skill) of
'attack': result := SkillCoords(1, 1);
'hitpoints': result := SkillCoords(1, 2);
'mining': result := SkillCoords(1, 3);
'strength': result := SkillCoords(2, 1);
'agility': result := SkillCoords(2, 2);
'smithing': result := SkillCoords(2, 3);
'defence': result := SkillCoords(3, 1);
'herblore': result := SkillCoords(3, 2);
'fishing': result := SkillCoords(3, 3);
'range': result := SkillCoords(4, 1);
'ranged': result := SkillCoords(4, 1);
'thieving': result := SkillCoords(4, 2);
'cooking': result := SkillCoords(4, 3);
'prayer': result := SkillCoords(5, 1);
'crafting': result := SkillCoords(5, 2);
'firemaking': result := SkillCoords(5, 3);
'magic': result := SkillCoords(6, 1);
'fletching': result := SkillCoords(6, 2);
'woodcutting': result := SkillCoords(6, 3);
'runecrafting': result := SkillCoords(7, 1);
'slayer': result := SkillCoords(7, 2);
'farming': result := SkillCoords(7, 3);
'construction': result:= SkillCoords(8,1);
'hunting': result:= SkillCoords(8,2);
else writeln('invalid skill: '+skill);
end;
end;




function GetSkillLevel(skill: string): Integer;
var
T: TPoint;
TmpResult: string;
i: Integer;
begin
GameTab(2);
t:=skilltocoords(skill);
tmpResult := GetTextAtEx(T.x + 12, T.y + 12, 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 + 12, T.y + 12, 100, StatChars, False,
True, 0, 5, -1, 2, True, tr_Digits);
if (Trim(tmpResult) <> '') then
Exit;
end;
if (not (Trim(tmpResult) = '')) then
Result := StrToInt(Trim(GetTextAtEx(T.x + 12, T.y + 12, 100, StatChars,
False, True, 0, 5, -1, 2, True, tr_Digits)));
end;





procedure LoadSkill(Skill:string);
begin
if Skill= 'woodcutting' then
SkillFight:= 'tree spirit';
if Skill= 'mining' then
SkillFight:= 'rock golem';
if Skill= 'smithing' then
SkillFight:= 'rock golem';
CurrentLevel:= GetSkillLevel(Skill);
CurrentSkill:= Skill;
WriteLn(PlayerName[CurrentPlayer] + 's ' + Skill + ' lvl- ' +
IntToStr(CurrentLevel));
GameTab(4);
end;




procedure GainedLvl;
begin
if GetColor(100, 381)= 8388608 then
if GetColor(100, 381)= 8388608 then
begin
WriteLn('Gained a level!');
w(1000, 2000);
Click(222, 439, 50, 4, true);
w(1000, 2000);
Talk('gainedlvl');
CurrentLevel:= CurrentLevel+1;
WriteLn(PlayerName[CurrentPlayer] + 's ' + CurrentSkill + ' level- ' +
IntToStr(CurrentLevel));
w(1000, 1000);
end;
end;




function ExistsItem(i: Integer): Boolean;
var
xx, yy, f, row, col: Integer;
Points: TPointArray;
begin
row := i div 4;
col := i - (row * 4) - 1;
if (col < 0) then
begin
col := 3;
row := row - 1;
end;
FindColorsTolerance(Points, 3885652, 569 + col * 42, 228 + row * 36, 569 + col
* 42 + 20, 228 + row * 36 + 15, 70);
Result := False;
xx := 0;
yy := 0;
for f := 0 to GetArrayLength(Points) - 1 do
begin
if (569 + col * 42 + xx <> Points[f].x) or (228 + row * 36 + yy <>
Points[f].y) then
begin
Result := True;
Exit;
end;
yy := yy + 1;
if (yy = 16) then
begin
xx := xx + 1;
yy := 0;
end;
end;
end;




function ItemCoords(i: Integer): TPoint;
var
row, col: Integer;
begin
row := i div 4;
col := i - (row * 4) - 1;
if (col < 0) then
begin
col := 3;
row := row - 1;
end;
Result.x := 536 + ((col + 1) * 42) + Random(7);
Result.y := 184 + ((row + 1) * 36) + Random(7);
end;




procedure MouseItem(i: Integer; left: Boolean);
var
aPoint: TPoint;
begin
aPoint := ItemCoords(i);
Click(aPoint.x + 5, aPoint.y, 0, 0, left);
end;




procedure OptionItemExcept(i:integer; Text:string);
var a, x, y:integer;
begin
for a:=1 to 28 do
begin
if a<>i then
begin
if ExistsItem(a) then
begin
MouseItem(a, false);
W(200, 100);
ChooseOption(x, y, Text);
w(800, 200);
end;
end;
end;
for a:=1 to 28 do
//Double Check\\
begin
if a<>i then
begin
if ExistsItem(a) then
begin
MouseItem(a, false);
W(200, 100);
ChooseOption(x, y, Text);
w(800, 200);
end;
end;
end;
end;




procedure CheckExp(Skill:string);
begin
GameTab(4);
w(500, 500);
case Skill of
'mining':
begin
Move(697, 217, 10, 10);
w(1000, 2000);
end;
'smithing':
begin
Move(693, 246, 10, 10);
w(1000, 2000);
end;
'woodcutting':
begin
Move(693, 371, 10, 10);
w(1000, 2000);
end;
end;
end;




procedure Withdraw(col, row, Amount: Integer);
var
rx, ry: Integer;
begin
rx := 35 + (col * 47);
ry := 27 + (row * 38);
if BankScreen then
begin
if (Amount = 1) then
begin
Click(rx, ry, 0, 0, True);
end
else
begin
Click(rx, ry, 0, 0, False);
if (Amount = 1) or (Amount = 5) or (Amount = 10) or (Amount = 0) then
begin
if (Amount = 5) then
ChooseOption(rx, ry, 'Withdraw 5');
if (Amount = 10) then
ChooseOption(rx, ry, 'Withdraw 10');
if (Amount = 0) then
ChooseOption(rx, ry, 'Withdraw All');
end
else
begin
ChooseOption(rx, ry, 'Withdraw X');
Wait(1000 + Random(100));
TypeSend(IntToStr(Amount) + Chr(13));
end;
end;
end;
end;




procedure Deposit(slot, toslot, thetype: Integer);
var
slotnumber, col, row, x, y: Integer;
begin
if BankScreen then
begin
slotnumber := slot;
while (slotnumber < toslot) do
begin
if ((slotnumber mod 4) = 0) then
col := 3
else
col := (slotnumber mod 4) - 1;
row := (slotnumber - 1) / 4;
if (FindColor(x, y, 65536, (571 + 47 * col), (215 + 36 * row), (601 + 47 *
col), (245 + 36 * row))) then
begin
if (thetype = 1) then
Click(x, y, 5, 5, True);
if (thetype = 2) then
begin
Click(x, y, 5, 5, False);
if (ChooseOption(x, y, 'All')) then
Wait(1000 + Random(100));
end;
end;
slotnumber := slotnumber + 1;
end;
end;
end;




procedure RandomRotate;
begin
case Random(3) of
0:
case Random(4) of
0:
SendArrowSilentWait(0, 100 + Random(2000));
1:
SendArrowSilentWait(1, 100 + Random(3000));
2:
SendArrowSilentWait(2, 100 + Random(500));
3:
SendArrowSilentWait(3, 100 + Random(3000));
end;
1:
begin
case Random(4) of
0:
SendArrowSilentWait(0, 100 + Random(1000));
1:
SendArrowSilentWait(1, 100 + Random(1500));
2:
SendArrowSilentWait(2, 100 + Random(250));
3:
SendArrowSilentWait(3, 100 + Random(1500));
end;
wm(100, 800);
case Random(4) of
0:
SendArrowSilentWait(0, 100 + Random(1000));
1:
SendArrowSilentWait(1, 100 + Random(1500));
2:
SendArrowSilentWait(2, 100 + Random(250));
3:
SendArrowSilentWait(3, 100 + Random(1500));
end;
end;
2:
begin
case Random(4) of
0:
SendArrowSilentWait(0, 100 + Random(500));
1:
SendArrowSilentWait(1, 100 + Random(700));
2:
SendArrowSilentWait(2, 100 + Random(150));
3:
SendArrowSilentWait(3, 100 + Random(700));
end;
wm(100, 800);
case Random(4) of
0:
SendArrowSilentWait(0, 100 + Random(500));
1:
SendArrowSilentWait(1, 100 + Random(700));
2:
SendArrowSilentWait(2, 100 + Random(150));
3:
SendArrowSilentWait(3, 100 + Random(700));
end;
wm(100, 800);
case Random(4) of
0:
SendArrowSilentWait(0, 100 + Random(500));
1:
SendArrowSilentWait(1, 100 + Random(700));
2:
SendArrowSilentWait(2, 100 + Random(150));
3:
SendArrowSilentWait(3, 100 + Random(700));
end;
end;
end;
end;




procedure RandomStuff(skill:string);
var
x, y: integer;
begin
if skill='mining' then
begin
if TimeFromMark(ChatM)>0 then//(ChatTime+random(ChatTime/2))*60000 then
begin
Chat;
MarkTime(ChatM);
end;
if TimeFromMark(RightClickM)>(RightClickTime+random(RightClickTime/2))*60000 then
begin
Click(42, 42, 600, 350, false);
ChooseOption(x, y, 'amine');
wm(500,800);
MarkTime(RightClickM);
end;
if TimeFromMark(RotateM)>(RotateTime * 60000 + Random(60000)) then
begin
RandomRotate;
MarkTime(RotateM);
end;
if TimeFromMark(SwitchTabM)>(SwitchTabTime+random(SwitchTabTime/2))*60000 then
begin
GameTab(1+random(13));
if random(2)+1=1 then
Move(566, 219, 181, 272);
w(400,800);
if random(2)+1=1 then
Move(566, 219, 181, 272);
w(400,800);
if random(2)+1=1 then
Move(566, 219, 181, 272);
w(400,800);
gametab(4);
MarkTime(SwitchTabM);
end;
if TimeFromMark(MoveM)>(MoveTime+random(MoveTime/2))*60000 then
begin
wm(3000,3000);
MarkTime(MoveM);
end;
if TimeFromMark(SongM)>(SongTime+random(SongTime/2))*60000 then
begin
Song;
MarkTime(SongM);
end;
if TimeFromMark(EmoteM)>(EmoteTime+random(EmoteTime/2))*60000 then
begin
Emote;
MarkTime(EmoteM);
end;
if TimeFromMark(TalkM)>(TalkTime+random(TalkTime/2))*60000 then
begin
Talk(Skill);
MarkTime(TalkM);
end;
if TimeFromMark(CheckExpM)>(CheckExpTime+random(CheckExpTime/2))*60000 then
begin
CheckExp(Skill);
MarkTime(CheckExpM);
end;
Exit;
end;
end;




function FindBlackInChat(a, b:integer): boolean;
var
x, y, Line: integer;
begin
Line:= 0;
Result:= false;
if not(FindColor(x, y, 16711680, 42, 451, 254, 459)) then
Line:= 1;
if Line= 0 then
if not(FindColor(x, y, 16711680, 42, 437, 254, 439)) then
Line:= 2;
if Line= 0 then
if not(FindColor(x, y, 16711680, 42, 420, 254, 427)) then
Line:= 3;
if Line= 0 then
if not(FindColor(x, y, 16711680, 42, 406, 254, 412)) then
Line:= 4;
if Line= 0 then
if not(FindColor(x, y, 16711680, 42, 394, 254, 400)) then
Line:= 5;
if Line= 0 then
if not(FindColor(x, y, 16711680, 42, 379, 254, 384)) then
Line:= 6;
if Line= 0 then
if not(FindColor(x, y, 16711680, 42, 365, 254, 369)) then
Line:= 7;
if Line= 0 then
if not(FindColor(x, y, 16711680, 42, 347, 254, 357)) then
Line:= 8;
if Line= 1 then
if GetColor(a, b)= 0 then
Result:= true;
if Line= 2 then
if GetColor(a, b-14)= 0 then
Result:= true;
if Line= 3 then
if GetColor(a, b-28)= 0 then
Result:= true;
if Line= 4 then
if GetColor(a, b-42)= 0 then
Result:= true;
if Line= 5 then
if GetColor(a, b-56)= 0 then
Result:= true;
if Line= 6 then
if GetColor(a, b-70)= 0 then
Result:= true;
if Line= 7 then
if GetColor(a, b-84)= 0 then
Result:= true;
if Line= 8 then
if GetColor(a, b-98)= 0 then
Result:= true;
end;





function InvFull: Boolean;
begin
Result:= True;
GameTab(4);
if GetColor(705, 443) = 3818059 then
Result:= False;
end;




function TimeRunning: string;
var
RHours, Minutes, Seconds, RMinutes, RSeconds: LongInt;
Time: string;
begin
Seconds := (GetSystemTime - ST) div 1000;
Minutes := Seconds div 60;
RHours := Minutes div 60;
Time := IntToStr(Seconds) + ' Seconds';
if Minutes <> 0 then
begin
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(Minutes) + ' Minutes and ' + IntToStr(RSeconds) +
' Seconds';
end;
if RHours <> 0 then
begin
RMinutes := Minutes mod (RHours * 60);
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(RHours) + ' Hours, ' + IntToStr(RMinutes) +
' Minutes and ' + IntToStr(RSeconds) + ' Seconds';
end;
Result := Time;
end;





function FOF(color,tol,jump,x,y,mx1,my1,mx2,my2:integer; text:string):boolean;
var x1,y1,x2,y2,m,cx,cy:integer;
begin
marktime(m);
x1:=x-jump; y1:=y-jump; x2:=x+jump; y2:=y+jump;
repeat
if findcolortolerance(cx,cy,color,x1,y1,x2,y2,tol) then begin
move(cx,cy,0,0);
w(100,50);
if isuptext(text) then
result:=true;
end;
x1:=x1-jump; y1:=y1-jump; x2:=x2+jump; y2:=y2+jump;
until (x1<mx1) or (x2>mx2) or (y1<my1) or (y2>my2) or (timefrommark(m)>40000) or result=true;
end;




function FindFromMap(MMcolor, MMtolerance, ScreenColor, ScreenTolerance:integer; text:string):boolean;
var a,b,c,d,e,f,g,h, cx, cy, x, y:integer;
begin
if SpiralColor(x, y, 638, 82, MMColor, MMTolerance, 100) then
begin
cx:= x; cy:= y;
a:= 648
b:= 82
c:= cx-a
d:= cy-b
e:= 257
f:= 167
g:= e+c*9
h:= f+d*9
if (g<1) or (h<1) or (g>527) or (h>430) then
begin
writeln('object is off screen');
result:=false;
exit;
end;
if fof(screencolor,screentolerance,5,g,h,1,1,515,338,text) then
result:=true;
end;
end;




procedure FindTextSpiral(txt: string; dx, dy: Integer; SpiralSize: Integer;
step, SpiralWait: Integer);
var
x, y, px, py, qx, qy: Integer;
FoundText: Boolean;
begin
FoundText := False;
px := dx;
py := dy;
qx := dx;
qy := dy;
x := dx;
y := dy;
MoveMouseSmooth(x, y);
repeat
Spiralwait := Spiralwait + Random(50);
MoveMouse(x, y);
px := px + 20;
py := py + 20;
qx := qx - 20;
qy := qy - 20;
repeat
GetMousePos(x, y);
x := x + step;
MoveMouseSmooth(x, y);
Wait(SpiralWait);
if (IsUpText(Txt)) then
FoundText := True;
until (x >= px) or (FoundText);
if (FoundText) then
Break;
repeat
GetMousePos(x, y);
y := y + step;
MoveMouseSmooth(x, y);
Wait(SpiralWait);
if (IsUpText(Txt)) then
FoundText := True;
until (y >= py) or (FoundText);
if (FoundText) then
Break;
repeat
GetMousePos(x, y);
x := x - step;
MoveMouseSmooth(x, y);
Wait(SpiralWait);
if (IsUpText(Txt)) then
FoundText := True;
until (qx >= x) or (FoundText);
if (FoundText) then
Break;
repeat
GetMousePos(x, y);
y := y - step;
MoveMouseSmooth(x, y);
Wait(SpiralWait);
if (IsUpText(Txt)) then
FoundText := True;
until (qy >= y) or (FoundText);
until (px > dx + SpiralSize) or (FoundText);
end;





function GetSkillAmount(skill: string): Integer;
var
T: TPoint;
TmpResult: string;
i: Integer;
begin
GameTab(2);
t:=skilltocoords(skill);
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;
if (not (Trim(tmpResult) = '')) then
Result := StrToInt(Trim(tmpResult));
end;




function HpPercent: Integer;
var
tlevel, tamount: Integer;
begin
tlevel := GetSkillLevel('hitpoints');
tamount := GetSkillAmount('hitpoints');
if tlevel = 0 then tlevel := 1;
Result := (tamount * 100) / tlevel;
end;


function Fighting:boolean;
var
x, y: integer;
begin
if FindColor(x, y, 65280, 217, 129, 297, 209) then
if (TimeFromMark(Fight)>15000) then
begin
GameTab(2);
w(300, 200);
if (HpPercent < 100) then
begin
Result:= True;
WriteLn('Found a fight!');
Talk('fight');
SetRun(True);
Fights:= Fights + 1;
MarkTime(Fight);
end else
begin
WriteLn('Waiting for HP to lower...');
w(2000, 1000);
GameTab(2);
w(300, 200);
if (HpPercent < 100) then
begin
Result:= True;
WriteLn('Found a fight!');
Talk('fight');
SetRun(True);
Fights:= Fights + 1;
end else
WriteLn('Fake fight.');
end;
GameTab(4);
end;
end;




function FindFromMapMod(xMod, yMod, MMcolor, MMtolerance, ScreenColor, ScreenTolerance:integer; text:string):boolean;
var a,b,c,d,e,f,g,h, cx, cy:integer;
begin
if SpiralColor(cx, cy, 648, 82, MMColor, MMTolerance, 100) then begin
a:= 648
b:= 82
c:= cx-a
d:= cy-b
e:= 257
f:= 167
g:= e+c*9
h:= f+d*9
if (g<1) or (h<1) or (g>527) or (h>430) then
begin
writeln('object is off screen');
result:=false;
exit;
end;
//start point for search is found, now it searches from g,h
if fof(screencolor,screentolerance,5,g+xMod,h+yMod,1,1,515,338,text) then
result:=true;
end;
end;




procedure MainSetup;
begin
MarkTime(ST);
MarkTime(RightClickM);
MarkTime(SwitchTabM);
MarkTime(MoveM);
MarkTime(SongM);
MarkTime(EmoteM);
MarkTime(TalkM);
MarkTime(CheckExpM);
MarkTime(RotateM);
end;







{====================================================================================
====================================================================================
====================================================================================
============================Script Procedures=======================================
====================================================================================
====================================================================================
====================================================================================}






function LostMining(c1, c2, c3, c4:integer):boolean;
begin
if Lost(c1, c2, c3, c4, 10) then
begin
Location[CurrentPlayer]:='Lost';
Active[CurrentPlayer]:=False;
ChangePlayers;
Result:= true;
end;
end;




function FindBitmapsProgressiveTol(bmp1, bmp2, bmp3, bmp4, bmp5, tolmax, step,
xs, ys, xe, ye: Integer): Boolean;
var
c, x, y: Integer;
begin
while (c < tolmax) do
begin
c := c + step;
if (bmp1 > 0) then
begin
if (FindBitmapSpiralTolerance(bmp1, x, y, xs, ys, xe, ye, c)) then
begin
Result := True;
break;
end;
end;
if (bmp2 > 0) then
begin
if (FindBitmapSpiralTolerance(bmp2, x, y, xs, ys, xe, ye, c)) then
begin
Result := True;
break;
end;
end;
if (bmp3 > 0) then
begin
if (FindBitmapSpiralTolerance(bmp3, x, y, xs, ys, xe, ye, c)) then
begin
Result := True;
break;
end;
end;
if (bmp4 > 0) then
begin
if (FindBitmapSpiralTolerance(bmp4, x, y, xs, ys, xe, ye, c)) then
begin
Result := True;
break;
end;
end;
if (bmp5 > 0) then
begin
if (FindBitmapSpiralTolerance(bmp5, x, y, xs, ys, xe, ye, c)) then
begin
Result := True;
break;
end;
end;
end;
end;




function FindMapOreColor:integer;
var
x, y, Tol: integer;
begin
repeat
if SpiralColor(x, y, 685, 83, 5458774, Tol, 60) then
Break;
Tol:= Tol + 1;
if (Tol >= 50) then
Break;
until(False);
Result:= GetColor(x, y);
if Tol >= 50 then
Result:= -1;
WriteLn('Ore Color- ' + IntToStr(Result));
end;




function FindFaladorLadderColor: integer;
var C, TX, TY, FaladorLadder, l: integer;

begin
FaladorLadder:= BitmapFromString(2, 2, '4F1F004F1F004F1F00' +
'A4A298');
repeat
c:= 0;
l:= l + 1;
if (LadderColor > 0) then
Break;
while (C < 100) do
begin
c:= c + 5;
if FindBitMapToleranceIn(FaladorLadder, TX, TY, 650, 144, 664, 156, c) then
begin
LadderColor:= GetColor(TX, TY);
Result:= LadderColor;
WriteLn('LadderColor = ' + IntToStr(LadderColor));
FreeBitMap(FaladorLadder);
Break;
end;
end;
if (Result = 0) then
PlaySound('a');
Wait(150);
until(l > 30);
FreeBitMap(FaladorLadder);
if (Result = 0) then
begin
WriteLn('LadderColor not found!');
Move(110, 132, 10, 10);
TerminateScript
end;
end;




function FindFaladorRoadColor: Integer;
var
c, TX, TY, FaladorRoad: Integer;
begin
FaladorRoad := BitmapFromString(6, 6, 'z78DAB370B2303773B51' +
'876240037E33211');
while (c <= 100) do
begin
c := c + 5;
if (FindBitmapToleranceIn(FaladorRoad, TX, TY, 570, 5, 735, 166, c))
then
begin
RoadColor := GetColor(TX, TY);
Result := RoadColor;
break;
end;
end;
if (Result = 0) then
WriteLn('ERROR: RoadColor NOT Found');
FreeBitmap(FaladorRoad);
end;




function FindFaladorWaterColor: Integer;
var
c, TX, TY, FaladorWater: Integer;
begin
FaladorWater := BitmapFromString(6, 6, 'z78DA33733677B' +
'174351B7624000B723409');
while (c < 65) do
begin
c := c + 5;
if FindBitmapToleranceIn(FaladorWater, TX, TY, 648 - 75, 86 + 20, 648 -
20, 86 + 30, c) then
begin
WaterColor := GetColor(TX, TY);
Result := RoadColor;
break;
end
end
FreeBitmap(FaladorWater);
if Result = 0 then WriteLn('ERROR: Watercolor NOT Found');
end;




function GetBankColor: Integer;
var
Bitmap, Color, c, x, y: Integer;
acc: Extended;
begin
Bitmap := BitmapFromString(15, 5, 'z78DA33B434B4343473B' +
'100421364D2D9D2C9C9D4C4CDCDD5D1CCD0C2D5DCC5D00299ED04' +
'8226C824B25E43B0998664990C213175116F32B2F9C824B2F9A4B' +
'A1997F9B842865493890F734C9301ACE46928');
Color := 6417151;
FindDeformedBitmapToleranceIn(Bitmap, x, y, 570, 5, 725, 160, 70, 0, True,
acc);
if (acc > SymbolAccuracy) then
begin
repeat
c := c + 5;
if (FindColorTolerance(x, y, Color, x, y, x + 15, y + 5, c)) then
begin
Result := GetColor(x, y);
end;
until (Result > 0) or (c > 70);
end;
FreeBitmap(Bitmap);
end;




function GetMapPickColor: Integer;
var
Bitmap, Color, c, x, y: Integer;
acc: Extended;
begin
Bitmap := BitmapFromString(15, 5, 'z78DA95D03B0EC430' +
'0804D02B610C832931D9DCFF48894293C8DAD5464853F07905342' +
'91A67A46FF43BA31914AE602183A9E5686799A64E3C04BA4CFA43' +
'7E98439C770971257CB09F934B8E089F2FE43287A2F534166629A' +
'1121D03DB5BB94C0B1D9D811E2DEF66ED94BCF6BFC97753A33BF3' +
'7ABBCAEB9F0FD413672D');
Color := 4219541;
FindDeformedBitmapToleranceIn(Bitmap, x, y, 570, 5, 725, 160, 70, 0, True,
acc);
if (acc > SymbolAccuracy) then
begin
repeat
c := c + 5;
if (FindColorTolerance(x, y, Color, x, y, x + 15, y + 5, c)) then
begin
Result := GetColor(x, y);
end;
until (Result > 0) or (c > 70);
end;
FreeBitmap(Bitmap);
WriteLn(IntToStr(Result));
end;




function FindFaladorBasicColors: Boolean;
var
c: Integer;
begin
repeat
c := c + 1;
Wait(250);
FindFaladorRoadColor;
until (c > 40) or (RoadColor <> 0);
WriteLn('RoadColor = ' + IntToStr(RoadColor));
c := 0;
repeat
c := c + 1;
Wait(250);
FindFaladorWaterColor;
until (c > 40) or (WaterColor <> 0);
WriteLn('WaterColor = ' + IntToStr(WaterColor));
c := 0;
repeat
c := c + 1;
Wait(250);
BankColor := GetBankColor;
until (c > 40) or (BankColor <> 0);
WriteLn('BankColor = ' + IntToStr(BankColor));
if ((RoadColor = 0) or (WaterColor = 0) or (BankColor = 0)) then
begin
Result := False;
WriteLn('ERROR: Could not find Colors. Please align Minimap North and restart script.');
TerminateScript;
end
else
Result := True;
end;




function ClimbLadderDown:Boolean;
var
c, x, y:integer;
begin
for c:=1 to 50 do
begin
if SpiralColor(x, y, 290, 207, 0, 0, 500) then
begin
Wait(100);
Click(x-5, y-5, -25, -25, false);
ChooseOption(x, y, 'Climb');
wait(300+random(500));
NFlag(0);
W(2000, 0);
LoadingWait;
Result:=True;
Exit;
end;
end;
c:=C+1;
SendArrowSilentWait((Random(2)*2)+1, 20 + Random(10));
if C=50 then
exit;
end;




procedure ClimbLadderUp;
var
x, y, c: integer;
begin
repeat
if FindFromMap(LadderColor, 5, 2775161, 15, 'limb') then
begin
WriteLn('Found ladder from map');
GetMousePos(x, y);
Click(x, y, 1, 1, false);
W(200, 100);
ChooseOption(x, y, 'Climb');
end else
if FOF(2775161, 21, 5, 230, 156, 3, 3, 474, 336, 'adder') then
begin
WriteLn('Found ladder from FOF');
GetMousePos(x, y);
Click(x, y, 1, 1, false);
W(500, 300);
ChooseOption(x, y, 'Climb');
end;
NFlag(0);
W(2000, 0);
if LoadingWait then
if FindColorTolerance(x, y, WaterColor, 570, 5, 735, 166, 50) then
Exit;
if FindColorTolerance(x, y, WaterColor, 570, 5, 735, 166, 50) then
Exit;
if (c > 15) then
begin
WriteLn('Tried climbing ladder too many times');
Exit;
end;
SpiralColor(x, y, 643, 83, LadderColor, 0, 100);
ClickFF(x + 7, y + 7, 11, 13, 1, 0);
NFlag(0);
until(false);
end;





procedure BankToGuild;
var
x, y, c: integer;
begin
Run;
if LostMining(WaterColor, BankColor, RoadColor, -1) then
exit;
MakeCompass('N');
//click 1
SpiralColor(x, y, 698, 106, 3107967, 80, 30);
ClickFF(x, y, 2, 2, -1, -1);
wait(3500);
GameTab(4);
NFlag(2 + random(8));
Run;
if LostMining(-1, BankColor, RoadColor, -1) then
exit;
//Click 2
SpiralColor(x, y, 629, 124, 65536, 20, 80);
ClickFF(x, y, 15, 15, 1, -1);
wait(2000);
NFlag(0);
Run;
repeat
c:=c+1;
ClimbLadderDown;
if (c = 20) then
begin
SpiralColor(x, y, 629, 124, 65536, 20, 80);
ClickFF(x-5, y-5, 15, 15, 1, -1);
wait(2000);
NFlag(0);
end;
if (c > 40) then
LostMining(15883008, 15883008, 15883008, 15883008);
until ((GetColor(580,80)=65536) and (GetColor(648,142)=65536));
if LostMining(0, MapOreColor, -1, -1) then
exit;
Run;
//ResumeFindingRandoms;
Location[CurrentPlayer]:='Guild'
end;




function DTM3Flag(DTM1, DTM2, DTM3: Integer; Clicks: Boolean): Boolean;
var
x, y: Integer;

begin
repeat
if FindDTM(DTM1, x, y, 570, 5, 735, 166) then
begin
Result := True;
if (Clicks) then
begin
Click(x, y, 13, -5, True);
NFlag(10)
break;
end
else
break;
end
else
Result := False;

if FindDTM(DTM2, x, y, 570, 5, 735, 166) then
begin
Result := True;
if (Clicks) then
begin
Click(x, y, 13, -5, True);
NFlag(10);
break;
end
else
break;
end
else
Result := False;

if FindDTM(DTM3, x, y, 570, 5, 735, 166) then
begin
Result := True;
if (Clicks) then
begin
Click(x, y, 13, -5, True);
NFlag(10);
break;
end
else
break;
end
else
Result := False;

Wait(100);
until (not FindColor(x, y, 255, 559, 0, 735, 166));
end;




procedure NeilBank(BankColor:Integer);
var
c, x, y: Integer;
begin
if findfrommapmod(5+random(5), -10 - Random(5), 195836, 40, BankColor, 25, 'nk bo') then
begin
getmousepos(x,y);
Click(x,y,0,0,false);
w(100,50);
if (ChooseOption(x, y, 'quickly')) then
begin
NFlag(0);
repeat
Wait(100);
c := c + 1
until (BankScreen)
or (c >= 50);
end;
end;
if not BankScreen then
begin
if findfrommap(195836,40,4547451,15,'ank') then
begin
getmousepos(x,y);
Click(x,y,0,0,false);
w(100,50);
if (ChooseOption(x, y, 'quickly')) then
begin
NFlag(0);
repeat
Wait(100);
c := c + 1
until (BankScreen)
or (c >= 50);
end;
end;
end;
end;




function FindPickHeadColor: Boolean;
var
x, y, PickAxe, PickAxeSteel:Integer;
begin
PickAxe := BitmapFromString(30, 14,
'564D42564D42544A3B4D4438544A3B564D42564D42544A3B4D4438' +
'544A3B544A3B544A3B544A3B544A3B000001000001000001000001' +
'544A3B564D42564D42564D42564D42564D42564D42544A3B544A3B' +
'564D42544A3B564D42564D42544A3B544A3B4D4438564D42564D42' +
'544A3B544A3B564D42564D42544A3B4D44384D44380000012F2000' +
'2F20003625003D2900000001564D42564D42564D42564D42564D42' +
'564D42564D42544A3B564D42544A3B564D42544A3B4D4438544A3B' +
'564D42564D42000001000001000001000001000001000001000001' +
'000001000001392D1B44341E4D3B22544127000001302020564D42' +
'544A3B564D42564D42564D42564D42564D42544A3B544A3B564D42' +
'4D44384D4438564D42000001000001392D1B342918342918342918' +
'34291834291834291834291834291834291840311E44341E4D3B22' +
'000001302020544A3B544A3B564D42564D42564D42564D42564D42' +
'544A3B544A3B564D42544A3B000001000001392D1B392D1B392D1B' +
'3429183429183429183429183429183429183429183429181E1500' +
'271B005441274D3B22000001000001564D42544A3B564D42564D42' +
'564D42564D42564D42564D42544A3B564D42000001392D1B392D1B' +
'392D1B392D1B392D1B342918342918342918342918342918342918' +
'3429181E1500271B002F2000513E254D3B2248382044341E000001' +
'000001544A3B544A3B564D42564D42564D42544A3B544A3B564D42' +
'544A3B000001000001000001000001000001000001000001000001' +
'0000010000010000010000011E15002F20002F20004D3B224D3B22' +
'48382044341E40311E44341E000001000001564D42564D42564D42' +
'544A3B544A3B564D42544A3B4D4438302020302020302020302020' +
'3020203020203020203020203020200000011E1500271B002F2000' +
'2F20004D3B224D3B2248382044341E40311E392D1B40311E44341E' +
'000001000001564D42564D42544A3B564D42544A3B544A3B4D4438' +
'544A3B544A3B544A3B544A3B544A3B4D4438544A3B544A3B000001' +
'1E15002F20002F20002F200000000100000100000144341E40311E' +
'392D1B342918392D1B40311E44341E000001564D42544A3B564D42' +
'564D42564D42564D42544A3B544A3B564D42564D42564D42544A3B' +
'564D420000011E1500271B002F20002F2000000001302020302020' +
'302020000001000001000001392D1B2F2515342918392D1B000001' +
'302020564D42564D42564D42564D42544A3B544A3B564D42564D42' +
'564D424D44384D4438564D420000011E15002F20002F2000000001' +
'302020302020544A3B544A3B544A3B302020302020000001000001' +
'0000012F2515392D1B000001544A3B564D42564D42564D42544A3B' +
'544A3B544A3B564D42564D42544A3B544A3B0000011E15002F2000' +
'2F20002F2000000001302020544A3B544A3B544A3B564D42564D42' +
'544A3B544A3B30202030202000000100000140311E000001564D42' +
'544A3B544A3B564D42564D42544A3B544A3B544A3B564D42564D42' +
'0000011E15002F20002F2000000001302020302020544A3B544A3B' +
'564D42564D42564D42544A3B4D4438544A3B564D42564D42302020' +
'000001302020302020544A3B544A3B544A3B4D4438544A3B544A3B' +
'544A3B544A3B0000011E15002F20002F20002F2000000001302020' +
'4D44384D4438544A3B544A3B564D42564D42564D42544A3B544A3B' +
'544A3B544A3B544A3B564D42302020544A3B');
PickAxeSteel := BitmapFromString(30, 14,
'564D42564D42544A3B4D4438544A3B564D42564D42544A3B4D4438' +
'544A3B544A3B544A3B544A3B544A3B000001000001000001000001' +
'544A3B564D42564D42564D42564D42564D42564D42544A3B544A3B' +
'564D42544A3B564D42564D42544A3B544A3B4D4438564D42564D42' +
'544A3B544A3B564D42564D42544A3B4D44384D44380000012D1E00' +
'2D1E003423003A2700000001564D42564D42564D42564D42564D42' +
'564D42564D42544A3B564D42544A3B564D42544A3B4D4438544A3B' +
'564D42564D42000001000001000001000001000001000001000001' +
'0000010000015C5656686060756D6C827878000001302020564D42' +
'544A3B564D42564D42564D42564D42564D42544A3B544A3B564D42' +
'4D44384D4438564D42000001000001595353595353595353595353' +
'595353595353595353595353595353575151615A596A6262756D6C' +
'000001302020544A3B544A3B564D42564D42564D42564D42564D42' +
'544A3B544A3B564D42544A3B0000010000015C5656595353575151' +
'5751515751515751515751515751515751515751515751511C1400' +
'251900827878756D6C000001000001564D42544A3B564D42564D42' +
'564D42564D42564D42564D42544A3B564D42000001615A595F5858' +
'5C5656595353575151575151544E4E544E4E544E4E544E4E544E4E' +
'544E4E1C14002519002D1E007D7474756D6C6E67676A6262000001' +
'000001544A3B544A3B564D42564D42564D42544A3B544A3B564D42' +
'544A3B000001000001000001000001000001000001000001000001' +
'0000010000010000010000011C14002D1E002D1E00797070756D6C' +
'6E67676A6262635D5C6A6262000001000001564D42564D42564D42' +
'544A3B544A3B564D42544A3B4D4438302020302020302020302020' +
'3020203020203020203020203020200000011C14002519002D1E00' +
'2D1E007B7272756D6C6E67676A6262635D5C5F5858635D5C686060' +
'000001000001564D42564D42544A3B564D42544A3B544A3B4D4438' +
'544A3B544A3B544A3B544A3B544A3B4D4438544A3B544A3B000001' +
'1C14002D1E002D1E002D1E00000001000001000001686060635D5C' +
'5F58585751515C5656615A59665E5E000001564D42544A3B564D42' +
'564D42564D42564D42544A3B544A3B564D42564D42564D42544A3B' +
'564D420000011C14002519002D1E002D1E00000001302020302020' +
'302020000001000001000001595353524B4B544E4E595353000001' +
'302020564D42564D42564D42564D42544A3B544A3B564D42564D42' +
'564D424D44384D4438564D420000011C14002D1E002D1E00000001' +
'302020302020544A3B544A3B544A3B302020302020000001000001' +
'0000014D47465F5858000001544A3B564D42564D42564D42544A3B' +
'544A3B544A3B564D42564D42544A3B544A3B0000011C14002D1E00' +
'2D1E002D1E00000001302020544A3B544A3B544A3B564D42564D42' +
'544A3B544A3B302020302020000001000001665E5E000001564D42' +
'544A3B544A3B564D42564D42544A3B544A3B544A3B564D42564D42' +
'0000011C14002D1E002D1E00000001302020302020544A3B544A3B' +
'564D42564D42564D42544A3B4D4438544A3B564D42564D42302020' +
'000001302020302020544A3B544A3B544A3B4D4438544A3B544A3B' +
'544A3B544A3B0000011C14002D1E002D1E002D1E00000001302020' +
'4D44384D4438544A3B544A3B564D42564D42564D42544A3B544A3B' +
'544A3B544A3B544A3B564D42302020544A3B');
GameTab(4);
Wait(2000);
if (FindBitmapSpiralTolerance(PickAxe, x, y, 546, 198, 745, 468, 100)) or
(FindBitmapSpiralTolerance(PickAxeSteel, x, y, 546, 198, 745, 468, 100))
then
begin
Equip[CurrentPlayer] := False;
Result := True;
end;
if (Result = False) then
begin
GameTab(5);
Wait(200 + Random(200));
if (FindBitmapSpiralTolerance(PickAxe, x, y, 546, 198, 745, 468, 100)) or
(FindBitmapSpiralTolerance(PickAxeSteel, x, y, 546, 198, 745, 468, 100))
then
begin
Equip[CurrentPlayer] := True;
Result := True;
end;
end;
if (Result = False) then
begin
WriteLn('');
WriteLn('ERROR! cannot find pick in screen, please put pick in inventory or your equip page and restart the script!');
WriteLn('');
Result := False;
end else
begin
hc1 := GetColor(x + 6, y + 3);
hc2 := GetColor(x + 18, y + 7);
hc3 := GetColor(x + 20, y + 6);
hc4 := GetColor(x + 19, y + 6);
hc5 := GetColor(x + 16, y + 5);
WriteLn('Pick head colors... ' + IntToStr(hc1) + ' ' + IntToStr(hc2) + ' ' +
IntToStr(hc3) + ' ' + IntToStr(hc4) + ' ' + IntToStr(hc5));
end;
FreeBitmap(PickAxe);
FreeBitmap(PickAxeSteel);
end;




procedure Bank;
var
x, y:integer;
begin
if (NoPick and Equip[CurrentPlayer]= true) then
begin
if InvFull then
begin
if(FindBitmapSpiralTolerance(ore,x,y,559,210,735,460,25))then
begin
Click(x,y,5,5,false);
ChooseOption(x,y,'Drop');
end;
end;
GameTab(5);
Click(593,303,0,0,true);
Wait(Random(1000)+2000);
GameTab(4);
end;

MarkTime(Mark);

if not BankScreen then
begin
repeat
NeilBank(4547194);
until(BankScreen
or (TimeFromMark(Mark)>30000));
if not (BankScreen)then
begin
DTM3Flag(FB1,FB2,FB3,True);
NFlag(0);
//openbank;
NeilBank(4547194);
end;
end;
if(BankScreen)then
begin
wm(300, 300);
if(NoPick=true)then
begin
OptionItemExcept(0, 'All');
Wait(Random(2000)+200);
Withdraw(1,4,1);
Wait(Random(2000)+200);
end else
begin
if(Equip[CurrentPlayer]=false)then
Deposit(2,28,2);
wm(300, 300);
if(Equip[CurrentPlayer]=true)then
begin
OptionItemExcept(0, 'All');
wm(300, 300);
end;
end;
if(NoPick=true)and(Equip[CurrentPlayer]=true)then
begin
Move(485+random(5), 41+random(5), 0, 0);
wait(200+random(300));
getmousepos(x,y);
Click(x,y,0,0,true);
wait(200+random(1000));
FindPickHeadColor;
Wait(Random(1000)+200);
FindColor(x, y, hc1, 505, 205, 740, 464);
Click(x, y, 0, 0, true);
end;
Banks:=Banks+1;
Banked[CurrentPlayer]:= Banked[CurrentPlayer]+1;
TotalOres:=TotalOres+28;
NoPick:=false
end;
end;




procedure ProgressReport;
begin
WriteLn(' ');
WriteLn(' ');
WriteLn(' ');
WriteLn('<=== The Guild Miner Progress Report ===>');
writeln('Current Player- '+ PlayerName[CurrentPlayer]);
writeln('Worked for '+ TimeRunning);
WriteLn('Current Player Banked '+inttostr(Banked[CurrentPlayer])+' loads[s].');
WriteLn('Banked '+IntToStr(TotalOres)+' Ores.');
WriteLn('Total banks- '+IntToStr(Banks)+'.');
if Gasses>0 then WriteLn('Gas avoided: '+IntToStr(Gasses))
WriteLn('<=======================================>');
end;




procedure GuildToBank;
var
c, x, y: integer;
begin
Run;
if LostMining(0, MapOreColor, -1, -1) then
Exit;
MakeCompass('N');
repeat
c:= c + 1;
Run;
if FindColor(x, y, LadderColor, 570, 5, 735, 166) then
Break;
AngleMapWalk(1, 0, MapOreColor, 0, 5, 5, 180, 270, 65, 5, 7 + Random(7));
if c = 8 then
Exit;
until(FindColor(x, y, LadderColor, 570, 5, 735, 166) or (c > 10))
If not FindColor(x,y,LadderColor,570, 5, 735, 166) Then
AngleMapWalk(1, 0, MapOreColor, 0, 5, 5, 225, 315, 65, 5, 7+random(4));
If FindColor(x, y, LadderColor,570, 5, 735, 166) Then
ClickFF(x + 7, y + 7, 12, 14, 1, 0);
w(1000,200);
NFlag(0);
ClimbLadderUp;
//PauseFindingRandoms;
Run;
If FindColor(x,y,BankColor,570, 5, 735, 166) then
begin
SpiralColor(x, y, 603, 15, 10074813, 40, 50);
Click(x + 1, y, 1, 5, true);
wait(16000);
NFlag(3+random(3));
if LostMining(-1, BankColor, RoadColor, -1) then
Exit;
end else
begin
SpiralColor(x, y, 647, 27, 3578259, 40, 50);
ClickFF(x - 5, y - 5, 10, 10, -1, -1);
wait(6000);
NFlag(3+random(3));
end;
Run;
w(400,500);
DTM3Flag(FB1, FB2, FB3, True);
NFlag(0);
if LostMining(WaterColor, BankColor, RoadColor, -1) then
Exit;
W(200, 500);
Bank;
if (Banked[CurrentPlayer] >= Loads) then
begin
WriteLn('Enough loads done, switching players.');
ChangePlayers;
NoPick:=False;
FindPickHeadColor;
end;
ProgressReport;
Location[CurrentPlayer]:='Falador'
end;




procedure ToCenter;
var
x, y: integer;
begin
MakeCompass('N');
SendArrowSilentWait(0,950+random(200));
if(FindColorSpiral(x,y,MapPickColor,570,63,725,160))then
begin
Click(x-10,y-10,20,20,true);
NFlag(15);
WM(1000,200);
end else
begin
wait(3000);
if(FindColorSpiral(x,y,MapPickColor,570,63,725,160))then
begin
ClickFF(x-10, y-10, 20, 20, 1, 1);
NFlag(15);
Wait(1000+Random(100));
end;
end;
end;




function FindRock(Color: integer): boolean;
var
x, y: integer;
begin
if not FindColorTolerance(x, y, Color, 19, 19, 498, 321, 10) then
begin
Result:= false;
Exit;
end;
FindMiddle(x, y, 260, 160, Color, 19, 19, 498, 321, 50, 50, 10, 10);
Move(x - 1, y - 1, 2, 2);
Wait(70 + Random(30));
if FindColorTolerance(x, y, 13883664, 42, 6, 52, 20, 60) then
begin
GetMousePos(x, y);
Click(x, y, 0, 0, true);
Result:= true;
Exit;
end;
FindMiddle(x, y, 302, 135, Color, 19, 19, 498, 321, 50, 50, 10, 10);
Move(x - 1, y - 1, 2, 2);
Wait(70 + Random(30));
if FindColorTolerance(x, y, 13883664, 42, 6, 52, 20, 60) then
begin
GetMousePos(x, y);
Click(x, y, 0, 0, true);
Result:= true;
Exit;
end;
FindMiddle(x, y, 213, 197, Color, 19, 19, 498, 321, 50, 50, 10, 10);
Move(x - 1, y - 1, 2, 2);
Wait(70 + Random(30));
if FindColorTolerance(x, y, 13883664, 42, 6, 52, 20, 60) then
begin
GetMousePos(x, y);
Click(x, y, 0, 0, true);
Result:= true;
Exit;
end;
end;




procedure ItemGrab;
var
x, y: integer;
begin
GameTab(4);
if (FindColor(x, y, 241, 565, 5, 725, 160)) then
begin
Click(x, y, 1, 1, True);
NFlag(0);
Wait(100 + Random(100));
FindTextSpiral('ake', 258, 169, 50, 5, 10 + Random(10));
GetMousePos(x, y);
Click(x, y, 0, 0, True);
Wait(1000 + Random(100));
end;
end;






function FindPick: Boolean;
var
x, y, c, XH, YH, BR, PickHandle, PickHead: Integer;
ReequipPick: Boolean;
begin
GameTab(4);
Result := True;
if (GetColor(473, 380) = 0) and (GetColor(482, 383) = 0) then
begin
PickHead := BitmapFromString(6, 5,
'2E1F002E1F00352400000001483E33483E331D1400261A002E1F00' +
'352400000001483E331D14001D1400261A002E1F00000001302020' +
'000001000001000001000001302020302020302020302020302020' +
'302020302020483E33');
PickHandle := BitmapFromString(15, 27,
'564D41595145564D41544A3C544A3C595145564D41564D41564D41' +
'564D41595145000001000001544A3C4F4538544A3C595145564D41' +
'544A3C544A3C544A3C5951455951455951455951450000012F2000' +
'362400000001544A3C564D41544A3C544A3C564D41564D41564D41' +
'5951455951455951450000012F20002F2000362400000001302020' +
'564D41544A3C544A3C595145564D41595145564D41595145595145' +
'0000012F2000362400362400000001302020564D41564D41564D41' +
'564D41564D41544A3C544A3C544A3C0000012F20002F2000362400' +
'362400000001302020544A3C544A3C544A3C544A3C544A3C544A3C' +
'544A3C544A3C0000012F2000362400362400362400000001302020' +
'544A3C564D41564D41564D41544A3C564D41564D410000012F2000' +
'2F2000362400362400000001302020302020564D41564D41564D41' +
'595145564D41564D41564D410000012F2000362400362400000001' +
'302020302020544A3C544A3C544A3C544A3C595145544A3C544A3C' +
'0000012F2000362400362400362400000001302020564D41564D41' +
'544A3C544A3C544A3C564D41544A3C4F45380000012F2000362400' +
'362400000001302020302020564D41564D41544A3C544A3C595145' +
'595145564D410000012F2000362400362400362400000001302020' +
'564D41564D41544A3C544A3C564D41564D41595145595145000001' +
'2F20002F20002F2000000001302020302020564D41564D41544A3C' +
'564D41564D41544A3C564D410000012F20002F20002F2000362400' +
'000001302020564D41544A3C544A3C544A3C595145544A3C544A3C' +
'564D410000012F20002F20002F2000000001302020302020544A3C' +
'544A3C564D41564D41595145544A3C544A3C0000012F20002F2000' +
'2F2000000001302020302020595145544A3C564D41595145595145' +
'595145564D41564D410000012F20002F20002F2000000001302020' +
'595145595145564D41564D41595145595145595145595145000001' +
'2F20002F20002F2000000001302020302020595145595145595145' +
'595145564D41564D41564D41564D410000012F20002F20002F2000' +
'000001302020564D41595145595145595145595145564D41564D41' +
'544A3C0000012F20002F20002F2000000001302020302020564D41' +
'595145595145544A3C544A3C564D41595145564D410000012F2000' +
'2F20002F2000000001302020544A3C564D41595145595145544A3C' +
'544A3C564D41564D41564D410000012F20002F2000000001302020' +
'302020544A3C564D41595145595145564D41544A3C544A3C4F4538' +
'000001271B002F20002F2000000001302020595145544A3C564D41' +
'595145595145595145544A3C544A3C544A3C0000011D1500271B00' +
'000001302020302020595145544A3C564D41595145595145595145' +
'564D41564D41564D410000011D15001D1500000001302020595145' +
'544A3C544A3C564D41595145595145595145595145595145544A3C' +
'0000011D15001D1500000001302020564D41595145595145595145' +
'595145564D41595145595145564D41544A3C564D41000001000001' +
'302020302020595145595145595145595145544A3C564D41595145' +
'544A3C544A3C4F4538564D41595145302020302020564D41595145' +
'564D41564D41564D41544A3C544A3C564D41544A3C544A3C544A3C' +
'');
GameTab(5);
Wait(1000);
if (GetColor(604, 300) = 65536) and (GetColor(601, 298) = 65536) then
begin
NoPick := True;
WriteLn('Broken Pickaxe. NoPick:=True;');
GameTab(4);
Result := False;
BR := 1 + Random(5);
case BR of
1:
begin
TypeSend('awww');
end;
2:
begin
TypeSend('n00!');
end;
3:
begin
TypeSend('arghh...');
end;
4:
begin
TypeSend('dumb pick');
end;
5:
begin
TypeSend('come back');
end;
end;
Exit;
end;
GameTab(4);
Wait(2000 + Random(100));
if InvFull then
begin
if (FindBitmapSpiralTolerance(Ore, x, y, 559, 210, 735, 460, 25)) then
begin
Click(x, y, 5, 5, False);
ChooseOption(x, y, 'Drop');
end;
end;
repeat
c := c + 1;
x := Random(510) + 5;
y := Random(330) + 5;
if (FindColorSpiral(x, y, hc1, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc2, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc3, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc4, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc5, 3, 3, 515, 338)) then
begin
Move(x, y, 2, 2);
if IsUpText('Take') then
begin
GetMousePos(x, y);
Click(x, y, 0, 0, True);
end;
NFlag(0);
Wait(1000 + Random(100));
end else
ItemGrab;
until ((FindBitmapSpiralTolerance(PickHead, x, y, 550, 200, 745, 465, 50))
or (c >= 10));
if not (FindBitmapSpiralTolerance(PickHead, x, y, 550, 200, 745, 465, 50))
then
begin
NoPick := True;
Result := False;
Exit;
end;
WriteLn('Found Head');
GameTab(5);
Wait(250);
if FindBitmapSpiralTolerance(PickHandle, XH, YH, 560, 280, 615, 322, 50)
then
begin
WriteLn('Found Handle');
Click(XH, YH, 0, 0, True); // remove the handle, if any.
ReequipPick := True;
end;
Wait(250);
GameTab(4);
Wait(250);
if FindBitmapToleranceIn(PickHead, x, y, 555, 205, 740, 464, 50) and
FindBitmapToleranceIn(PickHead, x, y, 555, 205, 740, 464, 50) then
begin
FindBitmapToleranceIn(PickHead, x, y, 555, 205, 740, 464, 50);
Click(x, y, 0, 0, true);
Wait(1000);
FindBitmapToleranceIn(PickHandle, x, y, 555, 205, 740, 464, 50);
Click(x, y, 0, 0, true);
PickAxeAttached := PickAxeAttached + 1;
WriteLn('Attached Head & Handle');
NoPick := False;
Result := True;
if ((Equip[CurrentPlayer]) or (ReequipPick)) then
begin
Wait(3000);
FindColor(x, y, hc1, 555, 205, 740, 464);
Click(x, y, 0, 0, true);
end;
end;
FreeBitMap(PickHandle);
FreeBitMap(PickHead);
end;
end;




procedure RoadWalk(RColor: Integer; Dir: string);
var
c, x, y: Integer;
begin
UpperCase(Dir);
if (Dir = 'S') then
begin
repeat
c := c + 5;
if (FindColor(x, y, RColor, 565, 160 - c, 725, 160)) then
begin
Click(x, y, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
if (Dir = 'SE') then
begin
repeat
c := c + 5;
if (FindColor(x, y, RColor, 725 - c, 160 - c, 725, 160))
then
begin
Click(x, y + 5, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
if (Dir = 'SW') then
begin
repeat
c := c + 5;
if (FindColor(x, y, RColor, 565, 160 - c, 565 + c, 160))
then
begin
Click(x + 5, y + 5, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
if (Dir = 'N') then
begin
repeat
c := c + 5;
if (FindColorTolerance(x, y, RColor, 565, 5, 725, 5 + c, 0)) then
begin
Click(x, y, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
if (Dir = 'NE') then
begin
repeat
c := c + 5;
if (FindColorTolerance(x, y, RColor, 725 - c, 5, 725, 5 + c, 0)) then
begin
Click(x, y + 5, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
if (Dir = 'NW') then
begin
repeat
c := c + 5;
if (FindColorTolerance(x, y, RColor, 565, 5, 565 + c, 5 + c, 0)) then
begin
Click(x, y + 5, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
if (Dir = 'E') then
begin
repeat
c := c + 5;
if (FindColorTolerance(x, y, RColor, 725 - c, 5, 725, 160, 0)) then
begin
Click(x, y + 5, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
if (Dir = 'W') then
begin
repeat
c := c + 5;
if (FindColorTolerance(x, y, RColor, 565, 5, 565 + c, 160, 0)) then
begin
Click(x, y + 5, 0, 0, true);
NFlag(0);
Break;
end;
until (c >= 100);
end;
end;



procedure RunTo(dir: string; runfar: Boolean);
begin
SetRun(True);
if (runfar) then
case UpperCase(dir) of
'N': Click(648, 83 - 63, 0, 0, true)
'S': Click(648, 83 + 63, 0, 0, true)
'E': Click(648 + 63, 83, 0, 0, true)
'W': Click(648 - 63, 83, 0, 0, true)
end;
if (not runfar) then
case UpperCase(dir) of
'N': Click(648, 83 - 30, 0, 0, true)
'S': Click(648, 83 + 30, 0, 0, true)
'E': Click(648 + 30, 83, 0, 0, true)
'W': Click(648 - 30, 83, 0, 0, true)
end;
Wait(6500);
if (runfar) then
case UpperCase(dir) of
'N': Click(648, 83 + 63, 0, 0, true)
'S': Click(648, 83 - 63, 0, 0, true)
'E': Click(648 - 63, 83, 0, 0, true)
'W': Click(648 + 63, 83, 0, 0, true)
end;
if (not runfar) then
case UpperCase(dir) of
'N': Click(648, 83 + 30, 0, 0, true)
'S': Click(648, 83 - 30, 0, 0, true)
'E': Click(648 - 30, 83, 0, 0, true)
'W': Click(648 + 30, 83, 0, 0, true)
end;
GameTab(4);
end;





procedure RunAway;
var
x, y, c: integer;
begin
Fights:= Fights + 1;
MakeCompass('N');
SendArrowSilentWait(0, 950 + Random(200));
if (Location[CurrentPlayer] = 'Guild')then
begin
Run;
repeat
c:= c + 1;
if FindColor(x, y, LadderColor, 570, 5, 735, 166) then
Break;
AngleMapWalk(1, 0, MapOreColor, 0, 5, 5, 180, 270, 65, 5, 7 + Random(7));
if c = 4 then
Break;
until(FindColor(x, y, LadderColor, 570, 5, 735, 166) or (c > 3));
FindColor(x, y, LadderColor, 570, 5, 735, 166);
ClickFF(x + 15, y - 2 , 10, 12, 1, 0);
NFlag(5 + Random(5));
case Random(3) of
0:
begin
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(20));
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(10));
Talk('fight');
end;
1:
begin
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(20));
Talk('fight');
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(10));
end;
2:
begin
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(20));
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(10));
Talk('fight');
end;
end;
end;
end;




function Mined: boolean;
begin
Result:= false;
//Coal
if FindBlackInChat(66, 458) and
FindBlackInChat(179, 445) then
if not FindBlackInChat(66, 457) then
begin
Result:= true;
Exit;
end;
//Mith
if FindBlackInChat(194, 454) and
FindBlackInChat(191, 447) then
if FindBlackInChat(67, 458) then
begin
Result:= true;
Exit;
end;
//No ore
if FindBlackInChat(268, 454) then
if not FindBlackInChat(268, 453) then
begin
Result:= true;
Exit;
end;
end;






procedure NeilMine;
var
Counter, x, y:integer;
Found: boolean;
begin
Run;
if not FindColorTolerance(x, y, 2570810, 19, 19, 498, 321, 8) and
not FindColorTolerance(x, y, 7425100, 19, 19, 498, 321, 8) then
begin
if LostMining(0, MapOreColor, -1, -1) then
begin
Change:= true;
Exit;
end;
ToCenter;
end;
if FindRock(7425100) then
Found:= true;
if not Found then
if FindRock(2636603) then
Found:= true;
if Found then
begin
NFlag(0);
W(500, 500);
{if FindGas(x, y - 20) then
begin
cl(643, 80, 6, 6, true);
Gasses:= Gasses+1;
writeln('Gas found.');
repeat
g:= g+1;
wait(500+random(10));
t:=random(10);
if t=3 then
randomstuff('mining');
until(g>60);
end; }
//Chat;
RandomStuff('mining');
//waiting until you have mined the ore
repeat
counter:=counter+1;
if LostMining(0, MapOreColor, -1, -1) then
begin
Change:= true;
break;
end;
FindPick;
if NoPick then Break;
if Fighting then RunAway;
w(50,25);
until(Mined or (Counter > 15 + Random(5)));
GainedLvl;
if change then exit;
end;
end;




procedure Mine;
begin
if(MapOreColor=0) then
MapOreColor:= FindMapOreColor;
case random(3) of
0:
begin
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 70 - Random(10), 20, random(10));
end;
1:
begin
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(20));
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 60 - Random(15), 20, random(10));
end;
2:
begin
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 50 - Random(15), 20, random(20));
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 50 - Random(15), 20, random(20));
AngleMapWalk(-1, 0, MapOreColor, 0, -10, -10, 135, 45, 50 - Random(15), 20, random(10));
end;
end;
MarkTime(Mark);
if(MapPickColor = 0) then
MapPickColor:= GetMapPickColor;
repeat
NeilMine;
if Change then
break;
Wait(10);
until(InvFull)or(NoPick)or(TimeFromMark(Mark)>1800000)
if Change then
exit;
gametab(4);
MakeCompass('N');
SendArrowSilentWait(0,950+random(200));
Location[CurrentPlayer]:='Walk2Bank'
end;




procedure SetUp;
var
WTime: integer;
begin
Ore := BitmapFromString(8, 11,
'564D42564D42564D42564D42564D42564D42000001000001564D42' +
'564D42564D42544A3B544A3B0000013D312254442F564D42564D42' +
'564D42564D420000012D2518443827584731564D42544A3B544A3B' +
'564D42000001201B124034257A6346564D42544A3B4D4438564D42' +
'000001483B297D6547806748564D42564D42544A3B564D42000001' +
'7D6547806748000001564D42564D42544A3B544A3B544A3B000001' +
'000001302020000001000001000001000001000001544A3B302020' +
'3020202D2518382D1E403425483B2951412D000001544A3B544A3B' +
'5847315C4A345E4D366552395E4D360000013020200000015C4A34' +
'5E4D3665523968543B655239000001302020000001');
FB1 := DTMFromString('78DA636C66626008634001972E5E66F80FA41' +
'981F83F1030B601D5C4A0AAF9F38789810BAA0604189B8850D345' +
'580D00CA7B110D');
FB2 := DTMFromString('78DA63EC61626008614001478F1E65F80FA41' +
'981F83F1030F602D544A1AAF9F38789810BAA0604182712A1662A' +
'504D247E3500C2961107');
FB3 := DTMFromString('78DA636C646260086140038C0CFFC12403C37' +
'F206004A9894255F1E70F130317540D58472B504D3401359D4035' +
'31F8D50000978B0E8E');
SetUpPlayers;
CurrentPlayer:= 1;
StartTime:= (StartWait * 10000);
if (StartTime>0) then
begin
MarkTime(WTime);
repeat
wait(29000);
move(100, 100, 50, 50);
until(TimeFromMark(WTime)>StartTime);
Move(100, 100, 0, 0);
Wait(100);
Move(200, 200, 0, 0);
Wait(10000);
end;
LogIn;
SymbolAccuracy:= 0.5;
FindFaladorLadderColor;
FindFaladorBasicColors;
LoadSkill('mining');
end;





begin
MainSetup;
Setup;
repeat
if Location[CurrentPlayer]='Falador' then
BankToGuild;
if Location[CurrentPlayer]='Guild' then
Mine;
if Location[CurrentPlayer]='Walk2Bank' then
GuildToBank;
until(false);
end.


Smelter/ jewelery maker
This script has a feature i was testing where it can run at any map angle (north, south, etc)
Basically i wrote four different scripts and put them together, one for each direction.
And the camera picks a random direction to face and decides what to do based on which direction it is.
program SmeltnMelt;
{.include KSI.scar}

{=============================================
========Smelt n Melt Progress Report=========
=============================================
[==Banked 87 load[s].==]
Worked for 2 Hour 16 Minutes and 52 Seconds
Banked 650 bars
=============================================}
////////////////////////////////////////////////////////////////////////////
//
// =Smelt n Melt= =By Almost=
//
//-Makes ores into bars and banks them.
//-Searches for randoms.
//-Fill out the colors in the "setup" underneath and start the script in the
//-Falador West bank.
////////////////////////////////////////////////////////////////////////////
{Credit for the banker DTMs goes to Wizzup? and Wt-Fakawi}


const
//================================Set Up===============================\\
//Color Settings- find on the mini map\\
LadderColor= 7496; //any ladder color

//Player Settings\\
StartingPlayer= 0; //The player you start off using.
Loads= 500; //Loads before switching users.

//Script Settings\\
Smith= true; //Set false to not withdraw ores when banking (for fast testing purposes)
Rotates= false; //For multi angle walking instead of just north.
Rotate= 4; //How often the camera rotates (If rotates is on).
//Low number for a high chance.



var
Bank, TimesBanked, Ladder, Road, fb1, fb2, fb3, waiting,
fx, fy, bx, by, s1, s2, jx, jy, Furnace, c:integer;
Jewellery: array[0..6] of integer;
Bar: array[0..6] of integer;

procedure SetUpPlayers;
begin
//i left this one as an example
PlayerName[0] :='name';
Pass[0] :='pass';
NickName[0] :='ame';
Location[0] :='Walk2Furnace';
Active[0] := True;
Bar[0] := 0;
Jewellery[0] := 1;
end;


//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure FindColors;
var c:integer;
begin
//Furnace:= FurnaceColor;
begin
SymbolAccuracy:=0.5;
repeat
c:=c+1;
if (c>10) then
begin
writeln('Bank Color not found.');
TerminateScript;
end;
Bank:= GetSymbolColor(x, y, 'Bank');
if Bank=0 then
wait(1000);
until(Bank>0);
writeln('Bank Color- ' + inttostr(Bank));
end;
Ladder:= LadderColor;
Road:= FindFallyRoadColor;
if findcolor(x, y, 5862376, 24, 36, 727, 416) then
cl(524, 5, 0, 0, true);
wait(500);
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure FindFurnaceColor;
var c:integer;
begin
SymbolAccuracy:=0.5;
repeat
c:=c+1;
if (c>10) then
begin
writeln('Furnace Color not found.');
TerminateScript;
end;
Furnace:= GetSymbolColor(x, y, 'furnace');
if Furnace=0 then
wait(1000);
until(Furnace>0);
writeln('Furnace Color- ' + inttostr(Furnace));
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure SetCoords;
begin
//Jewellery
if Jewellery[CurrentPlayer]=1 then
jx:=167; jy:=99;
if Jewellery[CurrentPlayer]=2 then
jx:=207; jy:=99;
if Jewellery[CurrentPlayer]=3 then
jx:=248; jy:=99;
if Jewellery[CurrentPlayer]=4 then
jx:=288; jy:=99;
if Jewellery[CurrentPlayer]=5 then
jx:=176; jy:=280;
if Jewellery[CurrentPlayer]=6 then
jx:=215; jy:=280;
if Jewellery[CurrentPlayer]=7 then
jx:=257; jy:=280;
if Jewellery[CurrentPlayer]=8 then
jx:=296; jy:=280;
//Bars
if Bar[CurrentPlayer]=1 then
s1:=668; s2:=448;
if Bar[CurrentPlayer]=2 then
s1:=712; s2:=444;
if Bar[CurrentPlayer]=3 then
s1:=668; s2:=448;
if Bar[CurrentPlayer]=4 then
s1:=590; s2:=440;
if (Jewellery[CurrentPlayer]>0) then
s1:=712; s2:=444;
end;


//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure setup;
begin
SetUpSRL;
SetUpPlayers;
CurrentPlayer:= StartingPlayer;
Run;
GameTab(4);
Makecompass('n');
CurrentAngle:='n';
FindColors;
SetScreenName(NickName[CurrentPlayer]);
SetCoords;
SymbolAccuracy:= 0.6;
FB1 := DTMFromString('78DA636C66626008634001972E5E66F80FA41' +
'981F83F1030B601D5C4A0AAF9F38789810BAA0604189B8850D345' +
'580D00CA7B110D');
FB2 := DTMFromString('78DA63EC61626008614001478F1E65F80FA41' +
'981F83F1030F602D544A1AAF9F38789810BAA0604182712A1662A' +
'504D247E3500C2961107');
FB3 := DTMFromString('78DA636C646260086140038C0CFFC12403C37' +
'F206004A9894255F1E70F130317540D58472B504D3401359D4035' +
'31F8D50000978B0E8E');
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure ProgressReport;
begin
writeln('========Smelt n Melt Progress Report=========');
writeln('=============================================');
writeln('Player- ' + PlayerName[CurrentPlayer]+'.');
WriteLn('Current player banked '+inttostr(Banked[CurrentPlayer])+' loads.');
WriteLn('Total banks- '+inttostr(TimesBanked)+'.');
Writeln('Worked for '+TimeRunning);
if Bar[CurrentPlayer]=1 then
writeln('Banked '+inttostr(TimesBanked*14)+' bars.');
if Bar[CurrentPlayer]=2 then
writeln('Banked around '+inttostr(TimesBanked*14)+' bars.');
if Bar[CurrentPlayer]=3 then
writeln('Banked '+inttostr(TimesBanked*9)+' bars.');
if Bar[CurrentPlayer]=4 then
writeln('Banked '+inttostr(TimesBanked*5)+' bars.');
if Talked>0 then
writeln('Talked '+inttostr(Talked)+' times.');
if Emotes>0 then
writeln('Used and emote '+inttostr(Emotes)+' times.');
if Songs>0 then
writeln('Changed songs '+inttostr(Songs)+' times.');
writeln('=============================================');
writeln(' ');
end;



procedure ChangePlayers;
var c:integer;
begin
repeat
c:= c+1;
CurrentPlayer:= CurrentPlayer+1;
if CurrentPlayer>=6 then
CurrentPlayer:= StartingPlayer;
if (c>10) then
begin
writeln('No active players.');
Terminatescript;
end;
until(Active[CurrentPlayer]=true);
LogNextPlayer;
if Bar[CurrentPlayer]=1 then
s1:=668; s2:=448;
if Bar[CurrentPlayer]=2 then
s1:=712; s2:=444;
if Bar[CurrentPlayer]=3 then
s1:=668; s2:=448;
if Bar[CurrentPlayer]=4 then
s1:=590; s2:=440;
SetScreenName(NickName[CurrentPlayer]);
SetCoords;
banked[CurrentPlayer]:=0;
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
function LostSmithing(c1, c2, c3, c4:integer):boolean;
begin
if Lost(c1, c2, c3, c4, 10) then
begin
Location[CurrentPlayer]:='Lost';
Active[CurrentPlayer]:=False;
ChangePlayers;
Result:= true;
end;
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure BankToFurnace;
begin
if Location[CurrentPlayer]='Walk2Furnace' then
begin
if LostSmithing(Bank, Ladder, Road, -1) then
exit;
if Rotates=true then
RandomSetMap(Rotate);
Run;
//Click 1=====
if CurrentAngle='n' then
AngleMapWalk(-2, 2, Road, 10, -7, 4, 50, 10, 65, 15, 6+random(6));
if CurrentAngle='e' then
AngleMapWalk(2, 2, Road, 10, 2, 7, 320, 270, 65, 15, 6+random(6));
if CurrentAngle='s' then
AngleMapWalk(2, -2, Road, 10, 5, -5, 225, 180, 65, 15, 6+random(6));
if CurrentAngle='w' then
AngleMapWalk(-2, -2, Road, 10, -5, -5, 160, 90, 65, 15, 6+random(6));
if LostSmithing(Bank, Road, Ladder, -1) then
exit;
Run;
if Rotates=true then
RandomSetMap(Rotate);
//Click 2=====
if CurrentAngle='n' then
cl(713-random(15),83+random(20)-10,0,0,true);
if CurrentAngle='e' then
cl(638, 14, 12, 6, true);
if CurrentAngle='s' then
cl(577, 73, 6, 12, true);
if CurrentAngle='w' then
cl(633, 134, 12, 4, true);
w(2000,0);
NFlag(4+random(5));
if LostSmithing(-1, Road, Ladder, -1) then
exit;
Run;
if Rotates=true then
RandomSetMap(Rotate);
if Furnace=0 then
FindFurnaceColor;
//Possible Click=====
if not findcolortolerance(x,y,furnace,582,8,725,161,10) then
begin
if CurrentAngle='n' then
cl(691-random(8), 122-random(8), 0, 0, true);
if CurrentAngle='e' then
cl(669-random(5), 41-random(5), 10, 10, true);
if CurrentAngle='s' then
cl(616-random(5), 69-random(5), 10, 10, true);
if CurrentAngle='w' then
cl(633-random(5), 119-random(5), 10, 10, true);
w(500,100);
NFlag(6+random(6));
if Rotates=true then
RandomSetMap(Rotate);
Run;
end;
if LostSmithing(Furnace, Road, Ladder, -1) then
exit;
//Click 3=====
findcolortolerance(x,y,furnace,582,8,725,161,10);
if CurrentAngle='n' then
cl(x, y, -7, -7, true);
if CurrentAngle='e' then
cl(x, y, -7, 7, true);
if CurrentAngle='s' then
cl(x, y, 7, 7, true);
if CurrentAngle='s' then
cl(x, y, 7, -7, true);
w(1000,0);
NFlag(0);
if Rotates=true then
RandomSetMap(Rotate);
Location[CurrentPlayer]:='Furnace';
end;
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure Smelt;
begin
if Location[CurrentPlayer]='Furnace' then
begin
if LostSmithing(Furnace, Road, Ladder, -1) then
exit;
repeat
if CurrentAngle='n' then
if not findcolortolerance(x,y,ladder,633,76,647,82,10) then
begin
SpiralColor(664, 110, Ladder, 10, 80);
cl(x+5,y+7,5,5,true);
w(200,0);
NFlag(0);
end;
if CurrentAngle='e' then
if not findcolortolerance(x,y,ladder,635,83,645,94,10) then
begin
findcolortolerance(x,y,ladder,617,60,713,156,10);
cl(x,y,5,-3,true);
w(200,0);
NFlag(0);
end;
if CurrentAngle='s' then
if not findcolortolerance(x,y,ladder,653,86,661,94,10) then
begin
findcolortolerance(x,y,ladder,617,60,713,156,10);
cl(x,y,-5,-3,true);
w(200,0);
NFlag(0);
end;
if CurrentAngle='w' then
if not findcolortolerance(x,y,ladder,648,71,661,79,10) then
begin
findcolortolerance(x,y,ladder,617,60,713,156,10);
cl(x,y-2,5,4,true);
w(200,0);
NFlag(0);
end;
if LostSmithing(Furnace, Road, Ladder, -1) then
exit;
//Finding the furnace
if CurrentAngle='n' then
begin
fx:=416+random(10);
fy:=184+random(10);
end;
if CurrentAngle='e' then
begin
fx:=265+random(10);
fy:=67+random(10);
end;
if CurrentAngle='s' then
begin
fx:=142+random(10);
fy:=167+random(10);
end;
if CurrentAngle='w' then
begin
fx:=244+random(10);
fy:=279+random(10);
end;
if (Jewellery[CurrentPlayer]>0) then
cl(622, 226, 5, 5, true);
if findfrom(x,y,'urn',3487034,10,fx,fy)then
begin
cl(x,y,2,2,true);
w(200,0);
fflag(0);
w(100,300);
end;
until (findcolor(x,y,128,150,361,192,378)) or (GetColor(239, 71)=39423);
//Jewellery\\
if (Jewellery[CurrentPlayer]>0) then
begin
repeat
cl(jx, jy, 5, 5, false);
w(300,200);
until(chooseoption(x,y,'ke X')) or (c>3);
w(600, 200);
typesend('99');
end;
//bronze bars\\
if Bar[CurrentPlayer]=1 then begin
repeat
c:=c+1;
cl(45,400,10,10,false);
w(300,200);
until(chooseoption(x,y,'lt X')) or (c>3);
w(600, 200);
typesend('99');
wait(1000);
end;
//iron bars\\
if Bar[CurrentPlayer]=2 then begin
repeat
c:=c+1;
cl(148,400,10,10,false);
w(300,200);
until(chooseoption(x,y,'lt X')) or (c>3);
w(600, 200);
typesend('99');
wait(1000);
end;
//steel bars\\
if Bar[CurrentPlayer]=3 then begin
repeat
c:=1+1;
cl(248,399,10,10,false);
w(200,200);
until(chooseoption(x,y,'lt X')) or (c>3);
wait(1000);
end;
//mith bars\\
if Bar[CurrentPlayer]=4 then begin
repeat
c:=1+1;
cl(354,399,10,10,false);
w(200,200);
until(chooseoption(x,y,'lt 5')) or (c>3);
wait(1000);
end;
marktime(waiting);
//waiting to be done smelting\\
repeat
w(200,200);
if LostSmithing(Furnace, Road, Ladder, -1) then
exit;
//if you gain a smithing lvl
if (getcolor(162, 434)>0) then
begin
makecompass('n');
wait(50+random(50));
makecompass('n');
if (Jewellery[CurrentPlayer]>0) then
cl(581, 226, 5, 5, true);
repeat
if findfrom(x,y,'urn',3487034,10,fx,fy)then
begin
cl(x,y,2,2,true);
w(200,0);
fflag(0);
w(100,300);
end;
until findcolor(x,y,128,150,361,192,378);
if (Jewellery[CurrentPlayer]>0) then
begin
repeat
cl(jx, jy, 5, 5, false);
w(200,200);
until(chooseoption(x,y,'ke X')) or (c>3);
w(600, 200);
typesend('99');
wait(1000);
end;
//bronze bars\\
if Bar[CurrentPlayer]=1 then begin
repeat
c:=c+1;
cl(45,400,10,10,false);
w(200,200);
until(chooseoption(x,y,'lt X')) or (c>3);
w(600, 200);
typesend('99');
wait(1000);
end;
//iron bars\\
if Bar[CurrentPlayer]=2 then begin
repeat
c:=c+1;
cl(156,429,10,10,false);
w(200,200);
until(chooseoption(x,y,'lt X')) or (c>3);
w(600, 200);
typesend('99');
wait(1000);
end;
//steel bars\\
if Bar[CurrentPlayer]=3 then begin
repeat
c:=c+1;
cl(248,399,10,10,false);
w(200,200);
until(chooseoption(x,y,'lt X')) or (c>3);
w(600, 200);
typesend('99');
wait(1000);
end;
//mith bars\\
if Bar[CurrentPlayer]=4 then begin
repeat
c:=c+1;
cl(354,399,10,10,false);
w(200,200);
until(chooseoption(x,y,'lt 5')) or (c>3);
w(600, 200);
typesend('99');
wait(1000);
end;
end;
findnormalrandoms;
if random(10)=1 then
RandomStuff('smithing');
if findfight then break;
until (getcolor(s1,s2)=3885652) or (timefrommark(waiting)>90000);
Run;
if Rotates=true then
RandomSetMap(Rotate);
end;
Location[CurrentPlayer]:='Walk2Bank';
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure FurnaceToBank;
begin
if Location[CurrentPlayer]='Walk2Bank' then
begin
if LostSmithing(Furnace, Road, Ladder, -1) then
exit;
//Click 1=====
if CurrentAngle='n' then
cl(607, 34, 15, 15, true);
if CurrentAngle='e' then
cl(601, 123, 10, -10, true);
if CurrentAngle='s' then
cl(690, 125, -10, -10, true);
if CurrentAngle='w' then
cl(700, 42, -10, 10, true);
w(500, 100);
NFlag(4+random(5));
if Rotates=true then
RandomSetMap(Rotate);
Run;
//Click 2=====
if LostSmithing(-1, Road, Ladder, -1) then
exit;
if CurrentAngle='n' then
AngleMapWalk(2, -1, Road, 5, 3, 3, 280, 220, 70, 20, 5+random(6));
if CurrentAngle='e' then
AngleMapWalk(0, -2, Road, 5, 5, -5, 225, 135, 70, 20, 5+random(6));
if CurrentAngle='s' then
AngleMapWalk(-2, 0, Road, 5, -5, -5, 135, 45, 70, 20, 5+random(6));
if CurrentAngle='w' then
AngleMapWalk(2, 0, Road, 5, 7, 2, 285, 350, 70, 20, 5+random(6));
if Rotates=true then
RandomSetMap(Rotate);
//Possible Click=====
if not findcolortolerance(x, y, bank, 600, 33, 721, 164, 10) then
begin
if CurrentAngle='n' then
begin
bx:=625;
by:=105;
end;
if CurrentAngle='e' then
begin
bx:=671;
by:=90;
end;
if CurrentAngle='s' then
begin
bx:=660;
by:=50;
end;
if CurrentAngle='w' then
begin
bx:=606;
by:=63;
end;
cl(bx, by, 10, 10, true);
NFlag(1);
end;
if LostSmithing(Bank, Road, Ladder, -1) then
exit;
findcolortolerance(x, y, bank, 600, 33, 721, 164, 10)
cl(x-5+random(10), y-5+random(10), 0, 0, true);
wait(1000);
NFlag(0);
if LostSmithing(Bank, Road, Ladder, -1) then
exit;
//Click 3=====
if CurrentAngle='n' then
begin
if findDTM(fb1, x, y, 573, 11, 728, 149) then
begin
cl(x, y, 13, -2, true);
end else
if findDTM(fb2, x, y, 573, 11, 728, 149) then
begin
cl(x, y, 13, -2, true);
end else
if findDTM(fb3, x, y, 573, 11, 728, 149) then
begin
cl(x, y, 13, -2, true);
end;
end;
wait(200);
NFlag(0);
if CurrentAngle='e' then
begin
spiralcolor(664, 85, 62965, 30, 40);
cl(x-4, y+5, -3, 10, true);
wait(200);
NFlag(0);
end;
if CurrentAngle='s' then
begin
spiralcolor(664, 60, 62965, 30, 40);
cl(x-3, y+5, 4, 5, true);
wait(200);
NFlag(0);
end;
if CurrentAngle='w' then
begin
spiralcolor(627, 85, 62965, 30, 40);
cl(x+4, y-6, 4, -10, true);
wait(200);
NFlag(0);
end;
end;
Location[CurrentPlayer]:='Bank';
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure BankBars;
var c:integer;
begin
if Location[CurrentPlayer]='Bank' then
begin
if LostSmithing(Bank, Road, Ladder, -1) then
exit;
repeat
c:=c+1;
NeilBank(4810623);
until(BankScreen) or (c>3);
if not (BankScreen)then begin
if CurrentAngle='n' then
begin
FindColorTolerance(x, y, Bank, mmx1, mmy1, mmx2, mmy2, 10);
cl(x, y, 0, 0, true);
end;
wait(200);
NFlag(0);
if CurrentAngle='e' then
begin
spiralcolor(664, 85, 62965, 30, 40);
cl(x-4, y+5, -3, 10, true);
wait(200);
NFlag(0);
end;
if CurrentAngle='s' then
begin
spiralcolor(664, 60, 62965, 30, 40);
cl(x-3, y+5, 4, 5, true);
wait(200);
NFlag(0);
end;
if CurrentAngle='w' then
begin
spiralcolor(627, 85, 62965, 30, 40);
cl(x+4, y-6, 4, -10, true);
wait(200);
NFlag(0);
end;
NeilBank(4810623);
end;
if Smith= true then
begin
if Bar[CurrentPlayer]=3 then begin
if not findcolor(x,y,4345174,711,446,712,447) then
cl(706,441,10,10,true);
end;
w(500,500);
//finding Bronze//////////////////
if Bar[CurrentPlayer]=1 then
begin
if not findcolortolerance(x,y,2710431,94,77,95,78,10) or
not findcolortolerance(x,y,8092548,143,78,144,79,10) then
begin
writeln('Out of ore!');
Location[CurrentPlayer]:='Lost';
Active[CurrentPlayer]:=False;
ChangePlayers;
end;
end;
//finding iron///////////////////
if Bar[CurrentPlayer]=2 then
begin
if not findcolortolerance(x,y,2174539,94,77,95,78,10) then
begin
writeln('Out of ore!');
Location[CurrentPlayer]:='Lost';
Active[CurrentPlayer]:=False;
ChangePlayers;
end;
end;
//finding steel//////////////////
if Bar[CurrentPlayer]=3 then
begin
if not findcolortolerance(x,y,1714730,94,77,95,78,10) or
not findcolortolerance(x,y,2174539,143,78,144,79,10) then
begin
writeln('Out of ore!');
Location[CurrentPlayer]:='Lost';
Active[CurrentPlayer]:=False;
ChangePlayers;
end;
end;
//finding mith//////////////////
if Bar[CurrentPlayer]=4 then
begin
if not findcolortolerance(x,y,1714730,94,77,95,78,10) or
not findcolortolerance(x,y,6965319,143,78,144,79,10) then
begin
writeln('Out of ore!');
Location[CurrentPlayer]:='Lost';
Active[CurrentPlayer]:=False;
ChangePlayers;
end;
end;
if bar[CurrentPlayer]= 4 then
begin
OptionItemExceptMulti(28, 27, 26, -1, 'All');
end else
ClickAllItemsColorWait('All',65536,900+Random(300));
//withdrawing for bronze
if Bar[CurrentPlayer]=1 then begin
c:=0;
repeat
c:=c+1;
cl(136,73,12,12,false);
w(100,100);
chooseoption(x,y,'X');
w(900,300);
typesend('14');
w(1600,400);
until findcolortolerance(x,y,7039860,584,229,585,230,20) or (c>3);
c:=0;
repeat
c:=c+1;
cl(87,73,12,12,false);
w(100,100);
chooseoption(x,y,'All');
w(1600,400);
until findcolortolerance(x,y,3768800,671,337,672,338,20) or (c>3);
end;
//withdrawing for iron
if Bar[CurrentPlayer]=2 then begin
c:=0;
repeat
c:=c+1;
cl(90,70,12,12,false);
w(100,100);
chooseoption(x,y,'ll');
w(1600,400);
until findcolortolerance(x,y,1845057,584,229,585,230,20) or (c>3);
end;
//withdrawing for steel
if Bar[CurrentPlayer]=3 then begin
c:=0;
repeat
c:=c+1;
cl(136,73,12,12,false);
w(100,100);
chooseoption(x,y,'X');
w(900,300);
typesend('9');
w(1600,400);
until findcolortolerance(x,y,1845058,584,229,585,230,20) or (c>3);
c:=0;
repeat
c:=c+1;
cl(87,73,12,12,false);
w(100,100);
chooseoption(x,y,'All');
w(1600,400);
until findcolortolerance(x,y,1977645,712,445,713,446,20) or (c>3);
end;
//withdrawing for mith
if Bar[CurrentPlayer]=4 then begin
c:=0;
repeat
c:=c+1;
cl(136,73,12,12,false);
w(100,100);
chooseoption(x,y,'5');
w(1600,400);
until findcolortolerance(x,y,5979709,584,229,585,230,20) or (c>3);
c:=0;
repeat
c:=c+1;
cl(87,73,12,12,false);
w(100,100);
chooseoption(x,y,'All');
w(1600,400);
until findcolortolerance(x,y,1977645,712,445,713,446,20) or (c>3);
end;
end;
banked[CurrentPlayer]:=banked[CurrentPlayer]+1;
TimesBanked:=TimesBanked+1;
ProgressReport;
if (Banked[CurrentPlayer]>=Loads) then
writeln('Enough loads done, switching players.');
if (Banked[CurrentPlayer]>=Loads) then
ChangePlayers;
if (Banked[CurrentPlayer]>=Loads) then
exit;
if Rotates=false then
begin
MakeCompass('n');
wait(50+random(50));
MakeCompass('n');
wait(50+random(50));
end;
end;
Location[CurrentPlayer]:='Walk2Furnace';
end;


//====================================================================
//=======================Main Line====================================
begin
setup;
repeat

if Location[CurrentPlayer]='Walk2Furnace' then
BankToFurnace;

if Location[CurrentPlayer]='Furnace' then
Smelt;

if Location[CurrentPlayer]='Walk2Bank' then
FurnaceToBank;

if Location[CurrentPlayer]='Bank' then
BankBars;

until(false);
end.


Varrock Miner-
program VarrockHavoc;
{Credit for the banker DTMs goes to Wizzup? and Wt-Fakawi}


const
//////////////////////////////////////////////////////////////////////////
//Player Settings\\
StartingPlayer= 0; //The player you start off using.
Loads= 99; //Loads before switching users.
//////////////////////////////////////////////////////////////////////////
//Script Settings\\
ChooseRandomly= true; //If it chooses randomly between the 2 rocks you set
Banking= true; //if the script banks your ores (for testing purposes, leave at true)
//////////////////////////////////////////////////////////////////////////

var fb1, fb2, fb3, OreCol1, OreCol2, TimesBanked:integer;
MapPick, Bank, Road:integer;
Change: boolean;
Ore1: array[0..6] of string;
Ore2: array[0..6] of string;
Equip: array[0..6] of boolean;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure SetUpPlayers;
begin
//i left one as an example

PlayerName[0] :='name';
Pass[0] :='pass';
NickName[0] :='ame';
Ore1[0] :='iron';
Ore2[0] :='copper';
Location[0] :='BankToMine';
Equip[0] := False;
Active[0] := True;
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
Procedure DoChats;
Begin
SetChat('Hide', 1);
SetChat('Hide', 1);
SetChat('Off', 2);
SetChat('Off', 2);
SetChat('On', 3);
SetChat('On', 3);
End;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure FindPickColor;
var c:integer;
begin
if MapPick=0 then
begin
SymbolAccuracy:=0.6;
repeat
c:=c+1;
MapPick:= GetSymbolColor(x,y,'mining spot');
wait(100);
if (MapPick>0) then
writeln('Pick Color- ' + inttostr(MapPick));
until((MapPick>0) or (c>4));
end;
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure SetOres;
begin
if Ore1[CurrentPlayer]= 'tin' then
OreCol1:= 8618893;
if Ore1[CurrentPlayer]= 'copper' then
OreCol1:= 4220044;
if Ore1[CurrentPlayer]= 'iron' then
OreCol1:= 2569300;
//OreColor2
if Ore2[CurrentPlayer]= 'tin' then
OreCol2:= 8618893;
if Ore2[CurrentPlayer]= 'copper' then
OreCol2:= 4220044;
if Ore2[CurrentPlayer]= 'iron' then
OreCol2:= 2569300;
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure ChangePlayers;
var c:integer;
begin
repeat
c:= c+1;
CurrentPlayer:= CurrentPlayer+1;
if CurrentPlayer>=6 then
CurrentPlayer:= StartingPlayer;
if (c>10) then
begin
writeln('No active players.');
Terminatescript;
end;
until(Active[CurrentPlayer]=true);
LogNextPlayer;
SetScreenName(NickName[CurrentPlayer]);
banked[CurrentPlayer]:=0;
end;





//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
function LostMining(c1, c2, c3, c4:integer):boolean;
begin
if Lost(c1, c2, c3, c4, 10) then
begin
Location[CurrentPlayer]:='Lost';
Active[CurrentPlayer]:=False;
ChangePlayers;
Result:= true;
end;
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure BankToMine;
begin
if LostMining(Bank, Road, -1, -1) then exit;
AngleMapWalk(-2, 0, Road, 20, -5, -5, 90, 30, 60, 1, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
cl(704, 108, -10, 3, true);
w(500, 0);
NFlag(8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
AngleMapWalk(0, -2, Road, 20, 4, -5, 80, 160, 65, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
AngleMapWalk(0, -2, Road, 20, 4, -5, 135, 225, 65, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
AngleMapWalk(0, -2, Road, 20, 4, -5, 135, 225, 65, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
cl(656, 147, 8, -8,true);
wait(500);
NFlag(8+random(4));
FindPickColor;
//First try\\
if (MapPick>0) and findcolor(x, y, MapPick, 563, 5, 731, 169) then
begin
findcolor(x, y, MapPick, 563, 5, 731, 169);
cl(x-10, y-10, 20, 20, true);
wait(500);
NFlag(3+random(3));
end else
//2nd try\\
begin
cl(634, 149, -4, 4,true);
wait(500);
NFlag(3+random(4));
FindPickColor;
if (MapPick>0) and findcolor(x, y, MapPick, 563, 5, 731, 169) then
begin
cl(x-10, y-10, 20, 20, true);
wait(500);
NFlag(3+random(3));
end else
//3rd try\\
begin
cl(634, 149, -4, 4,true);
wait(500);
NFlag(3+random(4));
FindPickColor;
if (MapPick>0) and findcolor(x, y, MapPick, 563, 5, 731, 169) then
begin
cl(x-10, y-10, 20, 20, true);
wait(500);
NFlag(3+random(3));
end else
begin
writeln('Map Pick not found');
TerminateScript;
end;
end;
end;
if LostMining(-1, Road, -1, -1) then exit;
Location[CurrentPlayer]:= 'Mine';
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure FindColors;
var c:integer;
begin
SymbolAccuracy:=0.4;
repeat
c:=c+1;
if (c>10) then
begin
writeln('Bank Color not found.');
TerminateScript;
end;
Bank:= GetSymbolColor(x, y, 'Bank');
if Bank=0 then
wait(1000);
until(Bank>0);
Road:= RoadColorFind(612, 46);
writeln('Bank Color- ' + inttostr(Bank));
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure setup;
begin
SetUpSRL;
if Equip[CurrentPlayer]= false then
CurrentInv:= 1;
SetUpPlayers;
CurrentPlayer:= StartingPlayer;
DoChats;
Run;
GameTab(4);
Makecompass('n');
FindColors;
SetOres;
SetScreenName(NickName[CurrentPlayer]);
FB1 := DTMFromString('78DA636C66626008634001972E5E66F80FA41' +
'981F83F1030B601D5C4A0AAF9F38789810BAA0604189B8850D345' +
'580D00CA7B110D');
FB2 := DTMFromString('78DA63EC61626008614001478F1E65F80FA41' +
'981F83F1030F602D544A1AAF9F38789810BAA0604182712A1662A' +
'504D247E3500C2961107');
FB3 := DTMFromString('78DA636C646260086140038C0CFFC12403C37' +
'F206004A9894255F1E70F130317540D58472B504D3401359D4035' +
'31F8D50000978B0E8E');
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure ProgressReport;
begin
writeln('=============================================');
writeln('========Varrock Havoc Progress Report========');
writeln('=============================================');
writeln('Player- ' + PlayerName[CurrentPlayer]+'.');
WriteLn('Current player banked '+inttostr(Banked[CurrentPlayer])+' loads.');
WriteLn('Total banks- '+inttostr(TimesBanked)+'.');
Writeln('Worked for '+TimeRunning);
if Talked>0 then
writeln('Talked '+inttostr(Talked)+' times.');
if Emotes>0 then
writeln('Used and emote '+inttostr(Emotes)+' times.');
if Songs>0 then
writeln('Changed songs '+inttostr(Songs)+' times.');
writeln('=============================================');
writeln(' ');
end;




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure RunAway;
var c:Integer;
begin
Run;
MakeCompass('E');
wait(50+random(50));
MakeCompass('N');
wait(50+random(50));
MakeCompass('N');
SendArrowSilentWait(0,950+random(200));
cl(634, 134, 10, 10, true);
NFlag(10+random(7));
repeat
c:= c+1;
//FindRandoms;
w(500, 200);
RandomStuff('mining');
until(c=6+random(3));
cl(643, 18, 10, 10, true);
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure NeilMine;
var dx, dy, counter, t:integer; found:boolean;
begin
Run;
if ChooseRandomly= true then
begin
case Random(2) of
0 :
begin
if FindObjOre(dx, dy, OreCol1, 10, 4) then
begin
found:= true;
end;
end;
1 :
begin
if FindObjOre(dx, dy, OreCol2, 10, 4) then
begin
found:= true;
end;
end;
end;
end;
/////////////////
if ChooseRandomly= false then
begin
if FindObjOre(dx, dy, OreCol1, 10, 4) then
begin
found:= true;
end else
if (OreCol2>0) then
if FindObjOre(dx, dy, OreCol2, 10, 4) then
begin
found:= true;
end;
end;
//////////////////
if LostMining(MapPick, Road, -1, -1) then exit;
if found then
begin
getmousepos(x, y);
cl(x,y,0,0,true);
Chat;
flag;
t:=random(8);
if t=3 then begin
//FindRandoms;
randomstuff('mining');
end;
//waiting until you have mined the ore
repeat
counter:=counter+1;
if LostMining(MapPick, Road, -1, -1) then
begin
Change:= true;
break;
end;
//FindRandoms;
randomstuff('mining');
FindPick;
If NoPick Then Break;
If FindFight Then RunAway;
w(50,50);
until (getcolor(173,426)=0) or (getcolor(279,426)=0) or (counter>6);
if change then exit;
end;
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure Mine;
begin
ResumeFindingRandoms;
repeat
NeilMine;
if Change then break;
Wait(10);
if (not(Loggedin)) then break;
until(InventoryFull)or(NoPick=true);
if Change then
exit;
gametab(4);
MakeCompass('E');
wait(50+random(50));
MakeCompass('N');
wait(50+random(50));
MakeCompass('N');
SendArrowSilentWait(0,950+random(200));
Location[CurrentPlayer]:='MineToBank'
end;



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
procedure MineToBank;
var c:integer;
begin
if LostMining(MapPick, Road, -1, -1) then exit;
AngleMapWalk(-2, 2, Road, 20, -5, 5, 0, 90, 70, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
AngleMapWalk(-2, 2, Road, 20, -5, 5, 350, 405, 70, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
AngleMapWalk(-2, 2, Road, 20, -5, 5, 320, 405, 65, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
//Moving left
AngleMapWalk(2, 2, Road, 20, 5, 5, 290, 370, 65, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
AngleMapWalk(2, 0, Road, 20, 5, 5, 240, 300, 65, 15, 8+random(4));
if LostMining(-1, Road, -1, -1) then exit;
if not findcolor(x, y, Bank, mmx1, mmy1, mmx2, mmy2) then
AngleMapWalk(2, 0, Road, 20, 5, 0, 230, 315, 55, 15, 8+random(4));
if LostMining(Bank, Road, -1, -1) then exit;
PauseFindingRandoms;
repeat
c:= c+1;
SpiralColor(653, 91, Bank, 30, 80);
cl(x-5, y-5, 10, 10, true);
wait(500);
NFlag(0);
SpiralColor(653, 91, 195836, 30, 80);
cl(x-5, y-3, 10, -3, true);
wait(500);
NFlag(0);
NeilBank(5593184);
if (c>10) then
begin
writeln('Bank not found');
TerminateScript;
end;
if BankScreen then
break;
until(BankScreen);
if Banking=true then
begin
if Equip[CurrentPlayer]= false then
OptionItemExcept(1, 'All');
if Equip[CurrentPlayer]= true then
OptionItemExcept(0, 'All');
end;
banked[CurrentPlayer]:=banked[CurrentPlayer]+1;
TimesBanked:=TimesBanked+1;
if Equip[CurrentPlayer]= false then
CurrentInv:= 1;
ProgressReport;
if (Banked[CurrentPlayer]>=Loads) then
writeln('Enough loads done, switching players.');
if (Banked[CurrentPlayer]>=Loads) then
ChangePlayers;
if (Banked[CurrentPlayer]>=Loads) then
exit;
Location[CurrentPlayer]:='BankToMine';
end;




begin
SetUp;
repeat

if Location[CurrentPlayer]= 'BankToMine' then
BankToMine;

if Location[CurrentPlayer]= 'Mine' then
Mine;

if Location[CurrentPlayer]= 'MineToBank' then
MineToBank;

until(false);
end.

skilld u

2008-03-01 16:28:24

wow. those are really good. yes.

Wizzup?

2008-03-01 16:36:23

UnSpace could be Replace(s, ' ', '');
Yes.
EDIT: I'm going to change my vote to no, you should just include SRL instead of depreciated functions alongside with core functions.

almost

2008-03-01 16:43:59

Yes Wizzup you are right.
I don't think Replace was out when i made that procedure it is ancient to me.
Maybe it was and i just never found it?…

Edit:
Read this wizzup…
Im pretty sure Replace didnt exist about 4 years ago.
And all FOUR scripts i had posted run on SRL.
I don't get what you are saying…

Wizzup?

2008-03-01 16:45:09

From: almost
Yes Wizzup you are right.
I don't think Replace was out when i made that procedure it is ancient to me.
Maybe it was and i just never found it?…


About my change of votes. -If you supply me with a good reason for not including SRL, I will change it back to yes.

BobboHobbo

2008-03-01 16:47:15

Wow alot of code, Yes.

Santa_Clause

2008-03-01 16:51:11

You really need to learn cases and standards. You've got the hang of for/to/do loops, but you still need a bit more practice.

Yes from me. Good job.

Edit: Noticed you didn't include SRL…KSI instead. Alot of the SRL functions are in your script. Holding vote for now.

almost

2008-03-01 16:52:29

Oh ok read what i just posted.
And by the way the section you are talking about, where i put the procedure Unspace, that isnt like an actual script.
It is just stuff i have some up with over the years…

My actual scripts make use of SRL though.
And if i knew that SRL had a way of unspacing, or any other procedure i have made, i wouldn't waste my time making one.



Santa_Clause-
Oh yes, my standards
looking at some of those old scripts again has made me laugh at how far i've come.
Like the smelter, it is from before i knew much about standards.
But i have those down now.
And thanks for the vote

almost

2008-03-01 17:10:00

KSI is just an include file i made so that each main script won't be millions of lines long.
But they all run on SRL, i just took out the include SRL line thing on all of them.

Wizzup?

2008-03-01 17:38:55

From: almost
My actual scripts make use of SRL though.


Excuse me - but I don't see you use {.include SRL/SRL.scar} :)

RAM

2008-03-01 17:40:46

Lots of good stuff posted here, but do you have any of your work that is current ?

~RAM

almost

2008-03-01 18:54:23

Wizzup-
Look at my last post, i took out the include lines.

Ram- My current stuff is non RuneScape related, so i didn't post it.
Except for the Color changer form, that's what i've been working on lately.
And i'm starting back up on RuneScape, that's why i want SRL membership.
I will be updating all my scripts plus making many more.

Negaal

2008-03-01 19:05:21

Holy….Shit?

Sorry, but why it has to be runescape script.
If applyer has good attidude and is good at programming…

Ow…he needs to know SRL?

Yeah, yes anyways.

:rolleyes:

Auto-Apply ftw?!


Edit:
Almsot is almost perfect.
AlmMousePath(0, 0, 0, 0, 1, 1, 1, 5, 100);

Dan Cardin

2008-03-01 19:10:32

From: almost
KSI is just an include file i made so that each main script won't be millions of lines long.
But they all run on SRL, i just took out the include SRL line thing on all of them.


is that supposed to mean that you include srl in the ksi include?(…would that even work? including a script that includes srl makes the origional script have srl?….would it?lol)


i vote yes :)

almost

2008-03-01 19:34:11

THANK YOU NEGAAL
I agree with this, but i just go along with what i am told =)

And dan, yes you can put an include in a include.
I put SRL in my own include folder called KSI.
I just took the line declaring it out to not cause confusion about what KSI was.
Not trying to replace SRL or something…


Edit:
Hmm.. i've had 2 or 3 people say they want to vote yes, but my votes for yes is still at 3?

MylesMadness

2008-03-01 20:24:20

Yes!

ZephyrsFury

2008-03-01 21:05:41

I'm gonna vote no.

Most of your scripts don't compile. They have simple errors such as unknown identifiers, semicolon expected errors, duplicate identifier errors. This leads me to believe that you haven't tested them at all. They don't include SRL. You've only included this KSI in one script.

So yea… sorry

almost

2008-03-01 21:17:04

Wow i'm sorry but you could not be much more wrong.
They don't include SRL. You've only included this KSI in one script.

Please look at half of the procedures in my scripts.
ALL my scripts use SRL.
I compiled them all before posting, i just took out the include file line to post them.
That's where you are getting your errors.
And i already posted that these are the scripts i have always used, i don't use other people's scripts because you get banned so much faster.
So they DO work and i HAVE tested them, for the entire time i've been scripting.

So basically if you had KSI it would work completely fine.
You are probably trying to include the latest version of SRL in it and then run it.
I have no clue how messed up that would make it.
These were made on an out of date version of SRL.

I think you just voted without reading through all my posts…

And everyone is forgetting i do have 2 fully up to date working scripts up there.

RAM

2008-03-01 21:20:41

From: almost


So basically if you had KSI it would work completely fine.


So……Post KSI ?

~RAM

P1nky

2008-03-01 21:37:25

i agree it should be a runescape script..

almost

2008-03-01 21:37:56

Ok i checked some things out…
With SCAR 3.14 there are some things that don't compile the same with the version i made these scripts on.
Like now you have to have a semicolon in every single line.
So there are errors as far as that goes.

Ram-
I could post KSI and it still won't compile or work right because of SRL being out of date.

P1nky-
I agree to a certain point.
If the applicant can't do RuneScape scripts, and they only have other things then they don't deserve membership.
But i think i clearly know how to make RuneScape autos.

Dan Cardin

2008-03-02 08:37:05

I could post KSI and it still won't compile or work right because of SRL being out of date.


update them to newest srl? and post ksi?

though i dont necessarily agree with the runescape rule. If you're script shows that you can script well enough then i think im going to vote yes…but it does depend on the script

JuKKa

2008-03-02 09:29:52

This is a bit like the case which Sky Scripter had…

As ur name says:
You almost lost my vote.

Yes. lol

almost

2008-03-02 19:23:00

Dan-
That's what i'm in the process of doing but that takes loads of time.

This is a bit like the case which Sky Scripter had…

As ur name says:
You almost lost my vote.

What does that mean?

MasterKill

2008-03-03 07:35:58

yes.

btw, some stuff is very old…

almost

2008-03-03 21:54:39

So… Can anyone tell me what exactly it takes to become a member?
Like a certain amount of yes's or a certain amount of time?

Dan Cardin

2008-03-04 07:11:47

more than 50% after the time period at the top is over. unless its like 20 yes to 1 no then an admin will usually just accept early

Naum

2008-03-04 13:01:34

no.
we need some runescape scripts.
Which need srl.

Dan Cardin

2008-03-04 14:12:41

From: NaumanAkhlaQ
no.
we need some runescape scripts.
Which need srl.


read some of the lower posts he posted like 4 runescape scripts that use srl :)

almost

2008-03-04 19:01:03

Nauman-
I see you haven't voted yet but before you do, like he said i have posted runescape scripts.

Timothegreat

2008-03-07 01:00:29

i voted yes, you need to update your srl and get back into recent scripting though…

almost

2008-03-07 16:32:53

Thanks for your vote.
I'm already back into scripting and better than ever.
I'm almost finished with a brand new power miner script.

ShowerThoughts

2008-03-07 16:39:37

yes. almost got my vote

Wizzup?

2008-03-07 17:57:40

I would like to see your (KSI) include before I let you in…

Just Kidding

2008-03-07 20:07:46

From: almost
Wow i'm sorry but you could not be much more wrong.
And i already posted that these are the scripts i have always used, i don't use other people's scripts because you get banned so much faster.


Please explain that, I also read all the posts and I agree why not just make an up to date srl script. This is srl after all and you almost got a powerminer finished why not apply with it.

As far as the other peoples scripts get you banned way faster is very untrue and makes me think you really havent used many scripts at all. I have never ever once been banned from an srl script and I have tested quite a large amount of very buggy scripts. Im talking ones that you might as well auto type "hey im cheating" they are so buggy yet no ban.

Im not voting cuz I havent been active and dont think it would be fair but. Just make a good script that uses srl in a normal way and using the most recent srl version like everyone else does. That way there is no confusion in the first place like there is now. Put it in the scripts to be tested, get feedback over a week or so, and then reapply when you can and I'm sure you will have no problem getting in.

almost

2008-03-08 10:56:24

hermpie-
does that mean you almost voted for me?
or does that mean you did?

wizzup-
i just found out KSI got deleted. i'm pretty pissed because that is my work from years and years…
i switched from scar 3.0 to 3.14 and all i saved was the scripts folder and forgot about the includes folder.
So i'm just going to fninish this power miner and make it straight SRL.

Just Kidding-
You are lucky.
Wether you get banned or not, the fact would be you are less likely to be banned using a script jagex has never seen before.
I'm pretty positive they have had a look at the behavior of all the "big" scripts.
And i've never been banned using my scripts, but i have on some "big" scripts.

Just Kidding

2008-03-08 15:02:16

Ive used alot of the big scripts that have been downloaded more than any here and been around the longest as well. Tara's chicken fighter, Lame, stupid 3000's guild miner for hours on end back in the day. Those are big heavily used scripts and still received no ban out of using these scripts. Jagex detection system sucks really to any scripter who knows what hes doing.

ShowerThoughts

2008-03-08 16:19:36

From: almost
hermpie-
does that mean you almost voted for me?
or does that mean you did?

wizzup-
i just found out KSI got deleted. i'm pretty pissed because that is my work from years and years…
i switched from scar 3.0 to 3.14 and all i saved was the scripts folder and forgot about the includes folder.
So i'm just going to fninish this power miner and make it straight SRL.

Just Kidding-
You are lucky.
Wether you get banned or not, the fact would be you are less likely to be banned using a script jagex has never seen before.
I'm pretty positive they have had a look at the behavior of all the "big" scripts.
And i've never been banned using my scripts, but i have on some "big" scripts.



yes almost, you got my vote

GoF

2008-03-18 07:59:02

Big yes. Shows you can script well and your stuff is way better than posting some scruffy bone picker or powerchopper etc. just so it'd be a RS script.

E: Silly me. But still I like your stuffz.

Richard

2008-03-18 17:23:02

This had been going for 2 and a half weeks, you think it would have been closed by now…

almost

2008-03-18 19:49:52

Ya it says it will take a max of 2 weeks.
So im still not sure how to tell when time is up.

P1nky

2008-03-18 21:09:07

d/w your in :P its just all admins are busy and stuff :)

Hobbit

2008-03-18 21:56:56

In

Closed
I'll pm an admin to speed it up :)

nielsie95

2008-03-19 02:42:06

Welcome sir.

Wizzup?

2008-03-19 05:38:49

I fail to see any working RuneScape scripts in your application…

Hobbit

2008-03-19 12:03:32

Please Post a Sample of your Work. Only SCAR Scripts Accepted


Doesn't say it has to be, should we change it?

Wizzup?

2008-03-19 12:18:31

From: Hobbit
Doesn't say it has to be, should we change it?


Probably, but only Dankness can as far as I know. ;)

Hobbit

2008-03-19 12:43:54

DANKNESS WHERE ARE YOOUUUUUUUUU???? Think he heard me?

Hmmmm Why do you think it's only Dankness? Does no one else have remote access to the server?