SRL Archive - SRL Archives

MouseEX! And GetNPCPlace and MORE!


Camaro'

2009-05-08 04:35:24

I have like 5 or 4 new functions! Please comment, well the first one is….

Mouse ex procedures is just a procedure that clicks a tpoint.

Options

LeftClick - Will just left click the tpoint
Rightclick - will right click the tpoint.
Move - will move to the tpoint
LeftFlag - will click and wait for flag;.

But for it to work you must declare

type
Options = (LeftClick,RightClick,Move,leftflag);
at the top of script

MouseEX

Procedure MouseEx(Point: Tpoint; Rx, Ry: integer; Click: Options; FlagDist: integer);
begin
Case Click of
LeftClick: Mouse(Point.x,Point.y,rx,ry,True);
RightClick: Mouse(Point.x,Point.y,rx,ry,False);
Move: MMouse(Point.x,Point.y,rx,ry);
LeftFlag: begin
Mouse(Point.x,Point.y,rx,ry,True);
FFlag(FlagDist);
end;

end;
end;

I think this is very useful.

Second one is GetNPCPlace. What this function does is searches the tbox given for a NPC and if it finds it results a tpoint.
GetNPCPlace

Function GetNPCPlace(Box: TBox): Tpoint;
Var
//i: integer;
npcs: TpointArray;
splitnpcs: T2dPointArray;
begin
findColorsTolerance(npcs,195836,Box.x1,Box.y1,Box.x2,Box.y2,3);
if length(npcs) > 1 then
begin
Splitnpcs := TPAtoATPAEx(npcs,20,20);
SortATPAsize(SplitNpcs,true);
result := MiddleTPA(SplitNpcs[0]);
end;
end;

Next is the update to Hover Skill, called SkillHover..
Well, for more antiban or randomness this function you input how long to hover the skill for, and the randomness on to that number..
SkillHover

procedure SkillHover(Skill: string; WaitTime, Rw: integer);
var
TP : TPoint;
Skills : TStringArray;
begin
if Skill <> 'random' then
TP := SkillToCoords(True,Skill)
else
begin;
Skills := ['attack','defence','strength','hitpoints','mining','smithing','woodcutting','firemaking','magic',
'fletching','hunter', 'summoning','fishing','construction','herblore','agility','thieving','crafting',
'ranged','slayer','farming', 'prayer', 'runecrafting', 'cooking'];
TP := SkillToCoords(True,Skills[Random(Length(Skills))]);
end;
if TP.x = 0 then
Exit;
GameTab(2);
MMouse(Tp.x, TP.y, 10, 10)
Wait(WaitTime + random(Rw));
end;

Next is Players on mm which is simple, all it does it results how many players are on the minimap.

Players ON MM

Function PlayersOnMM: Integer;
Var
i: integer;
ppl: TpointArray;
splitppl: T2dPointArray;
begin
if not(loggedin) then exit;
findColorsTolerance(ppl,16711422,mmx1,mmy1,mmx2,mmy2,1);
Splitppl := TPAtoATPAEx(ppl,4,4);
for i := 0 to high(splitppl) do
if length(Splitppl[i]) >= 3 then
result := result + 1;
end;

Same thing but for npcs..

NPCS on mm

Function NpcOnMM: Integer;
Var
i: integer;
ppl: TpointArray;
splitppl: T2dPointArray;
begin
if not(loggedin) then exit;
findColorsTolerance(ppl,195836,Mmx1,mmy1,mmx2,mmy2,3);
Splitppl := TPAtoATPAEx(ppl,4,4);
for i := 0 to high(splitppl) do
if length(Splitppl[i]) >= 3 then
result := result + 1;
end;

Thats it! Please comment!

Shuttleu

2009-05-08 04:38:52

very good
for the first one i think you should make it this
Procedure MouseEx(Point: Tpoint; Rx, Ry: integer; Click: Options; FlagDist: integer);
begin
Case Click of
LeftClick: Mouse(Point.x,Point.y,rx,ry,True);
RightClick: Mouse(Point.x,Point.y,rx,ry,False);
Move: MMouse(Point.x,Point.y,rx,ry);
LeftFlag: begin
Mouse(Point.x,Point.y,rx,ry,True);
FFlag(FlagDist);
end;

end;
end;
just so it doesnt wait until its stopped
and if the user wants to wait for it to stop then they can just put 0

~shut

ZaSz

2009-05-08 04:43:34

I like em all :p

footballjds

2009-05-08 04:44:48

ROFL, players on mm is already in srl ;)
i made a function for that about 1 year ago and it got submitted :D

Camaro'

2009-05-08 04:56:42

From: footballjds
ROFL, players on mm is already in srl ;)
i made a function for that about 1 year ago and it got submitted :D


Okay, i dont understand whats so funny that you roll on the floor laughing about. Just ignore it. Thanks for other comments guys. Well yeh, shuttleu, i cbf to change it rite now.

NiCbaZ

2009-05-08 05:32:37

From: footballjds
ROFL, players on mm is already in srl ;)
i made a function for that about 1 year ago and it got submitted :D


God you annoy me so such. Learn to type.


Nice functions, they all look nice, good job!

footballjds

2009-05-08 05:36:35

From: NiCbaZ
God you annoy me so such. Learn to type.


Nice functions, they all look nice, good job!


cmon, i didn't type that bad :rolleyes:

Nava2

2009-05-08 05:37:51

Players on Map is in SRL, been replaced, your mouse functions are the same as MouseFlag and the regulars ;)

Whats the change in Skill Hover?

Camaro'

2009-05-08 05:44:29

From: Nava2
Players on Map is in SRL, been replaced, your mouse functions are the same as MouseFlag and the regulars ;)

Whats the change in Skill Hover?


Well, its not the same, its easier if your script clicks a tpoint alot.
And it combines them for easier usage.

Skill hover is explained but ill re say it.

Instead of a set time it hovers on the skill, theres a parameter that you can choose how long it hovers for, and how long the randomness is.

And i didnt no players on mm was in srl.

Nava2

2009-05-09 15:52:07

From: The Cnr Sport
Well, its not the same, its easier if your script clicks a tpoint alot.
And it combines them for easier usage.

Skill hover is explained but ill re say it.

Instead of a set time it hovers on the skill, theres a parameter that you can choose how long it hovers for, and how long the randomness is.

And i didnt no players on mm was in srl.


Hmm I like the idea. Ibprobabky could have checked for myself but thanks for the proposal.

What if we renamed in HoverSkillEx? This way there is no breakage of scripts etc.

Sir R. M8gic1an

2009-05-09 17:18:01


{*******************************************************************************
procedure HoverSkillEx(Skill: string; WaitTime, RWait: integer, Click: boolean);
By: Dankness/Cheesehunk/Ron/Raymond/ZephyrsFury/The Cnr Sport
Description: Hovers mouse over selected skill to "check exp"
Click = True will Click Skill and Click = False will 'Hover'.
Won't "check" skills where your level is 1.
*******************************************************************************}
procedure HoverSkillEx(Skill: string; WaitTime, RWait: integer, Click: boolean);
var
TP: TPoint;
Skills: TStringArray;
TheSkill: string;

begin
if not GameTab(2) then exit;
if Skill <> 'random' then
TP := SkillToCoords(True, Skill)
else
repeat
Skills := ['attack','defence','strength','hitpoints','mining','smithing','woodcutting','firemaking','magic',
'fletching','hunter', 'summoning','fishing','construction','herblore','agility','thieving','crafting',
'ranged','slayer','farming', 'prayer', 'runecrafting', 'cooking'];
TheSkill := Skills[Random(Length(Skills))];
TP := SkillToCoords(True, TheSkill);
until (TP.x > 0) and (GetSkillLevel(TheSkill) > 1);
if Click then
begin
Mouse(Tp.X, TP.Y, 10, 10, True)
Wait(WaitTime + Random(RWait));
CloseWindow;
end else
begin
MMouse(TP.x, TP.y, 10, 10)
Wait(WaitTime + Random(RWait));
end;
end;

{*******************************************************************************
procedure HoverSkill(Skill: String; Click: Boolean);
By: Rasta Magician
Description: Hovers mouse over selected skill to "check exp"
Click = True will Click Skill and Click = False will 'Hover'.
Won't "check" skills where your level is 1.
*******************************************************************************}

procedure HoverSkill(Skill: string; Click: Boolean);
var
Wait, RWait: integer;

begin
if Click then
begin
Wait := 5000;
RWait := 9000;
end else begin
Wait := 1000;
RWait := 3000;
end;

HoverSkillEx(Skill, Wait, RWait, Click);
end;

i'll add it soon unless anyone has somethign against it.

~RM

Camaro'

2009-05-09 18:37:15

From: Rasta Magician

{*******************************************************************************
procedure HoverSkillEx(Skill: string; WaitTime, RWait: integer, Click: boolean);
By: Dankness/Cheesehunk/Ron/Raymond/ZephyrsFury/The Cnr Sport
Description: Hovers mouse over selected skill to "check exp"
Click = True will Click Skill and Click = False will 'Hover'.
Won't "check" skills where your level is 1.
*******************************************************************************}
procedure HoverSkillEx(Skill: string; WaitTime, RWait: integer, Click: boolean);
var
TP: TPoint;
Skills: TStringArray;
TheSkill: string;

begin
if not GameTab(2) then exit;
if Skill <> 'random' then
TP := SkillToCoords(True, Skill)
else
repeat
Skills := ['attack','defence','strength','hitpoints','mining','smithing','woodcutting','firemaking','magic',
'fletching','hunter', 'summoning','fishing','construction','herblore','agility','thieving','crafting',
'ranged','slayer','farming', 'prayer', 'runecrafting', 'cooking'];
TheSkill := Skills[Random(Length(Skills))];
TP := SkillToCoords(True, TheSkill);
until (TP.x > 0) and (GetSkillLevel(TheSkill) > 1);
if Click then
begin
Mouse(Tp.X, TP.Y, 10, 10, True)
Wait(WaitTime + Random(RWait));
CloseWindow;
end else
begin
MMouse(TP.x, TP.y, 10, 10)
Wait(WaitTime + Random(RWait));
end;
end;

{*******************************************************************************
procedure HoverSkill(Skill: String; Click: Boolean);
By: Rasta Magician
Description: Hovers mouse over selected skill to "check exp"
Click = True will Click Skill and Click = False will 'Hover'.
Won't "check" skills where your level is 1.
*******************************************************************************}

procedure HoverSkill(Skill: string; Click: Boolean);
var
Wait, RWait: integer;

begin
if Click then
begin
Wait := 5000;
RWait := 9000;
end else begin
Wait := 1000;
RWait := 3000;
end;

HoverSkillEx(Skill, Wait, RWait, Click);
end;

i'll add it soon unless anyone has somethign against it.

~RM


Nothing wrong with me :P.

Sir R. M8gic1an

2009-05-10 12:53:44

From: The Cnr Sport
Nothing wrong with me :P.


added :p

~RM

Nava2

2009-05-12 04:22:24

{*******************************************************************************
procedure HoverSkill(Skill: String; Click: Boolean);
By: Rasta Magician & Nava2
Description: Hovers mouse over selected skill to "check exp"
Click = True will Click Skill and Click = False will 'Hover'.
Won't "check" skills where your level is 1.
*******************************************************************************}

procedure HoverSkill(Skill: string; Click: Boolean);
begin
HoverSkillEx(Skill, 3000 + Integer(Click) * 2000, 6000 + Integer(Click) * 3000, Click);
end;