SRL Archive - Archive

Xanith - SRL Member Application


Xanith

2011-01-19 16:18:01

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
No


What is your general programming knowledge?
None, Just what I read here on the forums.


Are you a member of any other communities?
No.


Tell us about yourself…
From: Xanith
My name is Eric. Currently I am 18 soon to be 19(Jan 30th). I live in a small town in New Jersey about 5 minutes from NYC. My interests are listening to music, going to school(going to become an airplane mechanic), and just hanging out with friends.



Please show us one (or multiple) of your scripts.
program XanithsWillowCutter;
{$i SRl/SRL/misc/SMART.scar}
{$i SRL/SRL.scar}
{$i srl/srl/misc/debug.scar}
{$i reflection\reflection.simba}
{$i srl/srl/misc/PaintSmart.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; //Player username
Pass := ''; //Player password
Nick := ''; //Player nickname - 3 or 4 letters of your player name (no spaces or capitals).
Active := True; //Is the player active (do you want to auto on this acc)?
Pin := ''; //Bank Pink, leave as '' for no bank pin.
Integers[0] := 5; //Loads
Booleans[0] := True; //Axe Equipped?
Booleans[1] := False; //True for Members, False for Non-Members.
end;

{with Players[1] do
begin
Name := ''; //Player username
Pass := ''; //Player password
Nick := ''; //Player nickname - 3 or 4 letters of your player name (no spaces or capitals).
Active := True; //Is the player active (do you want to auto on this acc)?
Pin := ''; //Bank Pink, leave as '' for no bank pin.
Integers[0] := 5; //Loads
Booleans[0] := True; //Axe Equipped?
Booleans[1] := False; //True for Members, False for Non-Members.
end;

with Players[2] do
begin
Name := ''; //Player username
Pass := ''; //Player password
Nick := ''; //Player nickname - 3 or 4 letters of your player name (no spaces or capitals).
Active := True; //Is the player active (do you want to auto on this acc)?
Pin := ''; //Bank Pink, leave as '' for no bank pin.
Integers[0] := 5; //Loads
Booleans[0] := True; //Axe Equipped?
Booleans[1] := False; //True for Members, False for Non-Members.
end;}
end;

procedure notChopping(waitTime : integer);
var
t : integer;
b : TBox;
begin
t := (GetSystemTime + waitTime);
b := IntToBox(MSCX - 15, MSCY - 50, MSCX + 15, MSCY + 15);
repeat
wait(10);
until not (isMoving) or not (LoggedIn);

while (GetSystemTime < t) do
begin
if PixelShift(b, 300) < 300 then
Exit;
end;
end;

Procedure crudeAntiban;
begin
if(not(LoggedIn))then
exit;
case Random(18) of
0:
begin
HoverSkill('random', false);
Inc(Players[CurrentPlayer].Integers[3]);
end;
1:
begin
PickUpMouse;
Inc(Players[CurrentPlayer].Integers[3]);
end;
2:
begin
RandomMovement;
Inc(Players[CurrentPlayer].Integers[3]);
end;
3:
begin
BoredHuman;
Inc(Players[CurrentPlayer].Integers[3]);
end;
4:
begin
ExamineInv;
Inc(Players[CurrentPlayer].Integers[3]);
end;

5:
begin
RandomAngle(1);
Inc(Players[CurrentPlayer].Integers[3]);
end;
end;
end;

function findAndChop : Boolean;
var
x, y, i : integer;
CTS : integer;
treesTPA : TpointArray;
treeATPA : T2DpointArray;
tempResult : Boolean;
begin
Setangle(True);
repeat
if (InvFull) then
begin
Players[CurrentPlayer].Loc := 'to bank';
exit;
end;
if not (LoggedIn) then
begin
Players[CurrentPlayer].Active := False;
exit;
end;
CTS := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 0.89);
FindColorsTolerance(treesTPA, 2509885, MSX1, MSY1, MSX2, MSY2, 10);
SetColorToleranceSpeed(CTS);
if (Length(treesTPA) < 1) then
Exit;
treeATPA := SplitTPA(treesTPA, 10);
SortATPAFromFirstPoint(treeATPA, IntToPoint(MSCX, MSCY));
for i := 0 to high(treeATPA) do
begin
if length(treeATPA[i]) > 100 then
begin
MiddleTPAEx(treeATPA[i], x, y);
MMouse(x - 5, y - 5, 10, 10);
if WaitUpText('illow', 800) then
begin
ClickMouse2(false);
tempResult := WaitOption('hop', 800);
end;
if tempResult then
break
else begin
Players[CurrentPlayer].Active := False;
Logout;
exit;
end;
end;
end;
notChopping(RandomRange(10000, 15000));
Wait(200 + random(100));
FindNormalRandoms;
crudeAntiban;
until(InvFull) or not(LoggedIn);
if InvFull then
result := true;
end;

function findBankTPA : TpointArray;
var
CTS: integer;
initHue, initSat : extended;
TPA : TpointArray;
begin
CTS := GetColorToleranceSpeed;
GetColorspeed2Modifiers(initHue, initSat);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(7.31, 0.40);
FindColorsTolerance(TPA, 3947832, MMCX, (MMY1 + 20), (MMX2 - 20), (MMCY - 10), 6);
DebugTPA(TPA, 'h');
SMART_DrawBox(inttobox(MMCX, MMY1 + 20, MMX2 - 20, MMCY - 10));
Result := TPA;
end;

function findBankSymbolTPA : TpointArray;
var
CTS: integer;
initHue, initSat : extended;
TPA : TpointArray;
begin
CTS := GetColorToleranceSpeed;
GetColorspeed2Modifiers(initHue, initSat);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 1.49);
FindColorsTolerance(TPA, 6542813, MMCX, MMY1, MMX2, MMCY, 15);
SetColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(initHue, initSat);
result := TPA;
DebugTPA(result, 'g');
end;

function checkForFloor : boolean;
var
TPA : TpointArray;
CTS: integer;
initHue, initSat : extended;
begin
CTS := GetColorToleranceSpeed;
GetColorspeed2Modifiers(initHue, initSat);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.09, 0.21);
FindColorsTolerance(TPA, 3092529, MSX1, MSY1, MSX2, MSY2, 4)
FilterPointsPie(TPA, 0.0, 360.0, 26.0, 26.2, MSCX, MSCY);
SetColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(initHue, initSat);
if high(TPA) > 5 then
Result := True;
end;

function walkToBank : boolean;
var
i, H : integer;
tempTPA : TpointArray;
bankBox : TBox;
begin
if not LoggedIn then
exit;
if (Length(findBankTPA) < 1) or (Length(findBankSymbolTPA) < 1) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Exit;
end;
bankBox := GetTPABounds(findBankTPA);
tempTPA := findBankSymbolTPA;
H := High(tempTPA);
for i := 0 to H do
begin
if (PointInBox(tempTPA[i], bankBox)) then
begin
MouseBox(bankBox.x1 + 2 , bankBox.y1 + 2, bankBox.x2 - 2, bankBox.y2 - 2, 1);
Break;
end else begin
Players[CurrentPlayer].Active := False;
Logout;
exit;
end;
end;
wait(100);
repeat
Wait(10);
until not (IsMoving) or not (LoggedIn);

if (checkForFloor) then
begin
result := true;
Players[CurrentPlayer].Loc := 'bank';
end else begin
Players[CurrentPlayer].Active := False;
Logout;
exit;
end;
end;

function findTreesMMTPA(x1, y1, x2, y2 : integer): TPointArray;
var
TPA : TPointArray;
CTS: integer;
initHue, initSat : extended;
begin
CTS := GetColorToleranceSpeed;
GetColorspeed2Modifiers(initHue, initSat);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.08, 1.34);
FindColorsTolerance(TPA, 938807, x1, y1, x2, y2, 12);
SetColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(initHue, initSat);
debugTPA(TPA, 'v');
SMART_DrawBox(inttobox(x1, y1, x2, y2));
Result := TPA;
end;

function walkToTrees : Boolean;
var
x, y, len : integer;
begin
if (length(findTreesMMTPA((MMX1 + 20), MMCY, MMCX, MMY2))) < 1 then
begin
Players[CurrentPlayer].Active := False;
Logout;
exit;
end;
MiddleTPAEx(findTreesMMTPA((MMX1 + 20), MMCY, MMCX, MMY2), x, y);
Mouse(x, y, 0, 0, True);
Wait(300);
repeat
wait(10);
until not (isMoving) or not (LoggedIn);

len := length(findTreesMMTPA(MMCX - 10, MMCY - 10, MMCX + 10 , MMCY + 10));
if (len) < 1 then
begin
Players[CurrentPlayer].Active := False;
Logout;
exit;
end;
if len >= 60 then
begin
result := True;
Players[CurrentPlayer].Loc := 'trees';
end;
end;

procedure progress;
begin
ClearDebug;
Writeln('[----------------------------------------------------]');
Writeln(Padr('||Player: ' + Players[CurrentPlayer].Nick, 52) + '||');
Writeln(Padr('||Loads: ' + ToStr(Players[CurrentPlayer].Integers[2]), 52) + '||');

if Players[CurrentPlayer].Booleans[0] then
Writeln(Padr('||Willows: ' + ToStr(Players[CurrentPlayer].Integers[2] * 28), 52) + '||')
else
Writeln(Padr('||Willows: ' + ToStr(Players[CurrentPlayer].Integers[2] * 27), 52) + '||');


if Players[CurrentPlayer].Booleans[0] then
Writeln(Padr('||Experience: ' + ToStr(Players[CurrentPlayer].Integers[2] * 28 * 67.5), 52) + '||')
else
Writeln(Padr('||Experience: ' + ToStr(Players[CurrentPlayer].Integers[2] * 27 * 67.5), 52) + '||');
Writeln(Padr('||Antiban Used: ' + ToStr(Players[CurrentPlayer].Integers[3]), 52) + '||');

Writeln(Padr('||Time Running: ' + ToStr(TimeRunning), 52) + '||');
Writeln('[----------------------------------------------------]');
end;

function myDeposit : boolean;
var
i, j, CTS : integer;
initHue, InitSat : extended;
TP : TPoint;
TPA : TPointArray;
ATPA : Array of TPointArray;
badBox : TBox;
itemCount : integer;
begin
if not LoggedIn then
exit;
GameTab(tab_Inv);
itemCount := InvCount;
if Players[CurrentPlayer].Booleans[0] then
begin
if itemCount = 0 then
begin
result := True;
Players[CurrentPlayer].Loc := 'to willows';
exit;
end;
end else begin
if itemCount = 1 then
begin
result := True;
Players[CurrentPlayer].Loc := 'to willows';
exit;
end;
end;
badBox := PointToBox(InttoPoint(3092, 3246), inttoPoint(3095, 3245));
if MeInBox(badBox) then
WalkToTile(tile(3094, 3243), 1, 0);
CTS := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
GetColorspeed2Modifiers(initHue, initSat);
SetColorspeed2Modifiers(0.03, 0.34);
FindColorsTolerance(TPA, 803162, MSX1, MSY1, MSX2, MSY2, 26);
SetColorToleranceSpeed(CTS);
SetColorspeed2Modifiers(initHue, initSat);
ATPA := SplitTPA(TPA, 10);
SortATPAFromSize(ATPA, 900, True);
for i := 0 to high(ATPA) do
begin
TP := MiddleTPA(ATPA[i]);
FilterPointsPie(ATPA[i], 0.0, 360.0, 9.5, 10.9, TP.x, TP.y);
if high(ATPA[i]) > 60 then
begin
MMouse(TP.x - 5, TP.y - 5, 10, 10);
Wait(100);
if IsUpText('epos') then
begin
ClickMouse2(true);
Break;
end else begin
Players[CurrentPlayer].Active := False;
Logout;
exit;
end;
end;
end;
repeat
Wait(10);
until DepositScreen;
j := Random(27) + 1;
MouseBox(DepositItemBox(j).x1 + 11, DepositItemBox(j).y1 + 11, DepositItemBox(j).x2 - 11, DepositItemBox(j).y2 - 11, 3);
Wait(500);
if IsUpText('illow') then
begin
wait(100);
ClickMouse2(false);
wait(500);
ChooseOption('it-All');
Wait(100 + random(25));
end;
CloseWindow;
wait(100 + random(23));
if Players[CurrentPlayer].Booleans[0] then
begin
if itemCount = 0 then
begin
result := True;
Players[CurrentPlayer].Loc := 'to willows';
inc(Players[CurrentPlayer].Integers[2]);
exit;
end;
end else begin
if itemCount = 1 then
begin
result := True;
Players[CurrentPlayer].Loc := 'to willows';
inc(Players[CurrentPlayer].Integers[2]);
exit;
end;
end;
end;

procedure myFindLoc;
begin
if not LoggedIn then
exit;
if checkForFloor then
begin
if Players[CurrentPlayer].Booleans[0] then
begin
if InvCount = 0 then
begin
Players[CurrentPlayer].Loc := 'to willows';
exit;
end else begin
Players[CurrentPlayer].Loc := 'bank';
exit;
end;
end else begin
if InvCount = 1 then
begin
Players[CurrentPlayer].Loc := 'to willows';
exit;
end else begin
Players[CurrentPlayer].Loc := 'bank';
exit;
end;
end;
end else begin
if length(findTreesMMTPA(MMCX - 10, MMCY - 10, MMCX + 10 , MMCY + 10)) > 50 then
if (InvFull) then
begin
Players[CurrentPlayer].Loc := 'to bank';
exit;
end else begin
Players[CurrentPlayer].Loc := 'trees';
end;
end;
end;

procedure mainLoop;
begin
myFindLoc;
repeat
case LowerCase(Players[CurrentPlayer].Loc) of
'bank': begin
if myDeposit then
Players[CurrentPlayer].Loc := 'to willows';
FindNormalRandoms;
crudeAntiban;
progress;
end;
'to willows': begin
if walkToTrees then
Players[CurrentPlayer].Loc := 'trees';
FindNormalRandoms;
crudeAntiban;
end;
'trees': begin
if findAndChop then
Players[CurrentPlayer].Loc := 'to bank';
crudeAntiban;
end;
'to bank': begin
if walkToBank then
Players[CurrentPlayer].Loc := 'bank';
FindNormalRandoms;
crudeAntiban;
end;
end;
until not (LoggedIn) or (Players[CurrentPlayer].Integers[2] >= Players[CurrentPlayer].Integers[0]);
NextPlayer(Players[CurrentPlayer].Active);
end;

begin
DeclarePlayers;
Smart_Members := Players[CurrentPlayer].Booleans[1];
Smart_Server := 40;
Smart_Signed := True;
SetUpSRL;
SetUpReflection;
repeat
mainLoop;
until AllPlayersInactive;

end.

Gu3st...

2011-01-19 16:46:50

I'm not sure about this one…
You do seem to have decent scripting abilities, but you do a couple of mistakes like possible infinite loops and stuff like that…

I'll hold my vote

Tniffoc

2011-01-19 16:47:26

Well from the script I'd say its a definite yes. Its hard to believe that your only programing experience has been with SRL.

You have made some smaller errors but it looks great overall.

I won't vote due to my inactivity but best of luck man!

Xanith

2011-01-19 16:50:13

From: Zyt3x
I'm not sure about this one…
You do seem to have decent scripting abilities, but you do a couple of mistakes like possible infinite loops and stuff like that…

I'll hold my vote


Thanks for the input. I'll look at the script later to try and fix the infinite loops, and any other mistakes that i can find. =]

Xanith

2011-01-19 16:51:33

From: Tniffoc
Well from the script I'd say its a definite yes. Its hard to believe that your only programing experience has been with SRL.

You have made some smaller errors but it looks great overall.

I won't vote due to my inactivity but best of luck man!


I guess I just have a nack for this stuff ^.^

Thanks!

Rich

2011-01-19 16:54:20

You show good knowledge of TPAs, and some minor of the include, but that's all you really show. There are no (D)DTMs, bitmaps, and like stated above, there are a few errors such as infinite loops in the script. There is also a function in the script which is already in SRL (I think. Sorry if I'm wrong). The percentage for anti-ban taking place is, I believe, also too high. One thing which worries me is that this application is the first time I have seen you on SRL. Don't take that personally, but it's true. It could be because of my reduced activity, and because yours is rather low. Nevertheless…

Sorry, but it's a no from me.

Xanith

2011-01-19 17:30:33

From: Rich
You show good knowledge of TPAs, and some minor of the include, but that's all you really show. There are no (D)DTMs, bitmaps, and like stated above, there are a few errors such as infinite loops in the script. There is also a function in the script which is already in SRL (I think. Sorry if I'm wrong). The percentage for anti-ban taking place is, I believe, also too high. One thing which worries me is that this application is the first time I have seen you on SRL. Don't take that personally, but it's true. It could be because of my reduced activity, and because yours is rather low. Nevertheless…

Sorry, but it's a no from me.


You don't have to apologize, After I posted I realized that I didn't show knowledge, like you mentioned. Don't worry about it. =]

Rich

2011-01-19 17:34:44

That's not to say I don't like your attitude. Your attitude is fantastic, but, of course, we can't judge purely on attitude.

Richard.

Xanith

2011-01-19 17:49:26

Of course getting into SRL Members isn't about attitude alone. =]

The function that is already in SRL is myDeposit. the OpenDepositBox function.. well doesn't work that great. so I made this one that actually works really really well. I think that is what you are talking about.

Rich

2011-01-19 17:56:58

Perhaps add your function as an improve in the SVN section then?

Xanith

2011-01-19 17:59:37

Wow, i never thought of that. I'll clean it up, post it and see what people think.

Gu3st...

2011-01-19 18:02:47

From: Xanith
Wow, i never thought of that. I'll clean it up, post it and see what people think.
Awesome :)

Well, I'd just have to say, based on the attitude you've showed in this thread I'll vote yes even though theres minor faults in the script. :) You'll work those out, I'm sure

Xanith

2011-01-19 18:08:35

Zyt3x, If I get a chance to today I will. My gf gets out of work in an hour I have to pick her up then chill with her. I'll probably work on it in about 4 hours.

Sir R. M8gic1an

2011-01-19 18:11:41

I don't know what to say, but yes. Great script!

~RM

Xanith

2011-01-19 18:16:14

From: Sir R. Magician
I don't know what to say, but yes. Great script!

~RM


Oh my… That's all I can say.

lordsaturn

2011-01-20 01:17:06

After a quick glance, gonna have to say no on this one. Your crudeAntiban is hella crude. put the inc(foo) before the end; of the function, outside the case statement. same goes for mainloop.

However all that really matters is does the script run like it should? post progress reports and I might change my mind (have not yet voted).

Laur€ns

2011-01-20 11:50:59

Pretty good use of TPA's, and I like your custom deposit function. Your attitude towards the 'judges' is nice too.

But as lordsaturn said, you made a few mistakes here and there, but that's not enough to stop me from voting yes :)

Xanith

2011-01-20 15:10:31

From: lordsaturn
After a quick glance, gonna have to say no on this one. Your crudeAntiban is hella crude. put the inc(foo) before the end; of the function, outside the case statement. same goes for mainloop.

However all that really matters is does the script run like it should? post progress reports and I might change my mind (have not yet voted).


I'm Running it now, I'll post a proggy when it stops.


From: Laur€ns
Pretty good use of TPA's, and I like your custom deposit function. Your attitude towards the 'judges' is nice too.

But as lordsaturn said, you made a few mistakes here and there, but that's not enough to stop me from voting yes :)


Thank you Very much. =]

I posted the deposit function in the SRL Public SVN section check it out.

pyroryan

2011-01-20 16:31:02

From: Xanith
I'm Running it now, I'll post a proggy when it stops.




Thank you Very much. =]

I posted the deposit function in the SRL Public SVN section check it out.


You have bad grammar. So I'm saying no!
Fortunately, there is a difference between saying and voting. I'll hold until I actually read the stuff.
Off to class and good luck!

Xanith

2011-01-20 17:51:39

From: pyroryan
You have bad grammar. So I'm saying no!
Fortunately, there is a difference between saying and voting. I'll hold until I actually read the stuff.
Off to class and good luck!


Haha, I tend to capitalize words that shouldn't be. My pinky is a little too aggressive. :redface:

Have fun at class!! I hope you like what you see.:p

Tniffoc

2011-01-20 21:02:34

Well, I'm going to vote even though I'm not active when compared to most members, but I really feel like getting another SRL member with potential is more important than picking on a few errors. I learned most of my scripting AFTER I got in to members.

Cheers, its a yes.

Xanith

2011-01-20 21:27:38

From: Tniffoc
Cheers, its a yes.


Thank you!!

I've made minor changes to the script, I think I fixed some of the infinite loops.

lordsaturn, here is a very short progress report. It stopped because of the (Willow >) thing. (When there are too many right click options.)

[----------------------------------------------------]
||Player: ||
||Loads: 6 ||
||Willows: 168 ||
||Experience: 11340 ||
||Antiban Used: 30 ||
||Time Running: 26 Minutes and 14 Seconds ||
[----------------------------------------------------]

Daniel

2011-01-21 03:59:36

Yes.

Excellent attitude.
Decent script.

Mainly voting yes due to your attitude though, keep it up :)

Xanith

2011-01-21 04:04:07

From: Daniel
Yes.

Excellent attitude.
Decent script.

Mainly voting yes due to your attitude though, keep it up :)


Thank you for voting. =]
I really had fun making this script. I don't plan on stopping any time soon!

cycrosism

2011-01-23 11:20:44

Don't like seeing the reflection include being used, you should try to create a script that relies fully on srl and not reflection.

Edit: Lol at the person who derepped me for this

But I vote no if I see the reflection include, as do many other members

Rich

2011-01-23 11:32:13

From: cycrosism
Don't like seeing the reflection include being used, you should try to create a script that relies fully on srl and not reflection.
What's wrong with using a more reliable method? You'd rather he would use a less reliable method, when there's a better one available? Seems illogical to me.

noidea

2011-01-23 11:39:08

From: Rich
What's wrong with using a more reliable method? You'd rather he would use a less reliable method, when there's a better one available? Seems illogical to me.


Applying for members is supposed to display your knowledge of the SRL include. Reflection is a 3rd party include supported by a couple of SRLers
Just because its reliable doesnt mean you should or should not apply with it.

From: lordsaturn
After a quick glance, gonna have to say no on this one. Your crudeAntiban is hella crude. put the inc(foo) before the end; of the function, outside the case statement. same goes for mainloop.

However all that really matters is does the script run like it should? post progress reports and I might change my mind (have not yet voted).


That would produce a different result.

Xanith

2011-01-23 14:03:48

I only used reflection in one function, it isn't like the whole script depends on reflection. If I really wanted to I could change the walkToBank function to click lower in the bank, but I chose not to. The reason being, I wanted to show some knowledge of reflection and not just SRL.

Iron Man

2011-01-23 17:44:05

Procedure crudeAntiban;
var
i: integer;
begin
if(not(LoggedIn))then
exit;
i := random(18);
case i of
0: HoverSkill('random', false);
1: PickUpMouse;
2: RandomMovement;
3: BoredHuman;
4: ExamineInv;
5: RandomAngle(1);
end;
if (i<6) then
Inc(Players[CurrentPlayer].Integers[3]);
end;
@noidea: I think lordsaturn meant something like that?

I say yes. Your attitude is very nice, especially towards criticism. :D

noidea

2011-01-23 17:47:43

From: Iron Man

@noidea: I think lordsaturn meant something like that?

I say yes. Your attitude is very nice, especially towards criticism. :D


Probably.

I vote yes.

Xanith

2011-01-23 18:05:47

Thank you Iron Man and noidea.


From: Iron Man
Procedure crudeAntiban;
var
i: integer;
begin
if(not(LoggedIn))then
exit;
i := random(18);
case i of
0: HoverSkill('random', false);
1: PickUpMouse;
2: RandomMovement;
3: BoredHuman;
4: ExamineInv;
5: RandomAngle(1);
end;
if (i<6) then
Inc(Players[CurrentPlayer].Integers[3]);
end;
@noidea: I think lordsaturn meant something like that?

I say yes. Your attitude is very nice, especially towards criticism. :D


If I did that it would increase the count every time crudeAntiban is called, not every time an individual Antiban would be called.

Tniffoc

2011-01-25 02:42:15

From: Xanith
Thank you Iron Man and noidea.




If I did that it would increase the count every time crudeAntiban is called, not every time an individual Antiban would be called.


Well since you're just incrementing the same variable for all the cases, that code does the same thing and takes up many fewer lines. Notice the if statement before the line he wrote? That makes sure that one of the antibans was called before it increments. So, it will not actually increment every time, just when an antiban is called, which is exactly what you're doing now, but with fewer lines.

A little alarm should go off in your head every time you're having to repeatedly write the same thing over and over again. It suggests that something is off.

As I've heard and experienced many times, the best way to not write a bugged-up line of code is to not write one at all. (CS193P Stanford Lecture Guy)

Xanith

2011-01-25 02:49:17

From: Tniffoc
Well since you're just incrementing the same variable for all the cases, that code does the same thing and takes up many fewer lines. Notice the if statement before the line he wrote? That makes sure that one of the antibans was called before it increments. So, it will not actually increment every time, just when an antiban is called, which is exactly what you're doing now, but with fewer lines.

A little alarm should go off in your head every time you're having to repeatedly write the same thing over and over again. It suggests that something is off.

As I've heard and experienced many times, the best way to not write a bugged-up line of code is to not write one at all. (CS193P Stanford Lecture Guy)


ohhh!!! I must have overlooked that one line. Now I get it.

WT-Fakawi

2011-01-25 08:42:58

In.