SRL Archive - First Scripts

Auto Log-In/Talker


Exaligo I

2007-12-23 06:39:54

Hi,

This is my first ever script for SCAR. It took me a couple of hours yesterday to write (including the time it took to read some of the wonderful help in the tutorials section. Thanks WhoCares357!). It's not the best, most wonderfully complicated script, but it works and it's still my first.

I wrote it all myself, so I hope you like it.

//////////////////////////////////////////////////
// Auto Log-In/Talker v1.0 //
//////////////////////////////////////////////////
// Version 1.000000000000000000000... //
//////////////////////////////////////////////////
// As made by none other than Exaligo I //
//////////////////////////////////////////////////
// You know you want it //
// Well you've got it if you're reading this... //
// Oh well //
// =( //
//////////////////////////////////////////////////

//////////////////////////////////////////////////
// OPERATING INSTRUCTIONS //
//////////////////////////////////////////////////
// First, follow the set up instructions. //
// //
// Log in feature is optional. //
// If you use it, set doLogIn to 1. //
// //
// It will then log you in using the username //
// and password you set underneath when you //
// click run. //
// //
// You must start on the screen where you //
// choose between a new or existing user. //
// //
// The program will also work if you are //
// already logged in. Simply leave doLogIn //
// as 2. //
// //
// You can also set movement and colour //
// efects for text as in RS2. //
// //
// Simply type in the code for the effect //
// you want. They are: //
// - black: ¦ //
// - blue: ¦ //
// - cyan: ¦ //
// - green: ¦ //
// - magenta: ¦ //
// - orange: ¦ //
// - white: ¦ //
// - yellow: ¦ //
// - flash1: ¦ //
// - flash2: ¦ //
// - flash3: ¦ //
// - glow1: ¦ //
// - glow2: ¦ //
// - glow3: ¦ //
// - wave: / //
// - wave2: / //
// - scroll: / //
// - shake: / //
// //
// Those marked with a ¦ are colour, while //
// those marked with a / are movement //
// effects. (see setup) //
// //
// Finally, the time between each message //
// is set further down the page on line //
// 208. This is in milliseconds. There //
// are 1000 milliseconds in a second. //
// //
// Another option is to adjust the value //
// in brakcets after the first time figure. //
// This will adjust the random timing added //
// to each interval for antiban purposes. //
// //
// To exit script, press Ctrl + Alt + S as //
// normal, or alternatively press F8. (Note: //
// You may need to hold F8 for a couple of //
// seconds for the script to stop.) //
//////////////////////////////////////////////////

program PrimitiveAutotyper; // Autotyper v1.0
{.include SRL\SRL.scar}

//////////////////////////////////////////////////
// SETUP - ADJUST VALUES ACCORDINGLY //
//////////////////////////////////////////////////

const

//Use log in function (log in at start of script)
doLogIn = 2;
{Note! 1 = yes 2 = no}

//Set log in features:
username = 'Exaligo I';
password = 'password';

//Set message, colour and wave effects:
SetMessage = 'Sell god sword 1gp! Brilliant DEAL!!!';
moveEffect = 'wave:'; // e.g. 'wave:' 'wave2:' 'scroll:'...
colourEffect = 'glow1:'; // e.g. 'glow1:' 'glow2:' 'flash1:'...

//Set time between messages (milliseconds) below in line 208

//////////////////////////////////////////////////
// DO NOT TOUCH CODE BELOW!!! //
//////////////////////////////////////////////////
// Very important stuff going on down there! //
// Exception on line 208. //
//////////////////////////////////////////////////

// Set initial variables.
var
LogInFirstClick: Integer; //.bmp sample of existing user button
LogInBox: Integer; //.bmp sample of log in button
LogInClick2: Integer; //.bmp sample of click to play button
x,y: Integer; //coordinates to click at
FirstClick: Integer; //loop condition
SecondClick: Integer; //loop condition
ThirdClick:Integer; //loop condition

procedure LogIn; //Log in at start of script
begin
FirstClick:=0; //value to maintain loop
SecondClick:=0; //value to maintain loop
ThirdClick:=0; //value to maintain loop
if (doLogIn = 1) then
begin
writeln('Log in procedure initiated');
writeln('Searching for existing user button');
LogInFirstClick := BitmapFromString(19, 11, 'z78DAA554410E8' +
'3300CFB52B51804C74E23FF7FD2A4864336D7536039F860DCD869' +
'2ADCBF0B0F000736F4052E2ABE9ECA812D95757B429E6DA2D871A' +
'2195E59135EB6DA86A6BC26D325647DF07698630F648DE2734D6E' +
'4CCC584F25CFAACE3FF94AAA3ACF9DE5CBB99556BD877C0315A54' +
'ACBFAD832F79F308CB4D392E6055FFA07663DF34A59CFC68EF7B0' +
'32DD3F8E57E78A0D8EFFC31BE0C31CAC');
repeat //Keep searching until button is found.
if(FindBitmap(LogInFirstClick,x,y)) then
begin
FirstClick:=1; //Break search loop
writeln('Existing user button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
//Report error in finding button.
writeln('Error! Existing user button not found');
until(FirstClick = 1);
FreeBitmap(LogInFirstClick);
writeln('Inputting log in information');
Sendkeys (username+chr(13)+password);
writeln('Searching for log in button');
wait(500);
LogInBox := BitmapFromString(35, 15, 'z78DAB5965D6A03310C84AFB' +
'4C44A491E3734BEFF910A2B43C7C89F2243AB8761115A5923EBC7' +
'BDFF8A3DECBCDB026F66F6766CEFD6EDD9CEF6321B18355FED61C' +
'740B509A89E0917FE531442FDB864780B8CF218C6B9CAA51C73F4' +
'33F9544651B3CB883CD731BD11B559E4874E4C6B60C12854DA220' +
'6C75B6BED3530C436D95CDF792D6924C8C859E8B9520FC828ADE4' +
'0E429DF5C13E74D621E2A7F754062FC96464B4E862A84F97456EE' +
'BF65239949FC862E1476EB07247C4FDAFF49401CF7F2533B93DCD' +
'70B2DCD0EF3285BEC0C8C93FECA3FF63B47B47F94CEB05A14942F' +
'54079A0BFA8FEF18EC8DE27EA75FA5110BD35B4811EFC50FF32E7' +
'C99BEA75234C7A67F46DFD7E8E68FD5B3515DC7C15E0748DBB26E' +
'E1DDD715173E1C482B0CC82EA339FEAF87EA37D1ADF0C82A5F80B' +
'8C686356FA0E59D05B37DAEF32DAACABBC8F262E1A4F9A797CE30' +
'5EE3FB0FBC933');
repeat //Keep searching until button is found.
if(FindBitmap(LogInBox,x,y)) then
begin
SecondClick:=1; //Break search loop
writeln('Log in button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
//Report error in finding button.
writeln('Error! Log in button not found');
until(SecondClick = 1);
FreeBitmap(LogInBox);
writeln('Searching for click to play button');
Wait(5000);
LogInClick2 := BitmapFromString(18, 13, 'z78DA9554D10E02210' +
'CFBA50182E7A367BCFFFF24956252D2EB79EE81906EEBD8D610F1' +
'B17A4F35968DACC371DD4ACE59F1B6A647DC90D59E3952BD2C912' +
'35CA443CED44215785B4D6FA0D66891766A75EF7668EE0D6CF082' +
'CDF5A588C31D039BABE5B2DC047EECAB67FD5DCB68C3ED11CCA88' +
'5BBEEC5CD0A5ADAD180E977D4221D9E6138DE8B3238B33A2406AE' +
'0E9C673B542DB833C4AB72B00B7454D628DF378CF9F73BDEC027E' +
'7B2E6A718C107024EF901263651DD8450161074A7F1DA177BF967' +
'807742E864B5E87F021C272235669A18E90D91FC7EEE88B7C0737' +
'B01DE6D384C');
repeat //Keep searching until button is found.
if(FindBitmap(LogInClick2,x,y)) then
begin
ThirdClick:=1; //Break search loop
writeln('Click to play button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
//Report error in finding button.
writeln('Error! Click to play button not found');
until(ThirdClick = 1);
FreeBitmap(LogInClick2);
end;
end;

procedure Pause; //Wait for x seconds
begin
wait(4000+random(100)); //SETUP: Interval between messages (ms)
end;

procedure Text; //See below
begin
Sendkeys(colourEffect); //Sets colour effect
Sendkeys(moveEffect); //Sets movement effect
TypeSend(setMessage+chr(13)); //Types message
writeln('Message sent to client'); //Confirmation of message
writeln('');
end;

begin
activateclient; //Activites RS window
LogIn; //Runs log in
repeat //Repeatedly sends message
Text; //Types message
Pause; //Waits for interval
until(isfkeydown(8)) //End loop on F8
writeln('Procedure terminated');
wait(500);
writeln('Exiting script');
wait(500);
end.

Please post any problems, comment and I'd appreciate any help. I didn't include any anti randoms because they're not really needed for an auto talker. Please remember to read the instructions at the top, it tells you some stuff you might just want to know!

Thanks,
Exaligo I :cartman:


UPDATE
Version 1.1

23 December 2007

I've just been running the script and had to make some adjustments. Just for timing. I added some wait commands to allow for slow computers logging in and so that the computer has had a chance to log in before it starts typing.

Here is the improved code:

//////////////////////////////////////////////////
// Auto Log-In/Talker v1.1 //
//////////////////////////////////////////////////
// As made by none other than Exaligo I //
//////////////////////////////////////////////////
// You know you want it //
// Well you've got it if you're reading this... //
// Oh well //
// =( //
//////////////////////////////////////////////////

//////////////////////////////////////////////////
// OPERATING INSTRUCTIONS //
//////////////////////////////////////////////////
// First, follow the set up instructions. //
// //
// Log in feature is optional. //
// If you use it, set doLogIn to 1. //
// //
// It will then log you in using the username //
// and password you set underneath when you //
// click run. //
// //
// You must start on the screen where you //
// choose between a new or existing user. //
// //
// The program will also work if you are //
// already logged in. Simply leave doLogIn //
// as 2. //
// //
// You can also set movement and colour //
// efects for text as in RS2. //
// //
// Simply type in the code for the effect //
// you want. They are: //
// - black: ¦ //
// - blue: ¦ //
// - cyan: ¦ //
// - green: ¦ //
// - magenta: ¦ //
// - orange: ¦ //
// - white: ¦ //
// - yellow: ¦ //
// - flash1: ¦ //
// - flash2: ¦ //
// - flash3: ¦ //
// - glow1: ¦ //
// - glow2: ¦ //
// - glow3: ¦ //
// - wave: / //
// - wave2: / //
// - scroll: / //
// - shake: / //
// //
// Those marked with a ¦ are colour, while //
// those marked with a / are movement //
// effects. (see setup) //
// //
// Finally, the time between each message //
// is set further down the page on line //
// 208. This is in milliseconds. There //
// are 1000 milliseconds in a second. //
// //
// Another option is to adjust the value //
// in brakcets after the first time figure. //
// This will adjust the random timing added //
// to each interval for antiban purposes. //
// //
// To exit script, press Ctrl + Alt + S as //
// normal, or alternatively press F8. (Note: //
// You may need to hold F8 for a couple of //
// seconds for the script to stop.) //
//////////////////////////////////////////////////

program PrimitiveAutotyper; // Autotyper v1.0
{.include SRL\SRL.scar}

//////////////////////////////////////////////////
// SETUP - ADJUST VALUES ACCORDINGLY //
//////////////////////////////////////////////////

const

//Use log in function (log in at start of script)
doLogIn = 2;
{Note! 1 = yes 2 = no}

//Set log in features:
username = 'Exaligo I';
password = 'password';

//Set message, colour and wave effects:
SetMessage = 'Hi. My name is BOB the fish slayer. I kill fishies!';
moveEffect = 'wave:'; // e.g. 'wave:' 'wave2:' 'scroll:'...
colourEffect = 'glow1:'; // e.g. 'glow1:' 'glow2:' 'flash1:'...

//Set time between messages (milliseconds) below in line 208

//////////////////////////////////////////////////
// DO NOT TOUCH CODE BELOW!!! //
//////////////////////////////////////////////////
// Very important stuff going on down there! //
// Exception on line 208. //
//////////////////////////////////////////////////

// Set initial variables.
var
LogInFirstClick: Integer; //.bmp sample of existing user button
LogInBox: Integer; //.bmp sample of log in button
LogInClick2: Integer; //.bmp sample of click to play button
x,y: Integer; //coordinates to click at
FirstClick: Integer; //loop condition
SecondClick: Integer; //loop condition
ThirdClick:Integer; //loop condition

procedure LogIn; //Log in at start of script
begin
FirstClick:=0; //value to maintain loop
SecondClick:=0; //value to maintain loop
ThirdClick:=0; //value to maintain loop
if (doLogIn = 1) then
begin
writeln('Log in procedure initiated');
writeln('Searching for existing user button');
LogInFirstClick := BitmapFromString(19, 11, 'z78DAA554410E8' +
'3300CFB52B51804C74E23FF7FD2A4864336D7536039F860DCD869' +
'2ADCBF0B0F000736F4052E2ABE9ECA812D95757B429E6DA2D871A' +
'2195E59135EB6DA86A6BC26D325647DF07698630F648DE2734D6E' +
'4CCC584F25CFAACE3FF94AAA3ACF9DE5CBB99556BD877C0315A54' +
'ACBFAD832F79F308CB4D392E6055FFA07663DF34A59CFC68EF7B0' +
'32DD3F8E57E78A0D8EFFC31BE0C31CAC');
repeat //Keep searching until button is found.
if(FindBitmap(LogInFirstClick,x,y)) then
begin
FirstClick:=1; //Break search loop
writeln('Existing user button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
//Report error in finding button.
writeln('Error! Existing user button not found');
until(FirstClick = 1);
FreeBitmap(LogInFirstClick);
writeln('Inputting log in information');
wait(1000);
Sendkeys (username+chr(13)+password);
writeln('Searching for log in button');
wait(500);
LogInBox := BitmapFromString(35, 15, 'z78DAB5965D6A03310C84AFB' +
'4C44A491E3734BEFF910A2B43C7C89F2243AB8761115A5923EBC7' +
'BDFF8A3DECBCDB026F66F6766CEFD6EDD9CEF6321B18355FED61C' +
'740B509A89E0917FE531442FDB864780B8CF218C6B9CAA51C73F4' +
'33F9544651B3CB883CD731BD11B559E4874E4C6B60C12854DA220' +
'6C75B6BED3530C436D95CDF792D6924C8C859E8B9520FC828ADE4' +
'0E429DF5C13E74D621E2A7F754062FC96464B4E862A84F97456EE' +
'BF65239949FC862E1476EB07247C4FDAFF49401CF7F2533B93DCD' +
'70B2DCD0EF3285BEC0C8C93FECA3FF63B47B47F94CEB05A14942F' +
'54079A0BFA8FEF18EC8DE27EA75FA5110BD35B4811EFC50FF32E7' +
'C99BEA75234C7A67F46DFD7E8E68FD5B3515DC7C15E0748DBB26E' +
'E1DDD715173E1C482B0CC82EA339FEAF87EA37D1ADF0C82A5F80B' +
'8C686356FA0E59D05B37DAEF32DAACABBC8F262E1A4F9A797CE30' +
'5EE3FB0FBC933');
repeat //Keep searching until button is found.
if(FindBitmap(LogInBox,x,y)) then
begin
SecondClick:=1; //Break search loop
writeln('Log in button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
//Report error in finding button.
writeln('Error! Log in button not found');
until(SecondClick = 1);
FreeBitmap(LogInBox);
writeln('Searching for click to play button');
Wait(5000);
LogInClick2 := BitmapFromString(18, 13, 'z78DA9554D10E02210' +
'CFBA50182E7A367BCFFFF24956252D2EB79EE81906EEBD8D610F1' +
'B17A4F35968DACC371DD4ACE59F1B6A647DC90D59E3952BD2C912' +
'35CA443CED44215785B4D6FA0D66891766A75EF7668EE0D6CF082' +
'CDF5A588C31D039BABE5B2DC047EECAB67FD5DCB68C3ED11CCA88' +
'5BBEEC5CD0A5ADAD180E977D4221D9E6138DE8B3238B33A2406AE' +
'0E9C673B542DB833C4AB72B00B7454D628DF378CF9F73BDEC027E' +
'7B2E6A718C107024EF901263651DD8450161074A7F1DA177BF967' +
'807742E864B5E87F021C272235669A18E90D91FC7EEE88B7C0737' +
'B01DE6D384C');
repeat //Keep searching until button is found.
if(FindBitmap(LogInClick2,x,y)) then
begin
ThirdClick:=1; //Break search loop
writeln('Click to play button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(5000+random(100));
ClickMouse(x,y,true); //Click button
end else
//Report error in finding button.
writeln('Error! Click to play button not found');
until(ThirdClick = 1);
FreeBitmap(LogInClick2);
wait(2000);
end;
end;

procedure Pause; //Wait for x seconds
begin
wait(4000+random(100)); //SETUP: Interval between messages (ms)
end;

procedure Text; //See below
begin
Sendkeys(colourEffect); //Sets colour effect
Sendkeys(moveEffect); //Sets movement effect
TypeSend(setMessage); //Types message
writeln('Message sent to client'); //Confirmation of message
writeln('');
end;

begin
activateclient; //Activites RS window
LogIn; //Runs log in
repeat //Repeatedly sends message
Text; //Types message
Pause; //Waits for interval
until(isfkeydown(8)) //End loop on F8
writeln('Procedure terminated');
wait(500);
writeln('Exiting script');
wait(500);
end.

Again, please comment ;)

Exaligo I :cartman:


UPDATE
Version 1.2

23 December 2007

I've just changed more of the script. It now has some added fail safes, rather than dodgy infinite loops and it also has a report shown in the debug box at the end of the script.

Here is the latest version:

//////////////////////////////////////////////////
// Auto Log-In/Talker v1.2 //
//////////////////////////////////////////////////
// As made by none other than Exaligo I //
//////////////////////////////////////////////////
// You know you want it //
// Well you've got it if you're reading this... //
// Oh well //
// =( //
//////////////////////////////////////////////////
// Version History: //
// - v1.0: Basic log-in and talker. //
// - v1.1: Added key timing and fixed bugs. //
// - v1.2: Added report and fail safes. //
//////////////////////////////////////////////////

//////////////////////////////////////////////////
// OPERATING INSTRUCTIONS //
//////////////////////////////////////////////////
// First, follow the set up instructions. //
// //
// Log in feature is optional. //
// If you use it, set doLogIn to 1. //
// //
// It will then log you in using the username //
// and password you set underneath when you //
// click run. //
// //
// You must start on the screen where you //
// choose between a new or existing user. //
// //
// The program will also work if you are //
// already logged in. Simply leave doLogIn //
// as 2. //
// //
// You can also set movement and colour //
// efects for text as in RS2. //
// //
// Simply type in the code for the effect //
// you want. They are: //
// - black: ¦ //
// - blue: ¦ //
// - cyan: ¦ //
// - green: ¦ //
// - magenta: ¦ //
// - orange: ¦ //
// - white: ¦ //
// - yellow: ¦ //
// - flash1: ¦ //
// - flash2: ¦ //
// - flash3: ¦ //
// - glow1: ¦ //
// - glow2: ¦ //
// - glow3: ¦ //
// - wave: / //
// - wave2: / //
// - scroll: / //
// - shake: / //
// //
// Those marked with a ¦ are colour, while //
// those marked with a / are movement //
// effects. (see setup) //
// //
// Finally, the time between each message //
// is set further down the page on line //
// 208. This is in milliseconds. There //
// are 1000 milliseconds in a second. //
// //
// Another option is to adjust the value //
// in brakcets after the first time figure. //
// This will adjust the random timing added //
// to each interval for antiban purposes. //
// //
// To exit script, press Ctrl + Alt + S as //
// normal, or alternatively press F8. (Note: //
// You may need to hold F8 for a couple of //
// seconds for the script to stop.) //
//////////////////////////////////////////////////

program PrimitiveAutotyper; // Autotyper v1.0
{.include SRL\SRL.scar}

//////////////////////////////////////////////////
// SETUP - ADJUST VALUES ACCORDINGLY //
//////////////////////////////////////////////////

const

//Use log in function (log in at start of script)
doLogIn = 2;
{Note! 1 = yes 2 = no}

//Set log in features:
username = 'Exaligo I';
password = 'password';

//Set message, colour and wave effects:
SetMessage = 'Earthquake';
moveEffect = 'shake:'; // e.g. 'wave:' 'wave2:' 'scroll:'...
colourEffect = 'flash1:'; // e.g. 'glow1:' 'glow2:' 'flash1:'...

//Set number of times to repeat:
RepeatCount = 3;

//Set time between messages (milliseconds) below in line 208

//////////////////////////////////////////////////
// DO NOT TOUCH CODE BELOW!!! //
//////////////////////////////////////////////////
// Very important stuff going on down there! //
// Exception on line 208. //
//////////////////////////////////////////////////

// Set initial variables.
var
LogInFirstClick: Integer; //.bmp sample of existing user button
LogInBox: Integer; //.bmp sample of log in button
LogInClick2: Integer; //.bmp sample of click to play button
x,y: Integer; //coordinates to click at
FirstClick: Integer; //loop condition
SecondClick: Integer; //loop condition
ThirdClick:Integer; //loop condition
EndLoop:Integer; //Counts number of checks
TypeCount:Integer; //Counts repeats of message
MessageFail:Integer; //Counts failed messages
DidLogIn:String; //Was log-in procedure used?

procedure LogIn; //Log in at start of script
begin
FirstClick:=0; //value to maintain loop
SecondClick:=0; //value to maintain loop
ThirdClick:=0; //value to maintain loop
if (doLogIn = 1) then
begin
DidLogIn:= 'Yes'
writeln('Log in procedure initiated');
writeln('Searching for existing user button');
LogInFirstClick := BitmapFromString(19, 11, 'z78DAA554410E8' +
'3300CFB52B51804C74E23FF7FD2A4864336D7536039F860DCD869' +
'2ADCBF0B0F000736F4052E2ABE9ECA812D95757B429E6DA2D871A' +
'2195E59135EB6DA86A6BC26D325647DF07698630F648DE2734D6E' +
'4CCC584F25CFAACE3FF94AAA3ACF9DE5CBB99556BD877C0315A54' +
'ACBFAD832F79F308CB4D392E6055FFA07663DF34A59CFC68EF7B0' +
'32DD3F8E57E78A0D8EFFC31BE0C31CAC');
repeat //Keep searching until button is found.
wait(100);
if(FindBitmap(LogInFirstClick,x,y)) then
begin
FirstClick:=1; //Break search loop
EndLoop:= 0; //Resets attempt count
writeln('Existing user button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
EndLoop:= EndLoop+1;
//Report error in finding button.
writeln('Error! Existing user button not found');
until(FirstClick = 1) or (EndLoop >= 50); //Exit loop when button is found or 100 attempts failed
FreeBitmap(LogInFirstClick); //Clear bitmap to save memory
writeln('Inputting log in information');
wait(1000);
Sendkeys (username+chr(13)+password);
writeln('Searching for log in button');
wait(500);
LogInBox := BitmapFromString(35, 15, 'z78DAB5965D6A03310C84AFB' +
'4C44A491E3734BEFF910A2B43C7C89F2243AB8761115A5923EBC7' +
'BDFF8A3DECBCDB026F66F6766CEFD6EDD9CEF6321B18355FED61C' +
'740B509A89E0917FE531442FDB864780B8CF218C6B9CAA51C73F4' +
'33F9544651B3CB883CD731BD11B559E4874E4C6B60C12854DA220' +
'6C75B6BED3530C436D95CDF792D6924C8C859E8B9520FC828ADE4' +
'0E429DF5C13E74D621E2A7F754062FC96464B4E862A84F97456EE' +
'BF65239949FC862E1476EB07247C4FDAFF49401CF7F2533B93DCD' +
'70B2DCD0EF3285BEC0C8C93FECA3FF63B47B47F94CEB05A14942F' +
'54079A0BFA8FEF18EC8DE27EA75FA5110BD35B4811EFC50FF32E7' +
'C99BEA75234C7A67F46DFD7E8E68FD5B3515DC7C15E0748DBB26E' +
'E1DDD715173E1C482B0CC82EA339FEAF87EA37D1ADF0C82A5F80B' +
'8C686356FA0E59D05B37DAEF32DAACABBC8F262E1A4F9A797CE30' +
'5EE3FB0FBC933');
repeat //Keep searching until button is found.
wait(100);
if(FindBitmap(LogInBox,x,y)) then
begin
SecondClick:=1; //Break search loop
EndLoop:= 0; //Resets attempt count
writeln('Log in button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
EndLoop:= EndLoop + 1;
//Report error in finding button.
writeln('Error! Log in button not found');
until(SecondClick = 1) or (EndLoop >= 50); //Exit loop when button is found or 100 attempts failed
FreeBitmap(LogInBox); //Clear bitmap to save memory
writeln('Searching for click to play button');
Wait(5000);
LogInClick2 := BitmapFromString(18, 13, 'z78DA9554D10E02210' +
'CFBA50182E7A367BCFFFF24956252D2EB79EE81906EEBD8D610F1' +
'B17A4F35968DACC371DD4ACE59F1B6A647DC90D59E3952BD2C912' +
'35CA443CED44215785B4D6FA0D66891766A75EF7668EE0D6CF082' +
'CDF5A588C31D039BABE5B2DC047EECAB67FD5DCB68C3ED11CCA88' +
'5BBEEC5CD0A5ADAD180E977D4221D9E6138DE8B3238B33A2406AE' +
'0E9C673B542DB833C4AB72B00B7454D628DF378CF9F73BDEC027E' +
'7B2E6A718C107024EF901263651DD8450161074A7F1DA177BF967' +
'807742E864B5E87F021C272235669A18E90D91FC7EEE88B7C0737' +
'B01DE6D384C');
repeat //Keep searching until button is found.
wait(100);
if(FindBitmap(LogInClick2,x,y)) then
begin
ThirdClick:=1; //Break search loop
EndLoop:=0; //Resets attempt count
writeln('Click to play button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(2000+random(100));
ClickMouse(x,y,true); //Click button
end else
EndLoop:= EndLoop + 1;
//Report error in finding button.
writeln('Error! Click to play button not found');
until(ThirdClick = 1) or (EndLoop >= 50); //Exit loop when button is found or 100 attempts failed
FreeBitmap(LogInClick2); //Clear bitmap to save memory
wait(2000);
end else
DidLogIn:= 'No'
end;

procedure Pause; //Wait for x seconds
begin
wait(10000+random(100)); //SETUP: Interval between messages (ms)
end;

procedure Text; //See below
begin
if(not(LoggedIn))then
begin
writeln('Not logged in. Cancelling message.')
MessageFail:= MessageFail + 1; //If message fails 5 times, loop is broken and script ends.
Exit; //Exit procedure if not logged in when typing.
end;
TypeCount:= TypeCount + 1;
Sendkeys(colourEffect); //Sets colour effect
Sendkeys(moveEffect); //Sets movement effect
TypeSend(setMessage); //Types message
writeln('Message sent to client. Total sent: '+IntToStr(TypeCount)); //Confirmation of message
end;

begin
activateclient; //Activites RS window
MessageFail:= 0
LogIn; //Runs log in
repeat //Repeatedly sends message
Text; //Types message
Pause; //Waits for interval
until(isfkeydown(8)) or (TypeCount >= RepeatCount) or (MessageFail >= 5); //End loop on F8
writeln('Procedure terminated');
wait(500);
writeln('Publishing report');
writeln('');
writeln('Username: '+username);
writeln('Log-in procedure used: '+DidLogIn);
writeln('Text sent: "'+SetMessage+'"');
writeln('Times sent: '+IntToStr(TypeCount));
writeln('');
writeln('Thank you for using Exaligo Is Auto Log-In/Autotyper!');
writeln('');
writeln('Exiting script');
wait(500);
end.

Please comment on the update, as well as copying and pasting your report from the debug box. Any errors, you should get a message in the debug box too, so paste that in as well!

Here's mine:
Username: Exaligo I
Log-in procedure used: Yes
Text sent: Earthquake
Times sent: 1


Thanks again!
Exaligo I :cartman:

UPDATE
Version 1.3
24 December 2007

I've now fixed a couple of bugs. One of them is for when you enter 0 as a value for times to repeat. It would still send one message because of where the counter was placed. I've now moved it to the Type procedure so it counts before it types. =P

//////////////////////////////////////////////////
// Auto Log-In/Talker v1.3 //
//////////////////////////////////////////////////
// As made by none other than Exaligo I //
//////////////////////////////////////////////////
// You know you want it //
// Well you've got it if you're reading this... //
// Oh well //
// =( //
//////////////////////////////////////////////////
// Version History: //
// - v1.0: Basic log-in and talker. //
// - v1.1: Added key timing and fixed bugs. //
// - v1.2: Added report and failsafes. //
//////////////////////////////////////////////////

//////////////////////////////////////////////////
// OPERATING INSTRUCTIONS //
//////////////////////////////////////////////////
// First, follow the set up instructions. //
// //
// Log in feature is optional. //
// If you use it, set doLogIn to 1. //
// //
// It will then log you in using the username //
// and password you set underneath when you //
// click run. //
// //
// You must start on the screen where you //
// choose between a new or existing user. //
// //
// The program will also work if you are //
// already logged in. Simply leave doLogIn //
// as 2. //
// //
// You can also set movement and colour //
// efects for text as in RS2. //
// //
// Simply type in the code for the effect //
// you want. They are: //
// - black: ¦ //
// - blue: ¦ //
// - cyan: ¦ //
// - green: ¦ //
// - magenta: ¦ //
// - orange: ¦ //
// - white: ¦ //
// - yellow: ¦ //
// - flash1: ¦ //
// - flash2: ¦ //
// - flash3: ¦ //
// - glow1: ¦ //
// - glow2: ¦ //
// - glow3: ¦ //
// - wave: / //
// - wave2: / //
// - scroll: / //
// - shake: / //
// //
// Those marked with a ¦ are colour, while //
// those marked with a / are movement //
// effects. (see setup) //
// //
// Finally, the time between each message //
// is set further down the page on line //
// 235. This is in milliseconds. There //
// are 1000 milliseconds in a second. //
// //
// Another option is to adjust the value //
// in brakcets after the first time figure. //
// This will adjust the random timing added //
// to each interval for antiban purposes. //
// //
// To exit script, press Ctrl + Alt + S as //
// normal, or alternatively press F8. (Note: //
// You may need to hold F8 for a couple of //
// seconds for the script to stop.) //
// //
// The report will only be displayed if you //
// stop the script with F8 or it runs out //
// on its own. //
//////////////////////////////////////////////////

program Autotyper; // Auto Log-In/Typer
{.include SRL\SRL.scar}

//////////////////////////////////////////////////
// SETUP - ADJUST VALUES ACCORDINGLY //
//////////////////////////////////////////////////

const

//Use log in function (log in at start of script)
doLogIn = 2;
{Note! 1 = yes 2 = no}

//Set log in features:
username = 'Exaligo I';
password = 'password';

//Set message, colour and wave effects:
SetMessage = 'Hello old bean!';
moveEffect = 'scroll:'; // e.g. 'wave:' 'wave2:' 'scroll:'...
colourEffect = 'glow2:'; // e.g. 'glow1:' 'glow2:' 'flash1:'...

//Set number of times to repeat:
RepeatCount = 1;

//Set time between messages (milliseconds) below in line 208

//////////////////////////////////////////////////
// DO NOT TOUCH CODE BELOW!!! //
//////////////////////////////////////////////////
// Very important stuff going on down there! //
// Exception on line 235. //
//////////////////////////////////////////////////

// Set initial variables.
var
LogInFirstClick: Integer; //.bmp sample of existing user button
LogInBox: Integer; //.bmp sample of log in button
LogInClick2: Integer; //.bmp sample of click to play button
x,y: Integer; //coordinates to click at
FirstClick: Integer; //loop condition
SecondClick: Integer; //loop condition
ThirdClick:Integer; //loop condition
EndLoop:Integer; //Counts number of checks
TypeCount:Integer; //Counts repeats of message
MessageFail:Integer; //Counts failed messages
DidLogIn:String; //Was log-in procedure used?

procedure LogIn; //Log in at start of script
begin
FirstClick:=0; //value to maintain loop
SecondClick:=0; //value to maintain loop
ThirdClick:=0; //value to maintain loop
if (doLogIn = 1) then
begin
DidLogIn:= 'Yes'
writeln('Log in procedure initiated');
writeln('Searching for existing user button');
LogInFirstClick := BitmapFromString(19, 11, 'z78DAA554410E8' +
'3300CFB52B51804C74E23FF7FD2A4864336D7536039F860DCD869' +
'2ADCBF0B0F000736F4052E2ABE9ECA812D95757B429E6DA2D871A' +
'2195E59135EB6DA86A6BC26D325647DF07698630F648DE2734D6E' +
'4CCC584F25CFAACE3FF94AAA3ACF9DE5CBB99556BD877C0315A54' +
'ACBFAD832F79F308CB4D392E6055FFA07663DF34A59CFC68EF7B0' +
'32DD3F8E57E78A0D8EFFC31BE0C31CAC');
repeat //Keep searching until button is found.
wait(100);
if(FindBitmap(LogInFirstClick,x,y)) then
begin
FirstClick:=1; //Break search loop
EndLoop:= 0; //Resets attempt count
writeln('Existing user button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
EndLoop:= EndLoop+1;
//Report error in finding button.
writeln('Error! Existing user button not found');
until(FirstClick = 1) or (EndLoop >= 50); //Exit loop when button is found or 100 attempts failed
FreeBitmap(LogInFirstClick); //Clear bitmap to save memory
writeln('Inputting log in information');
wait(1000);
Sendkeys (username+chr(13)+password);
writeln('Searching for log in button');
wait(500);
LogInBox := BitmapFromString(35, 15, 'z78DAB5965D6A03310C84AFB' +
'4C44A491E3734BEFF910A2B43C7C89F2243AB8761115A5923EBC7' +
'BDFF8A3DECBCDB026F66F6766CEFD6EDD9CEF6321B18355FED61C' +
'740B509A89E0917FE531442FDB864780B8CF218C6B9CAA51C73F4' +
'33F9544651B3CB883CD731BD11B559E4874E4C6B60C12854DA220' +
'6C75B6BED3530C436D95CDF792D6924C8C859E8B9520FC828ADE4' +
'0E429DF5C13E74D621E2A7F754062FC96464B4E862A84F97456EE' +
'BF65239949FC862E1476EB07247C4FDAFF49401CF7F2533B93DCD' +
'70B2DCD0EF3285BEC0C8C93FECA3FF63B47B47F94CEB05A14942F' +
'54079A0BFA8FEF18EC8DE27EA75FA5110BD35B4811EFC50FF32E7' +
'C99BEA75234C7A67F46DFD7E8E68FD5B3515DC7C15E0748DBB26E' +
'E1DDD715173E1C482B0CC82EA339FEAF87EA37D1ADF0C82A5F80B' +
'8C686356FA0E59D05B37DAEF32DAACABBC8F262E1A4F9A797CE30' +
'5EE3FB0FBC933');
repeat //Keep searching until button is found.
wait(100);
if(FindBitmap(LogInBox,x,y)) then
begin
SecondClick:=1; //Break search loop
EndLoop:= 0; //Resets attempt count
writeln('Log in button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(1000+random(100));
ClickMouse(x,y,true); //Click button
end else
EndLoop:= EndLoop + 1;
//Report error in finding button.
writeln('Error! Log in button not found');
until(SecondClick = 1) or (EndLoop >= 50); //Exit loop when button is found or 100 attempts failed
FreeBitmap(LogInBox); //Clear bitmap to save memory
writeln('Searching for click to play button');
Wait(5000);
LogInClick2 := BitmapFromString(18, 13, 'z78DA9554D10E02210' +
'CFBA50182E7A367BCFFFF24956252D2EB79EE81906EEBD8D610F1' +
'B17A4F35968DACC371DD4ACE59F1B6A647DC90D59E3952BD2C912' +
'35CA443CED44215785B4D6FA0D66891766A75EF7668EE0D6CF082' +
'CDF5A588C31D039BABE5B2DC047EECAB67FD5DCB68C3ED11CCA88' +
'5BBEEC5CD0A5ADAD180E977D4221D9E6138DE8B3238B33A2406AE' +
'0E9C673B542DB833C4AB72B00B7454D628DF378CF9F73BDEC027E' +
'7B2E6A718C107024EF901263651DD8450161074A7F1DA177BF967' +
'807742E864B5E87F021C272235669A18E90D91FC7EEE88B7C0737' +
'B01DE6D384C');
repeat //Keep searching until button is found.
wait(100);
if(FindBitmap(LogInClick2,x,y)) then
begin
ThirdClick:=1; //Break search loop
EndLoop:=0; //Resets attempt count
writeln('Click to play button found');
MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
Wait(2000+random(100));
ClickMouse(x,y,true); //Click button
end else
EndLoop:= EndLoop + 1;
//Report error in finding button.
writeln('Error! Click to play button not found');
until(ThirdClick = 1) or (EndLoop >= 50); //Exit loop when button is found or 100 attempts failed
FreeBitmap(LogInClick2); //Clear bitmap to save memory
wait(2000);
end else
DidLogIn:= 'No'
end;

procedure Pause; //Wait for x seconds
begin
wait(10000+random(100)); //SETUP: Interval between messages (ms)
end;

procedure Text; //See below
begin
if(not(LoggedIn))then
begin
writeln('Not logged in. Cancelling message.')
MessageFail:= MessageFail + 1; //If message fails 5 times, loop is broken and script ends.
Exit; //Exit procedure if not logged in when typing.
end;
if(not(TypeCount >= RepeatCount))then
begin
TypeCount:= TypeCount + 1;
Sendkeys(colourEffect); //Sets colour effect
Sendkeys(moveEffect); //Sets movement effect
TypeSend(setMessage); //Types message
writeln('Message sent to client. Total sent: '+IntToStr(TypeCount)); //Confirmation of message
end;
end;

begin
activateclient; //Activites RS window
MessageFail:= 0
LogIn; //Runs log in
repeat //Repeatedly sends message
Text; //Types message
Pause; //Waits for interval
until(isfkeydown(8)) or (TypeCount >= RepeatCount) or (MessageFail >= 5); //End loop on F8
writeln('Procedure terminated');
wait(500);
writeln('Publishing report');
writeln('');
writeln('Username: '+username);
writeln('Log-in procedure used: '+DidLogIn);
writeln('Text sent: "'+SetMessage+'"');
writeln('Times sent: '+IntToStr(TypeCount));
writeln('');
writeln('Thank you for using Exaligo Is Auto Log-In/Autotyper!');
writeln('');
writeln('Exiting script');
wait(500);
end.

Again, please comment (I haven't got any replies yet. I know its only been up two days and today is Christmas eve, but you know. I'd appreciate it! ;) )

Thanks again!
Exaligo I :cartman:

p.s. I've now uploaded the latest version. I'll keep up to date from now! :f:

Wizzup?

2007-12-29 09:47:32

You should use the SRL include.
It has auto login and Typing functions, too. :)

Exaligo I

2007-12-29 10:14:33

I have included the SRL include. Look at lines 14 and 15:

program Autotyper; // Auto Log-In/Typer
{.include SRL\SRL.scar}

Then further down I used checked to see if the user was logged in, but thanks for the help. I'll try and rewrite the script with a multi player array using Login.scar. I can try and simplify the script so it runs better too.

Look out for version 2 (when I find time to write it… ;) )

Exaligo I

2008-01-09 15:02:36

OK, you can stop looking for version 2. I've scrapped that, but I'm thinking of starting on a body crafter, for all the lovely ess I got courtesy of Wizzup?'s Ess Miner! ;)

pizzownage

2008-01-09 19:32:38

after seeing your other script, i am anxious to see the body crafter. good work, it was nice

Exaligo I

2008-01-11 05:45:28

Thanks pizzownage. I'm trying to make a multiplayer form, though. Tabs are annoying. If you know how to get values from edit boxes on different tabs I'd be glad to hear it! lol ;)

Edit: Sorted! lol. I sort of completely forgot that the PageControl and TabPages set up an array. I used the fairly cumbersome method of generating a different box on each tab, with multiple bits of fairly similar code. I know I probably could of used a for do loop or case statement. Anyway, sorted now. Just got to make the script walk and craft now!