SRL Archive - Archive

hunt3rx3 - SRL Member Application


Shatterhand

2012-02-15 02:07:28

How Long have You Played Runescape?
6 Year(s)


Are you affilated in anyway with Jagex LTD?
no

Were you Referred to SRL?



What is your general programming knowledge?
Some C


Are you a member of any other communities?
not really


Tell us about yourself…
From: hunt3rx3
Im 19, been playing rs for long time. I study IT at university, so scripting is a good practise for me.



Please show us one (or multiple) of your scripts.
program iMakeVarryTabs;

{$i srl/srl/misc/smart.simba}
{$i srl/srl.simba}
{$i srl/srl/misc/online.simba}
{$i srl/srl/misc/paintsmart.simba}


const
//////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------//
//NICK IS FOR WINDOW TITLE

USERNAME = '';
PASSWORD = '';
NICK = '';

//--------------------------------------------------------------------------//
//////////////////////////////////////////////////////////////////////////////



var
x, y : Integer;
profitgained, profiteach, tabsmade : Integer;
time, starttime : Integer;
Ver : String;
Const
Version = 3;



procedure UpdateScript;
var
NewScript : String;
Suc : Boolean;
begin
if(FileExists('C:\Simba\Scripts\iMakeVarryTabs_v'+Ver+'.simba')) then
begin
ClearDebug;
WriteLn('You are trying to run an older version of this script even though you have the newer version.')
WriteLn('It is stored at "C:\Simba\Scripts\iMakeVarryTabs_v'+Ver+'.simba"')
TerminateScript;
end;

if(Not DirectoryExists('C:\Simba\Scripts')) then CreateDirectory('C:\Simba\Scripts');

NewScript := GetPage('http://pastehtml.com/view/bo0ybklyn.txt')
if ((CreateFile('C:\Simba\Scripts\iMakeVarryTabs_v'+Ver+'.simba') = -1) or (not WriteFileString(0, NewScript))) then Suc := False
else Suc := True;
WriteLn(FileSize(0));
CloseFile(0);

if((FileExists('C:\Simba\Scripts\iMakeVarryTabs_v'+Ver+'.simba')) and Suc) then
begin
ClearDebug;
WriteLn('There is a new version of the script, updating...')
Wait(500+Random(4000));
WriteLn('Updated the script, new version stored at "C:\Simba\Scripts\iMakeVarryTabs_v'+Ver+'.simba"')
TerminateScript;
end else
begin
ClearDebug;
WriteLn('Sorry I was not able to auto update this script, you can update it manually.')
WriteLn('Opening the web page for you to update.')
OpenWebPage('http://pastehtml.com/view/bn0pfcs3q.txt');
TerminateScript;
end;
end;



procedure CheckVersion;
begin
WriteLn('Checking if you have the most up to date version.');
Ver := GetPage('http://pastehtml.com/view/bo0y9o0tr.txt');

if(Ver = '') then
begin
WriteLn('There was an error connecting to the update server.')
Exit;
end;

if IntToStr(Version) = Ver then
begin
WriteLn('You are using the most up to date version.');
end else
begin
if Version > StrToInt(Ver) then
begin
ClearDebug;
WriteLn('**You seem to be using some sort of beta version, be careful.')
end else
begin
UpdateScript;
end;
end;
end;



procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := USERNAME;
Players[0].Pass := PASSWORD;
Players[0].Nick := NICK;
Players[0].Active := True;
end;



function CurrentTime: string;
var
Hour, Mins, Sec, MSec: Word;
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Result := ('['+Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2)+']');
end;



procedure RotateCam;
var
Keys: TIntegerArray;
I: Integer;
Deg: Extended;
begin
if(not(LoggedIn))then exit;
Keys := [VK_RIGHT, VK_LEFT];
I := Random(2);
if (Random(2) = I) then
begin
ActivateClient;
Deg := RS_GetCompassAngleDegrees;
Wait(100 + random(50));
KeyDown(Keys[I]);
Wait(500 + random(1000));
KeyUp(Keys[I]);
Wait(500 + random(1000));
end else
if (Random(3) = 0) then
SleepAndMoveMouse(1000 + random(200));
end;



procedure Antiban;
begin
case Random(100) of
0: PickUpMouse;
1..5: HoverSkill('Magic', False);
2: HoverSkill('Ranged', False);
3: HoverSkill('Strength', False);
50..70: SleepAndMoveMouse(RandomRange(1000,4000));
71..90: RotateCam;
end;
wait(RandomRange(2000,4000));
end;



procedure ReportOnSmart;
var
text1,text2,text3, text4, text5 : String;
boxBMP : Integer;
begin
text1:= 'Time running: '+MsToTime(TimeFromMark(starttime),Time_Formal);
text2:= 'Profit: '+IntToStr(profitgained);
text3:= 'XP: '+IntToStr(tabsmade*35);
text4:= 'Tabs: '+IntToStr(tabsmade);
text5:= 'Each: '+IntToStr(profiteach);
boxBMP := BitmapFromString(308, 64, 'meJztwjENAAAMAyD/biqqfy1Mw34I6aKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqur/AVZcclA=');SMART_DrawBitmap(true, boxBMP,Point(4,274));
SMART_DrawBitmap(true, boxBMP,Point(4,274));
SMART_DrawTextEx(false,10,275,SmallChars,text1,clBlue);
SMART_DrawTextEx(false,10,295,SmallChars,text2,clBlue);
SMART_DrawTextEx(false,10,315,SmallChars,text3,clBlue);
SMART_DrawTextEx(false,195,295,SmallChars,text4,clBlue);
SMART_DrawTextEx(false,195,315,SmallChars,text5,clBlue);
FreeBitmap(boxBMP);
end;



function FindLectern(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.42, 0.24);

if not(FindColorsTolerance(arP, 11186354, MSX1, MSY1, MSX2, MSY2, 5)) then
begin
//Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 35.42) and (X <= 47.33) and (Y >= 37.50) and (Y <= 50.14) and (Z >= 38.15) and (Z <= 50.91) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 3, 3);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Study')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
//Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;



function FindDemon(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.22, 1.40);

if not(FindColorsTolerance(arP, 1317937, MSX1, MSY1, MSX2, MSY2, 10)) then
begin
//Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 0.33) and (X <= 4.30) and (Y >= 0.28) and (Y <= 3.63) and (Z >= 0.16) and (Z <= 2.59) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 2, 2);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Talk')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
//Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;



function TalkToDemon : Boolean;
var
nextBMP: Integer;
label
Start;
begin
Result:=True;

Start:
MarkTime(time);
repeat
if (TimeFromMark(time)>300000) then
begin
ClearDebug;
Writeln(CurrentTime+' Cant find Demon.');
Result:=False;
Exit;
end;
RotateCam;
Wait(RandomRange(1000,1500));
until FindDemon(x,y)
Writeln(CurrentTime+' Found Demon.');
MarkTime(time);
repeat
Mouse(x,y,0,0,mouse_right);
Writeln(CurrentTime+' Right clicking on Demon.');
Wait(RandomRange(2000,1000));
if (TimeFromMark(time)>20000) then
begin
Result:=False;
Writeln(CurrentTime+' Cant talk to Demon.');
Exit;
end;
until ChooseOption('Fe')
Writeln(CurrentTime+' Chose option: "Fetch-from-bank".');
Wait(RandomRange(2000,3000));

nextBMP := BitmapFromString(19, 12, 'meJyzaI43a4qxaI4Do3gIAooYlIZIO+pxq4gASSAbKGLZlmDdkQRHkoVuQCSR6wxEELZUqSeQzWOhXFRb8fb9exNnG04daZFka4iUdIU3EEHUiGU7QRBcL1CZiqE2UNfff/+AKDkvE6hXKMQIqACiF0gC1QjHWQJJ0Ux7ZMRjpgjUe/HiJYjepUuXMSuL8LppQQwHkoJRJnAE1C6UbAokgQjI5TCQFlGS3rx5C0Tv/sOHRJSlIcqAiC9YB44EIgygKFQPyGXRFBOUk+js79m1a/fp02dWrVoN5PL5aUFs4fFRQ0a8AepABGQAdcmoK86eM2fylCmzZ8+pbW5gkeYBugEoBbGF00kGE3HYSUmrygMtAiKgU31DA0C6TEWB4kBZbg95iBoICWHAEYsib2RCNFAjMIhYpHg4rMQhauDK0NQjLLUSB+pl4GMEkpi64HZh2giVQtKCpozNRJQ8BABBW6fQ');
if FindBitmapToleranceIn(nextBMP, x, y, MCX1, MCY1, MCX2, MCY2, 30) then
begin
Writeln(CurrentTime+' Demon wants his payment.');
MouseBox(225,463,293,472,mouse_left); Wait(RandomRange(1000,2000));
MouseBox(118,387,400,394,mouse_left); Wait(RandomRange(1000,2000));
profitgained:=profitgained-10000;
Writeln(CurrentTime+' Paying 10k.');
FreeBitmap(nextBMP);
goto Start;
end;
FreeBitmap(nextBMP);

MarkTime(time);
repeat
if (TimeFromMark(time)>15000) then
begin
Result:=False;
Writeln(CurrentTime+' Cant uncert the soft clays.');
Exit;
end;
until FindNPCChatText('Un',ClickLeft)
Writeln(CurrentTime+' Chose option: "Un-cert another 24 pieces of soft clay".');
Wait(1000);
Writeln(CurrentTime+' Waiting for clays...');


end;



function MakeTabs : Boolean;
var
varTabBMP : Integer;
begin
varTabBMP := BitmapFromString(45, 49, 'meJzN2GFKAzEQBeDD+MuTldJaS1jbriIe0JvoGQSDA8OSTF7eTKII80Mwm/n6drK6Tema0nVZVq3L5UXrdnvV+rq/I0vW6yaybfppdD4/5To9LrmOD+lwOO/3p93uuDV4AevzmxTjMTEqGQRsK4BRiRrI/E1AGKMSYUwBBDAiyQwxgAu9AAaTa8vIgQgjAAiv1FhEIozWvYh9Rv4qZUggtSEGCOwgEpPBd++uIRkSiHdzb1x4jckYAfDXmoF0V7oA5FECjNYOAYC5FZ4QHMWgAexmMn4pCoYhErCg2PDz4z1Xt2+9rHsMhUFGwTDMNeRhZOQjDCYQfiqkBZZ0Gcyn7k4mZuDf4kD+G4M5pPi+dG8ZkLgYoBczwNMZdUfyqdLt8gcMVxqB+zISReCktAIZjCL2R20iI/AUbUlcBrJjIJDxKKYEwj+1Wr3w/xvhw+uNYpAhksGpyD9v35WYWxYoc6siCpNRS2IYcgLrl2jAcGHwtbUBvMC2JBjDXFUz8gsCnkkeE1imUdSM1ocFHldigOGaySmAwgAY3jHwDozJCM9k4MgUw1kw5mJw9yKKZVnD524QUHypHttzEOBlkJgwQL+4njJvZPcCEGPw808C1JDrG9H2SiE=');
Result:=True;
MarkTime(time);
repeat
if FindLectern(x,y) then
begin
Writeln(CurrentTime+' Clicking on lectern.');
Mouse(x,y,0,0,mouse_left);
Wait(RandomRange(4000,4500));
end;
if (TimeFromMark(time)>30000) then
begin
Result:=False;
Writeln(CurrentTime+' Cant find lectern or failed to click on it.');
FreeBitmap(VarTabBMP);
Exit;
end;
until FindBitmapToleranceIn(varTabBMP, x, y, MSX1, MSY1, MSX2, MSY2, 30)
FreeBitmap(VarTabBMP);
MarkTime(time);
repeat
MouseBox(228,224,273,279,mouse_right);
Writeln(CurrentTime+' Right clicking on Varrock Teleport.');
if (TimeFromMark(time)>15000) then
begin
Result:=False;
Writeln(CurrentTime+' Cant find option: "Make-All"');
Exit;
end;
until WaitOption('e-All',100)
Writeln(CurrentTime+' Chose option: "Make-All".');
Wait(1000);
Writeln(CurrentTime+' Making 24 tabs...');

end;



function WhileTabbing : Boolean;
begin
Result:=True;
MarkTime(time);
repeat
Wait(100);
Antiban;
FindNormalRandoms;
if (TimeFromMark(time)>180000) then
begin
Result:=False;
Writeln(CurrentTime+' Took too long to make 24 tabs.');
Exit;
end;
until (InvCount=4)
profitgained:=profitgained+24*profiteach;
tabsmade:=tabsmade+24;
ReportOnSmart;
Writeln(CurrentTime+' Done.');
Wait(RandomRange(2000,6000));
end;



procedure SetupPrices;
var
law, fire, clay, tab : Integer;
begin
law:=GetGEPrice('Law rune');
fire:=GetGEPrice('Fire rune');
clay:=GetGEPrice('Soft clay');
tab:=GetGEPrice('Varrock teleport');
profiteach:=(tab-clay-fire-law);
end;



procedure Main;
begin
tabsmade:=0;
profitgained:=0; //profit is not tabsmade*profiteach, cause the butler's costs
ClearDebug;
ToggleXPBar(True);
ToggleMoneyPouch(False);
SetAngle(SRL_ANGLE_HIGH);

if (InvCount>4) then
begin
Writeln('Waiting till the first 24 tabs are made.');
MarkTime(time);
repeat
Wait(2000);
if (TimeFromMark(time)>180000) then
begin
Writeln('Setup failure. Try again.');
Exit;
end;
until (InvCount=4)
end;
MarkTime(starttime);
ReportOnSmart;
Writeln(CurrentTime+' Ok, lets make some tabs. Current profit per tab: '+IntToStr(profiteach));


while LoggedIn do
begin
if not TalkToDemon then Exit;
MarkTime(time);
repeat
FindNormalRandoms;
if (TimeFromMark(time)>30000) then
begin
ClearDebug;
Writeln(CurrentTime+' Demon didnt bring us any soft clays.')
Exit;
end;
until (InvCount>4);
if (InvCount<28) then
begin
ClearDebug;
Writeln(CurrentTime+' Out of resources.');
Exit;
end;
ClearDebug;
Writeln(CurrentTime+' We got some clays!');
Wait(RandomRange(500,3000));
if not MakeTabs then Exit;
if not WhileTabbing then Exit;
ClearDebug;
end;
Writeln(CurrentTime+' We got logged out somehow.');
end;



begin
ClearDebug;
CheckVersion;
Smart_Server := 20;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetupSRL;
ActivateClient;
DeclarePlayers;
Disguise('iMakeTabs_v'+IntToStr(Version)+' ['+Players[0].Nick+']');


if not LoggedIn then
begin
//LoginPlayerToLob;
//OpenWorldScreen;
//SelectWorld(RandomWorld(true,false));
LoginPlayer;
ClearDebug;
Writeln('Logged in successfully.');
Writeln('Disable SMART and follow these steps:');
Writeln('- enter your house, building mode off');
Writeln('- make Demon follow you');
Writeln('- go to the lectern');
Writeln('- uncert 24 soft clays');
Writeln('- make 24 varrock tabs');
Writeln('Now enable SMART and start the script again.');
Exit;
end;

SetupPrices;
Main;
Logout;
Writeln(CurrentTime+' Script stopped.');

end.

program ChaosMossKiller;

{$i srl/srl/misc/smart.simba}
{$i srl/srl.simba}
{$i srl/srl/misc/paintsmart.simba}


const
//////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------//
//NICK: IT IS FOR WINDOW TITLE
//HOPPING: SET THIS FALSE IF U DONT WANT IT TO HOP WHEN PEOPLE AROUND
//BONECRUSHER: SET THIS TRUE IF YOU ARE USING BONECRUSHER (PRAY XP)
//ATK STYLE: attack / strength / defence

USERNAME='';
PASSWORD='';
NICK='';
HOPPING=True;
BONECRUSHER=False;
ATKSTYLE='strength';

//--------------------------------------------------------------------------//
//////////////////////////////////////////////////////////////////////////////



var
X, Y, StartTime, Time, StartXp : Integer;
Ver : String;

Const
Version = 2;



procedure UpdateScript;
var
NewScript : String;
Suc : Boolean;
begin
if(FileExists('C:\Simba\Scripts\ChaosMossKiller_v'+Ver+'.simba')) then
begin
ClearDebug;
WriteLn('You are trying to run an older version of this script even though you have the newer version.')
WriteLn('It is stored at "C:\Simba\Scripts\ChaosMosskiler_v'+Ver+'.simba"')
TerminateScript;
end;

if(Not DirectoryExists('C:\Simba\Scripts')) then CreateDirectory('C:\Simba\Scripts');

NewScript := GetPage('http://pastehtml.com/view/bnvw9tack.txt')
if ((CreateFile('C:\Simba\Scripts\ChaosMossKiller_v'+Ver+'.simba') = -1) or (not WriteFileString(0, NewScript))) then Suc := False
else Suc := True;
WriteLn(FileSize(0));
CloseFile(0);

if((FileExists('C:\Simba\Scripts\ChaosMossKiller_v'+Ver+'.simba')) and Suc) then
begin
ClearDebug;
WriteLn('There is a new version of the script, updating...')
Wait(500+Random(4000));
WriteLn('Updated the script, new version stored at "C:\Simba\Scripts\ChaosMossKiller_v'+Ver+'.simba"')
TerminateScript;
end else
begin
ClearDebug;
WriteLn('Sorry I was not able to auto update this script, you can update it manually.')
WriteLn('Opening the web page for you to update.')
OpenWebPage('http://pastehtml.com/view/bn0m5u106.txt');
TerminateScript;
end;
end;



procedure CheckVersion;
begin
WriteLn('Checking if you have the most up to date version.');
Ver := GetPage('http://pastehtml.com/view/bnvw6d6r8.txt');

if(Ver = '') then
begin
WriteLn('There was an error connecting to the update server.')
Exit;
end;

if IntToStr(Version) = Ver then
begin
WriteLn('You are using the most up to date version.');
end else
begin
if Version > StrToInt(Ver) then
begin
ClearDebug;
WriteLn('**You seem to be useing some sort of beta version, be careful.')
end else
begin
UpdateScript;
end;
end;
end;



procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := USERNAME;
Players[0].Pass := PASSWORD;
Players[0].Nick := NICK;
Players[0].Active := True;
end;



function CurrentTime: string;
var
Hour, Mins, Sec, MSec: Word;
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Result := ('['+Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2)+']');
end;



procedure RotateCam;
var
Keys: TIntegerArray;
I: Integer;
Deg: Extended;
begin
if(not(LoggedIn))then exit;
Keys := [VK_RIGHT, VK_LEFT];
I := Random(2);
if (Random(2) = I) then
begin
ActivateClient;
Deg := RS_GetCompassAngleDegrees;
Wait(100 + random(50));
KeyDown(Keys[I]);
Wait(500 + random(1000));
KeyUp(Keys[I]);
Wait(500 + random(1000));
end else
if (Random(3) = 0) then SleepAndMoveMouse(1000 + random(200));
end;



procedure ReportOnSmart;
var
text1,text2,text3,text4 : String;
boxBMP : Integer;
begin
if not BoneCrusher then
begin
text1 := 'Time running: '+MsToTime(TimeFromMark(StartTime),Time_Formal);
text2 := 'Moss Giants Killed: '+IntToStr((GetXPBarTotal-StartXp)/320);
text3 := 'XP Gained: '+IntToStr(((GetXPBarTotal-StartXp)/320)*240);
text4 := 'Pray XP: '+IntToStr(((GetXPBarTotal-StartXp)*3/4/240)*15);
boxBMP := BitmapFromString(308, 64, 'meJztwjENAAAMAyD/biqqfy1Mw34I6aKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqur/AVZcclA=');

SMART_DrawBitmap(true, boxBMP,Point(4,274));
SMART_DrawTextEx(false,10,275,SmallChars,text1,clBlue);
SMART_DrawTextEx(false,10,295,SmallChars,text2,clBlue);
SMART_DrawTextEx(false,10,315,SmallChars,text3,clBlue);
end;


if BoneCrusher then
begin
text1 := 'Time running: '+MsToTime(TimeFromMark(StartTime),Time_Formal);
text2 := 'Moss Giants Killed: '+IntToStr((GetXPBarTotal-StartXp)/335);
text3 := 'XP Gained: '+IntToStr(((GetXPBarTotal-StartXp)/335)*240);
text4 := 'Pray XP: '+IntToStr(((GetXPBarTotal-StartXp)/335)*15);
boxBMP := BitmapFromString(308, 64, 'meJztwjENAAAMAyD/biqqfy1Mw34I6aKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqur/AVZcclA=');

SMART_DrawBitmap(true, boxBMP,Point(4,274));
SMART_DrawTextEx(false,10,275,SmallChars,text1,clBlue);
SMART_DrawTextEx(false,10,295,SmallChars,text2,clBlue);
SMART_DrawTextEx(false,10,315,SmallChars,text3,clBlue);
SMART_DrawTextEx(false,156,315,SmallChars,text4,clBlue);
end;
FreeBitmap(boxBMP);
end;



procedure Antiban;
begin
case Random(240) of
1: begin HoverSkill(ATKSTYLE,false); Wait(RandomRange(3000,4000));end;
2: begin HoverSkill(skill_hitpoints,false); Wait(RandomRange(3000,4000)); end;
3: PickUpMouse;
4..6: RotateCam;
180..220: SleepAndMoveMouse(1000 + random(200));
end;
end;



function EatLobster: boolean;
var
FoodBMP: integer;
x, y: integer;
begin
FoodBMP := BitmapFromString(13, 14, 'meJwT9ZrOw8Mr5r9APHCpeNAy8eAV4iGrmBgYBG2rIYKSEVskIjaJBSwGKgMypGJ2ScXulYrbD+QK2TeKek0X818I1CUZtR2kIGw9hCGTckY24zKQIeI5WcRjIlAN0ASJkNVA7TLJJ4DiECSfdx+oF84FqgHaCDQEaAXQBKCIoKAg0DEQBDQKKAUUhDgV6Bjp+IMyaeeBCCiroGAAUuMxUSJ0rWT0ToiBIIdFbuU3L+A3y5PLugZXBnQJUI10wiHphCMgZSGrBCxLBKwrgAiiBqIM6BfpxKNAl8ikngXaAnKPTSXQ18LOHXA1QJcAnS2bfkk28yrQCrmsG4L29UJO7cKuPUAHQ9UELgWSQGVwvwARSIHHRFHvmcBwRlMDN1zQrhYUwn7zICGDVQ3QEKBFIAXg6AN6DVMNSAoWuUAFwGCUCN+ApgYYUMAgBYqDFIRvAHoWGPXAEAAAOIKIaA==');
GameTab(tab_Inv);
wait(100+random(20));
if FindBitmapToleranceIn(FoodBMP, x, y, MIX1, MIY1, MIX2, MIY2, 30) then
begin
Mouse(x+random(8), y+random(8), 2, 2, true); // leftclick food
writeln(CurrentTime+' Ate food successfully!');
wait(1500+random(200));
Result := True;
end
else
begin
writeln('Out of food.');
Result := False;
end;
FreeBitmap(FoodBMP);
end;



function FindMoss1(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.62, 1.26);

if not(FindColorsTolerance(arP, 2504249, MSX1+150, MSY1+85, MSX2-150, MSY2-85, 6)) then
begin
//Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 1.60) and (X <= 5.70) and (Y >= 1.68) and (Y <= 6.42) and (Z >= 1.19) and (Z <= 3.86) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 30, 30);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Attack')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
//Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;



function FindMoss2(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.62, 1.26);

if not(FindColorsTolerance(arP, 2504249, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
//Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 1.60) and (X <= 5.70) and (Y >= 1.68) and (Y <= 6.42) and (Z >= 1.19) and (Z <= 3.86) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 30, 30);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Attack')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
//Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;



procedure HopWorld;
begin
ExitToLobby;
OpenWorldScreen;
SelectWorld(RandomWorld(true,false));
LoginPlayer;
ToggleXPBar(true);
SetAngle(SRL_ANGLE_HIGH);
end;



procedure Main;
var
redbarBMP, whitedotBMP : Integer;
found, done : Boolean;
begin
startxp:=GetXPBarTotal;
if LoggedIn then Writeln(CurrentTime+' Starting script. XP Bar: '+IntToStr(StartXp)+'.');
MarkTime(starttime);

SetAngle(SRL_ANGLE_HIGH);
//main loop
while (LoggedIn) and (InvCount>0) do
begin

done:=False;
MarkTime(Time); //max 1min for moss detection
repeat
found:=False;
FindNormalRandoms;
case Random(3) of 0: RotateCam; end;
if FindMoss1(x,y) then found:=True //looking for closer mosses
else if FindMoss2(x,y) then found:=True; //looking for any mosses

if (TimeFromMark(Time)>60000) then
begin
Writeln(CurrentTime+' Cant find monsters.'); //failsafe for moss detection
Exit;
end;
if found then
begin
Mouse(x,y,0,0,mouse_right)
if ChooseOption('ttack') then done:=True;
end;
until done
if BoneCrusher then ReportOnSmart; //we need some time, bone is getting burried slowly (this is the report of the previous circle)

begin
begin
MarkTime(Time); //max 20 sec for moss kill
redbarBMP := BitmapFromString(54, 3, 'meJxjYKhgYKhgZOhi4TjMwrEPTBJC3CfhiJXvPKvARRASuoGMWKRuk4FYZR+wKr5kV3jFIfCQi+caJ8MBdoYlDAw5DAxNQAR0JAaaxMwwCxmxMCyEI1aGVXDEwbARhnbiQkDrgAjCwKMMA62GuxANIbsTjnA5GMmpq5Fci4bQpOBuwKUehIBhCADKUXek');
repeat
Wait(500); //less cpu usage (it wont look for redbar constantly)
Antiban; //antiban
until FindBitmapToleranceIn(redbarBMP, x, y, MSX1, MSY1, MSX2, MSY2, 30) or (TimeFromMark(time)>20000) //waiting until we see the full redbar or 15 seconds
FreeBitmap(redbarBMP);
end;
Wait(RandomRange(2000,2400));
end;
FindNormalRandoms;

if not LoggedIn then Exit; //failsafe
if not BoneCrusher then ReportOnSmart;

//eating?
if (HPPercent<50) then if not EatLobster then Exit;

//hopping?
if Hopping then
begin
whitedotBMP := BitmapFromString(4, 5, 'meJwLjor6//83EAXDGED0/d1rOOPulYuMDAxvnzy8cPwIkAFUBiSBKDA8AgBtbCYY');
if FindBitmapToleranceIn(whitedotBMP, x, y,588,56,655,119,30) then
begin
Writeln(CurrentTime+' Noob is here, we hopping.');
HopWorld;
end;
FreeBitmap(whitedotBMP);
end;
end;
end;



begin
ClearDebug;
CheckVersion;
Wait(RandomRange(3000,4000));
Smart_Server := 20;
Smart_Members := True;
Smart_Signed := False;
Smart_SuperDetail := False;

SetupSRL;
ActivateClient;
DeclarePlayers;
Disguise('ChaosMossKiller ['+Players[0].Nick+']');
ClearDebug;

if not LoggedIn then
begin
if LobbyScreen then LoginPlayer;
LoginPlayerToLob;
OpenWorldScreen;
SelectWorld(RandomWorld(true,false));
LoginPlayer;
ClearDebug;
end;

if LoggedIn then Main;
if LoggedIn then Logout;
Writeln(CurrentTime+' Script stopped.');

end.

RISK

2012-02-15 02:08:18

E:

I do not like your use of global variables. It hogs memory and it can be very confusing. You should change your use of global variables as much as possible to be local variables instead. Variables for progress reports and such can be global variables though.


Your scripts are not multiplayer enabled and your declare players does not seem to be the best way to do it. Why not check out this tutorial?: http://villavu.com/forum/showthread.php?t=49089 – It has a great guide on implementing multiplayer.


You use single line if .. then's, like this:
  if(not(LoggedIn))then exit;

That is incorrect and it is ugly, sadly. It should be changed to:
if (not(LoggedIn)) then
Exit;


procedure Antiban;
begin
case Random(240) of
1: begin HoverSkill(ATKSTYLE,false); Wait(RandomRange(3000,4000));end;
2: begin HoverSkill(skill_hitpoints,false); Wait(RandomRange(3000,4000)); end;
3: PickUpMouse;
4..6: RotateCam;
180..220: SleepAndMoveMouse(1000 + random(200));
end;
end;

You use single lines there too. It should be this:
procedure Example;
var
I: Integer;
begin
I := Random(10);

case (I) of
0 :
begin
end;
1 :
begin
end;
// etc.
end;
end;


You use multiple standard autocolor functions from ACA, which, in my opinion are not required at all. You could also have shortened it to one single function just for easier manageability.


You also use no real object finding with TPAs & ATPAs. You rely on bitmaps, as far as I can tell. Which is slow.
A good tutorial on TPAs is Coh3n's guide and then these:
1: http://villavu.com/forum/showthread.php?t=49067
2:http://villavu.com/forum/showthread.php?t=21786


You should also be much more active community-wise. I have rarely ever seen you post.

I'm sorry but it's a no from me. You are on the right track to learning though. :)

KingKong

2012-02-15 03:11:23

Its a no from me. You don't show a good understanding of TPA's/ATPA's, or the srl include. And the ones that you did include ATPA's were straight from the aca, which shows no knowledge on your part.

Shatterhand

2012-02-15 03:48:36

From: KingKong
Its a no from me. You don't show a good understanding of TPA's/ATPA's, or the srl include. And the ones that you did include ATPA's were straight from the aca, which shows no knowledge on your part.

Yea right, I didnt use TPAs yet. But whats wrong with ACA findobject? RISK said before that I could use ONE function instead of that. Which is that? :)

RISK

2012-02-15 03:50:14

You could use one function for your ACA created functions as a standardized thing. But, ACA is the only truly advanced coding in your scripts. Which wasn't created by you.

What KingKong is trying to tell you is that you need to work less with ACA functions and work more with your own TPAs and ATPAs.

Shatterhand

2012-02-15 04:26:27

From: RISK

What KingKong is trying to tell you is that you need to work less with ACA functions and work more with your own TPAs and ATPAs.

Umm I dont get it. TPA is not for instead of bitmaps? Its for finding items in inv/bank or minimap, things what are not changing? Or can we find a monster with TPA? I must really look into TPAs then. :D

Mat

2012-02-15 04:40:44

From: hunt3rx3
Umm I dont get it. TPA is not for instead of bitmaps? Its for finding items in inv/bank or minimap, things what are not changing? Or can we find a monster with TPA? I must really look into TPAs then. :D

TPA is a way to Find MainScreen Object like monster, Rocks anything.
They are very accurate as where Normal FindObjects aren't so accurate. Nothing to do with Bitmaps :)
Mat

RISK

2012-02-15 04:49:56

TPAs and ATPAs can be used for anything in RuneScape. Even inventory interaction.

Er1k

2012-02-15 04:58:34

From: RISK
TPAs and ATPAs can be used for anything in RuneScape. Even inventory interaction.


In one of my miners I actually used TPA to detect ores instead of DTMs. The opportunities with TPA are very diverse, I must say.

Ontopic: You show general understanding of scripting. But there are a lot more you can explore. You should also work on community participation - you are still very green in this community, and getting people to know you/ helping other users is highly appreciated.

[XoL]

2012-02-15 08:41:42

Along with what was stated above, I think you are still new to the community. Above all SRL members is a community title, we aim to help the community. I see that you have two active script threads (Which is great!) I also see you do ask for help (Also great) but what I don't see is consistency in posting elsewhere try to live it up a little in the community :).

I kind of just want to see your personality outside of threads you own.
I see MAJOR improvements from your last application, but I still don't think you meet the cut just yet; don't be down though I am fairly confident if you apply next time following the advice of the SRL members above me and my advice you will succeed.

For more advanced scripting I would suggest reading these guides:
http://villavu.com/forum/forumdisplay.php?f=96

Community Guides:
http://villavu.com/forum/showthread.php?t=72050
http://villavu.com/forum/showthread.php?t=66084

Anyway, sorry for the roughness. Good luck.

Shatterhand

2012-02-15 12:21:03

Thanks for the advices! :)

Shatterhand

2012-02-19 16:15:16

From: KingKong
ItYou don't show a good understanding (of TPA's/ATPA's), or the srl include.

What do u mean? :)

Hobbit

2012-02-23 13:01:12

The poll has closed and you didn't quite make it this time. Please take the suggestions made here and read some more in the tutorial section and improve your script. You may reapply in 4 weeks time.


Cheers
Hobbit