LordGregGreg
2007-07-17 03:39:53
It is 100% accurat and will give you a tangable percent of how awesome your signatiure is!
It is based on a 100% scale (0-100!!!)
[h]BE SURE TO DRAG THE SCAR TARGETING THING ON TO URE BROWSERS TITLE BAR[/h]
Enjoi
CHANGES
1. no more negaitve
2. less lag
PROGRAM GregsSigAwesomenessDetection;
{.include srl/srl.scar}
VAR
x1, y1, x2, y2,R,G,B,points: INTEGER;
RedCount:Extended;
// makeGregForm variables.
EndmakeGregForm: BOOLEAN;
GregsForm: TForm;
Label1, Label2, Label3, Label4, Label5, Label6,
Label7: TLabel;
Bevel1, Bevel2: TBevel;
Edit1, Edit2, Edit4, Edit3: TEdit;
Button1, Button2, Button3, Button4: TButton;
tcolor: LONGINT;
PROCEDURE Clear(Sender: TObject);
BEGIN
Edit1.Text := IntToStr(0);
Edit2.Text := IntToStr(0);
Edit3.Text := IntToStr(0);
Edit4.Text := IntToStr(0);
label7.Caption := '0% Awesome';
END;
PROCEDURE Judge(Sender: TObject);
BEGIN
x2:=strtoint(edit3.text);
y2:=strtoint(edit4.text);
points:=0;
RedCount:=0;
for x1:=strtoint(edit1.text) to x2 do
for y1:=strtoint(edit2.text) to y2 do
begin
points:=points+1;
ColortoRGB(getColor(x1,y1),R, G, B);
//if(NOT (((((R)-((G+B)/2))))=255))then
//writeln('R'+inttostr(R)+' G'+inttostr(G)+'B'+inttostr(R));
RedCount:= RedCount+((((R)-((G+B)/2))));
if(points mod 1200 = 0) then
begin
Button3.Caption:='Red is :'+floattostr(RedCount);
Button4.refresh;
end
end;
Button3.Caption:='Judge Sig';
writeln('Red Count was '+floatTostr(redCount));
writeln('points was '+floatTostr(points));
writeln('red over p was '+floatTostr(redCount/points));
label7.caption:=floattostr((((RedCount*100)/(points*255))+100)/2)+'% Awesome!';
addToReport('Sig is '+floattostr((((RedCount*100)/(points*255))+100)/2)+'% Awesome!');
END;
PROCEDURE clicked1(Sender: TObject);
BEGIN
REPEAT
wait(1);
UNTIL (NOT (ismousebuttondown(True)));
tColor := edit1.Color;
edit1.Color := clRed;
edit2.Color := clRed;
REPEAT
wait(1);
getmousepos(x, y);
Edit1.Text := IntToStr(x);
Edit1.refresh;
Edit2.Text := IntToStr(y);
Edit2.refresh;
UNTIL (ismousebuttondown(True));
BEGIN
getmousepos(x, y);
wait(10);
Edit1.Text := IntToStr(x);
Edit2.Text := IntToStr(y);
edit1.Color := tColor;
edit2.Color := tColor;
END;
END;
PROCEDURE clicked2(Sender: TObject);
BEGIN
REPEAT
wait(1);
UNTIL (NOT (ismousebuttondown(True)));
tColor := edit3.Color;
edit3.Color := clRed;
edit4.Color := clRed;
REPEAT
wait(1);
getmousepos(x, y);
Edit3.Text := IntToStr(x);
Edit3.refresh;
Edit4.Text := IntToStr(y);
Edit4.refresh;
UNTIL (ismousebuttondown(True));
BEGIN
getmousepos(x, y);
wait(10);
Edit3.Text := IntToStr(x);
Edit4.Text := IntToStr(y);
edit3.Color := tColor;
edit4.Color := tColor;
END;
END;
// When the form is closed, this code will be executed.
PROCEDURE makeGregFormOnClose(Sender: TObject;
VAR Action: TCloseAction);
BEGIN
IF (NOT (GregsForm.ModalResult = 1)) THEN
EndmakeGregForm := True;
END;
// This form was parsed using: DFM Form Parser v.23 by Ron.
PROCEDURE makeGregForm;
VAR
TimemakeGregForm: INTEGER;
BEGIN
TimemakeGregForm := GetSystemTime;
GregsForm := CreateForm;
WITH GregsForm DO
BEGIN
OnClose := @makeGregFormOnClose;
Position := poScreenCenter;
BorderStyle := bsSingle;
BorderIcons := [biMinimize, biSystemMenu];
ClientWidth := 211;
ClientHeight := 197;
Caption := 'Greg'#39's Judge';
Color := clWhite;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
ShowHint := True;
PixelsPerInch := 96;
END;
Label1 := TLabel.Create(GregsForm);
WITH Label1 DO
BEGIN
Parent := GregsForm;
Left := 36;
Top := 32;
Width := 124;
Height := 16;
Caption := 'Sig Awesomeness Detector';
Color := clMaroon;
Font.Color := clMaroon;
Font.Height := -13;
Font.Name := 'Nyala';
Font.Style := [];
ParentColor := False;
ParentFont := False;
END;
Label2 := TLabel.Create(GregsForm);
WITH Label2 DO
BEGIN
Parent := GregsForm;
Left := 71;
Top := 4;
Width := 48;
Height := 28;
Caption := 'Greg'#39's';
Font.Color := clMaroon;
Font.Height := -24;
Font.Name := 'Perpetua';
Font.Style := [fsItalic];
ParentFont := False;
END;
Label3 := TLabel.Create(GregsForm);
WITH Label3 DO
BEGIN
Parent := GregsForm;
Left := 6;
Top := 57;
Width := 50;
Height := 13;
Caption := 'Top Left X';
Font.Color := clMaroon;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
ParentFont := False;
END;
Label4 := TLabel.Create(GregsForm);
WITH Label4 DO
BEGIN
Parent := GregsForm;
Left := 96;
Top := 57;
Width := 7;
Height := 13;
Caption := 'Y';
Font.Color := clMaroon;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
ParentFont := False;
END;
Label5 := TLabel.Create(GregsForm);
WITH Label5 DO
BEGIN
Parent := GregsForm;
Left := 3;
Top := 89;
Width := 71;
Height := 13;
Caption := 'Bottom Right X';
Font.Color := clMaroon;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
ParentFont := False;
END;
Label6 := TLabel.Create(GregsForm);
WITH Label6 DO
BEGIN
Parent := GregsForm;
Left := 107;
Top := 89;
Width := 7;
Height := 13;
Caption := 'Y';
Font.Color := clMaroon;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
ParentFont := False;
END;
Bevel1 := TBevel.Create(GregsForm);
WITH Bevel1 DO
BEGIN
Parent := GregsForm;
Left := 1;
Top := 49;
Width := 192;
Height := 28;
END;
Bevel2 := TBevel.Create(GregsForm);
WITH Bevel2 DO
BEGIN
Parent := GregsForm;
Left := 1;
Top := 81;
Width := 195;
Height := 32;
END;
Label7 := TLabel.Create(GregsForm);
WITH Label7 DO
BEGIN
Parent := GregsForm;
Left := 6;
Top := 146;
Width := 166;
Height := 35;
Hint := 'How Awesome Your Signature is';
Caption := '0% Awesome!';
Font.Color := clMaroon;
Font.Height := -24;
Font.Name := 'Jokerman';
Font.Style := [];
ParentFont := False;
ParentShowHint := False;
ShowHint := True;
END;
Edit1 := TEdit.Create(GregsForm);
WITH Edit1 DO
BEGIN
Parent := GregsForm;
Left := 61;
Top := 53;
Width := 34;
Height := 21;
TabOrder := 8;
Text := '0';
END;
Edit2 := TEdit.Create(GregsForm);
WITH Edit2 DO
BEGIN
Parent := GregsForm;
Left := 104;
Top := 53;
Width := 32;
Height := 21;
TabOrder := 9;
Text := '0';
END;
Edit4 := TEdit.Create(GregsForm);
WITH Edit4 DO
BEGIN
Parent := GregsForm;
Left := 114;
Top := 85;
Width := 30;
Height := 21;
TabOrder := 10;
Text := '0';
END;
Button1 := TButton.Create(GregsForm);
WITH Button1 DO
BEGIN
Parent := GregsForm;
Left := 136;
Top := 51;
Width := 49;
Height := 25;
Caption := 'Choose';
Font.Color := clMaroon;
Font.Height := -11;
Font.Name := 'Lucida Handwriting';
Font.Style := [];
ParentFont := False;
TabOrder := 11;
Onclick := @clicked1;
END;
Button2 := TButton.Create(GregsForm);
WITH Button2 DO
BEGIN
Parent := GregsForm;
Left := 144;
Top := 83;
Width := 49;
Height := 25;
Caption := 'Choose';
Font.Color := clMaroon;
Font.Height := -11;
Font.Name := 'Lucida Handwriting';
Font.Style := [];
ParentFont := False;
TabOrder := 12;
onclick := @clicked2;
END;
Edit3 := TEdit.Create(GregsForm);
WITH Edit3 DO
BEGIN
Parent := GregsForm;
Left := 76;
Top := 85;
Width := 30;
Height := 21;
TabOrder := 13;
Text := '0';
END;
Button3 := TButton.Create(GregsForm);
WITH Button3 DO
BEGIN
Parent := GregsForm;
Left := 11;
Top := 116;
Width := 91;
Height := 25;
Caption := 'Judge This Sig';
TabOrder := 14;
onclick := @judge;
END;
Button4 := TButton.Create(GregsForm);
WITH Button4 DO
BEGIN
Parent := GregsForm;
Left := 110;
Top := 116;
Width := 63;
Height := 25;
Caption := 'Clear';
TabOrder := 15;
Onclick := @Clear;
END;
WriteLn('makeGregForm compiled in ' +
IntToStr(GetSystemTime - TimemakeGregForm) +
' milliseconds!');
END;
PROCEDURE SafemakeGregForm;
VAR
V: TVariantArray;
BEGIN
SetArrayLength(V, 0);
ThreadSafeCall('makeGregForm', V);
END;
PROCEDURE ShowmakeGregFormModal;
BEGIN
GregsForm.ShowModal;
END;
PROCEDURE SafeShowmakeGregFormModal;
VAR
V: TVariantArray;
BEGIN
SetArrayLength(V, 0);
ThreadSafeCall('ShowmakeGregFormModal', V);
END;
PROCEDURE MainmakeGregForm;
BEGIN
SafemakeGregForm;
SafeShowmakeGregFormModal;
FreeForm(GregsForm);
END;
BEGIN
ClearDebug;
ClearReport;
ActivateClient;
GetSelf.WindowState := wsMinimized;
MainmakeGregForm;
GetSelf.WindowState := wsNormal;
IF (EndmakeGregForm) THEN
TerminateScript;
END.