PDA

View Full Version : LeoSleep + script RSCEmulation



mpj123
01-20-2011, 01:19 AM
Download leosleep from http://villavu.com/forum/showthread.php?t=60127,

download scar and run the following script (or make your own):

everything below is made by me, mpj123. Enjoy


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:


2 hander
agility
aim
air
air rune
alchemy
anchovie pizza
apple pie
ardougne
armour
arrav
ashes
assistant
attack
avantoe
axe
bar
bass
battle axe
beer
beer glass
black axe
black dagger
black mace
black scimitar
blood rune
bones
bowl
bow string
brass
bread
bread dough
broken shield
bronze arrows
burnt lobster
burnt meat
burnt pie
cape
cast
certificate
chaos rune
cheese
chest key
closet key
combat
contest
cooked meat
cosmic rune
cow hide
crafting
crest
death rune
defense
demon
diamond amulet
digsite
dock tower
doric
dragon axe
dragon bones
dragon scale
dragonstone
dragon sword
draynor
druidic
druids robe
duel
dwarf cannon
dwarven stout
earth bolt
earth wave
effects
egg
enchant
enfeeble
eye patch
family crest
fatigue
feather
fight
fire
fire orb
fire rune
fish food
fishing bait
flour
fortress
garlic
gasmask
gauge
gauntlets
gertrude
ghost
ghostspeak
gloves
gnome robe
gnomes hat
gnome village
gower
grapes
greater
greater demon
guthix
halloween
hammer
hazeel cult
herblaw
hits
iban blast
irit leaf
iron
iron spear
judgement
jug
jungle potion
key
knife
knight
leather
lemon
lesser
lesser demon
longbow
luke
mace
magic
magic logs
magic longbow
magic shortbow
marrentill
mask
meat pie
mining
mithril seed
monk
mould
nature rune
needle
net
observatory
onion
oyster
picture
pike
pizza base
plain pizza
plank
plate mail
power
prayer
quests
ranarr weed
ranged
ranging potion
raw bear meat
raw cod
raw trout
red bead
red key
rscemulation
ruby
ruby amulet
rune arrows
rune axe
rune dagger
runescape
rune scimitar
rune spear
runite
runite ore
salmon
scimitar
scorpion cage
scroll
seaslug
sea slug
seers village
server
shark
shilo village
shortbow
short sword
shrimp
silver bar
silverlight
skill
slayer
snake weed
sound
spade
spawn
staff
stake
stats
steel arrows
stew
streel
swordfish
tarromin
temple
thread
tinderbox
tomato
torch
tuna
unicorn
unicorn horn
vial
water
waterfall
water orb
water rune
water wave
whisky
white berries
white knight
wind bolt
wine
witch
wizard
wolf fur
wolf leaf
woodcut
yellow key
zilent


PS, what's the function to detect words? I could totally make some cool use of that :)