Fixed the problem but nothing happens after i load up it, I enabled SMART but nothing happens :S
I followed the graphics setup exactly as written here
http://villavu.com/forum/showthread.php?t=107365
and tried the script with both lobster and tuna, but it is not working.
My SPS and SRL are both updated to the latest version.
Maybe, it is because I disabled use_directx? I disabled it because when i enable, the screen keeps flickering.
or do I have to do something about the <rant> thingy?
but still, thank you for kindly answering my questions.
Last edited by ardentboy28; 02-05-2014 at 06:33 PM.
I just sent you a PM
Glad we got everything straightened out.
I locked ardentboy's interface layout.
I reset it to old-school even though it already was.
I drug the "subscribe" button off of the mainscreen onto the chat box so it'd be out of the way.
The script is now fully functional. If anyone ever wants teamviewer help don't hesitate to ask.
WORKING FLAWLESSLY
footballjds is amazingly kind and actually used teamviewer to help me fix the problem.
(make sure you lock the interface)
Thanks!!!
the latest version of the script is up. I'm using github now so make sure you always check for the latest!
Okay DirectX didn't work for me, d3d9.dll didn't function correctly. Set it up to use OpenGL instead, runs fine, except... walks to the furnace to cook, right clicks, then waits a moment, neglects to actually select "cook", and then walks to the bank, dumps the raw fish in the bank, and heads back to the furnace with another raw load, and brings them back just the way they came. Not sure how to fix this.
Hey, try the DirectX plugin found here http://villavu.com/forum/showthread....light=d3d9.dll
This script fails to cook again. I think this happened after the graphics update a few weeks ago.
After some tweaking I managed to fix the script - the range colour needed an update. I know I played with some timings to make it more human-like; however, I forgot if it is this version.
Code:program cooking; {$DEFINE SMART} {$I SRL-6/SRL.simba} {$I sps/lib/sps-rs3.simba} var _totalEXP, food_cooked, food_burnt: integer; cook_walk: TSPSArea; paths: T2DPointArray; const USE_DirectX = false; procedure declarePlayers; begin setLength(players, 1); with players[0] do begin loginName := ''; bankPin := ''; password := ''; integers[0] := 1;//slot containing food to cook extendeds[0]:= 120;//exp per item isActive := true; isMember := false; world := -1; end; currentPlayer := 0; end; procedure initPaths; begin cook_walk.setup('cook_spot', '', __DEFAULT_ACCURACY, __DEFAULT_TOLERANCE, 0.7); setLength(paths, 3); //to bank paths[0] := [Point(90, 164), Point(94, 171), Point(102, 178), Point(114, 173), Point(117, 159), Point(119, 141), Point(114, 119), Point(110, 107), Point(95, 104)]; //to the north dock paths[1] := [Point(97, 166), Point(97, 173), Point(98, 179), Point(123, 180), Point(126, 152), Point(114, 136), Point(112, 116), Point(98, 106)]; //to the south dock paths[2] := [Point(94, 166), Point(118, 162), Point(118, 144), Point(104, 124), Point(97, 109), Point(94, 104)]; end; function location: TPoint; var places: TPointArray; bankD, rangeD: integer; begin result := cook_walk.getPlayerPos; players[currentPlayer].location := ''; if result.equals([-1, -1]) then exit; rangeD := distance(result, Point(95, 104)); bankD := distance(result, Point(90, 164)); if (rangeD < 15) then players[currentPlayer].location := 'range' else if (bankD < 15) then players[currentPlayer].location := 'bank'; status(players[currentPlayer].location); end; function walk(bank: boolean): boolean; var our_path: TPointArray; ourPos: TPoint; threshold: integer; n: integer; begin ourPos := location; if ourPos.equals([-1, -1]) then exit; our_path := paths[random(length(paths))].copy; if bank then invertTPA(our_path); threshold := getSystemTime + randomRange(45000, 65000); repeat if cook_walk.walkPath(our_path) then minimap.waitPlayerMoving(); wait(randomRange(250, 500)); ourPos := location; until ((distance(our_path[high(our_path)], ourPos) < 12)) or (getSystemTime > threshold); result := (threshold > getSystemTime); end; //this function returns the closest point in the array to the center of the arra function TPointArray.centerPoint(): TPoint; var tmpArray: TPointArray; begin if length(self) < 1 then exit; tmpArray := self; tmpArray.sortFromPoint(self.getMiddle); result := tmpArray[0]; end; //This just ensures that the option window gets closed function TRSChooseOption.close2(): boolean; var t: integer; begin t := getSystemTime + randomRange(2000,3000); while (t > getSystemTime) do if self.isOpen then self.close else exit(true); end; //This function will find all colors close to the range color and split them into //TPA's by width and height, a use range function will call this one function findRange: T2DPointArray; var rangeTPA: TPointArray; begin if findColorsTolerance(rangeTPA, 4146611, mainscreen.getBounds, 4, colorSetting(2, 0.06, 0.53)) then result := rangeTPA.toATPA(15, 15); sortATPAFromMidPoint(result, mainscreen.playerPoint); end; function useRange: boolean; var range: T2DPointArray; pont: TPoint; i, h, timer: integer; begin range := findRange; if (length(range) < 1) then exit; h := high(range); for i := 0 to h do begin if productionScreen.isOpen then exit(productionScreen.clickStart); if (length(range[i]) < 5) then continue; pont := range[i].centerPoint; mouse(pont.rand(-3, 3), Mouse_Right, Mouse_Human); if chooseOption.select(['-> Range'], randomRange(1000, 4000)) then begin minimap.waitPlayerMoving(); timer := getSystemTime + randomRange(3000, 6000); repeat wait(randomRange(100, 400)); until (productionScreen.isOpen) or (getSystemTime > timer); end; end else chooseOption.close2; end; function doneButton: boolean; var bluePoints: TPointArray; blueArea: TBox; begin blueArea := [244,197, 335, 223]; findColorsTolerance(bluePoints, 13278759, blueArea, 44); result := length(bluePoints) > 145; end; procedure whileCooking; var blkCount: TPointArray; count, threshold: integer; begin threshold := getSystemTime + randomRange(70000, 80000); repeat wait(randomRange(255, 555)); if doneButton then begin threshold := getSystemTime + randomRange(2500, 3500); repeat wait(randomRange(255, 555)); if not(doneButton) then exit; until (getSystemTime > threshold); end; until (getSystemTime > threshold); end; //This function will find all colors close to the banker color and split them into //TPA's by width and height, a use bank function will call this one function findBankers: T2DPointArray; var bankerTPA: TPointArray; begin if findColorsTolerance(bankerTPA, 2450798, mainscreen.getBounds, 14, colorSetting(2, 0.09, 1.31)) then result := bankerTPA.toATPA(15, 15); sortATPAFromMidPoint(result, mainscreen.playerPoint); end; function useBank: boolean; var bankers: T2DPointArray; pont: TPoint; i, h, timer: integer; begin bankers := findBankers; if (length(bankers) < 1) then exit; h := high(bankers); for i := 0 to h do begin if (length(bankers[i]) < 5) then continue; pont := bankers[i].centerPoint; mouse(pont.rand(-3, 3), Mouse_Right, Mouse_Human); if chooseOption.select(['Bank Banker', 'Bank Bank', 'nk Banker'], randomRange(1000, 4000)) then begin minimap.waitPlayerMoving(); timer := getSystemTime + randomRange(3000, 6000); repeat wait(randomRange(100, 400)); until (bankscreen.isOpen) or (pinscreen.isOpen) or (getSystemTime > timer); if pinscreen.isOpen then pinScreen.enter(players[currentPlayer].bankPin); if bankscreen.isOpen then exit(true); end else chooseOption.close2; end; end; function cook_count: TPoint var i, invcount, x, y: integer; clrFound: boolean; begin tabBackpack.open; invcount := tabBackpack.count; clrFound := findColor(x, y, 65535, tabBackpack.getBounds); case invcount of 0: result := [0, 0]; 1..27: result := [invcount-1, 29-invcount]; 28: if clrFound then result := [27, 1] else result := [28, 0]; end; end; procedure printProgress; var secondsElapsed, expPHour, totalEXP: extended; food: TPoint; begin food := cook_count; food_cooked := food_cooked + food.x; food_burnt := food_burnt + food.y; totalEXP := food_cooked * players[currentPlayer].extendeds[0]; secondsElapsed := (getTimeRunning/1000); expPHour := (totalEXP * 60 * 60) / secondsElapsed; smartImage.clearArea(intToBox(576, 200, 798, 278)); smartImage.drawBox(intToBox(576, 200, 798, 278), true, 7890014); smartImage.DrawText('Run Time: ' + msToTime(GetTimeRunning, TIME_SHORT), Point(618, 224), upchars, false, 1376386); smartImage.DrawText('EXP/Hour: ' + toString(round(expPHour)), Point(618, 234), upchars, false, 1376386); smartImage.DrawText('Total EXP: ' + toString(totalEXP), Point(618, 244), upchars, false, 1376386); smartImage.DrawText('Items cooked: ' + toString(food_cooked), Point(618, 254), upchars, false, 1376386); smartImage.DrawText('Items burnt: ' + toString(food_burnt), Point(618, 264), upchars, false, 1376386); end; function handleBanking: boolean; begin printProgress; if waitFunc(@useBank, 100, randomRange(20000,30000)) then begin bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY); if bankscreen.withdraw(players[currentPlayer].integers[0], WITHDRAW_AMOUNT_ALL_BUT_ONE, ['']) then result := bankscreen.close; end; end; procedure prepareSelf; begin wait(random(500, 1500)); minimap.clickCompass; wait(random(500, 1500)); mainscreen.setAngle(MS_ANGLE_HIGH); wait(random(1, 1500)); end; procedure mainLoop; var loc: TPoint; begin if not isLoggedIn then begin print('We''re not logged in. respawning client.'); wait(randomRange(5000, 10000)); smartReloadClient((5 * 60000) + random(15000)); if (waitClientReady()) then begin print('Client succesfully loaded after reload'); end else begin print('Client never reloaded after restart..', TDebug.FATAL); terminateScript; end; if not players[currentPlayer].isActive then players.next(false); if players[currentPlayer].login then prepareSelf; if not isLoggedIn then begin writeln('Terminating, not logged in.'); terminateScript; end; end; loc := location; if loc.equals([-1, -1]) then exit; wait(randomRange(1, 300)); if walk(true) then if handleBanking then if walk(false) then if tabBackpack.mouseSlot(randomRange(10, 28), mouse_left) then if useRange then whileCooking; end; begin if USE_DirectX then smartPlugins := ['d3d9.dll']; smartEnableDrawing := true; setupsrl; declarePlayers; initPaths; if not isLoggedIn then if players[currentPlayer].login then prepareSelf; while players.getActive > 0 do mainLoop; end.
Last edited by killercrashy; 04-26-2014 at 08:09 PM.
Thanks @killercrashy; your version is working for me.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Been trying to use this script, though I guess it's no longer being maintained. Seem to be running into the problem of not cooking while at the range, and immediately running back to bank.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I updated the colors of the range and it worked well.
Use directx, lowest settings, and zoom all the way out.
Replace the function findRange with this. Its around line 105.
Code://This function will find all colors close to the range color and split them into //TPA's by width and height, a use range function will call this one function findRange: T2DPointArray; var rangeTPA: TPointArray; begin if findColorsTolerance(rangeTPA, 3162322, mainscreen.getBounds, 10, colorSetting(2, 0.16, 2.42)) then result := rangeTPA.toATPA(15, 15); sortATPAFromMidPoint(result, mainscreen.playerPoint); end;
After clicking the range, it doesn't actually click the blue cook button so it sits there for second, hits the compass then heads back to the bank to repeat. :/
I would add the code error but i was messing with it earlier and decided to post my problem after closing rs, if need be ill add it tomorrow.
productionScreen wasn't getting recognised. This has a few quick fixes:
Simba Code:program cooking;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I sps/lib/sps-rs3.simba}
var
_totalEXP, food_cooked, food_burnt: integer;
cook_walk: TSPSArea;
paths: T2DPointArray;
const
USE_DirectX = false;
procedure declarePlayers;
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'un';
bankPin := '';
password := 'pw';
integers[0] := 10;//slot containing food to cook
extendeds[0]:= 120;//exp per item
isActive := true;
isMember := false;
world := -1;
end;
currentPlayer := 0;
end;
procedure initPaths;
begin
cook_walk.setup('cook_spot', RUNESCAPE_OTHER, __DEFAULT_ACCURACY, __DEFAULT_TOLERANCE, 0.7);
setLength(paths, 3);
//to bank
paths[0] := [Point(90, 164), Point(94, 171), Point(102, 178), Point(114, 173), Point(117, 159), Point(119, 141), Point(114, 119), Point(110, 107), Point(95, 104)];
//to the north dock
paths[1] := [Point(97, 166), Point(97, 173), Point(98, 179), Point(123, 180), Point(126, 152), Point(114, 136), Point(112, 116), Point(98, 106)];
//to the south dock
paths[2] := [Point(94, 166), Point(118, 162), Point(118, 144), Point(104, 124), Point(97, 109), Point(94, 104)];
end;
function location: TPoint;
var
places: TPointArray;
bankD, rangeD: integer;
begin
result := cook_walk.getPlayerPos;
players[currentPlayer].location := '';
if result.equals([-1, -1]) then exit;
rangeD := distance(result, Point(95, 104));
bankD := distance(result, Point(90, 164));
if (rangeD < 15) then players[currentPlayer].location := 'range' else
if (bankD < 15) then players[currentPlayer].location := 'bank';
status(players[currentPlayer].location);
end;
function walk(bank: boolean): boolean;
var
our_path: TPointArray;
ourPos: TPoint;
threshold: integer;
n: integer;
begin
ourPos := location;
if ourPos.equals([-1, -1]) then exit;
our_path := paths[random(length(paths))].copy;
if bank then invertTPA(our_path);
threshold := getSystemTime + randomRange(45000, 65000);
repeat
if cook_walk.walkPath(our_path) then minimap.waitPlayerMoving();
wait(randomRange(250, 500));
ourPos := location;
until ((distance(our_path[high(our_path)], ourPos) < 12)) or (getSystemTime > threshold);
result := (threshold > getSystemTime);
end;
//this function returns the closest point in the array to the center of the arra
function TPointArray.centerPoint(): TPoint;
var
tmpArray: TPointArray;
begin
if length(self) < 1 then exit;
tmpArray := self;
tmpArray.sortFromPoint(self.getMiddle);
result := tmpArray[0];
end;
//This just ensures that the option window gets closed
function TRSChooseOption.close2(): boolean;
var
t: integer;
begin
t := getSystemTime + randomRange(2000,3000);
while (t > getSystemTime) do if self.isOpen then self.close else exit(true);
end;
//This function will find all colors close to the range color and split them into
//TPA's by width and height, a use range function will call this one
function findRange: T2DPointArray;
var
rangeTPA: TPointArray;
begin
if findColorsTolerance(rangeTPA, 4146611, mainscreen.getBounds, 4, colorSetting(2, 0.06, 0.53)) then
result := rangeTPA.toATPA(15, 15);
sortATPAFromMidPoint(result, mainscreen.playerPoint);
end;
function TRSProductionScreen.isOpen(waitTime: integer = 0): boolean; override;
var
t: UInt64;
begin
result := false;
t := (getTickCount64() + waitTime);
while (not result) and (t >= getTickCount64()) do
begin
result := getColor(point(44, 66)) = 1388125;
wait(randomRange(20, 50));
end;
end;
function useRange: boolean;
var
range: T2DPointArray;
pont: TPoint;
i, h, timer: integer;
begin
range := findRange;
if (length(range) < 1) then exit;
h := high(range);
for i := 0 to h do
begin
if (length(range[i]) < 5) then continue;
pont := range[i].centerPoint;
mouse(pont.rand(-3, 3), Mouse_Right, Mouse_Human);
if chooseOption.select(['-> Range'], randomRange(1000, 4000)) then
begin
minimap.waitPlayerMoving();
writeLn(productionScreen.isOpen(1000) );
if productionScreen.isOpen(5000) then
begin
result := productionScreen.clickStart();
exit(true);
end;
end;
end else chooseOption.close2;
end;
function doneButton: boolean;
var
bluePoints: TPointArray;
blueArea: TBox;
begin
blueArea := [244,197, 335, 223];
findColorsTolerance(bluePoints, 13278759, blueArea, 44);
result := length(bluePoints) > 145;
end;
procedure whileCooking;
var
blkCount: TPointArray;
count, threshold: integer;
begin
threshold := getSystemTime + randomRange(70000, 80000);
repeat
wait(randomRange(255, 555));
if doneButton then
begin
threshold := getSystemTime + randomRange(2500, 3500);
repeat
wait(randomRange(255, 555));
if not(doneButton) then exit;
until (getSystemTime > threshold);
end;
until (getSystemTime > threshold);
end;
//This function will find all colors close to the banker color and split them into
//TPA's by width and height, a use bank function will call this one
function findBankers: T2DPointArray;
var
bankerTPA: TPointArray;
begin
if findColorsTolerance(bankerTPA, 2450798, mainscreen.getBounds, 14, colorSetting(2, 0.09, 1.31)) then
result := bankerTPA.toATPA(15, 15);
sortATPAFromMidPoint(result, mainscreen.playerPoint);
end;
function useBank: boolean;
var
bankers: T2DPointArray;
pont: TPoint;
i, h, timer: integer;
begin
bankers := findBankers;
if (length(bankers) < 1) then exit;
h := high(bankers);
for i := 0 to h do
begin
if (length(bankers[i]) < 5) then continue;
pont := bankers[i].centerPoint;
mouse(pont.rand(-3, 3), Mouse_Right, Mouse_Human);
if chooseOption.select(['Bank Banker', 'Bank Bank', 'nk Banker'], randomRange(1000, 4000)) then
begin
minimap.waitPlayerMoving();
timer := getSystemTime + randomRange(3000, 6000);
repeat
wait(randomRange(100, 400));
until (bankscreen.isOpen) or (pinscreen.isOpen) or (getSystemTime > timer);
if pinscreen.isOpen then pinScreen.enter(players[currentPlayer].bankPin);
if bankscreen.isOpen then exit(true);
end else chooseOption.close2;
end;
end;
function cook_count: TPoint
var
i, invcount, x, y: integer;
clrFound: boolean;
begin
tabBackpack.open;
invcount := tabBackpack.count;
clrFound := findColor(x, y, 65535, tabBackpack.getBounds);
case invcount of
0: result := [0, 0];
1..27: result := [invcount-1, 29-invcount];
28: if clrFound then result := [27, 1] else result := [28, 0];
end;
end;
procedure printProgress;
var
secondsElapsed, expPHour, totalEXP: extended;
food: TPoint;
begin
food := cook_count;
food_cooked := food_cooked + food.x;
food_burnt := food_burnt + food.y;
totalEXP := food_cooked * players[currentPlayer].extendeds[0];
secondsElapsed := (getTimeRunning/1000);
expPHour := (totalEXP * 60 * 60) / secondsElapsed;
smartImage.clearArea(intToBox(576, 200, 798, 278));
smartImage.drawBox(intToBox(576, 200, 798, 278), true, 7890014);
smartImage.DrawText('Run Time: ' + msToTime(GetTimeRunning, TIME_SHORT), Point(618, 224), upchars, false, 1376386);
smartImage.DrawText('EXP/Hour: ' + toString(round(expPHour)), Point(618, 234), upchars, false, 1376386);
smartImage.DrawText('Total EXP: ' + toString(totalEXP), Point(618, 244), upchars, false, 1376386);
smartImage.DrawText('Items cooked: ' + toString(food_cooked), Point(618, 254), upchars, false, 1376386);
smartImage.DrawText('Items burnt: ' + toString(food_burnt), Point(618, 264), upchars, false, 1376386);
end;
function handleBanking: boolean;
begin
printProgress;
if waitFunc(@useBank, 100, randomRange(20000,30000)) then
begin
bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
if bankscreen.withdraw(players[currentPlayer].integers[0], WITHDRAW_AMOUNT_ALL_BUT_ONE, ['']) then
result := bankscreen.close;
end;
end;
procedure prepareSelf;
begin
wait(random(500, 1500));
minimap.clickCompass;
wait(random(500, 1500));
mainscreen.setAngle(MS_ANGLE_HIGH);
wait(random(1, 1500));
end;
procedure mainLoop;
var
loc: TPoint;
begin
if not isLoggedIn then
begin
print('We''re not logged in. respawning client.');
wait(randomRange(5000, 10000));
smartReloadClient((5 * 60000) + random(15000));
if (waitClientReady()) then
begin
print('Client succesfully loaded after reload');
end else
begin
print('Client never reloaded after restart..', TDebug.FATAL);
terminateScript;
end;
if not players[currentPlayer].isActive then players.next(false);
if players[currentPlayer].login then prepareSelf;
if not isLoggedIn then
begin
writeln('Terminating, not logged in.');
terminateScript;
end;
end;
loc := location;
if loc.equals([-1, -1]) then exit;
wait(randomRange(1, 300));
if walk(true) then
if handleBanking then
if walk(false) then
if tabBackpack.mouseSlot(randomRange(10, 28), mouse_left) then
if useRange then whileCooking;
end;
begin
if USE_DirectX then smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
setupsrl;
declarePlayers;
initPaths;
if not isLoggedIn then if players[currentPlayer].login then prepareSelf;
while players.getActive > 0 do mainLoop;
end.
E: Crayfish @ level 1 cooking
E2: Banker + range colour seem to change frequently. Need to pick a stable colour across multiple worlds.
Last edited by The Mayor; 10-23-2014 at 08:41 AM.
I took what The Mayor gave and I personally had to edit the color for the bank and the range. I think there still needs a little optimization to be done. I am going to see if I can figure it out and I will post my findings. So far it is running though.
There are currently 1 users browsing this thread. (0 members and 1 guests)