SRL Archive - RS3 Multi-Skilled

[RS3][WIP]Foundry's Headless Arrow Manufacturer


Foundry

2014-02-18 22:21:24

Goal of this script:
To turn logs into arrows by first making shafts, then walking to Lumbridge and gathering the required feathers, and finally assembling the feathers and arrow shafts to make headless arrows.
Currently working features:
1. Chicken killing option. Now includes looting!
2. Shaft making option. You only have to be able to see the logs when you open up your bank. Haven't tested if this still works.
3. Proggy with ETA and amount per hour for both of the features.
4. Banking and walking using sps. Sometimes gets stuck, but logs out if that happens.
Planned Features
1. Headless arrow assembler.
2. Tying it all together into one coherent script.
3. Report actual amount of gp/h by counting each of the items picked up.
Instructions
Chickens
1. Go to the Lumbridge farm with chickens. The one on the left of the river with the fence and gate.
2. Once inside, ensure the door to the farmer's house is closed. Doesn't need to be but it helps avoid something I have no failsafe for yet.
3. Fill out the appropriate script options and press play. If it is a little bit slow on finding the chickens you may need to turn up the tolerance because I haven't really done extensive testing.


CHANGELOG
v.working
----
Updated the looting for the chickens. Picks up everything really nice now.
Added some antiban.
Still no proper wait while killing chickens but this wasn't meant to be a chicken killer anyways.
New walking to and from the pen. More reliable.
Next up is removing all of the unnecessary records I went crazy with right after I learned OOP.

v.053
----
Gate opening is now even more reliable.
No more access violations if you are using melee.
Accurately counts all loot now. Used to not count the first item picked up.
Overall much more reliable for those not using ranged.
Fine tuned banking walk. Next up is the pen path.
Slightly faster, too.

v.053
----
Doesn't keep looting the spot with the super large egg in the top left.
Opens the gate more reliably.
Faster chicken finding.
If it happens to misclick when attacking a chicken it will wait until done moving as opposed to waiting 3-5 seconds.
Will walk back into the pen if it ends up outside of it.

v.052
----
Loots now! Can make a decent amount per hr by just getting eggs, bones, chicken, and of course feathers.
Uses sps as opposed to crappy symbol walking.
A whole load of additional failsafes.
Waits while in combat.
Please download the sps map for it to work :)

v.041
----
Doesn't pick up loot and removed the full inventory check.
Finished code for walking. Just need the symbols to get updated for SRL.
General cleaning up of code that was written long ago...

v.04
----
Now picks up and banks any loot it can find (will refine this later to just feathers).
Improved detection of the gate.
Combat waiting is up next.

v.03
----
Now walks back into the pen if you somehow manage to get out of it.
Closes the gate even faster to keep people out.
Made proggy less ugly and more useful. It actually shows how many you have killed and how much
xp earned as opposed to just hourly rates.
Updated fence color. Should work much more reliably.

Script here
[ATTACH]25215[/ATTACH]
SPS map here (put it in runescape_other in the sps folder)
[ATTACH=CONFIG]25214[/ATTACH]

Proggies:

me-
[ATTACH=CONFIG]23056[/ATTACH]

For those who like to look w/o downloading (btw this is always updated):

program FoundrysThing;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i SPS/LIB/SPS-RS3.simba}

const
///////////////////////////////////////////////////////////////
// Constants for the proggy function. Don't mess with these. //
HEADLESS_ARROWS = 0; //
SHAFTS = 1; //
CHICKS = 2; //
// For the walking... //
BANK_CHEST = 0; //
PEN = 1; //
// For the gate functions... //
CLOSE = 0; //
OPEN = 1; //
CHECK = 2; //
/////////////////////////////////////////////CUSTOMIZE HERE///////////////////////
AntibanLevel = 'high'; // At what frequency do you want the script to call the//
// antiban procedure? //
ScriptOption = CHICKS; // Kill chickens at the Lumbridge farm or make shafts? //
// put CHICKS for chickens and SHAFTS for shafts. //
HowMany = 15000; // How many to do. Applies to making shafts and killing//
// chickens. Is used for the proggy mainly. //
Gatekeeper = false; // Do you want to protect the pen? //
Looting = true; // //
/////////////////////////////////////////////END OF CUSTOMIZATION/////////////////

procedure handlePlayers();
begin
players.setup(['Honto'], 'default'); // Put your info here. The labels might be mixed up.
currentPlayer := 0;
players[0].world := 43;
players[0].login();
Wait(randomrange(2000, 4000));
closeAdWindow();
exitSquealOfFortune();
mainscreen.setAngle(MS_ANGLE_HIGH);
// some procedure that scrolls out all of the way.
end;

// Don't screw with anything below this.
type
TColorProfile = record
Color, Tol: Integer;
HueMod, SatMod: Double;
end;

var
ScriptRunTime, AntibanInt, ABCounter, LogsDTM, ShaftsDTM,
FeathersDTM, FightLockBMP, Feathers, Logs, ShaftsMade, LootCounter: Integer;
GeneralTimer: TTimeMarker;
Chickens: array of TColorProfile;
CPGate: TColorProfile = [3953775, 11, 0.11, 0.24];
CPChickenGoozle: TColorProfile = [1060532, 16, 0.10, 0.89]; // I don't know what it is called :D
CPRawChicken: TColorProfile = [11974284, 5, 10.00, 1.32];
CPGroundColor: TColorProfile = [1847604, 8, 0.80, 3.34];
CPBones: TColorProfile = [13027788, 6, 1.39, 0.97];

function findColorsTolerance(out tpa: TPointArray; prof: TColorProfile; Bounds: TBox): Boolean; overload;
begin
result := findColorsTolerance(tpa, prof.Color, Bounds, prof.Tol, colorSetting(2, prof.HueMod, prof.SatMod));
end;

function countColorTolerance(prof: TColorProfile; Bounds: TBox): Integer; overload;
begin
result := countColorTolerance(prof.Color, Bounds, prof.Tol, colorSetting(2, prof.HueMod, prof.SatMod));
end;

function TRSChooseOption.count(options: TStringArray): Integer;
var
m_options: array of TOption;
i, j: Integer;
begin
m_options := getOptions();
for i to high(m_options) do
for j := 0 to high(options) do
if pos(options[j], m_options[i].str) > 0 then
begin
inc(result);
break;
end;
end;

function TRSTabBackpack.dtmToSlot(var dtm: Integer; out Slot: Integer): Boolean;
begin
if countDTM(dtm) = 0 then
exit(false);
Slot := findItem(dtm, getSlotBoxes, false)[0] + 1;
result := true;
end;

procedure Antiban();
var
pnt: TPoint;
begin
if not isLoggedIn() then
exit;
case random(AntibanInt) of
0..20:
begin
print('AB1 - Sleep And Move Mouse', TDebug.HINT);
sleepAndMoveMouse(randomrange(3000, 6000));
end;
21..30:
begin
print('AB2 - Random R Click Item', TDebug.HINT);
randomRClickItem;
end;
31..40:
begin
if ScriptOption = 0 then
begin
print('AB3 - Camera Angle Low', TDebug.HINT);
randomCameraAngle(MS_ANGLE_LOW);
end;
end;
51..60:
begin
print('AB5 - Random Mouse Point', TDebug.HINT);
pnt.create(Random(500), Random(500));
mouse(pnt, MOUSE_MOVE);
end;
61..70:
begin
print('AB6 - Mouse Off Client', TDebug.HINT);
mouseOffClient(OFF_CLIENT_RANDOM);
end;
71..80:
begin
print('AB7 - Small Random Mouse Move', TDebug.HINT);
smallRandomMouse(100);
end;
81..90:
begin
if ScriptOption = HEADLESS_ARROWS then
begin
print('AB8 - Random Compass', TDebug.HINT);
randomCompass(3, 200, true);
end;
end;
101..110:
begin
print('AB9 - Mouse Moving Object', TDebug.HINT);
mouseMovingObject();
end;
111..120:
begin
print('AB10 - Camera Angle High', TDebug.HINT);
randomCameraAngle(MS_ANGLE_HIGH);
end;
else
exit;
end;
inc(ABCounter);
end;

procedure proggy(ProggyType, MadeSoFar, Goal: Integer);
var
PerHr, XPPerHr, XP, ABPerHr: Integer;
DrawBox: TBox;
Msg: String;
begin
if not isLoggedIn() then
exit;
case ProggyType of
HEADLESS_ARROWS:
begin
PerHr := round((MadeSoFar * 1000) / (GeneralTimer.getTime() / 3600));
Msg := 'Headless arrows';
XPPerHr := PerHr;
end;
SHAFTS:
begin
PerHr := round((MadeSoFar * 15000) / (GeneralTimer.getTime() / 3600));
Msg := 'Shafts';
XPPerHr := round(PerHr / 15);
MadeSoFar := MadeSoFar * 15;
XP := MadeSoFar;
end;
CHICKS:
begin
PerHr := round((MadeSoFar * 1000) / (GeneralTimer.getTime() / 3600));
Msg := 'Chickens';
XPPerHr := round(PerHr * 25);
XP := MadeSoFar * 25;
end;
end;
ABPerHr := round((ABCounter * 1000) / (GeneralTimer.getTime() / 3600));
if PerHr = 0 then
PerHr := 1; // To avoid dividing by zero which is a no-no
DrawBox := intToBox(10, 10, 300, 85);
if Looting then
Drawbox.y2 := DrawBox.y2 + 15;
smartImage.clearArea(DrawBox);
smartImage.drawBox(DrawBox, true, 2300428);
smartImage.drawText(' Been making ' + Msg + ' for ' + msToTime(GeneralTimer.getTime(), TIME_SHORT), point(10, 10), upchars, false, clWhite);
smartImage.drawText(' Amount made: ' + toStr(MadeSoFar) + ' (' + toStr(PerHr) + '/hr)', point(10, 25), upchars, false, clOrange);
smartImage.drawText(' XP gained: ' + toStr(XP) + ' (' + toStr(XPPerHr) + '/hr)', point(10, 40), upchars, false, clOrange);
smartImage.drawText(' Antiban performed: ' + toStr(ABCounter) + ' (' + toStr(ABPerHr) + '/hr)', point(10, 55), upchars, false, clOrange);
smartImage.drawText(' Time ''til done: ' + msToTime(round((Goal / PerHr) * 3600000), TIME_SHORT), point(10, 70), upchars, false, clOrange);
if Looting then
smartImage.drawText(' Items retrieved: ' + toStr(LootCounter) + ' (' + toStr(round((LootCounter * 1000) / (GeneralTimer.getTime() / 3600))) + '/hr)', point(10, 85), upchars, false, clOrange);
end;

function getPenBounds(): TBox;
var
i: Integer;
finaltpa, tpa: TPointArray;
atpa, tpas, fatpa: T2DPointArray;
FenceColors: array of TColorProfile = [[7244947, 12, 0.19, 0.27], [7770005, 9, 0.36, 0.20]];
// I made the above an array in case I need to add more fence colors in the future.
begin
if not isLoggedIn() then
exit;
while isMouseOverMenuOpen(result, 75) do // figured I might as well not make another var...
sleepAndMoveMouse(randomrange(400, 600));
setLength(tpas, length(FenceColors));
for i := 0 to high(FenceColors) do
if not findColorsTolerance(tpas[i], FenceColors[i], mainscreen.getBounds()) then
exit(intToBox(-1, -1, -1, -1));
for i := 0 to high(tpas) do
begin
atpa := tpas[i].cluster(3);
atpa.filterBetween(0, 1000);
atpa.sortFromMidPoint(point(300, mainscreen.getBounds().y2));
if length(atpa) > 0 then
finaltpa.combine(atpa[0]);
if length(atpa) > 1 then
finaltpa.combine(atpa[1]);
end;
{smartImage.clear();
smartImage.debugATPA(atpa);
wait(5000);
exit;}
fatpa := finaltpa.cluster(105, 3);
fatpa.sortBySize(true);
for i := 0 to high(atpa) do
if countColorTolerance(CPGroundColor, fatpa[i].getBounds()) > 2000 then
exit(fatpa[i].getBounds());
result := intToBox(-1, -1, -1, -1);
end;

function interactGate(Open: Boolean): Boolean;
var
i: Integer;
tpa: TPointArray;
PenBounds: TBox;
begin
if not isLoggedIn() then
exit;
while minimap.isPlayerMoving(randomrange(600, 800)) do
wait(randomrange(500, 800));
PenBounds := getPenBounds();
if PenBounds.x1 = -1 then
exit(false);
with PenBounds do
begin
y1 := y2 - 18;
x1 := x1 + 80;
x2 := x2 - 110;
y2 := y2 + 0;
end;
{smartEnableDrawing := true;
smartImage.clear();
smartImage.drawBox(PenBounds);
writeLn(penBounds);
exit; }
if not findColorsTolerance(tpa, CPGate, PenBounds) then
exit(false);
result := true;
if ((length(tpa) < 50) and Open) or
((length(tpa) > 50) and (not Open)) then
exit;

repeat
mouse(tpa[random(high(tpa))], MOUSE_MOVE);
if isMouseOverText(['ate'], randomrange(500, 750)) then
exit(didClick(true, randomrange(250, 500)));
until(interactGate(Open));

end;

function whereAreWe(): Integer;
var
pnt: TPoint;
begin
if not isLoggedIn() then
exit;
pnt := sps.getPlayerPos();
if pnt.isInBox(intToBox(125, 50, 180, 110)) then
exit(PEN);
if pnt.isInBox(intToBox(155, 175, 205, 215)) then
exit(BANK_CHEST);
result := -1;
end;

function walk(WhereTo: Integer): Boolean;
var
pnt: TPoint;
begin
if not isLoggedIn() then
exit;
if whereAreWe() = WhereTo then
begin
print('We are already here.', TDebug.HINT);
exit(true);
end;
case WhereTo of
BANK_CHEST:
begin
if not interactGate(true) then
if not interactGate(true) then // need to open the gate...
begin
print('Failed to open the gate.', TDebug.ERROR);
exit;
end;
wait(randomrange(600, 900));
while minimap.isPlayerMoving() do
wait(randomrange(700, 900));
result := sps.walkpath([Point(150, 86), Point(154, 106), Point(182, 138), Point(190, 170), Point(170, 190)]);
while not result do
begin
interactGate(true);
result := sps.walkpath([Point(150, 86), Point(154, 106), Point(182, 138), Point(190, 170), Point(170, 190)]);
end;
end;
PEN:
begin
result := sps.walkpath([Point(174, 186), Point(190, 170), Point(182, 138), Point(154, 106), Point(150, 86)]);
while not result do
result := sps.walkpath([Point(174, 186), Point(190, 170), Point(182, 138), Point(154, 106), Point(150, 86)]);
if interactGate(true) then
begin
wait(randomrange(400, 800));
while (minimap.isPlayerMoving()) do
wait(randomrange(700, 1000));
end;
end;
end;
end;

function bankLoot(): Boolean;
begin
if not isLoggedIn() then
exit;
if not whereAreWe() = BANK_CHEST then
if not walk(BANK_CHEST) then
exit(false);
while not bankscreen.isOpen(750) do
bankscreen.open(BANK_CHEST_LUMBRIDGE);
bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
bankscreen.close();
result := true;
end;

function TColorProfile.find(out pnt: TPoint; const Bounds: TBox): Boolean;
var
tpa: TPointArray;
atpa: T2DPointArray;
i: Integer;
ChickenBox: TBox;
begin
if not isLoggedIn() then
exit;
// Uses the data from the record.

if findColorsTolerance(tpa, self, Bounds) then
begin
atpa := tpa.cluster(2);
atpa.filterBetween(0, 15);
if length(atpa) > 0 then
for i := 0 to high(atpa) do
begin
// Now it's time to check if the supposed chicken has a red head.

ChickenBox := atpa[i].getBounds();
ChickenBox.edit(-5, -5, 5, 5);
if findColorsTolerance(tpa, CPChickenGoozle, ChickenBox) then
// If the red color found is 1-7 pixels then...
if (inRange(length(tpa), 1, 7)) and
(atpa[i].getBounds().getWidth > 4) then
begin
pnt := atpa[i].getMiddle();
// It's a chicken!

exit(true);
end;
end;
end else
print('Chicken not found!', TDebug.HINT);
end;

// I need to finish this.
function findLoot(out pnt: TPoint): Boolean;
var
tpa, tpa2: TPointArray;
atpa, atpa2: T2DPointArray;
i, j: Integer;
PBounds: TBox;
begin
if not isLoggedIn() then
exit;
PBounds := getPenBounds();
PBounds.edit(10, 10, -15, -10);
if findColorsTolerance(tpa, CPBones, PBounds) then
begin
if findColorsTolerance(tpa2, CPRawChicken, PBounds) then
tpa.combine(tpa2);
atpa := tpa.cluster(6);
setLength(atpa2, length(atpa));
for i := 0 to high(atpa) do
begin
mainscreen.filterPointsPlayer(atpa[i]);
if length(atpa[i]) > 0 then
begin
atpa2[j] := atpa[i];
inc(j);
end;
end;
setLength(atpa2, j);
atpa2.sortFromMidPoint(mainscreen.playerPoint);
for i := 0 to j - 1 do
begin
if ((countColorTolerance(CPRawChicken, atpa2[i].getBounds()) > 20) or
(countColorTolerance(CPBones, atpa2[i].getBounds()) > 10)) and
(countColorTolerance(CPGroundColor, atpa2[i].getBounds()) > 39) then
begin
writeLn(countColorTolerance(CPGroundColor, atpa2[i].getBounds()));
pnt := atpa2[i].getMiddle();
exit(true);
end;
end;
end else
print('Failed to find loot.', TDebug.HINT);
end;

procedure grabLoot(pnt: TPoint);
var
p: TPoint;
_count: Integer;
MoveBefore, done: Boolean;
begin
if not isLoggedIn() then
exit;
if Random(2) = 1 then
MoveBefore := true;
mouse(pnt.rand(3), MOUSE_MOVE);
_count := tabBackpack.count();
if isMouseOverText(['uper', 'ttack', 'Open', 'alk'], randomrange(200, 350)) then
begin
fastClick(MOUSE_RIGHT);
chooseOption.select(['ones', 'aw', 'eather', 'gg'], randomrange(350, 500));
end else
fastClick(MOUSE_LEFT);
wait(randomrange(400, 700));
p := mainscreen.playerPoint;
p.offset(point(0, 6));
if MoveBefore then
mouse(p.rand(3));
while minimap.isPlayerMoving(randomrange(400, 550)) do
wait(randomrange(150, 200));
if _count <> tabBackpack.count() then
inc(LootCounter);
if tabBackpack.isFull() then
exit;
if not MoveBefore then mouse(p.rand(3));
while (isMouseOverMenuOpen(mainscreen.getBounds(), randomrange(400, 500)) and
(not tabBackpack.isFull())) do
begin
if isMouseOverText(['ones', 'aw', 'ake Egg'], 0) then
begin
fastClick(MOUSE_LEFT);
if not tabBackpack.waitForShift(1000 + random(500)) then
break
else
inc(LootCounter);
end else begin
fastClick(MOUSE_RIGHT);
if not chooseOption.isOpen(randomrange(450, 600)) then
break;
done := (chooseOption.count(['ake Bones', 'ake Raw', 'ake Feather', 'ake Egg']) = 1);
//writeLn(chooseOption.count(['ake Bones', 'ake Raw', 'ake Feather', 'ake Egg']));
if chooseOption.select(['ake Bones', 'ake Raw', 'ake Feather', 'ake Egg'], 0) then
inc(LootCounter)
else begin
chooseOption.close();
break;
end;
tabbackpack.waitForShift(800 + random(500));
if done then
break;
mouse(p.rand(3));
end;
end;
end;

function attackChicken(): Boolean;
var
spotstocheck: TPointArray;
i, j: Integer;
mousepnt, tmppnt: TPoint;
FoundOne: Boolean;
FenceBounds: TBox;
begin
if not isLoggedIn() then
exit;
getMousePos(mousepnt.x, mousepnt.y);
FenceBounds := getPenBounds();
if (isMouseOverText(['ttac', 'ack'], randomrange(50, 150))) and
(mousepnt.isInBox(FenceBounds)) then
exit(didClick(true, 300));
setLength(spotstocheck, 10);
for i := 0 to high(Chickens) do
begin
if Chickens[i].find(tmppnt, FenceBounds) then
begin
if not FoundOne then
FoundOne := true;
spotstocheck[j] := tmppnt;
inc(j);
end;
end;
if not FoundOne then
exit(false);
setLength(spotstocheck, j);

spotstocheck.sortFromPoint(mousepnt);
for i := 0 to j - 1 do
begin
if spotstocheck[i].x = 0 then
continue;
mouse(spotstocheck[i], MOUSE_MOVE);
if isMouseOverText(['ttac', 'ack'], randomrange(100, 250)) then
begin
if not didClick(true, 300) then
begin
print('Will wait until done moving...', TDebug.HINT);
while minimap.isPlayerMoving() do
wait(randomrange(400, 700));
exit;
end else
exit(true);
end;
end;
end;

function waitOnCombat(): Boolean;
var
t: Integer;
begin
if not isLoggedIn() then
exit;
t := getSystemTime() + randomrange(20250, 25250);
repeat
if random(7) = 4 then
sleepAndMoveMouse(randomrange(400, 600))
else
wait(randomrange(400, 800));
if GateKeeper then
interactGate(false);
until((getSystemTime() > t) or (not mainscreen.getBounds().bitmapExists(FightLockBMP, 10)));
result := not(getSystemTime() > t);
antiban();
end;

procedure getItems(var dtm: Integer; amount: Integer; Stack: Boolean = false);
var
Slot, StackAmount: Integer;
begin
if tabBackpack.countDTM(dtm) >= amount then
begin
writeLn('Already have the requested items.');
exit;
end;
while not bankscreen.isOpen(randomrange(500, 750)) do
begin
if not bankscreen.open(BANK_CHEST_LUMBRIDGE) then
bankscreen.open(BANK_NPC_BLUE);
end;
wait(randomrange(800, 1400)); // Have to wait for the items in the bank to appear.
if bankscreen.getPackCount > 1 then
bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
bankscreen.withdraw(dtm, WITHDRAW_AMOUNT_ALL);
repeat
bankscreen.close();
until(not(bankscreen.isOpen()));
tabBackpack.waitWhileLocked();
end;

function makeShafts(var ShaftCount: Integer; const AmountToMake: Integer): Boolean;
var
i: Integer;
begin
repeat
getItems(LogsDTM, 28);
if not tabBackpack.isFull() then
continue;
if (tabBackpack.countDTM(LogsDTM) >= 1) and
not productionScreen.isOpen() then
begin
if random(20) = 19 then
tabBackpack.clickDTM(LogsDTM, MOUSE_RIGHT, 'raft', 500, false)
else
tabBackpack.mouseSlot(randomrange(2, 28), MOUSE_LEFT);
end;
if productionScreen.isOpen(randomrange(1000, 2000)) then
begin
productionScreen.selectBox(1); // I will change this later when I figure
// out the production screen.
productionScreen.clickStart();
if progressScreen.isOpen(randomrange(1500, 2000)) then
begin
ShaftCount := ShaftCount + progressScreen.getTotalToMake();
repeat
wait(randomrange(800, 1400));
proggy(1, ShaftCount, AmountToMake);
until(not progressScreen.isOpen());
end;
end else if toolScreen.isOpen(randomrange(300, 600)) then
begin
toolScreen.select('Knife');
if productionScreen.isOpen(randomrange(2000, 3000)) then
continue
else begin
print('Could not choose the tool required to make shafts', TDebug.ERROR);
terminateScript();
end;
end;
until(ShaftCount >= AmountToMake);
exit(true);
end;

procedure setup;
begin
GeneralTimer.start;
disableSRLDebug := false;
case lowercase(AntibanLevel) of
'low': AntibanInt := 4400;
'mid': AntibanInt := 4000;
'high': AntibanInt := 3600;
else begin
print('Not a valid frequency level for antiban!', TDebug.ERROR);
terminateScript();
end;
end;
end;

procedure chickenMainLoop();
var
ChickensKilled: Integer;
TimeoutTimer: TTimeMarker;
LootSpot: TPoint;
begin
TimeoutTimer.start();
repeat
repeat
if Looting then
begin
while findLoot(LootSpot) and (not tabBackpack.isFull()) do
begin
grabLoot(LootSpot);
with TimeoutTimer do
begin
reset();
start();
end;
wait(randomrange(400, 800));
end;
if tabBackpack.isFull() then
begin
if not walk(BANK_CHEST) then
begin
print('Failed to walk to the bank.', TDEBUG.ERROR);
terminateScript();
end;
bankLoot();
if not walk(PEN) then
begin
print('Failed to walk to the pen', TDEBUG.ERROR);
terminateScript();
end;
end;
end;
if not isLoggedIn() then
break;
if not mainscreen.playerPoint.isInBox(getPenBounds()) then
begin
interactGate(true);
walk(PEN);
end;
if attackChicken() then
begin
if waitOnCombat() then
begin
inc(ChickensKilled);
with TimeoutTimer do
begin
reset();
start();
end;
end;
end else begin
wait(randomrange(100, 800));
antiban();
end;
proggy(CHICKS, ChickensKilled, HowMany);
if TimeoutTimer.getTime() > 210000 then
begin
print('Haven''t had any action in a while... going to shut down.', TDebug.ERROR);
terminateScript();
end;
if not isLoggedIn() then
break;
until(ChickensKilled >= HowMany);
if not isLoggedIn() then
begin
sixHourFix();
players[0].login();
wait(randomrange(1000, 2000));
closeAdWindow();
exitSquealOfFortune();
mainscreen.setAngle(MS_ANGLE_HIGH);
end;
until(ChickensKilled >= HowMany);
end;

procedure setUpResources();
begin
ShaftsDTM := DTMFromString('mwQAAAHic42RgYBBggABBIBYBYlYgZgZiNiDmBWIeqDwnEHNDaTYozQXEfEDMAcQu6pwMPLKqQBYjEDOh4GhTXjAWAvIkGbADbihmJALDAQBE+AMB');
LogsDTM := DTMFromString('mwQAAAHic42RgYJjJxMDQC8RdQDwFiOcD8XIgXgLEK4C4G4gXMzIwzAPi1UC8AYjXAPEqqNhiKA51UAOaxoQXizAQBoxEYDgAADv+DEQ=');
FeathersDTM := DTMFromString('mrAAAAHic42BgYDjDwsBwA4gvA/FZID4MxEeB+CAQHwDim4wQ/ACInwHxcyC+DsR3gfgREK9fsQJoCiMaZoJjfgb8AF0nOoYBAA/wD5M=');
FightLockBMP := BitmapFromString(10, 7, 'meJzTyeuyW/VQc+Yt40V3gAw4Aoo' +
'oJdabzb4DZGBFqlOvQEjsqPsckJScdBkrEu26gF8WlxREVii2ib9r' +
'P1YkGF0CAKpaaOo=');
addOnTerminate('freeResources');
end;

procedure freeResources();
begin
freeBitmap(FightLockBMP);
freeDTM(LogsDTM);
freeDTM(FeathersDTM);
freeDTM(ShaftsDTM);
end;

procedure setupChickens();
begin
setLength(Chickens, 5);
Chickens[0] := [3958954, 15, 0.14, 0.96]; // Different chickens.
Chickens[1] := [3363723, 10, 0.09, 1.23];
Chickens[2] := [3235232, 16, 0.18, 1.19];
Chickens[3] := [3301024, 18, 0.16, 1.19];
Chickens[4] := [2778294, 20, 0.17, 1.78];
//mouseBox(getPenBounds(), MOUSE_MOVE);
if not walk(PEN) then
terminateScript();
end;

var
lol: boolean;

begin
smartEnableDrawing := true;
setupSRL();
handlePlayers();
setupResources();
setup();
{while true do
begin
if lol then
lol := false
else
lol := true;
writeLn(lol);
writeLn(interactGate(lol));
end;}
if ScriptOption = SHAFTS then
makeShafts(ShaftsMade, HowMany)
else begin
sps.setup('CM_01', RUNESCAPE_OTHER, 4, 600.0, 0.40);
setupChickens();
chickenMainLoop();
end;
end.

rj

2014-02-18 22:37:54

Not too shabby, congratz on the release!

As for making SPS maps this might help out http://villavu.com/forum/showthread.php?t=84360

Kyle

2014-02-18 22:39:48

Gratz on release, looks like a really neat script! :D

Foundry

2014-02-19 21:24:27

Just made a minor update. It now closes the gate if it is open so it can detect the whole pen. This can prove to be quite funny when 3 or 4 people want to get in and you keep shutting them out :)

Also doesn't click on things outside of the pen if attack is in the mouseover text.

tehYosh

2014-02-21 09:54:33

With the looting, couldn't you just make it detect a loot pile (with whichever item appears on top) then get it to right click and chooseOption for feathers?

Fairly nice script idea, I used to do headless arrows as a decent method for 200-300k back in the past when I needed quick cash, I wish you the best with this script (Could be a good script to make an army with! :P)

Foundry

2014-02-21 11:15:45

From: tehYosh
With the looting, couldn't you just make it detect a loot pile (with whichever item appears on top) then get it to right click and chooseOption for feathers?

Fairly nice script idea, I used to do headless arrows as a decent method for 200-300k back in the past when I needed quick cash, I wish you the best with this script (Could be a good script to make an army with! :P)


The problem with that is it will be a little challenging finding the loot pile of only the most recently killed chicken with the screen moving and all. I could get some reference point before I kill it and calculate where the loot pile is based on that. That's probably what I will end up doing.

Yeah, it's a pretty good money maker.

tehYosh

2014-02-22 06:18:17

From: Foundry
The problem with that is it will be a little challenging finding the loot pile of only the most recently killed chicken with the screen moving and all. I could get some reference point before I kill it and calculate where the loot pile is based on that. That's probably what I will end up doing.

Yeah, it's a pretty good money maker.

Only suggesting from basic knowledge, didn't know if that'd be successful or not :p could you not have it search for when the hp bar of the chicken goes to 0, have it wait a small time and then to pick up the loot?

Foundry

2014-02-28 08:26:37

From: tehYosh
Only suggesting from basic knowledge, didn't know if that'd be successful or not :p could you not have it search for when the hp bar of the chicken goes to 0, have it wait a small time and then to pick up the loot?


Sorry for the late reply…
Yeah, I think I'll do that. Just wait for the HP bar to be a certain length and then use the location of that to find the loot pile. Next update will probably be this weekend.

kozak94

2014-02-28 09:28:13

Hello guys. Every time I add a new player to the Player Manager, I save and exit from the player manager. However, when I open the player manager again, the character name doesn't appear in the list. I also get an error upon trying to add a player again:

Program exception!
Stacktrace:

Exception class: Exception
Message: Out of bounds.
$006AAA2B
$006AA1CF
$0054D3C7
$0040C3C6
$0054B6C8
$0053EBBB
$005402A6
$0041BCEA
$0059FDAB
$005067FE
$005BBCCF
$754262FA
$75426D3A
$754277C4
$7542788A
$00509475
$0041F5A3
Simba Version: 1004

I re-installed and updated Simba but the error still appears. No scripts that use the player manager seem to work. Any advice would be greatly appreciated.

tehYosh

2014-02-28 14:14:22

From: kozak94
Hello guys. Every time I add a new player to the Player Manager, I save and exit from the player manager. However, when I open the player manager again, the character name doesn't appear in the list. I also get an error upon trying to add a player again:

*SNIP*

I re-installed and updated Simba but the error still appears. No scripts that use the player manager seem to work. Any advice would be greatly appreciated.

As a heads up, if you are saving your player file, you can tell if it has or not by going to your Simba folder, going into the 'Includes' folder, and then 'Players'. If you've made your list you should see an .xml file in there with the name you gave it, however if you wish to make your own it literally is just a case of :
<army>

<player>

<diplayName>DisplayNameHere</diplayName>

<loginName>LoginNameHere</loginName>

<nickName>NickNameHere</nickName>

<password>PasswordHere</password>

<bankPin>BankPinHere</bankPin> // Leave blank if you don't have a pin (<bankPink><.bankPin>)

</player>

</army>
So at worst paste that into a notepad, fill in your details however you'd like them to be (Remember the name you save your .xml file will be your File Name) and good luck!

kozak94

2014-03-05 15:04:11

From: tehYosh
As a heads up, if you are saving your player file, you can tell if it has or not by going to your Simba folder, going into the 'Includes' folder, and then 'Players'. If you've made your list you should see an .xml file in there with the name you gave it, however if you wish to make your own it literally is just a case of :
<army>

<player>

<diplayName>DisplayNameHere</diplayName>

<loginName>LoginNameHere</loginName>

<nickName>NickNameHere</nickName>

<password>PasswordHere</password>

<bankPin>BankPinHere</bankPin> // Leave blank if you don't have a pin (<bankPink><.bankPin>)

</player>

</army>
So at worst paste that into a notepad, fill in your details however you'd like them to be (Remember the name you save your .xml file will be your File Name) and good luck!


I will try it now. I realized after a while that it wasn't producing the xml file. Thank you very much!

kozak94

2014-03-05 15:33:57

Thank you tehYosh! It is exactly what was needed. I'll be honest and admit that I made a mistake a few times with inputting the proper name in the field, which is why the PlayerManager didn't recognize the input. Thanks again!

IROC-Z

2014-03-05 19:24:25

The script works good until it starts to make shafts. It will begin to make them, but I am not sure if it is an issue seeing if the production window is open or if it is in detecting how many logs are in the backpack. I am thinking the backpack because in the debug it counted 27 logs twice and then 16 right away. Any suggestions?

Foundry

2014-03-05 20:08:48

From: fortier4
The script works good until it starts to make shafts. It will begin to make them, but I am not sure if it is an issue seeing if the production window is open or if it is in detecting how many logs are in the backpack. I am thinking the backpack because in the debug it counted 27 logs twice and then 16 right away. Any suggestions?


I just tried it and I'm not having any issues. Maybe it is having trouble detecting your production screen?

IROC-Z

2014-03-05 20:41:03

From: Foundry
I just tried it and I'm not having any issues. Maybe it is having trouble detecting your production screen?


I'll recheck the setup on the character, I may have messed something up. It is normal display setup and layout? i.e. 0 transparency, old school, etc?

Edit: maybe it's the world I use? is there a specific one I should use or you recommend?

Foundry

2014-03-05 21:10:27

From: fortier4
I'll recheck the setup on the character, I may have messed something up. It is normal display setup and layout? i.e. 0 transparency, old school, etc?

Edit: maybe it's the world I use? is there a specific one I should use or you recommend?


It's all on the normal setup. I just installed Simba and configured the settings on my laptop and tested it… worked. Let me finish this update tonight and see if that fixes it. You could also try adjusting some of the few random waits, I had them sort of short.

IROC-Z

2014-03-05 22:14:43

From: Foundry
It's all on the normal setup. I just installed Simba and configured the settings on my laptop and tested it… worked. Let me finish this update tonight and see if that fixes it. You could also try adjusting some of the few random waits, I had them sort of short.


Alright, once I get a chance I will fiddle with it and if I come up with anything I will let you know!

*EDIT* Problem fixed, the key bind window has to be minimized so you can only see health, adrenaline, prayer points, and summoning points, not the actual key binds.

Foundry

2014-03-05 22:45:04

Just released a new version without looting sadly. Rewrote that whole confusing mess that got the bounds of the pen and did ten other things at the same time. Split it up into two procedures that work quite well. Also added walking to the bank when the inventory is full. Will open the gate and everything. If anything is wrong just add tolerance to some of the colors… Looting stuff is up next and then headless arrow making and finally feather gathering :)

IROC-Z

2014-03-06 00:47:54

Gaining a level seems to break the script because the fireworks cover up the progress window, is there a way to shut off the big level up thing and fireworks that cover my screen?

Edit: it seems that the script will try to fix itself. It will go to a new banker and withdraw one less then needed to fill the backpack, then it shuts off.

IROC-Z

2014-03-09 18:43:17

With a little messing around and digging I changed line 430 from

bankscreen.withrdaw(dtm,amount);

to

bankscreen.withdraw(dtm, withdraw_amount_all);

and it fixed the mess up after a level up. When I play I usually click the withdraw all selection versus clicking withdraw-x then typing in 27 or what no each time. Speeds the script up a bit also. I have run into a different issue I cannot seem to figure out.

The script will run just fine for a little bit when I am watching it then all of a sudden it stops and I get this message in my debug box:

—- TRSMinimap.getDots()
—— Found 15 minimap dots (ID: 4369)
—- TRSMinimap.getDots(): [{X = 657, Y = 46}, {X = 641, Y = 54}, {X = 657, Y = 58}, {X = 688, Y = 63}, {X = 702, Y = 67}, {X = 688, Y = 83}, {X = 683, Y = 114}, {X = 687, Y = 114}, {X = 691, Y = 114}, {X = 695, Y = 115}, {X = 699, Y = 115}, {X = 703, Y = 115}, {X = 627, Y = 157}, {X = 730, Y = 159}, {X = 730, Y = 164}]
– TRSBankscreen.__openNPC(): result = False
– Succesfully freed SMART[812]
– Freeing gametabs bitmaps…
Successfully executed.

**EDIT-1** There is a fix I am trying, I'll post it if it works.

Foundry

2014-03-09 19:40:03

From: fortier4
With a little messing around and digging I changed line 430 from

bankscreen.withrdaw(dtm,amount);

to

bankscreen.withdraw(dtm, withdraw_amount_all);

and it fixed the mess up after a level up. When I play I usually click the withdraw all selection versus clicking withdraw-x then typing in 27 or what no each time. Speeds the script up a bit also. I have run into a different issue I cannot seem to figure out.

The script will run just fine for a little bit when I am watching it then all of a sudden it stops and I get this message in my debug box:

—- TRSMinimap.getDots()
—— Found 15 minimap dots (ID: 4369)
—- TRSMinimap.getDots(): [{X = 657, Y = 46}, {X = 641, Y = 54}, {X = 657, Y = 58}, {X = 688, Y = 63}, {X = 702, Y = 67}, {X = 688, Y = 83}, {X = 683, Y = 114}, {X = 687, Y = 114}, {X = 691, Y = 114}, {X = 695, Y = 115}, {X = 699, Y = 115}, {X = 703, Y = 115}, {X = 627, Y = 157}, {X = 730, Y = 159}, {X = 730, Y = 164}]
– TRSBankscreen.__openNPC(): result = False
– Succesfully freed SMART[812]
– Freeing gametabs bitmaps…
Successfully executed.

**EDIT-1** There is a fix I am trying, I'll post it if it works.


Yeah, I'll look into fixing the shaft making part of the script. I haven't really tested it extensively.

As for the inventory procedure, I copied that from a previous script I made where the space in the inv varied. I will fix that tonight.

Finally, the error log is SRL6 failing to open the bank. I will make a failsafe for that.

IROC-Z

2014-03-09 20:27:57

From: Foundry
Yeah, I'll look into fixing the shaft making part of the script. I haven't really tested it extensively.

As for the inventory procedure, I copied that from a previous script I made where the space in the inv varied. I will fix that tonight.

Finally, the error log is SRL6 failing to open the bank. I will make a failsafe for that.


I fixed the failing to open the bank issue.

changed:


bankscreen.open(BANK_NPC_BLUE);
wait(randomrange(1000, 2000)); // Have to wait for the items in the bank to appear.
bankscreen.withdraw(dtm, withdraw_amount_all);

to


repeat
bankscreen.open(BANK_NPC_BLUE);
wait(randomrange(1000, 2000)); // Have to wait for the items in the bank to appear.
until(bankscreen.isopen());
bankscreen.withdraw(dtm, withdraw_amount_all);

Got an hour and a half run until I opened a bunch of tabs and lag messed it up.

Foundry

2014-03-09 22:28:35

From: fortier4
I fixed the failing to open the bank issue.

changed:


bankscreen.open(BANK_NPC_BLUE);
wait(randomrange(1000, 2000)); // Have to wait for the items in the bank to appear.
bankscreen.withdraw(dtm, withdraw_amount_all);

to


repeat
bankscreen.open(BANK_NPC_BLUE);
wait(randomrange(1000, 2000)); // Have to wait for the items in the bank to appear.
until(bankscreen.isopen());
bankscreen.withdraw(dtm, withdraw_amount_all);

Got an hour and a half run until I opened a bunch of tabs and lag messed it up.


Okay, updated. You have to use the bank chest at Lumbridge now because that is where everything will be centralized. Tell me if it doesn't work.

Also, please ignore the parts I have been working on. They are quite the eyesore.

IROC-Z

2014-03-09 23:05:29

From: Foundry
Okay, updated. You have to use the bank chest at Lumbridge now because that is where everything will be centralized. Tell me if it doesn't work.

Also, please ignore the parts I have been working on. They are quite the eyesore.


Is it the chest just north of the castle in that combat training area?

Foundry

2014-03-10 07:32:55

From: fortier4
Is it the chest just north of the castle in that combat training area?


Yeah, I'll add the location to the op. Thanks for reminding me

Foundry

2014-03-31 21:36:33

I updated this today. It still worked, just cleaned up some old stuff and prepared the walking for when the symbols are fixed.

Foundry

2014-05-10 18:55:17

@The Mayor; Thanks for the tutorial you did on making an SPS map, really helped!

Updated the script to what it should have been when I released it. It has walking and looting now and many more failsafes/standard qualities of a decent script. Please post proggies everyone and let me know if the colors need to be fine tuned.

Doldol

2014-05-10 22:59:02

I just tried the script and it has trouble attacking the chickens, everything should be set up correctly.

I get this spammed:

– isMouseOverText()
—- Current mouse-over text: ""
—- Current mouse-over text: ""
—- Current mouse-over text: ""
– isMouseOverText(): False
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed wrong values to a finder function: xs > xe (9,-16). Swapping the values for now.
Warning! You passed wrong values to a finder function: ys > ye (9,-24). Swapping the values for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -24. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Failed to find loot.
– isMouseOverText()
—- Current mouse-over text: ""
—- Current mouse-over text: ""
—- Current mouse-over text: ""
—- Current mouse-over text: ""
– isMouseOverText(): False
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed a wrong xs to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -1. That is below 0, thus out of bounds. Setting the value to 0 for now.
– HINT: Chicken not found!
Warning! You passed wrong values to a finder function: xs > xe (9,-16). Swapping the values for now.
Warning! You passed wrong values to a finder function: ys > ye (9,-24). Swapping the values for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -24. That is below 0, thus out of bounds. Setting the value to 0 for now.

Foundry

2014-05-12 23:13:08

It's now usable for melee players (figured out it didn't function correctly yesterday). I used recursion for the first time… fun stuff. Anyways, this is the version to download if you really want to see what the script is about because it has enough failsafes and antiban to be considered safe. Earlier versions moved the mouse to (0,0) sometimes and that has been fixed. Runs for at least 3 hours solid.

Nicodemus

2014-07-20 10:26:53

the script just takes all the logs in the inventory and then puts all the logs back in the bank…

theorange

2014-07-27 09:40:47

Compiled successfully in 6313 ms.
– setupSRL()
—- Setting up SRL…
—- initSmart():
—— Attempting to pair to a previously spawned client
—— smartPairToExistingClient():
——– Found 1 free client(s), attempting to pair to one…
———- smartSetAsTarget(): Succesfully set SMART[6696] as Simba's target
——– Succesfully paired to a existing client, SMART[6696]
—— smartPairToExistingClient(): result = true
—— Succesfully initialized via pairing to a previously spawned client
—- initSmart()
—— smartSetupDrawing(): Succesfully setup SMART drawing
—- Waiting up to 5 minutes for RS to load…

Does not interact with screen at all to login, If manually logged in, still does not do anything. directX settings.

Machu

2014-07-27 10:19:42

From: theorange
Compiled successfully in 6313 ms.
– setupSRL()
—- Setting up SRL…
—- initSmart():
—— Attempting to pair to a previously spawned client
—— smartPairToExistingClient():
——– Found 1 free client(s), attempting to pair to one…
———- smartSetAsTarget(): Succesfully set SMART[6696] as Simba's target
——– Succesfully paired to a existing client, SMART[6696]
—— smartPairToExistingClient(): result = true
—— Succesfully initialized via pairing to a previously spawned client
—- initSmart()
—— smartSetupDrawing(): Succesfully setup SMART drawing
—- Waiting up to 5 minutes for RS to load…

Does not interact with screen at all to login, If manually logged in, still does not do anything. directX settings.


—- Waiting up to 5 minutes for RS to load…say it all.

theorange

2014-07-27 23:56:38

From: Machu
—- Waiting up to 5 minutes for RS to load…say it all.


I wait the full 5 mins, then it counts down and fails

ayzee5793

2014-10-17 11:17:48

I'm trying to incorporate feather pick up, but it keeps getting confused with other colors, I believe its the black underlines. Any tips?

calem

2014-10-27 01:54:45

nice work m8

johnjoseph09

2014-12-29 03:01:26

This should help anyone who's starting from scratch without any money at all, thanks for the script ! :)

Foundry

2015-03-06 23:21:04

Just updated this. Will work on it more in the next two weeks sometime.