SRL Archive - Archive

tniffoc - SRL Member Application Form


Tniffoc

2008-09-14 10:44:09

<!– BEGIN TEMPLATE: formanswers –>
tniffoc - SRL Member Application Form
tniffoc

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
no


Programming Knowledge
Java, PHP, a little C++, HTML, and some CSS

Other Communitys
none

How Long have You Played Runescape
A few years

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

I have been programming Java for a couple of years. I have written a few websites with CSS, PHP, and Mysql. I'm interested in MMORPGs and when I came to SRL I began scripting by learning the basics of pascal before moving on and developing scripts using SRL. When Reflection came out, I developed an include that made some SRL procedures more reliable and did things that weren't possible before.

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted


{###############################################################################
CREDITS: Thank you to turbobk for the WalkBox function. Kudos to all the SRL
Members who helped me learn. Special note to Hy, who answered a few of my
earliest questions. If I forgot you, pm me and I'll add you.
--------------------------------------------------------------------------------
INSTRUCTIONS: Place character in the northern area of the Lumbridge cows. Fill
out lines 18-54. Press the run button. Press f2 while you character is fighting
a cow to recieve a proggy.
--------------------------------------------------------------------------------
NOTE: To all that it may concern, I did make the include URN, which I included
in this script via copy-paste instead of an include! I havn't used reflection
except for one walking procedure, to make anti-ban, and to
--------------------------------------------------------------------------------
Please post proggies in the thread for this auto.
###############################################################################}


program TniffocCowKiller;
{.include SRL/SRL/misc/Smart.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Fighting.scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
const
// Leave Alone!
WaitTime = 80;

//SMART Setup
WorldNumber = 74;
SignedApplet = false;
HighDefinition = false; // DON'T CHANGE THIS!!
Safe = true;

//Customize AntiBan
TalkAboutLevels = true; // True to talk about lvls as anti-ban, false to not talk about them

var
cow: TNPC;
cowColorArray: array of integer;
x,y: Integer;

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

Players[0].Name:= '********'; // Your username on Runescape
Players[0].Pass:= '********'; // Your password on Runescape
Players[0].Skill:= 'attack';
Players[0].Loc:= 'In lumby cow field';
Players[0].Nick:= '***';
Players[0].Active:= true;
Players[0].Integers[0]:= 25; //How many cows to kill.
// You may add more players as needed.
{
Players[1].Name:= '*******';
Players[1].Pass:= '*******';
Players[1].Skill:= 'attack';
Players[1].Loc:= 'In lumby cow field';
Players[1].Nick:= 'f99';
Players[1].Active:= true;}
end;

{*******************************************************************************
function randomizeSkill(skill: string): string;
By: tniffoc
Description: Will create a more human string for a certain skill E.X.:
"woodcutting" to "wc" or "woodcut" etc.
*******************************************************************************}
function randomizeSkill(skill: string): string;
var
i: integer;
begin
case skill of
'attack':if random(2) = 0 then
Result:= 'Attk'
else
Result:= 'Attack';
'defence':if random(2) = 0 then
Result:= 'def'
else
Result:= 'defence';
'strength':if random(2) = 0 then
Result:= 'str'
else
Result:= 'strength';
'hitpoints':if random(2) = 0 then
Result:= 'hp'
else
Result:= 'hitpoints';
'prayer':if random(2) = 0 then
Result:= 'pray'
else
Result:= 'prayer';
'magic':if random(2) = 0 then
Result:= 'mage'
else
Result:= 'magic';
'cooking':if random(2) = 0 then
Result:= 'cook'
else
Result:= 'cooking';
'fletching':if random(2) = 0 then
Result:= 'fletch'
else
Result:= 'fletching';
'firemaking':
begin
i:= random(9);
if (i <= 3) then begin
Result:= 'fm';
Exit;
end else begin
if(i <= 6)then begin
Result:= 'firemake';
Exit;
end else begin
Result:= 'firemaking';
Exit;
end;
end;
end;
'crafting': if random(2) = 0 then
Result:= 'crafting'
else
Result:= 'craft';
'smithing':
begin
i:= random(9);
if (i <= 3) then begin
Result:= 'smelting';
Exit;
end else begin
if(i <= 6)then begin
Result:= 'smith';
Exit;
end else begin
Result:= 'smithing';
Exit;
end;
end;
end;
'herblore':if random(2) = 0 then
Result:= 'herb'
else
Result:= 'herblore';
'theiving':if random(2) = 0 then
Result:= 'theif'
else
Result:= 'theiving';
'slayer':if random(2) = 0 then
Result:= 'slay'
else
Result:= 'slayer';
'farming':if random(2) = 0 then
Result:= 'farmin'
else
Result:= 'farming';
'runecrafting':
begin
i:= random(9);
if (i <= 3) then begin
Result:= 'rc';
Exit;
end else begin
if(i <= 6)then begin
Result:= 'runecraft';
Exit;
end else begin
Result:= 'runecrafting';
Exit;
end;
end;
end;
'construction':if random(2) = 0 then
Result:= 'construct'
else
Result:= 'construction';
'summoning':if random(2) = 0 then
Result:= 'summon'
else
Result:= 'summoning';
'woodcutting':
begin
i:= random(10);
if (i < 5) then begin
Result:= 'wc';
Exit;
end else begin
if(i > 7) then begin
Result:= 'woodcut';
Exit;
end else begin
Result:= 'woodcutting';
Exit;
end;
end;
end;
'mining':if random(2) = 0 then
Result:= 'mine'
else
Result:= 'mining';
'fishing':
begin
i:= random(9);
if(i <= 3) then begin
Result:= 'fish';
Exit;
end else begin
if(i <= 6) then begin
Result:= '<><';
Exit;
end else begin
Result:= 'fishing';
Exit;
end;
end;
end;
'mining':if random(2) = 0 then
Result:= 'mine'
else
Result:= 'mining';
end;
end;

{*******************************************************************************
function URNasklvl(skill: string; name: string): boolean;
By: tniffoc
Description: Will ask "name" what their lvl in "skill" is. Returns whether or
not it was able to randomize the skill name.
*******************************************************************************}
function URNasklvl(skill: string; name: string): boolean;
var
toSend,newSkill: string;
var
i: Integer;
begin
newSkill:= randomizeSkill(skill);
if(newSkill = '')then begin
newSkill:= skill;
Result:= false;
end else
Result:= true;
i:= random(10);
if(i <= 5) then begin
toSend:= name + ', what is your level in ' + newskill + '?';
end else begin
toSend:= 'what is your level in ' + newskill + ' , ' + name + '?';
end;
Writeln('Asked: ' + toSend);
TypeSend(toSend);
end;

{*******************************************************************************
function URNasklvls(skill: string): boolean;
By: tniffoc
Description: Asks people arround what thier "skill" lvl is. Returns whether or
not it was able to randomize the skill name.
*******************************************************************************}
function URNasklvls(skill: string): boolean;
var
i: Integer;
newSkill: string;
begin
i:= random(10);
newSkill:= randomizeSkill(skill);
if(newSkill = '')then begin
newSkill:= skill;
Result:= false;
end else begin
Result:= true;
end;
if(i <= 5) then begin
Writeln('Asked: ' + newSkill + ' lvls?');
TypeSend(newSkill + ' lvls?');
end else begin
Writeln('Asked: What are you lvls in ' + newSkill);
TypeSend('What are your lvls in ' + newSkill);
end;
end;

{*******************************************************************************
function URNlvlstalk(skill: string): boolean;
By: tniffoc
Description: Will ask a random player what their lvl in the skill of
"skill" is.
*******************************************************************************}
function URNlvlstalk(skill: string): boolean;
var
miniMapPlayers: array of TPlayer;
i,b: Integer;
mainScreenPlayers: array [0..100] of TPlayer;
begin
Writeln('Starting!');
b:= 0;
miniMapPlayers:= GetPlayers;
Writeln('Got Players!');
if(getarraylength(miniMapPlayers) = 0)then begin
Writeln('No players are on your minimap!');
Exit;
end;
for i:=0 to (getarraylength(miniMapPlayers)-1) do begin
if(TileOnMS(miniMapPlayers[i].Tile, miniMapPlayers[i].height))then begin
mainScreenPlayers[b]:= miniMapPlayers[i];
Writeln('Stored player on main screen!');
b:= b + 1;
end;
end;
Writeln('Done getting players!');
if(mainScreenPlayers[0].Name = '')then begin
Writeln('No Players on main screen!');
Exit;
end;
Writeln('Reporting!');
i:= random(b);
Writeln(IntToStr(i));
Writeln(mainScreenPlayers[i].Name);
if( skill = '') then begin
Writeln('ERROR:URN: Skill was not given!');
end else begin
Result:= URNasklvl(skill, mainScreenPlayers[i].Name);
end;
end;

{*******************************************************************************
procedure URNsaylvl(skill: Integer; mineIs: boolean);
By: tniffoc
Description: Says the current lvl of the skill under skill id "skill". If mineIs
is true, the procedure will say mine is before the level.
*******************************************************************************}
procedure URNsaylvl(skill: Integer; mineIs: boolean);
var
us: TMe;
begin
us:= GetMe;
if(mineIs)then begin
TypeSend('Mine is ' + IntToStr(us.Levels[skill]));
end else begin
TypeSend(IntToStr(us.Levels[skill]));
end;
end;

{*******************************************************************************
function URNfindfight(b: boolean; i: Integer; s: string): boolean;
By: tniffoc
Description: Finds if a char is in a fight using reflection. If "b" is true it
will run away in "s" direction and wait for "i" + random(rand) seconds before
running back. If you set b to false, set all the other arguments whatever you
want.
*******************************************************************************}
function URNfindfight(b: boolean; i: Integer; rand: integer; s: string): boolean;
var
us: TMe;
begin
us:= GetMe;
if(us.InFight)then begin
Writeln('URN has found a fight!');
Result:= true;
if(b)then begin
Writeln('URN is running away from the fight!');
RunAway(s,true,1,i + random(rand));
end;
end else begin
Writeln('URN did not find a fight!');
Result:= false;
end;
end;

{*******************************************************************************
Function: WalkBox(TileX1, TileY1, TileX2, TileY2, Click, FFlag): Boolean;
By: TurboBk.
Description: Will click anywhere in the box on the MM, defined by, x1 y1 x2 y2.
Click = (1 - LeftClick, 2 - RightClick, 3 - NoClick).
Flag = FFlag.
*******************************************************************************}
// Thanks again TuboBk
Function WalkBox(x1, y1, x2, y2: Integer; Click: Integer; Flag: Integer): Boolean;
Var
P: TPoint;
Y, Z: TPoint;
Begin
If Not LoggedIn Then Exit;
P := GetMyPos;
If PointInBox(P, IntToBox(x1, y1, x2, y2)) Then
Begin
Result := True;
Exit;
End;
Y := TileToMM(IntToPoint(x1, y1));
Z := TileToMM(IntToPoint(x2, y2));
MouseBox(Y.x, Y.y, Z.x, Z.y, Click);
Wait(200 + Random(200)); // Edit
FFlag(Flag);
P := GetMyPos;
If PointInBox(P, IntToBox(x1, y1, x2, y2)) Then
Begin
Result := True;
Exit;
End;
End;

procedure TnifSig;

begin
ClearReport;
AddToReport(' _____________ ');
wait(WaitTime);
AddToReport('| made by |');
wait(WaitTime);
AddToReport(' ----- ---- ');
wait(WaitTime);
AddToReport(' | | ');
wait(WaitTime);
AddToReport(' | | ');
wait(WaitTime);
AddToReport(' | | ');
wait(WaitTime);
AddToReport(' | | ');
wait(WaitTime);
AddToReport(' | | ');
wait(WaitTime)
AddToReport(' \__/ niffoc ');
wait(1000 + random(500));
end;

procedure RandomEvents;
var
i: Integer;
begin
for i:=0 to 5 do
begin
case i of
1: FindNormalRandoms;
2: FindTalk;
3: if(FindMod)then begin Writeln('Mod Found Sleeping!'); Logout; wait(60000*15); LoginPlayer; end;
end;
end;
end;

procedure TniffocAntiBan;
var
i: Integer;
skill: string;
begin
i:= random(4);
if(i = 1)then
skill:= 'attack';
if(i = 2)then
skill:= 'strength';
if(i = 3)then
skill:= 'defence';
if(i = 4)then
skill:= 'hitpoints';
i:= random(15);
case i of
1: if(TalkAboutLevels)then URNlvlstalk(skill);
2: PickUpMouse;
3: begin BoredHuman; MakeCompass('N'); end;
end;
end;

procedure ScriptSig;
begin
Writeln('********************************************************************');
Writeln('Tniffoc''s Cow trainer!!!!');
Writeln('********************************************************************');
end;

procedure RandomTileInCows;
begin
if(WalkBox(3246, 3295, 3263, 3282, 1, 0))then
begin
Writeln('Walked to a random square in the cows!');
end else
begin
Writeln('Couldn''t complete the walk... ');
Logout;
NextPlayer(false);
end;
wait(1000 + random(500));
end;

function TniffocFindCow: boolean;
//Tol:= 30
//Hmod:= .1
//Smod:= .14
var
CTS,i,ATPAHigh: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
foundCow: Boolean;

begin
CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.1, 0.14);
FindColorsSpiralTolerance(x,y,TPA,9344154, MSX1,MSY1,MSX2,MSY2,30);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2,0.2);
if(Length(TPA) > 0)then
begin
ATPA:= SplitTPAEx(TPA,10,10);
ATPAHigh:= High(ATPA);
for i:=0 to ATPAHigh do
begin
MiddleTPAEx(ATPA[i],x,y);
MMouse(x,y,2,2);
if(IsUpText('ow'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
Result:= true;
Writeln('Found a Cow!');
Exit;
end;
end;
Writeln('Didn''t find a cow with the cow colors!');
Result:= false;
Exit;
end else
begin
Writeln('Couldn''t find any cow colors!');
Result:= false;
Exit;
end;
end;


procedure TniffocFindCowForSure;
var
loop,loop2: Integer;
begin
loop:= 0
loop2:= 0;
repeat
repeat
loop:= loop+1;
TniffocFindCow;
Writeln('Starting FtWait');
wait(5000 + random(500));
FindTalk;
until(URNfindfight(false,15000,2000,'S')) or (loop > 3) or FindFight;
if(loop > 3)then
begin
RandomTileInCows;
end;
loop:= 0;
until (URNfindfight(false,15000,2000,'S')) or (loop2 > 10);
if(loop > 10)then
begin
Writeln('Never found a cow.. I think we''re lost!');
Logout;
NextPlayer(false);
end;
end;

procedure ProgressReport; forward;

function HpLeft: Integer;
begin
Result:= GetSkillInfo('hitpoints',true);
end;

procedure CheckHP;
var
i,h: Integer;
s: string;
begin
h:= HpLeft;
if(h <= 5)then
begin
RunAway('S',true,1,15000);
i:= 0;
repeat
RandomTileInCows;
RandomEvents;
TniffocAntiBan;
ProgressReport;
FTWait(4);
wait(30000 + random(1000));
GetMMLevels('hp',s);
until(i = (10 shl 1)) or (s = 'Green');
end;
end;

procedure ProgressReport;
begin
if(IsFKeyDown(2)) then begin
Writeln('------------------------------------------------------------------');
Writeln('Has been killing cows for: ' + TimeRunning);
Writeln('Has killed: ' + IntToStr(ReportVars[0]) + ' cows.');
Writeln('------------------------------------------------------------------');
end;
end;

begin
TnifSig;
ClearDebug;
ScriptSig;
SetupSRL;
DeclarePlayers;
Writeln('Waiting for SMART to setup... Please Hold.');
SmartSetup('world'+intToStr(WorldNumber), Safe, SignedApplet, HighDefinition);
SetTargetDC(SmartGetDC);
Writeln(booltostr(LoggedIn));
ReportVars[0]:= 0;
if(not LoggedIn)then
begin
Writeln('Logging in player.');
LoginPlayer;
Writeln('Just logged in!');
end;
Writeln('Passed Login!');
cowColorArray:= [11580859, 8357000]; //Setup Line
Writeln('Created array!');
repeat
repeat
if(not LoggedIn)then
LoginPlayer;
TniffocFindCowForSure;
Writeln('Found cow!');
ReportVars[0]:= ReportVars[0]+1;
Writeln('Upped report!');
CheckHP;
repeat
RandomEvents;
Writeln('Randomed');
wait(700 + random(300));
Writeln('Waited!');
TniffocAntiBan;
Writeln('Antibanned!');
ProgressReport;
Writeln('Proggied!');
until(not URNfindfight(false, 15000, 2000, 'S'));
GameTab(4);
Writeln('Done!');
until(Players[CurrentPlayer].Integers[0] = ReportVars[0]);
Writeln('Finished Player!');
Writeln('------------------------------------------------------------------');
Writeln('Has been killing cows for: ' + TimeRunning);
Writeln('Has killed: ' + IntToStr(ReportVars[0]) + ' cows.');
Writeln('------------------------------------------------------------------');
NextPlayer(true);
until(CurrentPlayer = (HowManyPlayers-1));
end.

——————————————————
<!– END TEMPLATE: formanswers –>

Harry

2008-09-14 10:54:28

No failsafe in the main loop if your player gets logged off.

function randomizeSkill(skill: string): string; can be shortened. A LOT. ;)

P1nky

2008-09-14 10:56:18

no, sorry i posted the reason in your other thread, where you asked if you could make it.
gl

Tniffoc

2008-09-14 11:10:34

Thanks for the feedback Hy! I've updated the failsafe! How would I shorten the randomizeSkill procedure? I want it to return those exact strings so… is there a way to do that and make it shorter?

Gu3st...

2008-09-14 11:29:24

case Skill of
'Attack': if Random(2) = 0 then Result := 'Atk' else Result := 'Attack';
'Defence': if Random(2) = 0 then Result := 'Def' else Result := 'Defence';
end;

I hold my vote.

Tniffoc

2008-09-14 11:32:26

From: Zytex!
case Skill of
'Attack': if Random(2) = 0 then Result := 'Atk' else Result := 'Attack';
'Defence': if Random(2) = 0 then Result := 'Def' else Result := 'Defence';
end;

I hold my vote.


Ok, looks like I've got a major update coming up. Wouldn't that be bad standards though? Should I use begins and ends or should I do it all on one line?

Method

2008-09-14 11:42:25

Almost your entire script before your function that finds and attacks the cow is an autoresponder or other various functions. I'm going to hold my vote for now, though.

Tniffoc

2008-09-14 11:45:01

From: Method
Almost your entire script before your function that finds and attacks the cow is an autoresponder or other various functions. I'm going to hold my vote for now, though.


I considered placing the auto-responder in a separate file but, the SRL Members application said that it had to compile on it's own. I am now in the process of shortening that procedure and making it more efficient. (See above posts.)

Updated!
New stuff-
  • Shortened randomizeSkill

Raskolnikov

2008-09-15 00:03:20

Sorry no reasons listed above, such as the long randomize skill.
if(us.InFight)then begin
is the then begin on the same line correct standards. I've sure never seen it?
Sorry again good luck

Cut em2 it

NiCbaZ

2008-09-15 00:23:13

'slayer':if random(2) = 0 then  Result:= 'slay' else   Result:= 'slayer';

Would be better.

No sorry, to much AntiBan well its to long.

Scaper

2008-09-15 07:05:06

^^ sorry

Daniel

2008-09-15 07:20:21

Grr, i keep getting Hy71194 confused with EvilChicken cos' of that avatar :p

Sorry, it's a no. Read other peoples comments and improve your script via their suggestions ;)

Tniffoc

2008-09-15 08:01:45

Well, thanks guys, looks like I'm not getting a yes this time :(. Keep up the suggestions though. What's wrong with the anti-ban being long? I fixed it to do the same thing as what NiCbaZ suggested. I've still got hopes though…

Gu3st...

2008-09-15 09:15:50

I think I will vote a yes.

Waddo

2008-09-15 10:17:12

you have reportvars but do srl stats
if you want a aposrophe use 4x' eg ''''
what is urn ? is this definatly your script?

Tniffoc

2008-09-15 17:15:51

From: Zytex!
I think I will vote a yes.


TYSM!

From: Waddo
you have reportvars but do srl stats
if you want a aposrophe use 4x' eg ''''
what is urn ? is this definatly your script?


URN is an include that I built. Because the script had to compile on it's own, I copy-pasted URN into my script. About the apostrophes, I'll update it soon. As for SRL stats, I didn't know if this script was going to succeed or not, so when I release it on Junior Members, If it somewhat succeeds, then I'll add stats. Otherwise, I feel like I'm just clogging the database with a useless script that never get's accessed.

3Garrett3

2008-09-15 17:18:33

From: tniffoc
Well, thanks guys, looks like I'm not getting a yes this time :(. Keep up the suggestions though. What's wrong with the anti-ban being long? I fixed it to do the same thing as what NiCbaZ suggested. I've still got hopes though…


From: 3Garrett3
I just think that since you are given enough time to make a script, and then check the tuts for what you need to get in, then ask around, then fix the script, then test, then fix. In all that time, you should have the script that you want. Not after you get here, you can change it.

Its like a test at school. You get all the time to prepare. Then you get there. You write the test. Your teacher is marking it. You don't get to grab it out of his hands and change things while he marks it. Common sense.


Even though you fix it, it doesn't mean anything to me.. ^^^

Tniffoc

2008-09-15 17:22:38

From: 3Garrett3
Even though you fix it, it doesn't mean anything to me.. ^^^


I thought that I was prepared and I even created a test thread. You can go to it here. I guess I wasn't prepared enough. :p I will allow for a longer test period before my next application. Thanks for the feedback!

3Garrett3

2008-09-15 17:26:37

From: NiCbaZ
Theres a 100% shorter way to do the random skill.

  'attack': Result:= 'attk' or Result:= skill;

Its heaps more simple but shorter, Shorter = l33ter, btw you might want to change the " or" not sure if it will work.


From: Zytex!
Yeah, I didn't really understand the purpose of a so long procedure to shorten a skill name…

Otherwise: You got antiban, but 70% of the script is antiban. :/
And waiting 1 hour because a moderator came along is to much i think.


The major changes were mentioned to how you could fix them..

E: I see that you had already submitted at the time. Maybe instead of being too eager, waited until it was ready fully before submitting?

Tniffoc

2008-09-15 17:36:26

From: 3Garrett3
The major changes were mentioned to how you could fix them..

E: I see that you had already submitted at the time. Maybe instead of being too eager, waited until it was ready fully before submitting?


*sigh*:( I wish I had waited. I was a stupid noob. Noob points+ for me!

NOTE: I did edit the procedure to make it shorter in the end…. just I did it after I submited.

nielsie95

2008-09-20 11:17:34

It seems like you're not getting in this time, sorry.
You may try again in 2 weeks.
Closed.