Code:
program autofighter;
//***********IMPORTANT!**************
//CLIENT SIZE MUST BE 698x469!!!
//sleeping bag must be in first slot
//
//I would also like to thank the maker of leosleep, blood and gottapercha
//and of course kaitnets/freddy1990 and SRL as they provided crucial tools
//
//I did edit the code slightly to make it work better and smoother
//on rscemulation though (fixed bitmaps as well) :P
//
//change shit here
const
//color of the monster you wish to attack
colortofight = 16185078;
//skele54 6318185
//guard 6250335
//red spiders 2629762
//pirates30 21074
//chicken 16185078
//right click to kill monsters? 1 to enable, 0 do disable
//0 is faster, but can lead to picking shit up and stuff...
rightclick = 1;
//optional in case you want to relogin , you can set these
//the logincolor1 and logincolor2 are colors from the login page
//"rune scape"... pick any of them including the sword color
//(depends on screen resolution sadly (remember your dimensions))
login = 'guthix';
password = 'blah';
logincolor1 = 11118880;
logincolor2 = 10064522;
//path to leosleep folder's sword.txt (it may not be created)
slword = 'C:\LeoSleep\slword.txt';
hc = 'C:\LeoSleep\hc.bmp';
green = 65280;
//global variables
var w, h, x, y, entered, backspace, antiban: Integer;
procedure getimage(); //Thanks to 'gottapercha'
//get the image and send it to leosleep
var
b: Integer;
begin
writeln('getting image');
b:= Bitmapfromstring(254,39, ''); //Create an empty bitmap with the correct width and height
CopyClientToBitmap(b, 255, 240, 509, 279); //Take a screenshot and copy it to b
//CopyClientToBitmap(b, 255, 230, 509, 269); original values
sleep(200+random(200));
SaveBitmap(b,hc);
sleep(3000+random(2000));
writeln('Got Image Sent to Leosleep!');
FreeBitmap(b); //Don't forget to free your bitmap after using
end;
procedure gettext; // By Thick As Blood
//get the text from the file
var
s2 : string;
InFile : Integer;
begin
writeln('writing word');
InFile:= OpenFile(slword, False);
writeln('Typeing Text Now');
ReadFileString(InFile, s2, FileSize(InFile));
CloseFile(InFile);
if(getcolor(74,225)=0) and (getcolor(395,242)=0)then
begin
StrToInt(s2);
TypeKeys(s2);
end;
end;
procedure fight;
//click or right click
begin
if(rightclick=1) then
begin
ClickMouse(x, y, false);
y:=y+12;
sleep(250);
end;
ClickMouse(x, y, True);
sleep(400);
end;
procedure backspaceproc;
begin
//delete all text
backspace := 16;
repeat
sleep(100);
SendKeysSilent(chr(8));
backspace := backspace - 1;
until(backspace = 0)
end;
procedure loginfound;
begin
writeln('loginscreen found');
//click existing user
ClickMouse(449, 365, True);
sleep(1000);
if(entered = 0) then
begin
//loginbox click n fill
ClickMouse(245, 356, True);
backspaceproc;
sleep(500);
SendKeysSilent(login);
sleep(100);
//password click n fill
ClickMouse(285, 402, True);
backspaceproc;
sleep(500);
SendKeysSilent(password+chr(13));
sleep(5000);
entered:=1;
end;
if(getcolor(230,225)=logincolor1) and (getcolor(300,190)=logincolor2) then
begin
repeat
ClickMouse(519, 337, True);
sleep(5000);
until(not (getcolor(230,225)=logincolor1)) and (not (getcolor(300,190)=logincolor2))
end;
end;
Procedure sleepifneeded;
begin
//check for green text
if(getcolor(14,472)=green) and (getcolor(97, 473)=green) and (getcolor(275, 470)=green) then
begin
//click on sleeping bag
sleep(3000);
ClickMouse(680,37, True);
sleep(1000);
ClickMouse(475,75, True);
repeat
sleep(1000);
getimage;
gettext;
until(not(getcolor(74,225)=0)) and (not (getcolor(395,242)=0))
end;
end;
//////////////////////////////////////////////////////////////
// MAIN //
//////////////////////////////////////////////////////////////
begin
GetClientDimensions(w, h);
antiban := 0;
repeat
//loginscreen debug
//writeln(inttostr(getcolor(230,225)) + ' and ' + inttostr(getcolor(300,190)));
If(getcolor(230,225)=logincolor1) and (getcolor(300,190)=logincolor2) then
begin
loginfound;
end;
if (FindColor(x,y, colortofight, 181, 0, w, h) or FindColor(x,y, colortofight, 0, 140, 170, 480)) then
begin
fight;
end;
antiban := antiban + 1;
sleep(400);
if(antiban > 5) then
begin
repeat
sleepifneeded;
writeln('sleepcheck');
until((getcolor(74,225)<>0) and (getcolor(395,242)<>0))
antiban := 0;
end;
until(false);
end.
edit dict.txt with the following: