SRL Archive - SRL Suggestions

MouseSkill ~ Antiban/Gametab/Mouse.scar


Rich

2010-06-02 14:37:07

It's pretty much HoverSkill, but gives you more choice of what to do.
What to do is decided by Action.
1 = Hover over Skill      2 = Left click on Skill, leave open window
3 = Left click on Skill, closes window 4 = Right click on Skill
{*******************************************************************************
procedure MouseSkill(Skill : string; Action : Integer);
By: R1ch
Description: Performs actions with selected skill under the Skills tab.
1 = Hover over Skill 2 = Left click on Skill, leave open window
3 = Left click on Skill, closes window 4 = Right click on Skill
*******************************************************************************}
procedure MouseSkill(Skill : string; Action : Integer);
var
TP: TPoint;
Skills: TStringArray;
TheSkill: string;
begin
if(not(GameTab(tab_Stats))) then exit;
if(Skill <> 'random')then
TP := SkillToCoords(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(TheSkill);
until (TP.x > 0) and (GetSkillLevel(TheSkill) > 1);
case Action of
1 : begin
MMouse(TP.x, TP.y, 10, 10);
Wait(1000 + Random(3000));
end;
2, 3 : begin
Mouse(Tp.y, TP.y, 10, 10, True);
if Action = 3 then
begin
Wait(5000 + Random(6500));
CloseWindow;
end;
end;
4: Mouse(TP.x, TP.y, 10, 10, False);
end;
end;
Comments?

marpis

2010-06-02 14:52:34

When would you use this?

Rich

2010-06-02 14:57:06

It could be used in the future for anti-ban (creating Objectives), and it also gives the user the ability to customize it a bit more.

Camaro'

2010-06-02 17:42:43

From: R1ch
It could be used in the future for anti-ban (creating Objectives), and it also gives the user the ability to customize it a bit more.


Meh, not needed, but the HoverSkill in SRL I never liked. It doesn't look human to me.

Sir R. M8gic1an

2010-06-02 20:22:58

I somewhat like it. But let's get it cleaned up please. SkillToCoords takes a variant. There's the skill constants. These are two facts that co-exist for a reason.

[php]
const
HOVER_SKILL = 1;
OPEN_SKILL = 2;
CHECK_CLOSE_SKILL = 3;
RCLICK_SKILL = 4;

{*******************************************************************************
procedure MouseSkill(Skill, Action : Integer);
By: R1ch
Description: Performs actions with selected skill under the Skills tab.

HOVER_SKILL = Hover over Skill
OPEN_SKILL = Left click on Skill, leave open window
CHECK_CLOSE_SKILL = Left click on Skill, closes window
RCLICK_SKILL = Right click on Skill

Skill = 0 for random skill
*******************************************************************************}
procedure MouseSkill(Skill, Action : Integer);
var
TP: TPoint;
begin
if not GameTab(tab_Stats) then exit;

if Skill > 0 then
TP := SkillToCoords(Skill)
else begin
Skill := RandomRange(skill_Attack, skill_Summoning);
TP := SkillToCoords(Skill);
end;

case Action of

HOVER_SKILL :
begin
MMouse(TP.x, TP.y, 10, 10);
Wait(1000 + Random(3000));
end;

OPEN_SKILL, CHECK_CLOSE_SKILL :
begin
Mouse(Tp.y, TP.y, 10, 10, True);
if Action = CHECK_CLOSE_SKILL then
begin
Wait(5000 + Random(6500));
CloseWindow;
end;
end;

RCLICK_SKILL:
Mouse(TP.x, TP.y, 10, 10, False);
end;
end;
[/php]

~RM

Mr. Doctor

2010-06-02 21:00:48

I also made something like this. The bad thing is, when you open the window it stops you from doing what ever you were doing. Unless you close it in less than a second. But what's the reason of opening the window if you only have one second to read it?

Sir R. M8gic1an

2010-06-02 21:26:37

From: Mr. Doctor
I also made something like this. The bad thing is, when you open the window it stops you from doing what ever you were doing. Unless you close it in less than a second. But what's the reason of opening the window if you only have one second to read it?


Use it as a long antiban. Eg, before opening the bank. Seems like a natural time to be looking at it.

This function would look at it for 5-11 seconds, in case you didn't notice it.

~RM

Mr. Doctor

2010-06-02 21:53:08

From: Rasta Magician
Use it as a long antiban. Eg, before opening the bank. Seems like a natural time to be looking at it.

This function would look at it for 5-11 seconds, in case you didn't notice it.

~RM


I concur. Now I reconsider my last post. Maybe one that could browse the skill menu?

E: [Offtopic] Any ETA on the Junior Member competition, Rasta Magician? PM me. [/Offtopic] (Unknowingly rhymes)

Tim0suprem0

2010-06-02 22:57:58

[QUOTE=Camaro';714347]Meh, not needed, but the HoverSkill in SRL I never liked. It doesn't look human to me.

I think it's about as necessary as HoverSkill, and I like it better than HoverSkill.

From: Mr. Doctor
Any ETA on the Junior Member competition, Rasta Magician?


From: i luffs yeww
^ I see no rhymes.

swisspking

2010-06-03 01:37:07

The "CHECK_CLOSE_SKILL" Thing could also be used after a lvl-up is detected. I personally do this every lvl-up.

~Swiss

Sir R. M8gic1an

2010-06-03 05:27:53

From: Mr. Doctor
I concur. Now I reconsider my last post. Maybe one that could browse the skill menu?

E: [Offtopic] Any ETA on the Junior Member competition, Rasta Magician? PM me. [/Offtopic] (Unknowingly rhymes)


Why don't you PM me ? lol, found it funny for you to be telling me how best to behave.

@R1ch:
I just checked HoverSkill, and this is pretty much the same code except you added two options to it. I see no one else credited. I'll add this to the svn when I figure out who should be credited & etc.


{*******************************************************************************
procedure HoverSkill(Skill: String; Click: Boolean);
By: Dankness/Cheesehunk/Ron/Raymond/ZephyrsFury
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
TP: TPoint;
Skills: TStringArray;
TheSkill: string;
begin
if(not(GameTab(tab_Stats))) then exit;
if(Skill <> 'random')then
TP := SkillToCoords(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(TheSkill);
until (TP.x > 0) and (GetSkillLevel(TheSkill) > 1);
if(Click)then
begin
Mouse(Tp.X, TP.Y, 10, 10, True);
Wait(5000 + Random(9000));
CloseWindow;
end else
begin
MMouse(TP.x, TP.y, 10, 10);
Wait(1000 + Random(3000));
end;
end

The only thing you seem to have done is add a case.

@Tim0: I don't see how you can NOT like HoverSkill but like MouseSkill. Essentially the same code.

~RM

ZephyrsFury

2010-06-03 05:56:15

I think you should just edit HoverSkill to include all of the actions you have in MouseSkill. Change the Boolean to a variant for compatibilities sake. True = Click and Wait, False = Hover, and then integer constants for your options. Although I have to ask what is the use of Click and Leave open and Right Click? Another possible option is to have it open the menu, have a look around, clicking tabs, then close.

Rich

2010-06-03 06:20:12

From: Rasta Magician
@R1ch:
I just checked HoverSkill, and this is pretty much the same code except you added two options to it. I see no one else credited. I'll add this to the svn when I figure out who should be credited & etc.


I didn't know who to credit, so I just slapped my name in there. I've no problem with you changing it.

From: ZephyrsFury
I think you should just edit HoverSkill to include all of the actions you have in MouseSkill. Change the Boolean to a variant for compatibilities sake. True = Click and Wait, False = Hover, and then integer constants for your options. Although I have to ask what is the use of Click and Leave open and Right Click? Another possible option is to have it open the menu, have a look around, clicking tabs, then close.


Click and leave open could be used for what you said; exploring the skill window. Right click could be used to set Objectives, and just as a form of anti-ban.

Sir R. M8gic1an

2010-06-03 07:21:34

From: R1ch
I didn't know who to credit, so I just slapped my name in there. I've no problem with you changing it.


How didn't you know who to credit?! The names are right there!

Doesn't matter.

~RM

Rich

2010-06-03 08:36:16

From: Rasta Magician
How didn't you know who to credit?! The names are right there!~RM


There were too many names LOL. I was just being very lazy. :redface:

Sir R. M8gic1an

2010-06-03 09:03:58

Quite honestly I think I'll just change skill in HoverSkill to a variant. Don't want to be bothering myself with issues over credit.

edit: done

~RM

ZephyrsFury

2010-06-03 09:06:49

From: Rasta Magician
Quite honestly I think I'll just change skill in HoverSkill to a variant. Don't want to be bothering myself with issues over credit.

~RM


That's why I do stuff like this:


By: Dankness/Cheesehunk/Ron/Raymond/ZephyrsFury

Just add keep adding names :p

Sir R. M8gic1an

2010-06-03 09:21:02

From: ZephyrsFury
That's why I do stuff like this:


By: Dankness/Cheesehunk/Ron/Raymond/ZephyrsFury

Just add keep adding names :p


You never cleaned out everyone's name tho. And some changes are too minor to bother adding credits. As if I were going to add myself to credits just because I made it use a variant now >.>

~RM

Wizzup?

2010-06-03 10:59:20

From: Rasta Magician
Quite honestly I think I'll just change skill in HoverSkill to a variant. Don't want to be bothering myself with issues over credit.

edit: done

~RM


Why Variants? I know I introduced them over a year ago, but they're actually rather annoying and generally bad practice in a statically typed language.

Rich

2010-06-03 12:13:18

To be honest RM, my way seems easier to use. Don't worry about credits; add my name or don't add my name - I don't care.

Sir R. M8gic1an

2010-06-03 18:24:44

From: Wizzup?
Why Variants? I know I introduced them over a year ago, but they're actually rather annoying and generally bad practice in a statically typed language.


Backwards compatibility.

ATM it was using strings, while we have the skill constants. I added a variant so it doesn't break scripts using strings, but so it allows people to use the consts.

~RM