SRL Archive - Test corner

I C R


Boreas

2007-12-07 01:55:31

EDIT: Has not been tested for safety. Use at your own risk. If I get time (doubtful), I'll set up a VM and TOR for a new army I don't mind losing and I'll test this.



In Chat RC

For those that don't have a second computer to log on as a master:

program New;
{.include srl/srl.scar}


/// ICR Globals- I suggest you change these
const
ICR_Keyword_Start = 'luke i am your father';
ICR_Keyword_StatusReport = 'gimme teh reportz0r';
ICR_Keyword_SwitchTo = 'please switch to';
ICR_Keyword_Activate = 'make';
ICR_Keyword_GetCP = 'who am i?';
ICR_Keyword_End = 'get back to work you lazy bum';

procedure DeclarePlayers;
begin
HowManyPlayers := 7;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick := '';
Players[0].Active := True;


end;


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


end;
function ICR_GetOurText:string;
begin
result:=trim(GetTextAtEx(60,459,0,smallchars,false,false,0,1,16711680,80,false,tr_allChars));
end;
procedure ICR_ClearChat;
begin
KeyDown(8)
repeat
KeyDown(8) //shouldnt be needed, but it didnt work without it
wait(50+random(60));
until ICR_GetOurText='*';
KeyUp(8);
end;


procedure ICR_StatusReport;
var
Player:integer;
str:string;
begin
ICR_ClearChat;
str:='';
for Player:=0 to getarraylength(Players)-1 do
begin
str:=str+ inttostr(Player)+ ' '+BoolToStr(Players[Player].active)+' ';
end;
TypeSend2(str);
end;

procedure ICR_GetCP;
begin
ICR_ClearChat;
typesend2(inttostr(currentplayer));
end;

procedure ICR_SwitchPlayer;
var
str:string;
begin
repeat
str:=ICR_GetOurText;
replace(str,ICR_Keyword_Start,'');
until pos('ty',str)<>0;
currentplayer:= strtoint(getnumbers(str));
ICR_ClearChat;
wait(500+random(200));
repeat logout
wait(500+random(200));
until not loggedin;
loginplayer;
end;

procedure ICR_ActivatePlayer;
var str:string;
begin
repeat
str:=ICR_GetOurText;
replace(str,ICR_Keyword_Start,'');
replace(str,ICR_Keyword_Activate,'');
until pos('ty',str)<>0;

str:=ICR_GetOurText;
writeln((str));
if pos('inactive',str)<>0 then
Players[strtoint(getnumbers(str))].Active:=false;
if pos('inactive',str)=0 then
Players[strtoint(getnumbers(str))].Active:=true;
ICR_ClearChat;
end;

procedure ICR_Main;
var str:string;
begin
str:=trim(GetTextAtEx(60,459,0,smallchars,false,false,0,2,16711680,80,false,tr_allChars));

if pos(ICR_Keyword_Start,str)=0 then
exit;
writeln('ICR Started');
repeat
wait(1);
str:=ICR_GetOurText;
if pos(ICR_Keyword_StatusReport,str)<>0 then
begin
ICR_StatusReport;
continue;
end;
if pos(ICR_Keyword_GetCP,str)<>0 then
begin
ICR_GetCP;
continue;
end;
if pos(ICR_Keyword_SwitchTo,str)<>0 then
begin
ICR_SwitchPlayer;
continue;
end;
if pos(ICR_Keyword_Activate,str)<>0 then
begin
ICR_ActivatePlayer;
continue;
end;
until pos(ICR_Keyword_End,str)<>0;
writeln('ICR End');
end;





begin
setupsrl;
DeclarePlayers;
loginplayer;
repeat
ICR_Main;
wait(1000+random(1000));
until isfkeydown(12);
end.

You type those globals into chatbox without pressing enter (first do the start one).
Usage-
'luke i am your father' just type it
'gimme teh reportz0r' just type it
'please switch to 6 ty' type it then number then 'ty'
'make active 3 ty' type it and active/inactive then 'ty'
'who am i?' just type it
'get back to work you lazy bum' just type it

Call ICR_Main; wherever you want 'cept in most timed loops.

R0b0t1

2007-12-09 12:17:25

Thats an interesting idea. Controlling the bot through the chatbox?


Saves you from having to restart the whole script, maybe like save the settings so you can say 'reload pl0x' or something.

n3ss3s

2007-12-09 12:25:57

Roflmao, the most smile to me gave that you are supposed to go to talk to the guy in RS, in legits mind just some random dude - "Luke I am your father" xD

But then I noted its for one computer…

But couldn't you also do like If NumpadKeyDown or whatever is the cmd?

But gj


EDIT: w00t my yewcutter has 8100 logs cut and 300 banks xD

R0b0t1

2007-12-09 12:36:44

That would take longer searching for the numpad all the time.


But then again, so would the text. I guess its just easier to remember what the commands are.



EDIT: Wewt! 75% of my NetBeans download!

Boreas

2007-12-09 19:54:00

You don't press enter (Typesend2), so nobody will ever see it. But in the highly unlikely event jagex is logging all key presses, you can change it to whatever you want. The first one ('luke i am your father') needs to be something you won't type in normal conversation or in an autotalker/responder. For everything else it doesn't matter*.

I have lost my position of having the longest reports in LAME and ChickenKiller,:( but maybe this will help others get longer reports:D.

*Except that they can't be contained within each other, as it checks whether a keyword is within the typed text, not necessarily equal to it.

Jason2gs

2007-12-09 21:39:30

Ah, I had this idea a long time ago.

In fact, I think it was you who shot it down…

http://www.villavu.com/forum/showthread.php?t=6185

Boreas

2007-12-10 01:19:16

Ah good call. *Finds new title button…*

n3ss3s

2007-12-10 09:20:27

One off topic question: (no offense to anyone)

What kind of sick pervert runs a script for more than 150 hours?!

Narcle

2007-12-10 09:42:57

*raises hand*
Though I have only made it to 127 hours so far. :D

lol i just noticed:

Jason2gs
Boreas pwner <- haha
King Black Dragon

Smartzkid

2007-12-10 16:01:30

From: n3ss3s
One off topic question: (no offense to anyone)

What kind of sick pervert runs a script for more than 150 hours?!


One who's running LAME :p

Jason2gs

2007-12-10 19:45:59

From: Boreas
Ah good call. *Finds new title button…*


*Notices new title*

Haha ^_^