Anyone got any suggestions for my issue?
I'm not an idiot but I am still getting used to the way Simba works. :P
Anyone got any suggestions for my issue?
I'm not an idiot but I am still getting used to the way Simba works. :P
@Justin
Love the script, works perfect for my needs.
I just added a proggy and removed the mouse click of the maple shieldbow (u) icon before it clicks the blue 'Fletch' button, other than that it seems to be perfect.
If you were wondering, your script averages ~1700 logs p/h and ~100k xp p/h with maples which is also ~100k gp p/h.
And a request:
Would it be possible to make a firemaking script? (Bonfire)
Last edited by slayr288; 10-09-2013 at 11:47 PM.
Hmm, I just got back after this whole RS3 and SRL6 stuff happened; it doesn't seem to detect when RS has loaded. This is probably not a script problem but could I get a little help with this?
Here's an edited version of your script that adds a paint proggy and changes the mouse movements to more human-like. Tell me what you think, just getting into scripting.
Simba Code:program SWFletcher;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
var
resetup = true;
x, y, amountCut: integer;
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;
procedure mMouse(XX: integer; YY: integer; XXX: integer; YYY: integer);
var
point: TPoint;
begin
point.create(randomRange(XX, XXX), randomRange(YY, YYY));
mouse(point, MOUSE_LEFT, MOUSE_HUMAN);
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.36);
if not (FindColorsTolerance(arP, 1449251, mainscreen.getBounds(), 5)) then
begin
setColorToleranceSpeed(tmpCTS);
settolerancespeed2modifiers(0.2, 0.2);
if (bankScreen.isOpen()) then
mMouse(600, 35, 613, 48);
sleep(randomRange(100, 225));
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(423, 248));
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 + 35, P.y + 35), false, clLime);
Mouse(Point(P.x + random(35), P.y + random(35)), mouse_Move, MOUSE_HUMAN);
smartImage.clearArea(IntToBox(P.x, P.y, P.x + 35, P.y + 35));
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
mMouse(600, 35, 613, 48);
sleep(randomRange(100, 225));
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 Proggy;
var
T1, T2, T3: Integer;
XPPerHour, XPGain, TimeGone, LogsPerHour: Extended
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
XPGain := 58.3 * amountCut;
XPPerhour := (3600*(XPGain))/((TimeGone));
LogsPerHour := (3600*(amountCut))/((TimeGone));
ConvertTime(GetTimeRunning, T1, T2, T3);
begin
smartImage.clear();
smartImage.DrawText('///*Justins Fletcher*\\\', Point(577, 440), upchars, false, clRed);
smartImage.DrawText('Time Ran: ' + IntToStr(T1) + ':' + IntToStr(T2) + ':' + IntToStr(T3), Point(577, 450), upchars, false, clRed);
smartImage.DrawText('Logs cut: ' + IntToStr(amountCut), Point(577, 460), upchars, false, clRed);
smartImage.DrawText('Logs cut p/h: ' + IntToStr(Round(LogsPerHour)), Point(577, 470), upchars, false, clRed);
smartImage.DrawText('XP Gained: ' + IntToStr(Round(XPGain)), Point(577, 480), upchars, false, clRed);
smartImage.DrawText('XP p/h: ' + IntToStr(Round(XPPerhour)), Point(577, 490), upchars, false, clRed);
end;
end;
procedure mainLoop()
var
p: TPointArray;
b: TBox;
t, a: integer;
k: boolean;
begin
if resetup then
begin
MouseBox(mainscreen.getBounds(), mouse_move);
getMousePos(x, y);
if (countColor(1613523, IntToBox(945, 591, 959, 610)) = 9) then
typeSend('l', false);
mouseScroll(Point(x, y), randomRange(20, 55), false);
typeByteWait(vk_up, 800 + random(200));
resetup := false;
end;
repeat
if not IsLoggedIn then
begin
players[currentPlayer].login();
sleep(3000 + random(1400));
resetup := true;
exit;
end;
if (tabBackpack.count() = 28) then
begin
if(bankScreen.isOpen()) then
mMouse(600, 35, 613, 48);
sleep(randomRange(100, 225));
tabBackpack.mouseSlot(1, MOUSE_MOVE);
if (isMouseOverText(['logs'], 1000)) then
begin
fastClick(mouse_Left);
if waitForInterface then
if getInterface = 'knife' then
begin
mMouse(460, 309, 503, 354);
waitForCraftInterface;
end;
if getInterface = 'craft' then
begin
if (countColor(1356525, IntToBox(343, 229, 383, 269)) <> 154) then
mMouse(482, 454, 702, 477);
sleep(randomRange(100, 225));
t := getSystemTime() + 51000;
k := false;
a := randomRange(24, 27);
repeat
wait(100 + random(350));
Proggy;
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;
end;
end;
end;
if findBankChest(false) then
begin
if (BankScreen.isOpen(5000)) then
begin
sleep(randomRange(100, 225));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
sleep(randomRange(100, 225));
MouseBox(IntToBox(521, 120, 542, 136), mouse_move);
if (isMouseOverText(['logs'], 1000)) then
begin
fastClick(MOUSE_RIGHT);
sleep(randomRange(100, 225));
chooseOption.select(['All']);
sleep(randomRange(100, 225));
mMouse(600, 35, 613, 48);
sleep(randomRange(100, 225));
if bankScreen.isOpen() then
mMouse(600, 35, 613, 48);
sleep(randomRange(100, 225));
tabBackpack.mouseSlot(1, MOUSE_MOVE);
waitForUnlock;
end else
begin
players[currentPlayer].isActive = false;
mMouse(600, 35, 613, 48);
sleep(randomRange(100, 225));
players[currentPlayer].logout();
FreeBitMap(0);
TerminateScript();
end;
end else
begin
mMouse(600, 35, 613, 48);
sleep(randomRange(100, 225));
end;
end;
if resetup then
exit;
until not (IsLoggedIn);
mainLoop();
end;
begin
declarePlayers();
smartEnableDrawing := true;
SetupSRL;
MouseSpeed := randomRange(19, 25);
players[currentPlayer].login();
Proggy;
mainLoop();
end.
Example proggy:
Last edited by slayr288; 10-10-2013 at 11:06 AM.
Simba Code:procedure mouse(pnt: TPoint; button: integer; mmType: integer = MOUSE_HUMAN); overload;
From my understanding, the default mouse procedure will use MOUSE_HUMAN.
Nice work with the progress report, Do you mind if I add it into the live script? (Credits will be given given of course)
Justin.
Yeh sure, go ahead. And I didn't know mouse_human was default :P, was just being safe. Oh well.
Sweet update and sweet progress report aswell, prepare for a long proggy
As of 1 minute ago. I've been forcing the session expire reload.Code:-------- Saving screenshot: IP_address.png ------ Found lobby screen ---- TPlayer.loginToLobby(): True ------ minimap.__createMask(): Creating the bitmap mask Exception in Script: Runtime error: "Out of memory" at line 370, column 35 in file "C:\Simba\Includes\SRL-6\lib\interfaces\minimap.simba" The following bitmaps were not freed: [0, SMART Debug Image]
Here's a 6 hour proggy since it glitched on 6 hours.
Last edited by slayr288; 10-13-2013 at 01:27 PM.
I know I'm being stupid, this looks great and it's a great help as a reference when I'm building scripts. How do I get new fonts v15?
Thanks Justin, I'm going to look over this to get up to speed with SRL-6.
kudos
any bans? im planning to start scripting again sometime this month.
There are currently 1 users browsing this thread. (0 members and 1 guests)