SRL Archive - Test corner

SCAR message board/ chat room


Awkwardsaw

2009-11-22 13:16:31

state: beta

alright, so.. now that i finally figured out my php troubles (damn html.. :D), i made a SCAR script around it. this is in its beta, and i would like to add many more things to it, to make it more safe, useable, ect.

every thing should be self explanitory, fill in your name, and your message, and hit send :p

REMEMBER: the material you post is public to EVERY ONE who uses it. dont post any flame, or illegal stuff. i DO track IP's, so if i see any thing that i dont like, i will ban you from the script, and probobly report you to admin/ mod. we follow all SRL rules :D

program New;

var
// Initform variables.
frmDesign : TForm;
Label1, Label2 : TLabel;
Memo1 : TMemo;
Edit1, Edit2 : TEdit;
Button1 : TButton;
i : integer;

procedure parsesite;
var
s, a : string;
b : TStringArray;
c : integer;
begin
s := getpage('http://akwardsaw.hostoi.com/Mess_Board.php');
a := between('[akw]', '[/akw]', s);
b := explode('<br>', a);
memo1.Text := '';
for c := 0 to high(b) do
memo1.Lines.Add(b[c]);
end;

procedure dostuff(sender: TObject);
begin
AddPostVariable(i, 'user', Edit2.text);
AddPostVariable(i, 'a', Edit1.text);
PostHTTPPageEx(i, 'http://akwardsaw.hostoi.com/Mess_Board.php');
wait(100 + random(200));
parsesite;
end;

// This form was parsed using DFM Form Parser v.26c Beta by Ron.
// Generated from SCAR.dfm.
procedure Initform;
var
TimeInitform : Integer;
begin
TimeInitform := GetSystemTime;
frmDesign := CreateForm;
with frmDesign do
begin
Position := poScreenCenter;
BorderStyle := bsSingle;
BorderIcons := [biMinimize,biSystemMenu];
Width := 822;
Height := 536;
Caption := 'Chat :D';
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 96;
end;
Label1 := TLabel.Create(frmDesign);
with Label1 do
begin
Parent := frmDesign;
Left := 8;
Top := 448;
Width := 46;
Height := 17;
Caption := 'Message:';
end;
Label2 := TLabel.Create(frmDesign);
with Label2 do
begin
Parent := frmDesign;
Left := 8;
Top := 472;
Width := 31;
Height := 13;
Caption := 'Name:';
end;
Memo1 := TMemo.Create(frmDesign);
with Memo1 do
begin
Parent := frmDesign;
Left := 0;
Top := 0;
Width := 793;
Height := 441;
ReadOnly := True;
ScrollBars := ssVertical;
TabOrder := 8;
end;
Edit1 := TEdit.Create(frmDesign);
with Edit1 do
begin
Parent := frmDesign;
Left := 64;
Top := 448;
Width := 729;
Height := 21;
TabOrder := 9;
Text := '';
end;
Edit2 := TEdit.Create(frmDesign);
with Edit2 do
begin
Parent := frmDesign;
Left := 64;
Top := 472;
Width := 185;
Height := 21;
TabOrder := 10;
Text := '';
end;
Button1 := TButton.Create(frmDesign);
with Button1 do
begin
Parent := frmDesign;
Left := 256;
Top := 472;
Width := 105;
Height := 25;
Caption := 'Send!';
TabOrder := 11;
OnClick := @DoStuff;
end;
WriteLn('Initform compiled in ' + IntToStr(GetSystemTime - TimeInitform) + ' milliseconds!');
end;

procedure SafeInitform;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('Initform', v);
end;

procedure ShowInitformModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowInitformModal;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowInitformModal', v);
end;

procedure MainInitform;
begin
try
SafeInitform;
SafeShowInitformModal;
finally
FreeForm(frmDesign);
except
WriteLn('An error seems to have occurred in: Initform');
end;
end;

begin
ClearDebug;
I := InitializeHTTPClient(true, true);
GetSelf.WindowState := wsMinimized;
MainInitform;
GetSelf.WindowState := wsNormal;
end.

remember to post feedback, tips + ideas to make this better for every one :)

bullzeye95

2009-11-22 13:38:03

I can send "[/akw]" and stop anybody from sending anything.

Awkwardsaw

2009-11-22 13:46:31

From: bullzeye95
I can send "[/akw]" and stop anybody from sending anything.


and i can delete w/e you say

bullzeye95

2009-11-22 13:47:30

And then I could do say it again :rolleyes:

Awkwardsaw

2009-11-22 13:58:54

or better yet, i can add
if(inStr("[/akw]", $n))
die("lol");

Camaro'

2009-11-22 19:43:01

Bullzeye, he mentioned it is still in beta, he will fix that i assume?

Awkwardsaw

2009-11-22 20:17:43

;) i did

Floor66

2009-11-23 08:52:59

Why do you use the [awk] tags anyway?

Quickmarch

2009-11-23 10:05:54

Why not use a socket for communication? It would be way quicker.

mastaraymond

2009-11-23 10:46:14

From: Quickmarch
Why not use a socket for communication? It would be way quicker.

Because you would need to create, and host, a sever application?

Quickmarch

2009-11-23 16:50:03

From: mastaraymond
Because you would need to create, and host, a sever application?


I suppose…

Awkwardsaw

2009-11-23 16:58:25

From: Floor66
Why do you use the [awk] tags anyway?


take out the parsing in the script, and find out =\

Awkwardsaw

2009-11-23 16:59:37

From: Quickmarch
Why not use a socket for communication? It would be way quicker.


:p

yeah. i would need a server.

i was also thinking about making it into a database, maby that way i can limit it to about 15-20 messages at a time