SRL Archive - Test corner

some experimental function i made - please review them


solemn wishes

2006-12-30 17:46:38

hi guys,

what this first one bassicly does is send data to Eliza, the computer theripist online and receives what she says. Im having some trouble with it repeating the same message until the server relaods but once i find out hwo to do that it should be very evry nice. If anyone could perhaps advise me where next to go with it or how to get it fully working thats great also.

if we could get this to fully work it would be phernominal, or even get a smarter bot than eliza but for now thats all i know of.


program HumanResponse;
var HTTP1: Integer;
textO, s : string;
type
SkillInfo = record
sstats, lol, messageTs, pagesource : string;
end;
var
lol, shtml : string;
Stats: string;
responcetype: Array[0..22] of SkillInfo;

const
messageTs = 'hello eliza';// Type your message here


procedure getresponse;
begin
lol := Between('<strong>Eliza:</strong>', '<form method=POST action=http://www-ai.ijs.si/eliza-cgi-bin/eliza_script>', shtml);

end;

Function postdata(source : string) : SkillInfo;
begin
Result.pagesource := source;
s:= PostHTTPPageEx(HTTP1, 'http://www-ai.ijs.si/cgi-bin/eliza/eliza_script');
AddPostVariable(HTTP1, messageTS, messageTS);
getresponse;
end;


begin
ClearDebug;

HTTP1:= InitializeHTTPClient(True, false);
SetHTTPUserAgent(HTTP1, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');
AddPostVariable(HTTP1, messageTS, messageTS);
SendConnectionData(HTTP1, messageTS);
s:= GetPage('http://www-ai.ijs.si/cgi-bin/eliza/eliza_script');
shtml:= GetPage('http://www-ai.ijs.si/cgi-bin/eliza/eliza_script');
writeln('Sending Message')

writeln('Message Sent')

postdata(shtml)
Writeln('Loading Source...');
Writeln('Your Message was - ' +messageTS)
Writeln('Response - '+ lol);

ClearPostData(HTTP1)
end.



also i have this, its just a bit of fun but maybe you guys might find it usefull for autocliking on other games or something.


program Revolvo;

Var
wt, x1, y1, x, y : integer;
a, s : string;
SmallChars, OutFile : Integer;

//Records all mouse movements and clicks then saves them
//s to stop the script

const
filename = 'test.scar';//name to save it under
fileloc = 'C:\Documents and Settings\MuNkY\Desktop\'; //where to save


Procedure RecordMouse;
begin

s:= 'Program new; begin ';
repeat

getmousepos(x1,y1);
getmousepos(x, y);

while (Not(x=x1)or(not(y=y1))) do begin
wait(1); wt:= wt + 1;

if(IsMouseButtonDown(True))then a:= a + 'clickmouse('+inttostr(x)+','+inttostr(y)+', true)'
if(IsMouseButtonDown(False))then a:= a + 'clickmouse('+inttostr(x)+','+inttostr(y)+', false)'
getmousepos(x,y)
end;

s:= s + 'MoveMouse('+inttostr(x)+','+inttostr(y)+')' + a;
s:= s +' sleep('+inttostr(wt)+')';
Writeln(s); wt:= 0; a:= '';
until(iskeydown('w')) begin s:= s + ' end.';

OutFile:= reWriteFile(fileloc + FileName, False);
WriteFileString(OutFile, s);
closefile(outfile);
end;

writeln('Recording finished, final copy saved at')
writeln(fileloc+ FileName)
end;



begin
RecordMouse
end.

WT-Fakawi

2006-12-30 18:34:08

I have the whole ELiza.txt online.

Eliza

Maybe its helpful.

Yakman

2006-12-31 08:03:32

i already made something like that mouse recorder, except mines stores the data into a list of scar variables,

here you go, and good job with the eliza idea

solemn wishes

2007-04-07 08:20:15

From: Yakman
i already made something like that mouse recorder, except mines stores the data into a list of scar variables,

here you go, and good job with the eliza idea



oooo very nice, sorry to dig up old topics :D

Infantry001

2007-04-07 11:29:08

yea that elizea idea is really great. Arent there smarter bots out there? What about smarter child?

Dark_Sniper

2007-04-10 17:45:35

nice idea