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
——————————————————
<!– END 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 –>