SRL Archive - Archive

Renzanity - SRL Member Application


Renzanity

2015-05-05 06:05:58

How Long have You Played Runescape?
10 Year(s)


Are you affilated in anyway with Jagex LTD?
No, I am not.

Were you Referred to SRL?
No, I was not.


What is your general programming knowledge?
I'm afraid I don't have any programming knowledge.


Are you a member of any other communities?
No, I am not.


Tell us about yourself…
From: Renzanity
Hello,

You can all call me, Renz. That's my real name if that didn't clear things up.:p I'm from the Philippines, a south-east Asian country.

So the MMO's that I play are most likely unheard from most of the people in this community, but I'll still state a couple: Ragnarok and Dragon Nest. As for other types of games, I'd say I've only been interested in PC games, console never got my attention as much as PC did. I asked my friends how can they even snipe in CoD using a console controller…I think, people that can snipe using a console controller are BAWS.

Anyway, one of the games that I enjoy playing on PC are games that has zombies in them. Yes, zombie games, preferably FPS. Dying Light is BY FAR, the best I've played(recommendation). The other games that I played were the MMO's stated above and any FPS game.

Virtual world aside, I like mostly anything to do with alcohol(will wait for your funny and clever comments about this later:p), getting fat and doing sports that I know of(Basketball, Volleyball etc.) .

I actually didn't expect I'd end up in the SRL community. This may sound a little too normal to you guys, but it's not for me, because I didn't expect I'd be able to get the knowledge I have now if it wasn't for me ending in the right place.

Anyway, I was browsing about Runescape guides (Skill training, money making etc.) and found myself laughing at the money making guides because of the comments about bots ruining the method being talked about. And so then I started searching about Runescape bots. I was surprised that there were a lot of sites that popped up. So I browsed a little further and saw a website with the villavu website on it as well as other bot sites available on the internet in a detailed post(forgot the website I got it from). I checked all of them, if I can remember correctly. All of them were the same, selling bots to people, but not on villavu. I finally got SIMBA to run and then tried to run a script, but it won't run because I was dumb enough to grab a script from the outdated section xD, I browsed the forum a bit more and I ended upin the RS3 help and tutorials section of the forum. There I saw the RS3 Help tab, but then after I scrolled down before clicking the RS3 Help button, I saw 'RS3 Beginner Scripting Tutorials', I was shocked because 'this forum actually teaches anyone how to make the scripts that are posted in the forum' I got excited so I forgot about trying to run the outdated script I was trying to run and got myself into browsing the beginner's tutorial section. There, I saw The Mayor's 'All-In-One RS3 and SRL6 Scripting Tutorial!' and 'Simplistic Beginners Guide To RS3 Scripting'. After that, I finally was able to notice that the script I had was from the outdated section of the forum…After slamming my head countless times on the desk, I ran a bunch of scripts and saw how they worked which fascinated me because I botted on the Ragnarok before, but I never saw what the bot sees and the mouse movement that it makes while it's running. After that, I started to write my first script one step at a time. (I hope that didn't bore anyone to death:p)

In case you're all wondering on what statement to leave below, I'd rather you leave constructive criticisms rather than say that it's good enough but if you really think that the script is good, I thank you in advance. If you check out the scripts I have published in the public, they don't get too much feedback/suggestion other than people posting bugs, and most of the bugs were their fault for not following instructions or RAM problems.:p So please, do tell me what I did wrong or leave any suggestions.

Quick mentions:
The Mayor - For his easy to understand tutorials for beginners.
Janilabo - For the encouragement.
Taric - For more encouragement.
The SRL Community - For simply existing.

Have a good one everybody!

-Renz



Please show us one (or multiple) of your scripts.
program RenzanitySafeCracker;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.simba}
{$i srl-6/lib/misc/srlplayerform.simba}

////////////////////////////////////////////////////////////////////////////////
///////////////////******************************************///////////////////
//******************Special thanks to The Mayor's Tutorials!******************//
//*And ofcourse to all of the people who've been scripting waaaaay before me!*//
//***********Thank you everyone for providing such helpful scripts!***********//
////////////********************************************************////////////
////////////////////////////////////////////////////////////////////////////////

var
startXp, sapphireDTM, emeraldDTM, rubyDTM, sCount, eCount, rCount, BreaksTaken: integer;
craftXP: double;
BreakTimer, ReloadTimer, ScriptTimer: TTimeMarker;
device, toCut, heal: boolean;
path: array [0..4] of TPointArray;

procedure initPlayerForm();
begin
with playerForm do
begin
name := 'Renzanity Safe Cracker';
scriptHelpThread := 'https://villavu.com/forum/showthread.php?t=112952';

editBoxLabels := ['World'];
editBoxDefaults := ['-1'];
editBoxHints := ['Enter any world you want to go, -1 to just make it press play, 0 for random worlds'];

checkBoxLabels := ['Display Debug', 'Use stethoscope', 'Cut Gems', 'Heal with food'];
checkBoxDefaults := ['False', 'False', 'False', 'False'];
checkBoxHints := ['', '', '', 'Check this box if you want to heal using food, leave it unchecked if you want to heal in the Taverley bank.'];
end;
end;
procedure declarePlayers();
var
i: integer;
begin
players.setup(playerForm.players); //Loads the SPF players from Rafiki's SRL Player Manager
currentPlayer := 0; // Player to use first
//Sets player attributes based on the settings from the form
for i := 0 to high(players) do
with players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]);

booleans[0] := strToBool(playerForm.players[i].settings[1]);
booleans[1] := strToBool(playerForm.players[i].settings[2]);
booleans[2] := strToBool(playerForm.players[i].settings[3]);
booleans[3] := strToBool(playerForm.players[i].settings[4]);

world := integers[0];

if not booleans[0] then
disableSRLDebug := true;
if booleans[1] then
device := true;
if booleans[2] then
toCut := true;
if booleans[3] then
heal := true;
end;
end;
{*Antiban*}
procedure antiBan();
begin
case random(120) of
0..30: begin
writeLn('Initiating Antiban #1..');
pickUpMouse();
wait(randomRange(300, 450));
smallRandomMouse(5 + random(50));
end;
31..60: begin
writeLn('Initiating Antiban #2..');
pickUpMouse();
wait(randomRange(200, 300));
sleepAndMoveMouse(randomRange(1000, 1500));
end;
61..90: begin
writeLn('Initiating Antiban #3..');
sleepAndMoveMouse(randomRange(1000, 1500));
smallRandomMouse(5 + random(50));
wait(randomRange(1000, 2000));
end;
91..120: begin
writeLn('Initiating Antiban #4..');
pickUpMouse();
wait(randomRange(200, 300));
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(1000, 1700));
end;
end;
end;
{*Procedure: findNormalRandoms()*
*Description: Handles spin tickets, ad windows, and click to continue buttons.*
*Credits: The Mayor: "I modified Coh3ns procedure." - The Mayor's GAO*}
procedure findNormalRandoms();
var
x, y, xButton: integer;
p: TPoint;
begin
xButton := DTMFromString('mlwAAAHicY2dgYAhgZWAIgWIfKPZnhYjvAcrvAOIDUAxibwPiQ0D8Z4spw99LSQw/+jjAGMQuF+Ji8GFmZABqxYkZ8WAoAACvTBHu');

exitTreasure();
claimTicket();

if findDTM(xButton, x, y, mainscreen.getBounds()) then
mouse(point(x, y).rand(3), MOUSE_LEFT);

conversationBox.continue(true, true);

freeDTM(xButton);
end;
{*Simple Custom Object Finder Function*}
function renzanityFindObj(hue, sat: extended; W, H, colour, tolerance, clickType: integer; mouseOverText, chooseOptions: array of string): boolean;
var
i, x, y: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit(false);

findColorsSpiralTolerance(x, y, TPA, colour, mainScreen.getBounds(), tolerance, colorSetting(2, hue, sat));

if (length(TPA) < 1) then
exit();

ATPA := TPA.cluster(W, H);
ATPA.filterBetween(0, 5);
ATPA.sortFromSize(25, true);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

for i := 0 to high(ATPA) do
begin
case random(5) of
0..3: missMouse(middleTPA(ATPA[i]), true)
else
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
end;

if isMouseOverText(mouseOverText, 500) then
begin
fastClick(clickType);
if clickType = MOUSE_LEFT then
exit(true);

if chooseOption.select(chooseOptions) then
exit(true)
else
mouse(mainscreen.getBounds().getGaussPoint(), MOUSE_MOVE);
end;
end;
end;
{*Function to detect if the player is still cracking the safe*
*Credits: The Mayor - VEB Miner*}
function isPlayerAnimating(minShift: integer): boolean;
var
shift: integer;
begin
shift := getPixelShiftAverage(mainscreen.playerBox, 150, 70);
result := shift > minShift;
end;
{*SPS Compilation*}
procedure loadResources();
begin
path[0] := [Point(238, 528), Point(237, 570), Point(216, 589)]; {*Path to the Safes*}
path[1] := [Point(215, 586), Point(162, 597)]; {*Path to the Banker in Den*}
path[2] := [Point(158, 599), Point(217, 587)]; {*Path back to the Safes from Den Banker*}
path[3] := [Point(130, 170), Point(151, 207), Point(141, 250), Point(118, 280)]; {*Path to the Bank to Heal*}
path[4] := [Point(117, 285), Point(141, 251), Point(151, 212), Point(196, 171)]; {*Path back to the trapdoor*}

sapphireDTM := DTMFromString('mggAAAHicY2NgYIhlYmDwB+IIIE4E4mQgTgLiKEYGhmggToLiSCAOAWIeviigLiYMLMeAHTDiwBAAAPdBBQs=');
emeraldDTM := DTMFromString('mggAAAHicY2NgYGhjYmCoBOIGJgi7F4qjGSE4CYoTgDgMiHmi+IG6mDCwHAN2wIgDQwAAakIGCw==');
rubyDTM := DTMFromString('mggAAAHicY2NgYIhhYmDwB+JQIE4A4mQoXsLIwLAIiFcC8SogXgjEc4E4gJ8bqIsJA8sxYAeMODAEAACOlwau');

SPS.setup('safeCracker', RUNESCAPE_OTHER); {*Used Ancrath's SPS Map*}
end;
{*Free DTMs*}
procedure freeTheDTMs();
begin
freeDTMs([sapphireDTM, emeraldDTM, rubyDTM]);
end;
{*Gem counter*}
procedure gemCount();
begin
sCount := (sCount + tabBackPack.countDTM(sapphireDTM));
eCount := (eCount + tabBackpack.countDTM(emeraldDTM));
rCount := (rCount + tabBackpack.countDTM(rubyDTM));
end;
{*To log you in*}
procedure logIn();
begin
if not isLoggedIn() then
begin
players[currentPlayer].login();
loadResources();
wait(randomRange(3000, 5000)); //To wait for the lag to subside
minimap.clickCompass(); //So you're always facing north
mainScreen.setAngle(MS_ANGLE_HIGH); //Sets your angle to the highest possible angle
mainScreen.setZoom(true); //Fixes your zoom..probably pointless because of the clickCompass.
findNormalRandoms(); //Closes all screen interferences
if (not gameTabs.isTabActive(TAB_BACKPACK)) then
gameTabs.openTab(TAB_BACKPACK);
end;
end;
{*To take a break for 1-3mins after 1-2hrs*}
procedure miniBreak();
begin
writeLn('Taking a break..');
case random(50) of
0..35: begin
players[currentPlayer].exitToLobby();
scriptTimer.pause();
wait(randomRange(62000, 160500)); //Edit this part if you want to change how long the break should be
inc(BreaksTaken);
loadResources(); //Default = 1min to 3min range
BreakTimer.reset();
logIn();
ScriptTimer.start();
BreakTimer.start();
end;
36..50: begin
players[currentPlayer].logout();
scriptTimer.pause();
wait(randomRange(160500, 310500)); //Edit this part if you want to change how long the break should be
inc(BreaksTaken); //Default = 3min to 5min range
BreakTimer.reset();
logIn();
ScriptTimer.start();
BreakTimer.start();
end;
end;
end;
{*To reload the client after 6hrs*}
procedure reloadSmart();
begin
writeLn('Reached 6hrs of runtime..restarting SMART..');
wait(randomRange(500, 800));
writeLn('Waiting for 5 mins to reload..');
scriptTimer.pause();
smartReloadClient(284231);
inc(BreaksTaken);
ReloadTimer.reset();
logIn();
ScriptTimer.start();
ReloadTimer.start();
end;
{*******************************************************************************
******************** CODE FOR THE SCRIPT STARTS HERE ********************
*******************************************************************************}

{*Taverley lodestone*}
procedure lodeTav();
begin
if (not isLoggedIn()) or (tabBackPack.isFull()) then
exit;

findNormalRandoms();
writeLn('Using Taverley lodestone..');
lodestoneScreen.teleportTo(LOCATION_TAVERLEY);
wait(randomRange(16800, 18000)); //To wait for the screen to load..
end;
{*Progress Report*}
procedure pRep();
var
time, currentXp, xpPH, craftXpPH, sPH, ePH, rPH: integer;
sC, sCPH: double;
begin
time := ScriptTimer.getTime();
currentXp := (chatBox.getXpBar() - startXp);
xpPH := round((currentXp * 60) / (time / 60000));
sC := (currentXp / 70);
sCPH := round((sC * 60) / (time / 60000));
sPH := round((sCount * 60) / (time / 60000));
ePH := round((eCount * 60) / (time / 60000));
rPH := round((rCount * 60) / (time / 60000));
craftXpPH := round((craftXP * 60) / (time / 60000));

clearDebug();
writeLn('v1.4'); //Progress report in the debug
writeLn('/=======================================\');
writeLn('|========Renzanity Safe Cracker=========|');
writeLn(PadR('| Time Ran: ' + msToTime(time, TIME_SHORT), 40) + '|');
writeLn(PadR('| No. of breaks taken: ' + intToStr(breaksTaken), 40) + '|');
writeLn(PadR('| No. of safes cracked: ' + floatToStr(sC), 40) + '|');
writeLn(PadR('| Safes cracked/hr: ' + floatToStr(sCPH), 40) + '|');
writeLn(PadR('| Thieving xp: ' + intToStr(currentXp) + ' xp', 40) + '|');
writeLn(PadR('| Thieving xp/hr: ' + intToStr(xpPH) + ' xp', 40) + '|');
if toCut then
begin
writeLn(PadR('| Crafting xp: ' + floatToStr(craftXP) + ' xp', 40) + '|');
writeLn(PadR('| Crafting xp/hr: ' + intToStr(craftXpPH) + ' xp', 40) + '|');
end;
writeLn(PadR('| Sapphire Count: ' + intToStr(sCount) + ' pcs' + ' ~ S/hr: ' + intToStr(sPH) + ' pcs', 40) + '|');
writeLn(PadR('| Emerald Count: ' + intToStr(eCount) + ' pcs' + ' ~ E/hr: ' + intToStr(ePH) + ' pcs', 40) + '|');
writeLn(PadR('| Ruby Count: ' + intToStr(rCount) + ' pcs' + ' ~ R/hr: ' + intToStr(rPH) + ' pcs', 40) + '|');
writeLn('\=======================================/');
end;
{*To cut the gems*}
procedure cutGems();
begin
if (not isLoggedIn()) or (tabBackPack.count() < 1) then
exit;

findNormalRandoms();
wait(randomRange(800, 1000));
writeLn('Going to cut gems now..');
begin
typeByte(VK_1); //Place any gem on the actionbar tab1
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
wait(randomRange(500, 1000));
until not progressScreen.isOpen();
end;
end;
wait(randomRange(300, 500));
begin
typeByte(VK_2); //Place any gem on the actionbar tab2
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
wait(randomRange(500, 1000));
until not progressScreen.isOpen();
end;
end;
wait(randomRange(300, 500));
begin
typeByte(VK_3); //Place any gem on the actionbar tab3
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
wait(randomRange(500, 1000));
until not progressScreen.isOpen();
end;
end;
wait(randomRange(300, 500));
{*Crafting xp counter*}
craftXP := ((sCount * 50) + (eCount * 67.5) + (rCount * 85));
end;
{*To heal with food from Den banker*}
procedure healFood();
begin
if (not isLoggedIn()) or (actionBar.getHPPercent() >= 90) then
exit;

findNormalRandoms();
pRep();
wait(randomRange(500, 800));
SPS.walkPath(path[1]);
case random(10) of
0..7: begin
writeLn('Looking for the Emerald Banker');
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_LEFT, ['ank'], ['']) then
begin
smallRandomMouse(5 + random(50));
if bankScreen.isOpen(3000) then
begin
writeLn('Withdrawing food..');
bankScreen.clickButton(BANK_BUTTON_PRESET_2);
repeat
writeLn('Eating..');
typeByteWait(VK_4, 50 + random(70));
wait(randomRange(100, 400));
until (actionBar.getHPPercent() = 100);
if not tabBackPack.isEmpty() then
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_LEFT, ['ank'], ['']) then
begin
smallRandomMouse(5 + random(50));
smartImage.clearArea(mainScreen.getBounds());
if bankScreen.isOpen(3000) then
if device then
begin
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
pickUpMouse();
end else
begin
repeat
wait(randomRange(500, 800));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
end;
wait(randomRange(300, 500));
SPS.walkPath(path[2]);
end;
until bankScreen.isOpen(5000);
end;
end;
until bankScreen.isOpen(5000);
end;
8..10: begin
writeLn('Looking for the Emerald Banker');
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_RIGHT, ['ank'], ['ank']) then
begin
smallRandomMouse(5 + random(50));
smartImage.clearArea(mainScreen.getBounds());
if bankScreen.isOpen(3000) then
begin
writeLn('Withdrawing food..');
bankScreen.clickButton(BANK_BUTTON_PRESET_2);
repeat
writeLn('Eating..');
typeByteWait(VK_4, 50 + random(70));
wait(randomRange(100, 400));
until (actionBar.getHPPercent() = 100);
if not tabBackPack.isEmpty() then
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_RIGHT, ['ank'], ['ank']) then
begin
smallRandomMouse(10 + random(50));
if bankScreen.isOpen(3000) then
if device then
begin
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
pickUpMouse();
end else
begin
repeat
wait(randomRange(500, 800));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
end;
wait(randomRange(300, 500));
SPS.walkPath(path[2]);
end;
until bankScreen.isOpen(3000);
end;
end;
until bankScreen.isOpen(3000);
end;
end;
end;
{*To heal in Taverley Bank*
*Part of the code came from Ancrath's Safe Cracker script*}
procedure healBank();
var
x, y: integer;
tDoor: TBox;
begin
if (not isLoggedIn()) or (actionBar.getHPPercent() >= 90) then
exit;

lodeTav();
findNormalRandoms();
SPS.walkPath(path[3]);
repeat
antiBan();
findNormalRandoms();
until (actionBar.getHPPercent() = 100);
SPS.walkPath(path[4]);

writeLn('Finding the Den Entrance..');
renzanityFindObj(0.06, 0.65, 8, 8, 3094656, 5, MOUSE_NONE, [''], ['']);
smartImage.clearArea(mainScreen.getBounds());
wait(randomRange(200, 500));
getMousePos(x, y);
tDoor := [x-23, y-28, x-17, y-22];
mouseBox(tDoor);
wait(randomRange(500, 800));
if isMouseOverText(['rapdoor']) then
case random(10) of
0..5: begin
mouseBox(tDoor, MOUSE_LEFT);
smallRandomMouse(5 + random(50));
end;
6..10: begin
mouseBox(tDoor, MOUSE_RIGHT);
if chooseOption.isOpen() then
begin
chooseOption.select(['pen']);
smallRandomMouse(5 + random(50));
end;
end;
end;
wait(randomRange(5000, 7500));
SPS.walkPath(path[0]);
end;
{*To find banker and bank*}
procedure bank();
begin
if (not isLoggedIn()) or (tabBackPack.isEmpty()) then
exit;

findNormalRandoms();
pRep();
SPS.walkPath(path[1]);
case random(10) of
0..7: begin
writeLn('Looking for the Emerald Banker');
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_LEFT, ['ank'], ['']) then
begin
smallRandomMouse(5 + random(50));
smartImage.clearArea(mainScreen.getBounds());
end;
until bankScreen.isOpen(3000);
if device then
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
end;
pickUpMouse();
SPS.walkPath(path[2]);
end else
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
repeat
wait(randomRange(1000, 1500));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
SPS.walkPath(path[2]);
end;
end;
end;
8..10: begin
writeLn('Looking for the Emerald Banker');
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_RIGHT, ['ank'], ['ank']) then
begin
smallRandomMouse(5 + random(50));
smartImage.clearArea(mainScreen.getBounds());
end;
until bankScreen.isOpen(3000);
if device then
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
end;
pickUpMouse();
SPS.walkPath(path[2]);
end else
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
repeat
wait(randomRange(1000, 1500));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
SPS.walkPath(path[2]);
end;
end;
end;
end;
end;
{*To crack the safe*}
procedure crack();
begin
if not isLoggedIn() then
exit;

findNormalRandoms();
if tabBackPack.isFull() then
begin
gemCount();
wait(randomRange(300, 500));
pRep();
if toCut then
begin
cutGems();
wait(randomRange(500, 800));
bank();
end else bank();
end;

if (actionBar.getHPPercent() <= 25) then
if heal then
begin
if toCut then
begin
cutGems();
bank();
healFood();
end else
begin
bank();
healFood();
end;
end else
begin
if toCut then
begin
cutGems();
bank();
healBank();
end else
begin
bank();
healBank();
end;
end;

if not isPlayerAnimating(140) then
case random(50) of
0..47: begin
writeLn('Finding safes..');
if renzanityFindObj(0.08, 0.14, 10, 10, 4083556, 7, MOUSE_LEFT, ['afe'], ['']) then
begin
case random(10) of
0..7: smallRandomMouse(5 + random(50));
8..10: begin
fastClick(MOUSE_LEFT);
smallRandomMouse(5 + random(50));
end;
end;
writeLn('Cracking the safe now..');
pRep();
smartImage.clearArea(mainScreen.getBounds());
end else SPS.walkPath(path[2]);
end;
48..50: begin
writeLn('Finding safes..');
if renzanityFindObj(0.08, 0.14, 10, 10, 4083556, 7, MOUSE_RIGHT, ['afe'], ['rack']) then
begin
smallRandomMouse(5 + random(50));
writeLn('Cracking the safe now..');
pRep();
smartImage.clearArea(mainScreen.getBounds());
end else SPS.walkPath(path[2]);
end;
end;
end;
{*Setup*}
begin
clearDebug(); //To clear the debug box
smartEnableDrawing := true; //To enable us to have that cool proggy
smartShowConsole := false; //To get rid of that pesky DoS window
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
exit;
ScriptTimer.start();
declarePlayers();
addOnTerminate('freeTheDTMs');
disableIPScreenshots := true;
disableSRLLog := true;
setupSRL();
mouseSpeed := random(30, 50); //Randomized mouse speed for a more human-like action
loadResources();
logIn(); //Logs you in when you're logged out
startXp := chatbox.getXpBar(); //Gets your xp while running the script
BreakTimer.start();
ReloadTimer.start();

{*Mainloop*}
repeat
crack();
//Edit this part if you want to change how long before you take a break
if breakTimer.getTime() >= (randomRange(3655000, 7203500)) then
miniBreak(); //Edit this part if you want to change how long before you reset your SMART
if reloadTimer.getTime() >= (randomRange(21600000, 23400000)) then
reloadSmart();
until not isLoggedIn();
end.

Janilabo

2015-05-05 06:38:25

Hmmmm well, you clearly have some programming knowledge - from Pascal at least. :p

Anyways, I gave you a YES-vote simply because:
1. You have been pretty active in the scripting scene.
2. You are also actively posting
3. You are mature and also got the positive attitude which is a big +
4. Your scripts are cleaner than plenty of others seen around the community (you use standards, comments and credits)

I think you deserve to be a Member of this community, so good luck with the application process!
We will see the community decision within next couple weeks (in or not). :)

cosmasjdz

2015-05-05 09:57:24

Active, decent scripts…Yes.

3Garrett3

2015-05-05 10:17:48

I'm just looking the script over, the 4 pros that Janilabo posted are definitely on my list as well. I have a comment for your script though: Why so much redundant code? You've got entire functions that are two case statements. One statement uses left click on the first line and one uses right click on the first line. Then you copy paste the same code for both cases. Instead of:


procedure bank();
begin
if (not isLoggedIn()) or (tabBackPack.isEmpty()) then
exit;

findNormalRandoms();
pRep();
SPS.walkPath(path[1]);
case random(10) of
0..7: begin
writeLn('Looking for the Emerald Banker');
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_LEFT, ['ank'], ['']) then
begin
smallRandomMouse(5 + random(50));
smartImage.clearArea(mainScreen.getBounds());
end;
until bankScreen.isOpen(3000);
if device then
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
end;
pickUpMouse();
SPS.walkPath(path[2]);
end else
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
repeat
wait(randomRange(1000, 1500));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
SPS.walkPath(path[2]);
end;
end;
end;
8..10: begin
writeLn('Looking for the Emerald Banker');
repeat
if renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_RIGHT, ['ank'], ['ank']) then
begin
smallRandomMouse(5 + random(50));
smartImage.clearArea(mainScreen.getBounds());
end;
until bankScreen.isOpen(3000);
if device then
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
end;
pickUpMouse();
SPS.walkPath(path[2]);
end else
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
repeat
wait(randomRange(1000, 1500));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
SPS.walkPath(path[2]);
end;
end;
end;
end;
end;

You could have something like:


procedure bank();
begin
if (not isLoggedIn()) or (tabBackPack.isEmpty()) then
exit;

findNormalRandoms();
pRep();
SPS.walkPath(path[1]);
writeLn('Looking for the Emerald Banker');
repeat
case random(10) of
0..7: renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_LEFT, ['ank'], ['']);
8..10: renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_RIGHT, ['ank'], ['ank']) then
end;
until bankScreen.isOpen(3000);

// Pretend I fixed the indent, writing this in browser

if device then
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
end;
pickUpMouse();
SPS.walkPath(path[2]);
end else
begin
if bankScreen.isOpen(10000) then
begin
writeLn('Depositting loot..');
repeat
wait(randomRange(1000, 1500));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
SPS.walkPath(path[2]);
end;
end;
end;
end;

You could even make it easier by having the "clickType" that you use in your object finder, you would just set that in a case and have the rest of the script run normally (having a chooseoption if you're clicking right I suppose is required). It would also be something to consider using a function for such a procedure, because it gives you access to another failsafe (ie if not findBank then doFailsafe()). It will help you when making more complicated scripts to ensure you have plenty of failsafes.

tls recently bumped a thread here indicating a lot of reasons why members would vote no on a thread. What I've pointed out above is point #4 (inefficient code) on the list.

I'm also pretty sure you have a healing feature which does the same as the banking feature? Quickly looking at it, it uses the same writeLN and looks for the bank. So I don't know why you exactly have the same function when you could just call the bank opening function and then do whatever once it's open. You don't need to reinvent the wheel when opening the bank.

In terms of usability, about 1/3 of the way down the script you have a comment saying "Edit this to change how long you want a break for". It really should be set up at the top of your script in a constant. The user should not have to scroll through the whole script to determine if there are any parts they should change, they should have all their options clearly presented at the top of the script.

I'm now working my way at the top of the script apparently: In your FindNormalRandoms function you have credited Mayor's GAO script, but SRL has a few features other than that. We have closeAd() or something along those lines that will close all popup windows, and that's basically all you'd want right? I don't know what else gets in the way other than claiming a ticket maybe? Even then I don't know if those exist anymore.

You also have a 6 hour SMART reload, but that's handled by SRL as well. If you're worried about resetting variables I'd suggest putting them in your login function, it would be more of a "playerSetup" function than a login function but I don't see anything wrong with that. You may as well use SRL functions when you can.

That's all from me I think. Hopefully some of that wall of text was useful. As for my vote, I'm undecided and I'll wait to make sure I didn't miss anything or be overly critical of anything. You're active and have released many scripts, but like I mentioned before there are a few concerning points that I'm not completely over. I'm an old fart though so who knows what recent members will vote.

The Mayor

2015-05-05 10:55:10

If you can put this in a for..to..do loop you will have my vote ;)


begin
typeByte(VK_1); //Place any gem on the actionbar tab1
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
wait(randomRange(500, 1000));
until not progressScreen.isOpen();
end;
end;
wait(randomRange(300, 500));
begin
typeByte(VK_2); //Place any gem on the actionbar tab2
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
wait(randomRange(500, 1000));
until not progressScreen.isOpen();
end;
end;
wait(randomRange(300, 500));
begin
typeByte(VK_3); //Place any gem on the actionbar tab3
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
wait(randomRange(500, 1000));
until not progressScreen.isOpen();
end;
end;

And Garrett is right, that procedure from GAO is outdated (I think GAO is in outdated section lel). Use closePopup(); https://github.com/SRL/SRL-6/blob/master/lib/misc/antiban.simba#L719

But @Garrett; I'm not sure if you know the 6h logout is redundant now as Jagex removed it. I think you can stay logged in 24h now, so force reloading might be a good strategy.

Ross

2015-05-05 11:43:03

Active, lots of scripts, gave me an account to use for script testing, nice guy.

However, your objectFinder is a generic one that's been used in many scripts after I believe @The Mayor popularized it. As a requirement for members there needs to be an understanding op TPAs and ATPAs (see section "What do we Look For? - Definite" here) that was unfortunately rendered useless by this function. You will have my vote if you can prove your understanding of them by commenting each line (regarding ATPAs) with what it means/does in the context of the function.

3Garrett3

2015-05-05 11:45:05

From: The Mayor

But @Garrett; I'm not sure if you know the 6h logout is redundant now as Jagex removed it. I think you can stay logged in 24h now, so force reloading might be a good strategy.


Oh right I forgot how to RS. My bad.

The Mayor

2015-05-05 11:57:16

From: 3Garrett3
Oh right I forgot how to RS. My bad.


I haven't experienced it myself, it's just what I heard. I've barely logged in since the 6h limit got removed, let alone played > 6h :p

Turpinator

2015-05-05 12:21:58

{*Simple Custom Object Finder Function*}
function renzanityFindObj(hue, sat: extended; W, H, colour, tolerance, clickType: integer; mouseOverText, chooseOptions: array of string): boolean;
var
i, x, y: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit(false);

findColorsSpiralTolerance(x, y, TPA, colour, mainScreen.getBounds(), tolerance, colorSetting(2, hue, sat));

if (length(TPA) < 1) then
exit();

ATPA := TPA.cluster(W, H);
ATPA.filterBetween(0, 5);
ATPA.sortFromSize(25, true);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

for i := 0 to high(ATPA) do
begin
case random(5) of
0..3: missMouse(middleTPA(ATPA[i]), true)
else
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
end;

if isMouseOverText(mouseOverText, 500) then
begin
fastClick(clickType);
if clickType = MOUSE_LEFT then
exit(true);

if chooseOption.select(chooseOptions) then
exit(true)
else
mouse(mainscreen.getBounds().getGaussPoint(), MOUSE_MOVE);
end;
end;
end;

Hmm. The params of this seem a little redundant. For example… ClickType, ANNND chooseoption text?
If its a right click, wouldnt you need chooseoption? (i guess if youre prepping for an action, you could right click but not select).
But the main part that caught my attention was the required use of the chooseoption text even if youre left clicking.

I like the check at the beginning to ensure youre logged in, good.
But… theres a few ways you could make this more computationally efficient without changing the output of the func. on a quick inspection i can think of 2 right now. Find one and you have my vote. (and if you find one that i didnt notice, extra props)

(also, props for using cluster and not TPA.toATPA(w,h); or whatever people seem to use for no apparent reason.)

CynicRus

2015-05-05 15:02:01

Yes from me.

Renzanity

2015-05-05 20:01:32

Thank you for all the comments! I'm really happy that I decided to submit an application, for I received a bunch of advice and challenges.

As for the conditions given to me:


@3Garret3
[SPOILER=Preview]
I followed your advice and updated the findNormalRandoms procedure I had.

procedure findNormalRandoms();
begin
exitTreasure();
claimTicket();
closePopUp();
conversationBox.continue(true, true);
end;
And shortened the healFood() and miniBreak() procedures just like what you did with the bank() procedure:

procedure miniBreak();
begin
writeLn('Taking a break..');
case random(50) of
0..35: players[currentPlayer].exitToLobby();
36..50: players[currentPlayer].logout();
end;
scriptTimer.pause();
wait(randomRange(breakMinL, breakMaxL));
inc(BreaksTaken);
loadResources();
BreakTimer.reset();
logIn();
ScriptTimer.start();
BreakTimer.start();
end;

{*Other code*}

procedure healFood();
begin
if (not isLoggedIn()) or (actionBar.getHPPercent() >= 90) then
exit;

findNormalRandoms();
pRep();
wait(randomRange(500, 800));
SPS.walkPath(path[1]);
writeLn('Looking for the Emerald Banker');
repeat
case random(10) of
0..7: renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_LEFT, ['ank'], ['']);
8..10: renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_RIGHT, ['ank'], ['ank']);
end;
until bankScreen.isOpen(3000);
smallRandomMouse(5 + random(50));
writeLn('Withdrawing food..');
bankScreen.clickButton(BANK_BUTTON_PRESET_2);
repeat
writeLn('Eating..');
typeByteWait(VK_4, 50 + random(70));
wait(randomRange(100, 400));
until (actionBar.getHPPercent() = 100);
if tabBackPack.count() > 1 then
begin
repeat //To deposit left over food
case random(10) of
0..7: renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_LEFT, ['ank'], ['']);
8..10: renzanityFindObj(0.26, 0.59, 4, 10, 3496520, 23, MOUSE_RIGHT, ['ank'], ['ank']);
end;
until bankScreen.isOpen(3000);
smallRandomMouse(5 + random(50));
smartImage.clearArea(mainScreen.getBounds());
if device then
begin
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
pickUpMouse();
end else
begin
repeat
wait(randomRange(500, 800));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
until bankScreen.isPackEmpty();
pickUpMouse();
bankScreen.close();
end;
wait(randomRange(300, 500));
SPS.walkPath(path[2]);
end;
end;
And also about the looooooong scroll just to change the breaktimer countdown.
EDIT: I'll look for a way for me to put this into my playerForm soon.:p All tidied up into minutes not ms.

const
{*Edit this part if you want to change how long before you take a break*}
breakMinT = 3655000; //Minimum time (Default = 1hr)
breakMaxT = 7203500; //Maximum time (Default = 2hrs)

{*Edit this part if you want to change how long the break should be*}
breakMinL = 62000; //Minimum time (Default = 1min)
breakMaxL = 160500; //Minimum time (Default = 3mins)

{*Edit this part if you want to change how long before you reset your SMART*}
reloadMinT = 21600000; //Minimum time (Default = 6hrs)
reloadMaxT = 36000000; //Maximum time (Default = 10hrs)

{*Edit this if you want to change how long before the script initiates the reloadSmart procedure*}
reloadMinL = 300000; //Minimum time (Default = 5mins)
reloadMaxL = 600000; //Minimum time (Default = 10mins)

Hooray for my script shortening by 100lines! xD
[/SPOILER]



@The Mayor
[SPOILER=Preview]
I tested this out and I'm glad to say it worked! Hooray for another shorter procedure!

procedure cutGems();
var
i: integer;
begin
if (not isLoggedIn()) or (tabBackPack.count() < 1) then
exit;

findNormalRandoms();
wait(randomRange(800, 1000));
writeLn('Going to cut gems now..');
for i := 1 to 3 do
begin
typeSend(intToStr(i), false); //Place any gem on the actionbar tabs 1, 2 and 3
wait(randomRange(300, 500));
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
wait(randomRange(500, 1000));
until not progressScreen.isOpen();
end;
end;
wait(randomRange(300, 500));
{*Crafting xp counter*}
craftXP := ((sCount * 50) + (eCount * 67.5) + (rCount * 85));
end;
[/SPOILER]



@Ross
[SPOILER=Preview]
I hope I got the right understanding of each:p

ATPA := TPA.cluster(W, H); //Grabs and merges the points found within the set params to a TBox
ATPA.filterBetween(0, 5); //If the length of the TPA's in the ATPA is between the minimum and maximum lengths you have set, they will be removed
ATPA.sortFromSize(25, true); //Sorts the obj's found from the size indicated, if set to 'true' then it sorts the closests first
ATPA.sortFromMidPoint(mainscreen.playerPoint); //Sorts the colors found with the player as the focal point
[/SPOILER]



@Turpinator
[SPOILER=Preview]
I don't understand this statement:
From: Turpinator

But the main part that caught my attention was the required use of the chooseoption text even if youre left clicking.

Did you mean I should remove the if statement for the left click like so?:

for i := 0 to high(ATPA) do
begin
case random(5) of
0..3: missMouse(middleTPA(ATPA[i]), true)
else
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
end;

if isMouseOverText(mouseOverText, 500) then
begin
fastClick(clickType);
if clickType = MOUSE_RIGHT then
chooseOption.select(chooseOptions);
exit(true);
end;
end;

Or perhaps you meant when executing the findObj function you thought you're still required to type in a chooseOption text?

If you could please enlighten me some more, I'm still getting used to reading code efficiency, as you can see.:p
[/SPOILER]


I hope I didn't miss out anything, if I did please guide me accordingly. Thank you.

P.S.
Thank you for the Yes votes.:D -Sends virtual fist bumps your way-

Ross

2015-05-05 20:47:00

From: Renzanity
Thank you for all the comments! I'm really happy that I decided to submit an application, for I received a bunch of advice and challenges.

As for the conditions given to me:









I hope I didn't miss out anything, if I did please guide me accordingly. Thank you.

P.S.
Thank you for the Yes votes.:D -Sends virtual fist bumps your way-


Well shit man. YES.

Turpinator

2015-05-05 21:24:41

From: Renzanity
Thank you for all the comments! I'm really happy that I decided to submit an application, for I received a bunch of advice and challenges.

As for the conditions given to me:

I hope I didn't miss out anything, if I did please guide me accordingly. Thank you.

P.S.
Thank you for the Yes votes.:D -Sends virtual fist bumps your way-


Wow, spoliers dont copy. But yes. That is correct. (basically just make that parameter be a default [''] or something)

hint: one of mine relates to something in ross's part.

Also, thats not exactly what cluster does. kind of. the part that threw me off was the use of a tbox.

rj

2015-05-05 21:30:48

yes

3Garrett3

2015-05-05 21:53:37

Well I'm sold. YES

Clarity

2015-05-05 23:34:43

I had similar concerns as Garrett but you've definitely shown a good understanding of SRL-6 in response, along with fantastic forum activity and awesome attitude. Yes from me.

The Mayor

2015-05-06 07:07:48

Yep you answered my question good ;) Not too sure about your answers to the TPA/ATPA stuff though :p

Yes from me.

Renzanity

2015-05-06 07:46:12

From: Turpinator
Also, thats not exactly what cluster does. kind of. the part that threw me off was the use of a tbox.

From: The Mayor
Not too sure about your answers to the TPA/ATPA stuff though :p


I think this was the odd one out of the bunch…:

ATPA := TPA.cluster(W, H); //This separates points into their own TPAs if they fall from the set bounds 'W' and 'H'
//Basically making smaller boxes out of the big TPA found

And sir Turp, I'm sorry if I'm taking too long to answer your question. I really don't get it as of now, it's okay to vote no now. I'll be sure to answer you even when the application's over.:)

Turpinator

2015-05-06 10:53:16

From: Renzanity
I think this was the odd one out of the bunch…:

ATPA := TPA.cluster(W, H); //This separates points into their own TPAs if they fall from the set bounds 'W' and 'H'
//Basically making smaller boxes out of the big TPA found

And sir Turp, I'm sorry if I'm taking too long to answer your question. I really don't get it as of now, it's okay to vote no now. I'll be sure to answer you even when the application's over.:)


Nah, its cool. the 2 things i was looking at…
– you first sorted by size (from 25), and then sorted from midpoint.
– you used FindColorsTolerance(), and then checked the length of the TPA to ensure it wasnt empty. You could have just done If not FindColorsTolerance() then exit(false); and continued on.

Also, you use findcolorsSpiralTolerance() and then split it into an ATPA, sooooo… you re-arrange it anyway. (and according to @Olly; spiral is slower than non spiral. [probably not by much though])

Renzanity

2015-05-06 11:57:08

From: Turpinator
Nah, its cool. the 2 things i was looking at…
– you first sorted by size (from 25), and then sorted from midpoint.
– you used FindColorsTolerance(), and then checked the length of the TPA to ensure it wasnt empty. You could have just done If not FindColorsTolerance() then exit(false); and continued on.

Also, you use findcolorsSpiralTolerance() and then split it into an ATPA, sooooo… you re-arrange it anyway. (and according to @Olly; spiral is slower than non spiral. [probably not by much though])


Now that you pointed those out, I feel so relieved. Another eye opener and piece of knowledge to store. Thanks a lot, sir.:) -Secretly bro fists you twice-

I re-worked the function according to the points you brought up, shortened my script further by 4 lines.:p

The Mayor

2015-05-06 12:56:42

From: Renzanity
Secretly fists you twice


Hmm not sure what's going on between you and @Turpinator;

Renzanity

2015-05-06 13:01:00

From: The Mayor
Hmm not sure what's going on between you and @Turpinator;


Lmao. xD That just made my day, and it's only 1am where I'm at.

Sirenia

2015-05-07 14:21:42

Missclick, meant to click yes :x

Janilabo

2015-05-07 14:29:50

@Renzanity, poll looks pretty clear at this point! :sasmokin:

Renzanity

2015-05-07 14:43:14

From: Janilabo
@Renzanity, poll looks pretty clear at this point! :sasmokin:

I'm still openly accepting comments for the script's improvement though. :p

Thanks for the votes, guys!

Have a good one!

tls

2015-05-07 15:53:37

While you are an active member of the forums, I don't think you quite have a grasp on the necessary attributes we are looking for in a member.

In my quick glance over your script I noticed several things that should be improved upon:
1. There is a lot of repeated code, you can shorten them with loops.

if toCut then
begin
cutGems();
wait(randomRange(500, 800));
bank();
end else bank();
Look at that code. There are two bank()'s. Why? It could easily be shortened to:

if toCut then
begin
cutGems();
wait(randomRange(500, 800));
end;
bank();
This isn't just for the sake of removing an extra line. It makes more sense and leaves less function calls to debug when you do run into an issue.
2. There are some lapses in logic with your code.
Example: You use a playerform and that is good, multiplayer used to be the cornerstone of this community. BUT you don't properly implement it. In fact there is not apparent switching, it just runs a single player and takes breaks. Also, the global variables device, toCut, and heal NEVER get reset.
3. FAILSAFES!!! Why do so many people just assume that because they write their code in a specific order, it will always execute correctly and in that order? You call cutGems() then immediately bank() without even checking that all the gems were cut. You also just add the XP to the counter without making sure they all finished.
4. SPS. Now I'm a huge fan of projects that simplify and empower scripts. That being said, I would rather see custom walking with radial or ddtms or tpas. That is just because I'm oldschool tho ;)
5. There is a lack of original code. For a ~700 line script you sure do have a lot of copied code(I do see credits tho, which is proper). The majority of original code is control flow, and is quite clunky. I'd like to see you streamline that, and then implement your own code for the color finding and other tasks that prove "knowledge".
6. Custom TPAs/ATPAs. You have none. This made me almost immediately vote no. Then I saw the object finding function and noticed that you don't quite seem to know how to use them. Definitely check out some tutorials, they can be super fast and never miss the right object if you make them correctly.

With all of these problems, I personally don't think you are ready. But this community no longer prides itself in quality, and only cares about activity and personality(which are important factors).

Hoodz

2015-05-07 17:16:15

first of all, im going to vote yes because of your activity and decent knowledge of scripting.

but i have a few tips for you.
1. try to keep your code as clean as possible, make the mainloop very easy without order stuff. I personally like the state mainloop because your script wont (if done properly) get stuck

function getState(): Integer;
begin
if (player not logged in...) then
exit(0);
if (no items in inv and bank not open) then
exit(1);
if (bank not open and items in inv) then
exit(2);
end;

procedure executeState(state: Integer);
begin
case state of
0: login...
1: open bank....
2: craft ....
end;
end;

//////
mainloop
//////

repeat
executeState(getState());
until (false);
again this is just my preference.

2. try to use less "else", why? because i think they bring more repeated code and have a chance to make the script slower. I can give you an example if you want.

3. give vars/constants other names so its easier to identify them (this can be hard, im bad at it too)
example:

sPH, ePH, rPH: integer;
sC, sCPH: double;
i have no idea what they are.


goodluck with the rest of your app!

Renzanity

2015-05-09 12:43:13

From: tls
-snips and reflects on it for a couple of days-


Hi sir tls,

Thank you for letting me know of a few more setbacks on the script. I didn't know it would be better to do the if toCut then that way.

As for the multiplayer, I've been searching and testing a bunch of ways to implement the multiplayer function on my scripts even before reading your comment. And upon reading it, I 'sort of' had a few idea how and will test them out when I finally have a better access to the internet. (I'm running on mobile data for a couple of weeks now)

I've added failsafes for the cutGems() and healBank() procedures since those were the two parts where the script actually gets stuck.

[SPOILER=Cut Gems procedure]
I added a DTM counter at the start of the code so that it would skip the procedure if the following DTMs are not present.

if (not isLoggedIn()) or (tabBackPack.countDTM(sapphireDTM) = 0) or (tabBackpack.countDTM(emeraldDTM) = 0) or (tabBackpack.countDTM(rubyDTM) = 0) then
exit;

I also added a repeat loop on the part of the code that executes the actual cutting. It stops the loop when the following DTMs are not present anymore.

repeat
for i := 1 to 3 do
begin
typeSend(intToStr(i), false); //Place any gem on the actionbar tabs 1, 2 and 3
if productionScreen.isOpen(2000) then
begin
productionScreen.clickStart(true);
if progressScreen.isOpen(2000) then
repeat
antiBan();
until not progressScreen.isOpen(2000);
end;
end;
until (tabBackPack.countDTM(sapphireDTM) = 0) or (tabBackpack.countDTM(emeraldDTM) = 0) or (tabBackpack.countDTM(rubyDTM) = 0); //Failsafe for when there are left over gems
[/SPOILER]
[SPOILER=Heal Bank procedure]

lodeTav();
repeat
SPS.walkPath(path[3]);
antiBan(); //A repeat loop to make sure you do walk to the bank after using the lodestone
until (actionBar.getHPPercent() = 100); //Sometimes it starts to lag after using the lodestone and endss up not going to the bank
[/SPOILER]
From: hoodz
-snip and reflects on it for a couple of days-


Hi sir hoodz,

Thanks for sharing that useful piece of code, I'll work on trying to implement that on my scripts. I could bug you with questions about it in the future, right? Haha.:p

I followed yours and tls' advice and reduced the 'else' in my script.

I tried to make the vars understandable, how's this for a try?:

sappCount, emerCount, rubyCount: integer; //Global var
sappPH, emerPH, rubyPH: integer; //Local var
safes, safesPH: double;

Sorry for the late reply, I thought I'd try out both of your advice so that I'd understand them before I reply. If you think I missed something on this reply, please let me know. And thank you for voting.:)

Have a good one, you two!

Hoodz

2015-05-09 15:04:31

From: Renzanity

Hi sir hoodz,

Thanks for sharing that useful piece of code, I'll work on trying to implement that on my scripts. I could bug you with questions about it in the future, right? Haha.:p

I followed yours and tls' advice and reduced the 'else' in my script.

I tried to make the vars understandable, how's this for a try?:

sappCount, emerCount, rubyCount: integer; //Global var
sappPH, emerPH, rubyPH: integer; //Local var
safes, safesPH: double;

Sorry for the late reply, I thought I'd try out both of your advice so that I'd understand them before I reply. If you think I missed something on this reply, please let me know. And thank you for voting.:)


perfect! sure you can bug me with questions.

Justin

2015-05-19 05:17:33

Accepted.

Congratulations :)