slushpuppy
2012-10-14 03:12:46
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?
mirc scripting lang,php,javascript,C,java,pascal
Are you a member of any other communities?
no
Tell us about yourself…
Please show us one (or multiple) of your scripts.
Some of my contributions to the community
http://villavu.com/forum/showthread.php?p=1058025#post1058025 - Sound plugin
In house finder:
Usage:
Results:

Beefy bill script:
Sound plugin:
http://villavu.com/forum/showthread.php?p=1117702#post1117702
6 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
mirc scripting lang,php,javascript,C,java,pascal
Are you a member of any other communities?
no
Tell us about yourself…
From: slushpuppy
I am 22 years old and is currently serving in the army. I started coding when I was 11 years old. My interests are: engineering, programming, politics and economics. Like some others in the botting community, I came over to villavu after the bot nuke last year- then I was immediately hooked by the friendly and accommodating nature of the members in this forum
Please show us one (or multiple) of your scripts.
Some of my contributions to the community
http://villavu.com/forum/showthread.php?p=1058025#post1058025 - Sound plugin
In house finder:
Usage:
FindHouseBounds(16118766,25); Results:

function DistBetween(tp1, tp2: TPoint) : Double;
var difX, difY: Extended;
begin
difX := Sqr(tp1.x - tp2.x);
difY := Sqr((tp1.y - tp2.y));
Result := double(Sqrt(difX + difY));
end;
function getPolarAngle(o,pt : TPoint) : Extended;
begin
Result := ArcTan2(o.y - pt.y, o.x - pt.x) * 180 / Pi;
end;
function inArray(search : Integer; arr : array of Integer) : Integer;
var
I : Integer;
begin
for I := 0 to High(arr) do
begin
if arr[I] = search then
begin
Result := I;
Exit;
end
end;
Result := -1;
end;
function FindHouseBounds(col,tol : Integer) : TPointArray;
var
tpa,walltpa,players : TPointArray;
atpa : Array of TPointArray;
tmp, foundIndex, I : Integer;
dist1,dist2 : Extended;
MMCTP : TPoint;
degArray : Array of Integer;
knownDegrees : Array[0..360] of Integer;
begin
SetArrayLength(walltpa,1);
SetArrayLength(degArray,1);
writeln(inttostr(Length(walltpa)));
MMCTP := Point( MMCX,MMCY );
players := GetMiniMapDots('p'); //Remove if you don't want to create player filtering.
FindColorsTolerance(tpa,col,MMX1,MMY1,MMX2,MMY2,tol);
SortTPAFrom(tpa,MMCTP);
for I := 0 to High(tpa) do
begin
tmp := floor(getPolarAngle(MMCTP,tpa[I]) / 5); // decrease 5 if splittpawrap isn't capturing bounds properly
foundIndex := inArray(tmp,degArray);
if foundIndex = -1 then
begin
walltpa[Length(walltpa) - 1] := tpa[I];
degArray[Length(degArray) - 1] := tmp;
SetArrayLength(walltpa,GetArrayLength(walltpa) + 1);
SetArrayLength(degArray,GetArrayLength(degArray) + 1);
end else
begin
dist1 := DistBetween(MMCTP,walltpa[foundIndex]);
dist2 := DistBetween(MMCTP,tpa[I]);
if dist2 < dist1 then
walltpa[foundIndex] := tpa[I];
end
end;
writeln(degArray);
SplitTPAWrap(walltpa,5,atpa);
DebugATPABounds(atpa);
Result := walltpa;
end;Beefy bill script:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/srl/skill/fighting.Simba}
{$i sps/sps.simba}
{$i SRL/SRL/misc/debug.simba}
//{$I SRL/srl/core/inventory.Simba}
const
MIN_HPPERCENT = 50;
MIN_RUN = 30;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
WorldInfo := [27, 42, 45, 46, 48, 52, 59, 70, 72, 78, 79, 87, 104, 115, 117];
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Slayer;
Active := True;
end;
end;
//Point(4456,3403),Point(4448,3337),Point(4583,3340),Point(4582,3410)
{ === No touchy below === }
const
COLOR_COWREMAINS = 11382453;
COLORTOL_COWREMAINS = 25;
COLOR_BEEFYBILL = 12636639;
COLORTOL_BEEFYBILL = 25;
COLOR2_BEEFYBILL = 8097668;
COLORTOL2_BEEFYBILL = 32;
COLOR_LOOTCOWHIDE = 15791099;
COLORTOL_LOOTCOWHIDE = 12;
COLOR_LOOTBEEF = 3953860;
COLORTOL_LOOTBEEF = 10;
var
Color_Cows : Array of Integer;
ColorTol_Cows : Array of Integer;
cowSlaughterPT,beefyBillPT : TPoint;
procedure initVar;
begin
Color_Cows := [3230807,5593442,7638445];
ColorTol_Cows := [5,16,18];
cowSlaughterPT := Point(4454, 3309);
beefyBillPT := Point(4510, 3324);
SPS_Setup(RUNESCAPE_SURFACE,['11_8','10_8']);
end;
function GetTol(const color1, color2: Integer): Extended;
var
red, green, blue: Integer;
red2, green2, blue2: Integer;
redDif, greenDif, blueDif: Integer;
begin
red := color1 and $FF;
green := color1 shr 8 and $FF;
blue := color1 shr 16 and $FF;
red2 := color2 and $FF;
green2 := color2 shr 8 and $FF;
blue2 := color2 shr 16 and $FF;
redDif := red - red2;
greenDif := green - green2;
blueDif := blue - blue2;
Result := redDif * redDif + greenDif * greenDif + blueDif * blueDif;
end;
function findCompositeColors(maxDist : Integer ;colors : TIntegerArray; tols : TIntegerArray) : array of TPointArray;
var
I,Y,Z,found2Index,foundCount : Integer;
tol : extended;
tpa,tpa2 : TPointArray;
tp1,tp2 : TPoint;
points : array of TPointArray;
colorList : TIntegerArray;
begin
SetArrayLength(points, Length(colors));
foundCount := 0;
for I := 0 to High(colors) do
if FindColorsSpiralTolerance(MSCX,MSCY,tpa,colors[I],MSX1,MSY1,MSX2,MSY2,tols[I]) then
begin
Inc(foundCount);
tpa2 := CombineTPA(tpa2,tpa);
{points[I] := SplitTPA(tpa,maxDist);
DebugATPABounds(points[I]); }
end;
// debugtpa(tpa2,'');
if foundCount = Length(colors) then
begin
points := splittpa(tpa2,maxDist);
//DebugATPAbounds(points);
for I := 0 to high(points) do
begin
colorList := GetColors(points[I]);
foundCount := 0;
for Y := 0 to high(colors) do
begin
tol := sqr(tols[Y]);
for Z := 0 to high(colorList) do
begin
if GetTol(colors[Y],colorList[Z]) <= tol then
begin
Inc(foundCount);
break;
end;
end;
end;
if foundCount = Length(colors) then
begin
SetArrayLength(Result,Length(Result) + 1);
Result[High(Result)] := points[I];
end;
end;
end;
end;
procedure walkToCenterOfField;
begin
writeln('walk to center of field');
SPS_BlindWalk(cowSlaughterPT);
end;
procedure walkToBeefyBill;
var
x,y : Integer;
begin
writeln('walk to beefy bill');
SPS_BlindWalk(beefyBillPT);
if FindSymbol(x,y,Symbol_Shop) then
Mouse(x,y,2,2,mouse_Left);
end;
function onPlayer(x,y : Integer) : Boolean;
begin
Result := (InRange(x,MMCX-30,MMCX+30)) AND (InRange(y,MMCY-30,MMCY+30))
end;
function attackCow(uptext : TStringarray;col,tol : Integer; msDots : TPointArray; mouseCLick : Integer) : Boolean;
var x, y: integer;
tmp : TPointarray;
begin
tmp := CopyTPA(msDots);
if FindColorSpiralTolerance(x, y, col,MSX1, MSY1, MSX2, MSY2,tol) then
begin
FilterPointsDist(tmp,0,50,x,y);
if (not isFightAt(x,y)) AND (not onPlayer(x,y)) AND (Length(tmp) > 0) then
begin
Mouse(x, y, 0, 0, mouseCLick);
Result := ChooseOptionMulti(uptext);
end
end else
Result := false;
end;
Function IsAttacking: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 135, 280, 185);
Result := (AveragePixelShift(PBox, 250, 500) > 500);
end;
procedure findAndAttackCow;
var
I : Integer;
found : Boolean;
mmDots,msDots : TPointArray;
begin
writeln('Attack cow');
if (not InFight) AND (not IsAttacking) then
begin
mmDots := GetMMDotsOnMS('npc');
for I := 0 to High(mmDots) do
begin
setArrayLength(msDots,Length(msDots) + 1);
msDots[Length(msDots) - 1] := MMtoMS(mmDots[I]);
end;
for I := 0 to High(Color_Cows) do
begin
found := attackCow(['ttac'],Color_Cows[I],ColorTol_Cows[I],msDots,mouse_Right);
if found then break;
end;
if not found then
begin
if Length(mmDots) > 1 then
Mouse(mmDots[1].x, mmDots[1].y, 2, 2, mouse_Left)
else walkToCenterOfField;
end else
begin
sleep(2000);
while (isMoving) or (IsAttacking) do sleep(200);
end;
end;
end;
procedure bankwithBill;
var
x,y,I : Integer;
found : Boolean;
tp : TPoint;
atpa : array of tpointarray;
begin
writeln('Banking');
walkToBeefyBill;
while isMoving do sleep(1500);
repeat
begin
found := false;
while ActivatedItem = -1 do
if FindItem(x,y,'color',COLOR_COWREMAINS,MIX1, MIY1, MIX2, MIY2,[COLORTOL_COWREMAINS]) then
begin
found := true;
Mouse(x, y, 1, 1, true);
sleep(500);
break;
end else begin
DropAll;
break;
end;
if found then begin
if FindSymbol(x,y,Symbol_Shop) then
if MMtoMS(Point(x,y)) <> Point(-1,-1) then
begin
atpa := findCompositeColors(3,[COLOR_BEEFYBILL,COLOR2_BEEFYBILL],[COLORTOL_BEEFYBILL,COLORTOL2_BEEFYBILL]);
SortATPAFrom(atpa,Point(MSCX,MSCY));
found := false;
for I := 0 to High(atpa) do
begin
tp := MiddleTPA(atpa[I]);
MMouse(tp.x,tp.y,2,2);
if WaitUpTextMulti(['alk-to','eefy','ill','lk-to'],1000) then
begin
ClickMouse2(mouse_Left);
found := true;
while isMoving do sleep(1500);
break;
end;
end;
sleep(1000);
if AreTalking then
begin
SmartHoldKey(VK_1);
wait(RandomRange(25, 50));
SmartReleaseKey(VK_1);
sleep(1000);
end
end;
found := false;
end;
end until InvEmpty;
end;
function canFight : Boolean;
var
S : String;
begin
writeln(inttostr(HPPercent) + ' '+inttostr(GetMMLevels('run', S)));
Result := (HPPercent >= MIN_HPPERCENT) AND (GetMMLevels('run', S) >= MIN_RUN);
end;
procedure loot(uptext : TStringarray;x,y : Integer);
begin
Mouse(x,y,2,2,mouse_right);
WaitOptionMulti(uptext,2000);
while IsMoving do sleep(1000);
end;
procedure findAndLootCowRemains;
var x, y, I : integer;
tp : TPoint;
tpa : TPointArray;
atap : T2DPointArray;
box : TBox;
begin
writeln('loot');
FindColorsSpiralTolerance(MSCX,MSCY,tpa,COLOR_LOOTCOWHIDE, MSX1, MSY1, MSX2, MSY2,COLORTOL_LOOTCOWHIDE);
SplitTPAExWrap(tpa,10,10,atap);
for I := 0 to High(atap) do
begin
if InvFull then break;
box := GetTPABounds(atap[I]);
if (InRange(box.Y2 - box.Y1,6,16)) AND (InRange(box.X2 - box.X1,6,16)) then
begin
MiddleTPAex(atap[I],x,y);
if not InvFull then
loot(['owhid','whid'],x,y);
if not InvFull then
loot(['aw','raw','beef','eef','ee'],x,y);
sleep(1000);
end;
// writeln(inttostr(I) + ' ' +inttostr() +' '+inttostr(box.X1 - box.X2));
end;
end;
procedure rest;
var
minHP,minRun : Integer;
S : String;
begin
minHP := 90 + Random(10);
minRun := MIN_RUN + Random(100 - MIN_RUN);
repeat
begin
if not IsResting then SetRest;
sleep(1500);
end
until(HPPercent >= minHP) AND (GetMMLevels('run', S) >= minRun);
Mouse(MMCX, MMCY, 30, 30, mouse_Left);
end;
function inBounds : Boolean;
var
tp : TPoint;
begin
tp := SPS_GetMyPos;
writeln(tp);
Result := ((InRange(tp.x,4411,4572)) AND (InRange(tp.y,3282,3364)));
end;
begin
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
Smart_ForceNew := True;
{$ENDIF}
DeclarePlayers;
SetupSRL;
initVar;
repeat
begin
if not LoggedIn then begin
LogInPlayer;
SetAngle(SRL_ANGLE_HIGH);
end;
if not inBounds then
walkToCenterOfField;
FindNormalRandoms;
if not InvFull then findAndLootCowRemains;
if canFight then
begin
SetRun(TRUE);
if InvFull then
bankWithBill
else begin
findAndAttackCow;
findAndLootCowRemains;
end;
end else
rest;
if not InvFull then findAndLootCowRemains;
while (IsMoving) OR (InFight) do begin
FindNormalRandoms;
sleep(200);
end;
sleep(300);
end until (false);
end.Sound plugin:
http://villavu.com/forum/showthread.php?p=1117702#post1117702