Code:
program TokkulFighter;
const
{Setup}
cavecolor = 7566204 ; //the color of the cave. White a color between the lightest and darkest.
timetowait = 200000 ; //time to wait after log out before loging in.
DoneLogout = 15 ; // How many times to go through until logging out.
attacktype = 2 ;// Attack Type (1-2-3-4)
//miniNpc = 1310462 ;//The yellow dot of npcs on the minimap. NOT USED!!!!
User = 'user' ; //User name ;
Pass = 'pass' ; //Password ;
Sword = 10921638 ;//The color of the sword in the bottom right of plaing screen. The multi kill sword.
miniNPC = 60909 ;//Color of the yellow dots of NPCs on the minimap.
//Setup the settings.
//Stand outside the cave and then logoff
//Put the target in runescape and press play.
//Ctrl+Alt+S = stop.
{That's all}
var
x,y,w,e,t,v,wtr,doneit,state,pick,entercave,lasttime,mtime,ftime,mintimec,click,hourtimec,minre,hourre,secre,days,counter: integer;
doneitstr,status,systime,hourtime,dayss,minres,hourres,secres,lasttimewent: string;
starts,start,cavefirst,b,logstat:boolean;
procedure LoadBmps;
begin
entercave := BitmapFromString(29, 5, 'z78DA3330400037246040' +
'55400B93DD7000E25592AA9E5A2A49F5177E1388319954BDE4B99' +
'65A260F5DD7E28A3B00195CC18D');
end;
procedure systimecount ;
begin
mtime:=GetSystemTime;
ftime:=mtime-lasttime;
ftime:=ftime div 1000;
systime:=inttostr(ftime);
mintimec:=ftime div 60;
hourtimec:=mintimec div 60;
secre:= ftime mod 60;
minre:= mintimec mod 60;
hourre:= hourtimec mod 24;
days:= hourtimec div 24;
dayss:=inttostr(days);
hourres:=inttostr(hourre);
minres:=inttostr(minre);
secres:=inttostr(secre);
if length(hourres)=1 then
hourres:='0'+hourres;
if length(minres)=1 then
minres:='0'+minres;
if length(secres)=1 then
secres:='0'+secres;
hourtime:=dayss+(':')+hourres+(':')+minres+(':')+secres;
end;
Procedure PrintProgressReport;
Begin
systimecount;
writeln('|==============Tokkul Hut!================|');
writeln('|PROGRESS REPORT:');
writeln('|Status: '+status)
writeln('|You have been through '+doneitstr+' times.');
writeln('|Has been running for '+hourtime);
writeln('|The last time you came out of the cave was '+lasttimewent );
writeln('|=========================================|');
End;
procedure ChangeStatus(CurrentStatus:String);
var
i:string;
Begin
i:=currentstatus
status:=i;
PrintProgressReport;
end;
procedure setattack ;
var
xx,yy:integer;
begin
movemousesmooth( 554, 186);
wait(200+random(55));
clickmouse(554, 186,true);
case attacktype of
1: begin xx:= 585; yy:= 280; end;
2: begin xx:= 581; yy:= 327; end;
3: begin xx:= 597; yy:= 365; end;
4: begin xx:= 584; yy:= 406; end;
end;
movemousesmooth( xx, yy);
wait(200+random(55));
clickmouse(xx, yy,true);
wait(1000+random(55));
end;
procedure typelogin(Type1, Type2:string) ;
var
i,b:integer;
c:char;
begin
i:=Length(Type1);
repeat
b:=b+1;
c:=StrGet(Type1,b);
wait(40+random(55)) ;
keydown(GetKeyCode(c));
wait(40+random(55)) ;
keyup(GetKeyCode(c));
until(b=i)
wait(40+random(55)) ;
keydown(13);
wait(40+random(55))
keyup(13);
b:=0;
i:=Length(Type2);
repeat
b:=b+1;
c:=StrGet(Type2,b);
wait(40+random(55)) ;
keydown(GetKeyCode(c));
wait(40+random(55)) ;
keyup(GetKeyCode(c));
until(b=i)
end;
procedure logout;
begin
changeStatus( 'Logging out...');
movemouseSmooth(4, 476);
wait(300+random(55));
clickmouse(4, 476,true);
wait(300+random(55));
movemouseSmooth(645, 486);
wait(300+random(55));
clickmouse(645, 486,true);
wait(300+random(55));
movemouseSmooth(633, 379);
repeat
wait(300+random(55));
clickmouse(633, 379,true);
until(FindColor(w,e,65535,447, 243,457, 253))
wait(5000+random(55));
if b then
begin
repeat
wait(1000);
until(false);
end;
end;
procedure mapfix;
var
mapp:Extended;
begin
wait(2000+random(55));
repeat
mapp:=DetectRS2MinimapCompassAngle;
wait(1);
keydown(37);
wait(60);
keyup(37);
until((mapp>3.14126130608096) and (mapp<3.34126130608096))
wait(20);
wait(random(55))
keydown(38);
wait(1100+random(55));
keyup(38);
wait(10+random(55));
keydown(40);
wait(400+random(55));
keyup(40);
end;
procedure login;
begin
ChangeStatus('Logging in...');
movemouseSmooth(418, 292);
wait(500+random(55));
clickmouse(418, 292,true);
wait(500+random(55));
typelogin(User,Pass);
movemouseSmooth(259, 314) ;
wait(100+random(55));
repeat
clickmouse(259, 314,true);
wait(3000+random(55));
until(FindColor(w,e,16777215,360, 329,447, 343))
movemouseSmooth(w,e);
wait(55+random(55));
clickmouse(w,e,true);
wait(3000);
ChangeStatus('Setting up...')
setattack;
b:=true;
mapfix;
movemouseSmooth(584, 188);
wait(341+random(55));
clickmouse(584, 188,true);
if FindColor(w,e,Sword,477, 301,501, 323) then
begin
cavefirst:=true;
b:=false;
logstat:=true
end;
if b=true then
logout;
end;
procedure checklog;
begin
if FindColor(w,e,65535,300, 245, 315, 250) then
login;
end;
procedure atttackdots;
var
ab,cd,ef,gh,xx,yy:integer;
begin
if FindColor(ab,cd,65280,2, 2, 515, 337) or FindColor(ef,gh,255,2, 2, 515, 337) then
begin
exit;
end else if FindColor(xx,yy,mininpc,575, 15, 714, 148)then
begin
if FindColor(x,y,cavecolor,10,10,514,336) then
exit;
movemousesmooth(xx,yy);
wait(5);
wait(random(55));
Clickmouse(xx,yy,true);
end;
end;
procedure settime;
begin
lasttime:=GetSystemTime ;
end;
procedure findcave;
begin
ChangeStatus('Finding Cave...');
repeat
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
if(FindColor(x,y,cavecolor,10,10,514,336))THEN
begin
movemouseSmooth(x,y);
wait(500+random(55));
PrintProgressReport;
clickmouse(x,y,false)
wait(600+random(55));
PrintProgressReport;
findbitmap(entercave,x,y);
movemouseSmooth(x,y);
wait(500+random(55));
PrintProgressReport;
clickmouse(x+3,y+3,true);
wait(2000);
end else
begin
wait(3000+random(55));
PrintProgressReport;
end;
until(FindColor(t,v,128, 249, 359,358, 373))
end;
procedure doingit ;
BEGIN
PrintProgressReport;
movemouseSmooth(2,484);
wait(100+random(55)) ;
clickmouse(2,494,true);
end;
procedure attack;
begin
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
PrintProgressReport;
wait(3000+random(55))
PrintProgressReport; systimecount;
status:='Attacking!';
PrintProgressReport;
PrintProgressReport; systimecount;
wait(7000);
wait(random(55)); PrintProgressReport; systimecount;
movemouseSmooth(649,66);
wait(200+random(55));
clickmouse(649,66,true);
pick:=0;
atttackdots;
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
repeat
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
pick:=pick+1;
if (pick>4)then
pick:=0;
if(pick=1)then
begin
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
movemouseSmooth(574, 218) ; PrintProgressReport; systimecount ;
wait(3000+random(55));
end;
//////////atttackdots;
if(pick=2)then
begin
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
movemouseSmooth(596, 257) ; PrintProgressReport; systimecount;
wait(3000+random(55));
end;
if(pick=3)then
begin
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
movemouseSmooth(589, 291);PrintProgressReport; systimecount;
wait(3000+random(55));
end;
if(pick=4)then
begin
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
movemouseSmooth(641, 222); PrintProgressReport; systimecount;
wait(3000+random(55));
end;
if(FindColor(x,y,cavecolor,10,10,514,336))then
state:=1
until(state=1);
end;
procedure work(cavefirst:boolean) ;
var
start:boolean;
begin
end;
procedure first;
begin
if wtr=0 then
begin
starts:=true;
end
else
starts:=false;
wtr:=1;
end ;
procedure main;
begin
start:=true;
if not cavefirst then
start:=false;
repeat
if start then
begin
checklog;
if logstat then
begin
logstat:=false;
exit;
end;
cavefirst:=true;
end;
start:=true;
repeat
if cavefirst then
begin
repeat
pick:=1
state:=0
doneit:=doneit+1;
doneitstr:=inttostr(doneit);
ChangeStatus('Loading...');
wait(200+random(55));
findcave;
ChangeStatus('Loading...');
ChangeStatus('Entering arena...');
wait(3000+random(55));
attack;
lasttimewent:=hourtime;
ChangeStatus('Loading...');
wait(200+random(55));
movemouseSmooth(301, 448);
wait(100+random(55));
clickmouse(301, 448,true);
counter:=counter+1;
until(counter=DoneLogout)
end
else
begin
wait(3000+random(55));
attack;
lasttimewent:=hourtime;
ChangeStatus('Loading...');
wait(200+random(55));
movemouseSmooth(301, 448);
wait(100+random(55));
clickmouse(301, 448,true);
counter:=counter+1;
start:=false;
cavefirst:=true;
end;
until(counter=DoneLogout);
logout;
wait(timetowait+random(55));
until(false)
end;
procedure fakemain;
begin
first;
if starts=true then
begin
cavefirst:=true;
settime;
lasttimewent:='never.';
systimecount;
loadbmps;
doingit;
doneit:=-1;
ChangeStatus('Loading...');
wait(3000+random(55));
counter:=0;
end;
main;
end;
begin
repeat
logstat:=false;
fakemain;
until(false);
end.