almost
2008-03-01 14:34:42
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 –>