Justin
2013-10-05 05:31:36
I decided to make a basic Soul Wars Fletcher as my first public srl-6 script. I don't expect this script to get much attention due to how 'basic' it is. What it will do is craft Maple Logs to Maple shieldbow (u)'s.
The script can and will be improved overtime. There's many functions that can be improved and they will be over time. Please keep an eye on the bottom right image as that will change if there is an update.
Please make sure you read this thread in how to correctly setup SRL-6 for RS3 - http://villavu.com/forum/showthread.php?t=47714 and http://villavu.com/forum/showthread.php?t=106161
Maple logs need to be in the 9th bank slot.

Please let me know if you have any problems with this script. I have trained 55-70 fletching with this script :)
From: Coh3n
Adding players to Rafiki (Player Manager)
[INDENT]
Adding players to the player manager is very, very easy. It is a very basic form, but does allow multiple player files to be saved/loaded, as well and username and password encryption. It also means you will never have to enter your username and password in a script ever again. Open Simba and go to SRL > Player Manager. A form should pop up:
The setup is pretty straight forward:Note that the Player Manager can run at any time, and it does not start a script. The Player Manager and the script are completely separate. Script specific settings are set in the script.
- Click the green "+" button to add a player.
- Edit the players information on the right. You'll notice only the login name and password are required. I recommend you also enter a nickname. This nickname can be used to load your player into a script, otherwise you will have to use your login name. The display name is used only for debugging.
- Choose whether or not you want to use encryption.
- Save your players!
- You can add/delete players from the list at any time.
[/INDENT]
For people who want to know what was chaged: http://diffchecker.com/lwe7k67m
program SWFletcher;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
var
resetup = true;
x, y, img_name, amountCut: integer;
_img_name: string;
procedure declarePlayers();
begin
players.setup([''], '');
currentPlayer := 0;
end;
function waitForInterface: Boolean;
var
p: TPoint;
t: Integer;
begin
t := getSystemTime() + 5000;
repeat
wait(100);
until ((countColor(2070783, 465, 279, 497, 293) = 54) or (countColor(10987173, 352, 159, 385, 181) = 3) or (getSystemTime() >= t));
result := (countColor(2070783, 465, 279, 497, 293) = 54) or (countColor(10987173, 352, 159, 385, 181) = 3);
end;
function waitForCraftInterface: Boolean;
var
p: TPoint;
t: Integer;
begin
t := getSystemTime() + 5000;
repeat
wait(100);
until ((countColor(10987173, 352, 159, 385, 181) = 3) or (getSystemTime() >= t));
result := (countColor(10987173, 352, 159, 385, 181) = 3);
end;
function waitForUnlock: Boolean;
var
p: TPoint;
t: Integer;
begin
t := getSystemTime() + 5000;
repeat
wait(100);
until ((countColor(13553357, IntToBox(866, 275, 933, 297)) <> 4) or (getSystemTime() >= t));
result := (countColor(13553357, IntToBox(866, 275, 933, 297)) <> 4);
sleep(300 + random(300));
end;
function getInterface: string;
begin
if countColor(2070783, 465, 279, 497, 293) = 54 then
result := 'knife';
if countColor(10987173, 352, 159, 385, 181) = 3 then
result := 'craft';
end;
function findBankChest(hover: boolean): boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := getToleranceSpeed();
setColorToleranceSpeed(2);
settolerancespeed2modifiers(0.43, 0.82);
if not (FindColorsTolerance(arP, 1449508, mainscreen.getBounds(), 5)) then
begin
setColorToleranceSpeed(tmpCTS);
settolerancespeed2modifiers(0.2, 0.2);
if (bankScreen.isOpen()) then
bankScreen.close();
sleep(60 + random(140));
players[currentPlayer].logout();
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.66) and (X <= 2.23) and (Y >= 0.67) and (Y <= 2.26) and (Z >= 0.50) and (Z <= 1.56) 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(479, 340));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then
Continue;
P := MiddleTPA(ararP[i]);
smartImage.drawBox(IntToBox(P.x, P.y, P.x + 10, P.y + 10), false, clLime);
Mouse(Point(P.x + random(10), P.y + random(10)), mouse_Move, MOUSE_HUMAN);
smartImage.clearArea(IntToBox(P.x, P.y, P.x + 10, P.y + 10));
Wait(100 + Random(100));
if (isMouseOverText(['Bank'], 1000)) then
begin
Result := True;
if not hover then
fastClick(mouse_Left);
Break;
end;
end;
setColorToleranceSpeed(tmpCTS);
settolerancespeed2modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
if (bankScreen.isOpen()) then
bankScreen.close();
sleep(60 + random(140));
Exit;
end;
end;
procedure randomGameTabCommon();
var
allTabs, commonTabs, t: Integer;
TIA: TIntegerArray;
begin
if not (isLoggedIn()) then
exit();
t := gameTabs.getActiveTab();
TIA := [TAB_STATS, TAB_BACKPACK, TAB_EQUIPMENT, TAB_FRIENDS, TAB_MAGIC];
repeat
commonTabs := TIA[random(length(TIA))];
until(commonTabs <> t);
gameTabs.openTab(commonTabs);
wait(randomRange(300, 600));
gameTabs.openTab(t);
end;
procedure ProgressReport; //Thanks slayr288!
var
T1, T2, T3: Integer;
XPPerHour, XPGain, TimeGone, LogsPerHour: Extended
begin
TimeGone := (GetTimeRunning/1000);
XPGain := 58.3 * amountCut;
XPPerhour := (3600*(XPGain))/((TimeGone));
LogsPerHour := (3600*(amountCut))/((TimeGone));
ConvertTime(GetTimeRunning, T1, T2, T3);
begin
smartImage.clearArea(IntToBox(739, 484, 954, 554));
smartImage.DrawText('Time Ran: ' + IntToStr(T1) + ':' + IntToStr(T2) + ':' + IntToStr(T3), Point(742, 490), upchars, false, 5730676);
smartImage.DrawText('Logs cut: ' + IntToStr(amountCut), Point(742, 500), upchars, false, 5730676);
smartImage.DrawText('Logs cut p/h: ' + IntToStr(Round(LogsPerHour)), Point(742, 510), upchars, false, 5730676);
smartImage.DrawText('XP Gained: ' + IntToStr(Round(XPGain)), Point(742, 520), upchars, false, 5730676);
smartImage.DrawText('XP p/h: ' + IntToStr(Round(XPPerhour)), Point(742, 530), upchars, false, 5730676);
end;
end;
procedure mainLoop()
var
p: TPointArray;
b: TBox;
t, a: integer;
k: boolean;
begin
repeat
if not IsLoggedIn then
begin
players[currentPlayer].login();
sleep(3000 + random(1400));
typeByteWait(vk_up, 800 + random(200));
end;
if (tabBackpack.count() = 28) then
begin
if(bankScreen.isOpen()) then
bankScreen.close();
smartImage.drawBox(tabBackPack.getSlotBox(1), false, clLime);
tabBackpack.mouseSlot(1, MOUSE_MOVE);
smartImage.clearArea(tabBackPack.getSlotBox(1));
if (isMouseOverText(['logs'], 1000)) then
begin
fastClick(mouse_Left);
if waitForInterface then
if getInterface = 'knife' then
begin
smartImage.drawBox(IntToBox(460, 309, 503, 354), false, clLime);
MouseBox(IntToBox(460, 309, 503, 354), mouse_Left);
smartImage.clearArea(IntToBox(460, 309, 503, 354));
waitForCraftInterface;
end;
if getInterface = 'craft' then
begin
smartImage.drawBox(IntToBox(480, 453, 575, 479), false, clLime);
MouseBox(IntToBox(482, 454, 702, 477), mouse_Left);
smartImage.clearArea(IntToBox(480, 453, 575, 479));
t := getSystemTime() + 51000;
k := false;
a := randomRange(24, 27);
repeat
wait(100 + random(350));
case random(1000) of
0:
begin
smartImage.drawBox(tabStats.getSkillBox(SKILL_FLETCHING), false, clLime);
MouseBox(tabStats.getSkillBox(SKILL_FLETCHING), mouse_Move);
smartImage.clearArea(tabStats.getSkillBox(SKILL_FLETCHING));
end;
14: tabBackpack.open();
60: randomRClickItem();
90: sleepAndMoveMouse(1000 + random(2000));
150: pickUpMouse();
180: mouseOffClient(4);
220: smallRandomMouse();
280: randomCameraAngle(MS_ANGLE_HIGH);
350: randomCompass(10, 30, true);
400: randomGameTabCommon();
end;
if (countColor(131072, tabBackPack.getSlotBox(a)) = 75) then
begin
if not k then
findBankChest(true);
k := true;
end;
until (countColor(131072, tabBackPack.getSlotBox(28)) = 75) or (getSystemTime() >= t);
sleep(600 + random(200));
amountCut := amountCut + 28;
ProgressReport;
end;
end;
end;
if findBankChest(false) then
begin
if (BankScreen.isOpen(5000)) then
begin
smartImage.drawBox(IntToBox(481, 586, 508, 604), false, clLime);
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
smartImage.clearArea(IntToBox(481, 586, 508, 604));
smartImage.drawBox(IntToBox(521, 120, 542, 136), false, clLime);
MouseBox(IntToBox(521, 120, 542, 136), mouse_move);
smartImage.clearArea(IntToBox(521, 120, 542, 136));
if (isMouseOverText(['logs'], 1000)) then
begin
fastClick(MOUSE_RIGHT);
chooseOption.select(['All']);
sleep(60 + random(140));
bankScreen.close();
sleep(60 + random(140));
if bankScreen.isOpen() then
bankScreen.close();
smartImage.drawBox(tabBackPack.getSlotBox(1), false, clLime);
tabBackpack.mouseSlot(1, MOUSE_MOVE);
smartImage.clearArea(tabBackPack.getSlotBox(1));
waitForUnlock;
end;
end else
begin
bankScreen.close();
sleep(60 + random(140));
end;
end;
until (false);
end;
begin
declarePlayers();
smartEnableDrawing := true;
_img_name := GetPage('http://srljustin.com/sw_name');
img_name := BitmapFromString(159, 165, _img_name);
SetupSRL;
smartImage.drawBitmap(img_name, Point(576, 427));
MouseSpeed := randomRange(20, 28);
players[currentPlayer].login();
mainLoop();
end.

