SRL Archive - Archive

GetHyper - SRL Member Application


GetHyper

2015-06-16 12:10:31

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Minimal if I'm honest, started working through 'Learn Python the hard way' as I purchased it not too long ago.


Are you a member of any other communities?
No


Tell us about yourself…
From: GetHyper
24, male from Notts - UK.
Full time job in a prison, outside of work I play 5-a-side, go clay pigeon shooting (got a gun licence), train in kickboxing… oh and drink occasionally.
Purchased a house not too long ago, first time buyer, quite an old one and needs decorating throughout so that is taking a fair bit of my time.

I love watching films, keep trying to update my IMDB list of watched films but it's hard to remember what you have seen!

Haven't played RS in a while and come back to RS3 as I got bored playing WoW. No matter how much I try I always end up coming back to this damn game!



Please show us one (or multiple) of your scripts.
Released this yesterday
https://villavu.com/forum/showthread.php?t=113478

Just released this
https://villavu.com/forum/showthread.php?t=113493&p=1346871#post1346871

Clarity

2015-06-16 12:33:08

Script 1

program HyperFletch;

{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i sps/lib/sps-rs3.simba}
{$i srl-6/lib/misc/srlplayerform.simba}

var
i, x, y, S, C, TO_CUT, logsC, bowsS,
logsPH, bowsPH : integer;
prodScreenT, progScreenT, bankScreenT, tscrt, findBT : TTimeMarker;
TPA : TPointArray;
ATPA : T2DPointArray;

procedure initPlayerForm();
begin
with playerForm do
begin
name := 'HyperFletch';
scriptHelpThread := ' ';
editBoxLabels := ['Number to cut/string', 'QuickKey'];
editBoxDefaults := ['1000', '2'];
comboBoxLabels := ['Action', 'Location', 'Length'];
comboBoxDefaults := ['Cut', 'VarrockWest', 'Long'];
setLength(comboBoxItems, length(comboBoxLabels));
comboBoxItems[0] := ['Cut', 'String'];
comboBoxItems[1] := ['Lumbridge', 'ShantayPass', 'VarrockWest', 'VarrockEast'];
comboBoxItems[2] := ['Long', 'Short'];
end;
end;

procedure declarePlayers();
begin
players.setup(playerForm.players);
currentPlayer := 0;

for i := 0 to high(players) do
with players[i] do

begin
TO_CUT := strToInt(playerForm.players[i].settings[0]); //number to cut
strings[0] := playerForm.players[i].settings[1]; //quickkey
strings[1] := playerForm.players[i].settings[2]; //action
strings[2] := playerForm.players[i].settings[3]; //location
strings[3] := playerForm.players[i].settings[4]; //length
end;
end;

procedure antiban();
begin
case random(100) of
1..10 : hoverSkill(SKILL_FLETCHING);
11 : wait(randomRange(2000, 3500));
25..45 : mouseOffClient(OFF_CLIENT_RANDOM);
41 : pickUpMouse();
99 : wait(randomRange(3000, 4500));
end;
end;

//Chooses product based on user specification
procedure whatLength();
begin
if not isLoggedIn() then
exit();

case (players[currentPlayer].strings[3]) of
'Long' :begin
if toolScreen.isOpen then toolScreen.select('Knife');
prodScreenT.start();
repeat
if productionScreen.isOpen() then productionScreen.selectBox(4);
if productionScreen._getSelectedBox(4) then
productionScreen.clickStart();
until (progressScreen.isOpen) or (prodScreenT.getTime() > 70000);
inc(C);
end;
'Short' :begin
if toolScreen.isOpen then toolScreen.select('Knife');
prodScreenT.start();
repeat
if productionScreen.isOpen() then productionScreen.selectBox(2);
if productionScreen._getSelectedBox(2) then
productionScreen.clickStart();
until (progressScreen.isOpen) or (prodScreenT.getTime() > 70000);
inc(C);
end;
end;
end;

//Find banker in Varrock west bank and clicks to open
procedure findVarWest();
begin
if not isLoggedIn() then
exit;

if not bankScreen.isOpen then

begin

findColorsSpiralTolerance(x, y, TPA, 4663352, mainScreen.getBounds(), 7, colorSetting(2, 0.33, 1.10));

if length(TPA) < 1 then
exit;

ATPA := TPA.toATPA(20, 20);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainScreen.playerPoint);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

if isMouseOverText(['ank', 'anker'], 1000) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;
end;

//Find banker in Varrock east bank and clicks to open
procedure findVarEast();
begin
if not isLoggedIn() then
exit;

if not bankScreen.isOpen then

begin

findColorsSpiralTolerance(x, y, TPA, 5057346, mainScreen.getBounds(), 10, colorSetting(2, 0.45, 0.72));

if length(TPA) < 1 then
exit;

ATPA := TPA.toATPA(20, 20);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainScreen.playerPoint);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

if isMouseOverText(['ank', 'anker'], 1000) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;
end;

//Finds Shantay chest
procedure findShanChest();
begin
if not isLoggedIn() then
exit;

if not bankScreen.isOpen then

begin

findColorsSpiralTolerance(x, y, TPA, 3876917, mainScreen.getBounds(), 3, colorSetting(2, 0.41, 1.06));

if length(TPA) < 1 then
exit;

ATPA := TPA.toATPA(20, 40);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainScreen.playerPoint);

for i := 0 to high(ATPA) do

begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

if isMouseOverText(['hest', 'pen'], 1000) then
begin
fastClick(MOUSE_LEFT);
break();
end;
end;
end;
end;

//Opens the bank/chest and withdraws items
procedure openBanker();
begin
if not isLoggedIn() then
exit;

case (players[currentPlayer].strings[2]) of
'Lumbridge' :begin
if not bankScreen.isOpen() then
bankScreenT.start();
repeat
bankScreen.Open(BANK_CHEST_LUMBRIDGE);
wait(randomRange(100, 300));
until (bankScreen.isOpen) or (findBT.getTime > 10000);
if bankScreen.isOpen then
wait(randomRange(100, 300));
bankScreenT.start();
repeat
bankScreen.clickButton(3);
until (not bankScreen.isOpen()) or (bankScreenT.getTime > 30000);
if (not tabBackpack.isFull()) then
begin
wait(random(500));
if(not tabBackpack.isFull()) then
begin
terminateScript();
end;
end;
end;
'ShantayPass' :begin
findBT.start();
repeat
findShanChest();
wait(randomRange(100, 300));
until (bankScreen.isOpen) or (findBT.getTime > 10000);
if bankScreen.isOpen then
wait(randomRange(100, 300));
bankScreenT.start();
repeat
bankScreen.clickButton(3);
until (not bankScreen.isOpen()) or (bankScreenT.getTime > 30000);
if (not tabBackpack.isFull()) then
begin
wait(random(500));
if(not tabBackpack.isFull()) then
begin
terminateScript();
end;
end;
end;
'VarrockWest' :begin
if not bankScreen.isOpen() then
bankScreenT.start();
repeat
findVarWest();
wait(randomRange(100, 300));
until (bankScreen.isOpen) or (findBT.getTime > 10000);
if bankScreen.isOpen then
wait(randomRange(100, 300));
bankScreenT.start();
repeat
bankScreen.clickButton(3);
until (not bankScreen.isOpen()) or (bankScreenT.getTime > 30000);
if (not tabBackpack.isFull()) then
begin
wait(random(500));
if(not tabBackpack.isFull()) then
begin
terminateScript();
end;
end;
end;
'VarrockEast' :begin
if not bankScreen.isOpen() then
bankScreenT.start();
repeat
findVarEast();
wait(randomRange(100, 300));
until (bankScreen.isOpen) or (findBT.getTime > 10000);
if bankScreen.isOpen then
wait(randomRange(100, 300));
bankScreenT.start();
repeat
bankScreen.clickButton(3);
until (not bankScreen.isOpen()) or (bankScreenT.getTime > 30000);
if (not tabBackpack.isFull()) then
begin
wait(random(500));
if(not tabBackpack.isFull()) then
begin
terminateScript();
end;
end;
end;
end;
end;

//Calls tool/production screen and starts
procedure fletchNow();
begin
if not isLoggedIn() then
exit();

case (players[currentPlayer].strings[1]) of
'Cut' :begin
tscrT.start();
repeat
sendKeys(Players[CurrentPlayer].Strings[0], 30 + Random(30), 30 + Random(30));
wait(200 + random(150));
until (toolScreen.isOpen) or (productionScreen.isOpen) or (tscrT.getTime > 10000);
if toolScreen.isOpen then toolScreen.select('Knife');

whatLength();
end;
'String' :begin
tscrT.start();
repeat
sendKeys(Players[CurrentPlayer].Strings[0], 30 + Random(30), 30 + Random(30));
wait(200 + random(150));
until (productionScreen.isOpen) or (tscrT.getTime > 10000);
if productionScreen.isOpen then
prodScreenT.start();
repeat
productionScreen.clickStart()
until (progressScreen.isOpen) or (prodScreenT.getTime > 10000);
inc(S);
end;
end;
end;

procedure areWeProg();
begin
if not isLoggedIn() then
exit();

if progressScreen.isOpen() then
progScreenT.start();
repeat
wait(randomRange(1000, 1999));
antiban();
until (not progressScreen.isOpen() or (progScreenT.getTime() > 70000));
if not progressScreen.isOpen() then
wait(200 + random(200));
end;

procedure progressReport();
begin
if not isLoggedIn() then
exit;

logsC := C * 28;
bowsS := S * 14;
logsPH := round((logsC * 60) / (getTimeRunning() / 60000));
bowsPH := round((bowsS * 60) / (getTimeRunning() / 60000));

clearDebug();
writeln('#########################################');
writeln('##############HyperFletch################');
writeln('Time Running: ' + timeRunning());
writeln('Bows Strung: ' + intToStr(bowsS) + ' p/h: ' + intToStr(bowsPH));
writeln('Logs Cut: ' + intToStr(logsC) + ' p/h: ' + intToStr(logsPH));

end;

begin
clearDebug();
smartShowConsole := false;
disableSRLDebug := true;
initPlayerForm();
runPlayerForm();
if not playerForm.isScriptReady then
exit();
declarePlayers();
setupSRL();

if not isLoggedIn() then
begin
players[currentPlayer].login();
exitTreasure();
minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
end;

repeat
openBanker();
fletchNow();
areWeProg();
progressReport();
until (not isLoggedIn()) or (TO_CUT = (S * 14)) or (TO_CUT = (C * 28));
writeln('We are done, logging out');
players[currentPlayer].logout();
end.

Script 2

program HyperBar_n_Baller;

{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i sps/lib/sps-rs3.simba}
{$i srl-6/lib/misc/srlplayerform.simba}

{ ______________________________________
|\ \
| \ \
| \ \
| #######################################
| # This is made for lumbridge #
| # Setup preset 1 with; #
| # 9 iron, 18 coal #
\ # Profit is based on buying the ore #
\ # XP is rounded #
\#######################################
}

var
Runs, x, y, i, BARS_TO_DO, PRICE_OF_COAL, PRICE_OF_IRON,
PRICE_OF_CBALL, barsSmelted, ballsMade,
ballP, ironP, coalP, xpGained, xpPerHour, profitMade, profitPerHour : integer;
makeB, openB, openF, makeC : TTimeMarker;
pathToFurnace, pathToChest, TPA : TPointArray;
ATPA: T2DPointArray;
Lumbridge: TSPSArea;

procedure initPlayerForm();
begin
with playerForm do
begin
name := 'HyperBar''n''Baller';
scriptHelpThread := '';
editBoxLabels := ['Bars to do', 'Price of coal', 'Price of iron', 'Price of cball'];
editBoxDefaults := ['1000', '373', '220', '335'];
end;
end;

procedure declarePlayers();
begin
players.setup(playerForm.players);
currentPlayer := 0;

with players[0] do
begin
BARS_TO_DO := strToInt(playerForm.players[0].settings[0]);
PRICE_OF_COAL := strToInt(playerForm.players[0].settings[1]);
PRICE_OF_IRON := strToInt(playerForm.players[0].settings[2]);
PRICE_OF_CBALL := strToInt(playerForm.players[0].settings[3]);
end;
end;

procedure antiban();
begin
case random(100) of
1 : hoverSkill(SKILL_SMITHING);
11 : wait(randomRange(2000, 3500));
25 : mouseOffClient(OFF_CLIENT_RANDOM);
41 : pickUpMouse();
60 : boredHuman();
99 : wait(randomRange(5000, 7500));
end;
end;

procedure findFurnace();
begin
if not isLoggedIn() then
exit;

findColorsSpiralTolerance(x, y, TPA, 5269873, mainScreen.getBounds(), 5, colorSetting(2, 0.28, 0.67));

if length(TPA) < 1 then
exit;

ATPA := TPA.toATPA(20, 20);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainScreen.playerPoint);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

if isMouseOverText(['urnace', 'nace'], 1000) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;

procedure walkToAndUse(toDo: string);
begin
if not isLoggedIn() then
exit();

case toDo of
'bank' :begin
pathToChest := [Point(200, 146), Point(144, 132)];
if Lumbridge.walkPath(pathToChest) then
minimap.waitPlayerMoving();
wait(randomRange(250, 500));
openB.start();
repeat
bankScreen.Open(BANK_CHEST_LUMBRIDGE);
wait(randomRange(500, 800));
if bankScreen.isOpen() then
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
wait(randomRange(500, 800));
until (tabBackpack.isFull()) or (openB.getTime() > 30000);
end;
'furnace' :begin
pathToFurnace := [Point(143, 132), Point(200, 144)];
Lumbridge.walkPath(pathToFurnace);
if Lumbridge.walkPath(pathToFurnace) then
minimap.waitPlayerMoving();
wait(randomRange(250, 500));
findFurnace();
wait(randomRange(500, 800));
if productionScreen.isOpen(5000) then
productionScreen.selectBox(5);
wait(randomRange(300, 500));
productionScreen.clickStart();
wait(randomRange(1500, 2750));
if progressScreen.isOpen() then
makeB.start();
repeat
wait(randomRange(1000, 2500));
antiban();
until (not progressScreen.isOpen()) or (makeB.getTime() > 120000);
if not progressScreen.isOpen() then
findFurnace();
if productionScreen.isOpen(5000) then
productionScreen.clickStart();
wait(randomRange(1500, 2750));
if progressScreen.isOpen() then
makeC.start();
repeat
wait(randomRange(3000, 5500));
antiban();
until (not progressScreen.isOpen()) or (makeC.getTime() > 120000);
end;
end;
end;

procedure progressReport();
begin
barsSmelted := Runs * 9;
ballsMade := Runs * 36;
ballP := ballsMade * PRICE_OF_CBALL;
ironP := barsSmelted * PRICE_OF_IRON;
coalP := ((barsSmelted * PRICE_OF_COAL) * 2);
xpGained := round((barsSmelted * 17) + ((ballsMade / 4) * 25));
xpPerHour := round((xpGained * 60) / (getTimeRunning() / 60000));;
profitMade := (ballP - (ironP + coalP));
profitPerHour := round((profitMade * 60) / (getTimeRunning() / 60000));

clearDebug();
writeln('#########################################');
writeln('############HyperBar n Ball##############');
writeln('Time running: ' + timeRunning());
writeln('Bars smelted: ' + intToStr(barsSmelted));
writeln('Balls made: ' + intToStr(ballsMade));
writeln('XP Gained: ' + intToStr(xpGained));
writeln('XP Gained p/h: ' + intToStr(xpPerHour));
writeln('Profit Made: ' + intToStr(profitMade));
writeln('Profit Made p/h: ' + intToStr(profitPerHour));
end;

//main loop
begin
clearDebug();
smartShowConsole := false;
disableSRLDebug := True;
initPlayerForm();
runPlayerForm();
if not playerForm.isScriptReady then terminateScript();
declarePlayers();
setupSRL();

Lumbridge.setup('LUMBY_SPS_01', RUNESCAPE_OTHER);

exitTreasure();

if not isLoggedIn() then
players[currentPlayer].login() else
wait(randomRange(3000,5000));
writeln('Just getting ready');
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);

repeat
walkToAndUse('bank');
walkToAndUse('furnace');
inc(Runs);
progressReport();
until (Runs = (BARS_TO_DO / 9)) or (not isLoggedIn());
if Runs = (BARS_TO_DO / 9) then
players[currentPlayer].logout();
end.

Camel

2015-06-16 14:01:18

I'm noticing a lot of redundant procedures

For example these three
procedure findVarWest();
begin
if not isLoggedIn() then
exit;

if not bankScreen.isOpen then

begin

findColorsSpiralTolerance(x, y, TPA, 4663352, mainScreen.getBounds(), 7, colorSetting(2, 0.33, 1.10));

if length(TPA) < 1 then
exit;

ATPA := TPA.toATPA(20, 20);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainScreen.playerPoint);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

if isMouseOverText(['ank', 'anker'], 1000) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;
end;

//Find banker in Varrock east bank and clicks to open
procedure findVarEast();
begin
if not isLoggedIn() then
exit;

if not bankScreen.isOpen then

begin

findColorsSpiralTolerance(x, y, TPA, 5057346, mainScreen.getBounds(), 10, colorSetting(2, 0.45, 0.72));

if length(TPA) < 1 then
exit;

ATPA := TPA.toATPA(20, 20);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainScreen.playerPoint);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

if isMouseOverText(['ank', 'anker'], 1000) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;
end;

//Finds Shantay chest
procedure findShanChest();
begin
if not isLoggedIn() then
exit;

if not bankScreen.isOpen then

begin

findColorsSpiralTolerance(x, y, TPA, 3876917, mainScreen.getBounds(), 3, colorSetting(2, 0.41, 1.06));

if length(TPA) < 1 then
exit;

ATPA := TPA.toATPA(20, 40);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainScreen.playerPoint);

for i := 0 to high(ATPA) do

begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

if isMouseOverText(['hest', 'pen'], 1000) then
begin
fastClick(MOUSE_LEFT);
break();
end;
end;
end;
end;

They're all identical besides color parameters. Your code could be reduced by at least 100 lines if you used generalized object finding functions (mainscreen.findobject() would probably work)

Clarity

2015-06-16 15:04:08

From: Camel
They're all identical besides color parameters. Your code could be reduced by at least 100 lines if you used generalized object finding functions (mainscreen.findobject() would probably work)

I do think one of the most important things to demonstrate is custom color searching with specific TPA and ATPA handling, rather than using mainscreen.findObject().

I'd agree with the redundancy, and say that a better solution in my eyes would be a custom function, like hyperFindObject().

Additionally, just a placement note. You can declare the SPS paths during the beginning of the script, rather than assigning the walking paths every time walkToAndUse() is called.

Best of luck, @GetHyper! I shall vote later on.

J_R

2015-06-16 16:05:50

Just a suggestion (I don't think im supposed to vote so I won't), but instead of having 3 redundant long procedures for bank finding at Varrock East, West, and the Shantay Pass I would suggest just trying to use bankscreen.open with the appropriate constant (I know for sure that BANK_CHEST_SHANTAY should work as that's where I run all my bankstanding scripts, I'd try BANK_BOOTH or BANK_NPC_BLUE/GREY, don't remember the color of varrock bankers because I haven't been there in a year, for the 2 varrock ones).

I also agree with Clarity, you could turn one of the three bank finders into a general purpose object finder by making the color a parameter.

GetHyper

2015-06-16 16:17:54

I appreciate the comments and suggestions.
Regardless of the answer I will be sticking around and improving so it's all good.

Will look at the script over the week to see if I can implement what you have said, thanks again.


Also, the shantay chest isn't working at current - or it wasn't earlier and I looked at ashamans bonfire sctipt and that is using a custom colour I believe.

The Mayor

2015-06-17 03:27:51

Standards are a little bit messy in places, and you've only been active for 2 weeks after not being around for 2 years ;) I'm sure if you spend a while longer here and improve your skills you will be a member in no time.

GetHyper

2015-06-17 04:51:52

From: The Mayor
Standards are a little bit messy in places, and you've only been active for 2 weeks after not being around for 2 years ;) I'm sure if you spend a while longer here and improve your skills you will be a member in no time.


To be fair, not sure why I applied - can you just deny it now to stop wasting peoples time?

Turpinator

2015-06-17 14:21:27

From: GetHyper
To be fair, not sure why I applied - can you just deny it now to stop wasting peoples time?


Haha. Dont have that attitude! I guess if you really want to, it can be closed early so that you dont have to wait as long to re-apply.

But hey, give it a couple weeks (once people are a little more accustomed to seeing you) and apply agian. Then i think youll fare much better. :)

GetHyper

2015-06-17 15:22:43

From: Turpinator
Haha. Dont have that attitude! I guess if you really want to, it can be closed early so that you dont have to wait as long to re-apply.

But hey, give it a couple weeks (once people are a little more accustomed to seeing you) and apply agian. Then i think youll fare much better. :)


Oops, I didn't mean for it to sound like that, I meant it more as - I need to read up, gain more experience and prove I can be better.

I just read it back and thought - yeah maybe it does sound shitty.

I have a good reason, I'm just decorating my house for a whole week and it's getting to me :'( sympathy!

StickToTheScript

2015-06-18 21:17:58

I would like to let you know that my thoughts are the same as The Mayor. Specifically the activity for only a few weeks.

GetHyper

2015-06-19 08:58:57

From: StickToTheScript
I would like to let you know that my thoughts are the same as The Mayor. Specifically the activity for only a few weeks.


Yep, I did think this myself - only just come back really. Sorry :).

Lipcot

2015-06-19 09:48:52

I havent been around that much, but anyway i dont know you and for what i've looked around, you have been active not for long, so its a no for me!

Just stick around some more time and im sure you'll make it!

Hoodz

2015-06-19 10:17:51

@GetHyper; just keep this thread active to get more tips!

GetHyper

2015-06-19 14:04:53

From: Lipcot
I havent been around that much, but anyway i dont know you and for what i've looked around, you have been active not for long, so its a no for me!

Just stick around some more time and im sure you'll make it!


It's all good, I hadn't really thought of the time around when I applied, I realised after it would go against me. No worries and i'll stick around!

From: hoodz
@GetHyper; just keep this thread active to get more tips!


I know, just been busy decorating my damn house (well, 1 room) all this week so haven't had tons of time.
Back on it though.

Smidqe

2015-06-19 16:54:46

I'm going to vote no.

I didn't find your scripts upto the standards what they should be. Format is all over the place, also the use of global variables such as i, x, y and so forth are not good practices. When programs or scripts grow, it'll become more difficult to debug a single function. Personally I try to have as few global variables as possible and every single variable as . My current project has 3 even though it has over 2k lines. Also when your standards are good, the script becomes more readable even to those who have no prior experience of programming. Clean code makes everything easier.

Also as stated by @Camel, you have redundant code, but I noticed you started learning records, which is good thing. Perhaps in the future you'll be a good enough scripter for the SRL Member title, I'm looking forward for that.

I know it's nitpicking even the smallest mistakes, but this way you learn to watch your code and possibly help others. You should atleast run the formatter plugin within Simba, which will automatically format the script to the standards, but it also removes comments.

  if not isLoggedIn() then
players[currentPlayer].login() else
wait(randomRange(3000,5000));
writeln('Just getting ready');
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);

This example is something I noticed from first look. You have else after the wait() function, general format is that there is only one bolded word on the line, which I've corrected in the fixed version below. Also if the if..then is a single liner like in the example, the rest code doesn't need to be indented, unless you have begin..end in there. I also added a white line after the if..else but that's just my practice, I try to group the code in 2-4 lines each.

  if not isLoggedIn() then
players[currentPlayer].login()
else
wait(randomRange(3000,5000));

writeln('Just getting ready');
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);

I know this kind of experience comes with time, but it is really good to learn early on. I haven't tested your scripts, so I don't know if they work at all, because I don't have the time.


This is a function from my current project, I added this to here just to show you how I do the the formatting in my scripts, of course you don't have to include the empty lines. What this example brings in is the children functions (inString()) and local records. There's some tricks that Lape can do so it's worthwhile to read it.

function TStringArray.find(__method : integer; matchAll : boolean = true; percentage : integer = 100; mouseAction : integer = MOUSE_NONE): boolean;
function inString(str : string; __strings : TStringArray; matchAll : boolean = true; percentage : integer = 100): boolean;
var
s : TStringArray;
i, j, match : integer;
begin
s := explode(' ', str);

for i := 0 to high(s) do
for j := 0 to high(__strings) do
match += (__strings[j] = s[i]).int(); //I like this line a lot :P, increases match if string[j] = s[i]

result := (((match = length(__strings)) and matchAll) or (((match / length(__strings)) * 100) > percentage));
end;

type
TTextArray = record
__options : TOptionArray;
__text : string;
end;
var
__array : TTextArray;
h, i : integer;
box : TBox;
begin
__array.__options := [];

if __method = __RS_OPTIONS then
__array.__options := chooseOption.getOptions()
else
__array.__text := getMouseOverText();

if __method = __RS_OPTIONS then
h := high(__array.__options);

for i := 0 to h do
begin
if __method = __RS_OPTIONS then
result := inString(__array.__options[i].str, self)
else
result := inString(__array.__text, self);

if result and __method = __RS_OPTIONS then
box := __array.__options[i].bounds;

if result then
break;
end;

if result and __method = __RS_OPTIONS then
box.mouse(mouseAction);
end;

PS: I personally didn't have much activity around here when I applied, but it was my script that gave me this title. So a script that I consider good will always get my vote, even if activity is not the best.

Also I know this is a long post, but somethings explaining requires it (also I'm drunk).

GetHyper

2015-06-20 13:47:54

@Smidqe

I would like to thank you for your time and your post, it is very helpful reading comments from members like yourself that are willing to help others.

The instring - I will have to re-read a few times to get my head around all that code.

I did not realise there was a formatter in the extensions menu, just never noticed.

Again, thank you.

Smidqe

2015-06-20 14:05:09

From: GetHyper
@Smidqe

I would like to thank you for your time and your post, it is very helpful reading comments from members like yourself that are willing to help others.

The instring - I will have to re-read a few times to get my head around all that code.

I did not realise there was a formatter in the extensions menu, just never noticed.

Again, thank you.


No problem.

The inString() function, while not the most complicated function that I have, is definately hard to understand until one has enough experience on the programming language.

If lape would've not supported OOP programming style this function would look totally different. I still haven't figured out all the secrets Lape holds.

Turpinator

2015-06-20 15:21:04

From: Smidqe
If lape would've not supported OOP programming style this function would look totally different. I still haven't figured out all the secrets Lape holds.


Theres really very little difference without the pseudo OOP.
https://www.diffchecker.com/jkktlbgk

Smidqe

2015-06-21 03:52:36

From: Turpinator
Theres really very little difference without the pseudo OOP.


I'm impressed, I thought there would be more dramatic changes. :pinch: