SRL Archive - SRL Suggestions

QuickMouse


Sir R. M8gic1an

2011-01-27 07:01:55

U know all those mouse functions that usually get turned down?

I think that functions that mix two things should have a place in SRL.

eg, not 1 thing, not 10 things, 2 things.

MouseUpText
MouseColorTol
MouseDoubleClick

why? because we repeat these things all the time



//SRLSettings.Simba
const
rX = 5;
rY = 5;
WAIT_UPTEXT = 200;

//SetupSRL
var
RP: TPoint;
sUTW: integer;

procedure SetupSRL;
begin
RP := Point(Max(rX, sX), Max(rY, sY));
sUTW := sUTW := Max(WAIT_UPTEXT, UT_Wait); //sUTW = SRL UpTextWait
end;

//Script.Simba
program AScript;

var
sX, sY, UT_Wait: integer;

procedure SetupScript;
begin
sX := 3;
sY := 3;
UT_Wait = 150;
end;

{ Replaces
MMouse(x, y, RP.X, RP.Y);
QuickMouse(TP, RP, LeftClick, 'uard'); //guard
}

//Contributors: Nielsie95, Sir R. Magician, Sex, Rich, Zyt3x
{ function: QuickMouse;
QuickMouse is a function that relies on preset values to allow maximum scripting efficiency.
These values can be changed in Settings.Simba, or on your own Script.
QuickMouse uses the variables set in SetupSRL.
}
function QuickMouse(TP, RP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
var
MPos : TPoint;
begin
MMouse(TP.x, TP.y, RP.x, RP.y);
Result := WaitUpText(sUTW);
if (Action = Move) or ((not Result) xor (Action = Move)) then exit;

// by Rich
GetMousePos(MPos.x, MPos.y);
if Action = LeftClick then
Mouse(MPos.x, MPos.y, 0, 0, True)
else
Mouse(MPos.x, MPos.y, 0, 0, False)

Result := pos(UpText, GetUpText) > 0; // RM & Zyt3x fix
end;

and even more… you can have constants for your x and y randomness which you can then store into a TPoint which you pass on to the function.

~RM

**BANNED The Man

2011-01-27 07:06:09

I would have to agree…
But still the opposite point is if you make a function for everything then it would be way to easy to script.
But I agree that things we use in EVERY script and like half the functions in a script should be added.

-Boom

EvilChicken!

2011-01-27 08:25:43

I actually agree. :)

I'd like to see you make all these functions, then people could say which ones they'd find useful and not.

Awkwardsaw

2011-01-27 08:28:12

i have always agreed with these mouse functions. it doesnt break any scripts, its easy to commit, and its convenient. perhaps a MouseChooseOption?
(pseudo code)

function MChooseOption(TP, rXY: TPoint; UpText, option: string): boolean;
begin
if not MouseUpText(TP, rXY, false, UpText) then
exit;
result := waitchooseoption(option, 500);
end;

as above, yes its only two lines, but it serves the same purpose

marpis

2011-01-27 10:09:19

MouseUptext is actually the only one that I approve.

For multimouse, the user can just do

for i := 1 to 5 do
Mouse(x, y, 0, 0, true);


MouseColor? Not going to be used. There are a million different ways of finding the place we want to click, and FindObject functions should be enough.

Sex

2011-01-27 11:00:22

This line would have to be changed. GetUpText gets the entire uptext, correct?
Result := GetUpText = UpText;

Gu3st...

2011-01-27 11:08:10

From: Sex
This line would have to be changed. GetUpText gets the entire uptext, correct?
Result := GetUpText = UpText;
Pos(UpText, GetUpText) <> 0

I agree with Marpis

anonymity

2011-01-27 12:39:05

On the general topic, I agree that combining functionality is a great idea! I do think that if this were to be done, it should be added not edited.

ex, keeping all of the original functions there and adding ones that do more for less lines.

As long as we can still do what we want specifically without changing the lesser functions or taking away the option to utilize them.

Rich

2011-01-27 14:01:35

Instead of the example you posted RM, how about:
function MouseUpText(TP, rXY: TPoint; Action: Integer; UpText: String): boolean;
var
mTP: TPoint;
begin
MMouse(TP.x, TP.y, rXY.x, rXY.y);
Result := WaitUpText(UpText, 500);

if ((not Result) or (Action = 0)) then exit;

GetMouseTP(mTP);
if Action = 1 then
Mouse(mTP.x, mTP.y, 0, 0, True)
else
Mouse(mTP.x, mTP.y, 0, 0, False)

Result := GetUpText = UpText;
end;

Wizzup?

2011-01-27 14:03:21

I don't really like this. What's the point? Really. If someone wants these he can easily recreate them himself. It's not like it really abstracts anything either. What if I made a function AddXThenSubstractY(x,y,z):integer; ? That one is just as useful as the ones mentioned here.

Rich

2011-01-27 14:09:28

But isn't the point of the include for users to have resources and functions at their fingertips? You could argue the same for functions like WaitOption, which are now widely used, but could also be recreated by the user.

Wanted

2011-01-27 14:20:41

What is with all this redundant function wrapping lately. If you're worried about it being used to many times then put it in your script, SRL has enough redundant code as it is. The only one of those that is even remotely useful is MouseUpText and that would eliminate the need for WaitUpText because you might as well combine the two into one function.

It's sorta like using the generic Object.scar FindObj except this is as simple as a mouse movement? Enough with this.

Nava2

2011-01-27 15:31:10

SRL is for COMPLICATED functions which are not arbitrary for one to create.

Why do you think we try to have the best available people developing? Because we want people to write shortcut methods? No.

marpis

2011-01-29 12:39:03

Now that I think of this, I always use WaitUptext instead of IsUptext. But we don't know how long the user wants his script to wait for the uptext, so mehh. Also I don't think this is the same thing as WaitOption, since they are not that easy, I mean they have loops with timers. This would just be

functionMouseUptext(x, y, rx, ry: integer; Uptext: string; left: boolean): boolean;
begin
MMouse(x, y, rx, ry);
if IsUptext(Uptext) then
begin
Result := True;
ClickMouse2(left);
end;
end;

Also, what Nava2 said.

Wizzup?

2011-01-29 13:06:34

From: Nava2
Why do you think we try to have the best available people developing? Because we want people to write shortcut methods? No.


Don't get too high on your horse… The best people will do simple tasks as well, because those tend not to be done, even though they are often essential to the success of a project.

Nava2

2011-01-29 13:57:40

From: Wizzup?
Don't get too high on your horse… The best people will do simple tasks as well, because those tend not to be done, even though they are often essential to the success of a project.


I think you missed my point.

These methods are not necessary, and we have some of the best people working on this project so we know what is right, and then are capable of doing the more complicated sides of things.

.. I was also kinda rattled about something else at this point (personally). For that, I apologise.

Sir R. M8gic1an

2011-01-29 17:37:20

From: EvilChicken!
I actually agree. :)

I'd like to see you make all these functions, then people could say which ones they'd find useful and not.


GIT!

function MouseUpText(TP, rXY: TPoint; Action: Integer; UpText: String): boolean;
var
mTP: TPoint;
begin
MMouse(TP.x, TP.y, rXY.x, rXY.y);
Result := WaitUpText(UpText, 500);

if ((not Result) or (Action = 0)) then exit;

GetMouseTP(mTP);
if Action = 1 then
Mouse(mTP.x, mTP.y, 0, 0, True)
else
Mouse(mTP.x, mTP.y, 0, 0, False)

Result := GetUpText = UpText;
end;

What's Action 0?

From: Nava2
SRL is for COMPLICATED functions which are not arbitrary for one to create.

Why do you think we try to have the best available people developing? Because we want people to write shortcut methods? No.


Yeh well, while we're on SRL 5 we might as well chuck them in. ;)

RM

Rich

2011-01-29 17:57:55

From: Sir R. M8gic1an
function MouseUpText(TP, rXY: TPoint; Action: Integer; UpText: String): boolean;
var
mTP: TPoint;
begin
MMouse(TP.x, TP.y, rXY.x, rXY.y);
Result := WaitUpText(UpText, 500);

if ((not Result) or (Action = 0)) then exit;

GetMouseTP(mTP);
if Action = 1 then
Mouse(mTP.x, mTP.y, 0, 0, True)
else
Mouse(mTP.x, mTP.y, 0, 0, False)

Result := GetUpText = UpText;
end;

What's Action 0?
Just move the mouse and check. No clicking.

EDIT:
function MouseUpText(TP, rXY: TPoint; Action: Integer; UpText: String): boolean;
var
mTP: TPoint;
begin
if not InRange(Action, 0, 2) then
begin
srl_Warn('[MouseUpText] Action ' + Action + ' is not a valid Action', warn_AllVersions);
Exit;
end;
MMouse(TP.x, TP.y, rXY.x, rXY.y);
Result := WaitUpText(UpText, 500);

if ((not Result) or (Action = 0)) then exit;

GetMouseTP(mTP);
if Action = 1 then
Mouse(mTP.x, mTP.y, 0, 0, True)
else
Mouse(mTP.x, mTP.y, 0, 0, False)

Result := GetUpText = UpText;
end;

Gu3st...

2011-01-29 19:12:40

Why are you using hard coded values when you have constants for it?
Action = 0, InRange(Action, 0, 2)

Also; Result := GetUpText = UpText; will never return true if the user inputs only parts of the uptext (like "ttack" instead of "Attack Chicken / Level - 2 blah blah"

Nose Smasher

2011-01-29 19:22:15

Don't really see a need for this… Sounds just like a function one would write into the script itself to save yourself a few lines of code… I usually find myself editing SRL functions for my scripts anywayz…

Sir R. M8gic1an

2011-01-29 19:43:27

From: nose_smasher
Don't really see a need for this… Sounds just like a function one would write into the script itself to save yourself a few lines of code… I usually find myself editing SRL functions for my scripts anywayz…


RM.simba ;)

~RM

Sir R. M8gic1an

2011-01-29 20:22:12

SRL 5 Approved.

~RM

Nava2

2011-01-30 00:28:45

From: Sir R. M8gic1an
SRL 5 Approved.

~RM


Where was this said?

This is not *just* your decision.

Sir R. M8gic1an

2011-01-30 03:34:54

well, approved by me :)

Sir R. M8gic1an

2011-01-30 05:36:49


const
WAIT_UPTEXT = 200; //Settings.Simba

var
UT_Wait: integer; //Uptext wait

procedure SetupScript;
begin
UT_Wait := 150;
end;

procedure SetupSRL;
begin
sUTW := Max(WAIT_UPTEXT, UT_Wait); //sUTW = SRL UpTextWait
end;

//Contributors: Sir R. Magician, Rich, Zyt3x
{
QuickMouse is a function that relies on preset values to allow maximum scripting efficiency.
These values can be changed in Settings.Simba, or on your own Script.
QuickMouse uses the variables set in SetupSRL.
}
function QuickMouse(TP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
begin
MMouse(TP.x, TP.y, rXY.X, rXY.Y);
Result := WaitUpText(sUTW);

if (!Result) xor (Action = Move) then exit;

// by Rich
GetMouseTP(mTP);
if Action = 1 then
Mouse(mTP.x, mTP.y, 0, 0, True)
else
Mouse(mTP.x, mTP.y, 0, 0, False)

Result := pos(UptText, GetUpText) > 0; // RM & Zyt3x fix
end;


@Nava: I think every developer has the right to approve something for the repos ;) We can always discuss whether we really want it in later and discuss ways to make it better.

QuickMouse honestly sounds a lot better than MMouse ;)

~RM

Sex

2011-01-30 05:40:35

From: Sir R. M8gic1an
Simba Code:
[LEFT]function QuickMouse(TP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
begin
MMouse(TP.x, TP.y, rXY.X, rXY.Y);
Result := WaitUpText(Wait_UT);

if (!Result) xor (Action = Move) then exit;

// by Rich
GetMouseTP(mTP);
if Action = 1 then
Mouse(mTP.x, mTP.y, 0, 0, True)
else
Mouse(mTP.x, mTP.y, 0, 0, False)

Result := pos(UptText, GetUpText) > 0; // RM & Zyt3x fix
end;
[/LEFT]


@Nava: I think every developer has the right to approve something for the repos ;) We can always discuss whether we really want it in later and discuss ways to make it better.

QuickMouse honestly sounds a lot better than MMouse ;)

~RM
I believe I saw a post above yours. I may be wrong though, or it was deleted.
Result := pos(UptText, GetUpText) > 0; // RM & Zyt3x fix
I brought that up :p.

And also, yes, in the mouse related functions, why are enumerations not used?

**BANNED The Man

2011-01-30 05:43:24

From: Sir R. M8gic1an

const
WAIT_UPTEXT = 200; //Settings.Simba

var
UT_Wait: integer;

procedure SetupScript;
begin
UT_Wait := 150;
sUTW := Max(WAIT_UPTEXT, UT_Wait); //sUTW = SRL UpTextWait, should go in SetupSRL
end;

//Contributors: Sir R. Magician, Rich, Zyt3x
function QuickMouse(TP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
begin
MMouse(TP.x, TP.y, rXY.X, rXY.Y);
Result := WaitUpText(sUTW);

if (!Result) xor (Action = Move) then exit;

// by Rich
GetMouseTP(mTP);
if Action = 1 then
Mouse(mTP.x, mTP.y, 0, 0, True)
else
Mouse(mTP.x, mTP.y, 0, 0, False)

Result := pos(UptText, GetUpText) > 0; // RM & Zyt3x fix
end;

@Nava: I think every developer has the right to approve something for the repos ;) We can always discuss whether we really want it in later and discuss ways to make it better.

QuickMouse honestly sounds a lot better than MMouse ;)

~RM


You need to set rXY :D

-Boom

Sex

2011-01-30 05:56:33

Correct ^.
There was a bit more wrong with that function. I revised it a little below. I do believe RM is lit though :p.
function WhateverTheFuckYouWantToCallIt(TP, RP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
var
MPos : TPoint;
begin
MMouse(TP.x, TP.y, RP.x, RP.y);
Result := WaitUpText(UpText);
if (not Result) xor (Action = Move) then exit;

// by Rich
GetMousePos(MPos.x, MPos.y);
if Action = LeftClick then
Mouse(MPos.x, MPos.y, 0, 0, True)
else
Mouse(MPos.x, MPos.y, 0, 0, False)

Result := pos(UpText, GetUpText) > 0; // RM & Zyt3x fix
end;

Sir R. M8gic1an

2011-01-30 05:59:31

I like the RP naming :)


//SRLSettings.Simba
const
rX = 5;
rY = 5;
WAIT_UPTEXT = 200;

//SetupSRL
var
RP: TPoint;
sUTW: integer;

procedure SetupSRL;
begin
RP := Point(Max(rX, sX), Max(rY, sY));
sUTW := sUTW := Max(WAIT_UPTEXT, UT_Wait); //sUTW = SRL UpTextWait
end;

//Script.Simba
program AScript;

var
sX, sY, UT_Wait: integer;

procedure SetupScript;
begin
sX := 3;
sY := 3;
UT_Wait = 150;
end;

{ Replaces
MMouse(x, y, RP.X, RP.Y);
QuickMouse(TP, RP, LeftClick, 'uard'); //guard
}

//Contributors: Nielsie95, Sir R. Magician, Sex, Rich, Zyt3x
{ function: QuickMouse;
QuickMouse is a function that relies on preset values to allow maximum scripting efficiency.
These values can be changed in Settings.Simba, or on your own Script.
QuickMouse uses the variables set in SetupSRL.
}
function QuickMouse(TP, RP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
var
MPos : TPoint;
begin
MMouse(TP.x, TP.y, RP.x, RP.y);
Result := WaitUpText(sUTW);
if (Action = Move) or ((not Result) xor (Action = Move)) then exit;

// by Rich
GetMousePos(MPos.x, MPos.y);
if Action = LeftClick then
Mouse(MPos.x, MPos.y, 0, 0, True)
else
Mouse(MPos.x, MPos.y, 0, 0, False)

Result := pos(UpText, GetUpText) > 0; // RM & Zyt3x fix
end;

~RM

Sex

2011-01-30 06:02:24

From: Sir R. M8gic1an
I like the RP naming :)

Simba Code:
[LEFT]//SRLSettings.Simba
const
rX = 5;
rY = 5;

//Script.Simba
program AScript;

var
sX, sY: integer;

procedure DeclarePlayers;
begin
sX := 3;
sY := 3;
end;

procedure SetupScript;
begin
rXY := Point(Max(rX, sX), Max(rY, sY));
end;

MMouse(x, y, rXY.X, rXY.Y);
[/LEFT]


~RM

Is it supposed to be that rXY will always have 5,5? You have Max so it chooses the highest number of the two.

Sir R. M8gic1an

2011-01-30 06:08:55

From: Sex
Is it supposed to be that rXY will always have 5,5? You have Max so it chooses the highest number of the two.


You get to change your personal settings.

Also, looking at your code, we could pass on RP as the RandomPoint if we wanted to, otherwise you can give it any other point.

Will add the code to the other post ;) e: added


{ Replaces
QuickMouse(TP, RP, LeftClick, 'uard'); //guard
MMouse(x, y, RP.X, RP.Y);
WaitUpText
Mouse

//Next in line: QuickMouseOption
}

NOTICE: this does not make scripts too easy to script. This does the easy part for you.

~RM

nielsie95

2011-01-30 06:26:55

You seriously didn't notice all the errors in that piece of code, but you still approve it for SRL..? You still missed the xor.

Sir R. M8gic1an

2011-01-30 06:44:56

Actually, the xor is not all that wrong :p

I was thinking through it while doing it, what got me messed up was the Result variable in that line.

if Action = Move then exit.

The result is already set ;)

Also Niels, getting 1 xor possibility wrong in the middle of all this… You know, we're not all pro ;)

~RM

nielsie95

2011-01-30 06:48:45

Why would you click when action = move and WaitUpText was false? You need an or ;)

Sir R. M8gic1an

2011-01-30 06:49:23

From: nielsie95
Why would you click when action = move and WaitUpText was false?


Oh shit yeh, so that xor was right there…

~RM

nielsie95

2011-01-30 06:51:59

You're looking for or.

EDIT: I see you've edited your posts.


if (Action = Move) or ((not Result) xor (Action = Move)) then exit;

//I meant:
if (not Result) or (Action = Move) then exit;

From: Sir R. M8gic1an

Also Niels, getting 1 xor possibility wrong in the middle of all this… You know, we're not all pro ;)

~RM

I thought you posted here after I pointed out the wrongs in the developers' section, so I'm sorry for reacting that way. But you still might want to actually compile before you post (if you're not certain of your code). Also, wouldn't WaitUpText need to receive the uptext as a parameter?

Sir R. M8gic1an

2011-01-30 07:00:56

From: nielsie95
You're looking for or.


I found or ;) Thank you :)

~RM

Nava2

2011-01-30 11:15:07

From: Sir R. M8gic1an
@Nava: I think every developer has the right to approve something for the repos ;) We can always discuss whether we really want it in later and discuss ways to make it better.


When there are 3 other saying no, you really can not. Your prerogative is not greater than that of the development team. I can not fathom what has made your opinion so much greater than everyone else's here, but you are wrong and its blatantly obvious to those who disagree.

I also really dislike how you are having this conversation in public boards where it looks as though you are trying to help out some ``lower ranks'' but the ``big bad devs'' disagree with you.

TL;DR:
If this is put into SRL5, I will remove it. I think others will as well. Good day.

Rich

2011-01-30 12:03:32

^ Why remove it? There's absolutely no harm in having a good function added into the include, which I'm sure many people will use.

3Garrett3

2011-01-30 12:26:19

From: Rich
^ Why remove it? There's absolutely no harm in having a good function added into the include, which I'm sure many people will use.


This^

I see no harm in having it there. SRL isn't only l33t functions which are too complex for the average person to think of. It wont hurt to have it there, people can use it if they want.

Nava2

2011-01-30 12:27:11

From: 3Garrett3
This^

I see no harm in having it there. SRL isn't only l33t functions which are too complex for the average person to think of. It wont hurt to have it there, people can use it if they want.


The fact of the matter is, people should not use it. It is poor practice and not a good idea.

Rich

2011-01-30 12:37:25

Who should people not use it? Why is it poor practice? Why is it a bad idea? Like I said a couple of posts ago, it's a good function, and there's no harm done in including it. What's wrong with making people's lives easier?

bugger0001

2011-01-30 12:37:27

Tbh, I do mind having "a few good" functions in the include. Let's say one would use a real shitty computer for Simba scripting or what ever. Having a big include would seriously slow down the runtime then. I'm not saying RM's functions would cause this or anything, but it is usually a principle for such projects not to have "trivial" stuff in it. By adding one trivia, you create an instance to allow others and thus your project will grow too big and messy to handle. Nobody wants to have all the good stuff and not know where it is or how it's named or even worse. It is better to have less ;)

3Garrett3

2011-01-30 12:38:29

From: Nava2
The fact of the matter is, people should not use it. It is poor practice and not a good idea.


I've looked at the code harder, and I'll agree that at the stage it's in (written by Sex) it shouldn't be used. It doesn't even have a chooseoption after the right click. And the result at the end doesn't make sense either. It could be reworked to actually be useful, maybe when RM isn't high he will look at it more, but currently it isn't useful. The idea has potential though, IMO

Rich

2011-01-30 12:43:00

Ignoring the function in question, you could say the same which you are saying for the function for quite a portion of timing.simba.

function WaitUpTextMulti(S: TStringArray; Time: Integer): Boolean;
var
T: Integer;
begin
Result := false;
T := GetSystemTime + Time;
while (GetSystemTime < T) do
begin
if (IsUpTextMultiCustom(S)) then
begin
Result := True;
Exit;
end;
Wait(20 + Random(20));
end;
end;
Isn't a hard bit of code to write, but it, and many other functions like it, are in that file.

EDIT: Improved the QuickMouse function (pretty much rewrote it):
{*******************************************************************************
function QuickMouse(TP, RP: TPoint; Action : Integer; UpText, Option : string): Boolean;
By: Loads of people
Date: 30/01/2011
Description: Mouse function with variable options.
TP and RP -> Mouse co-ords and random mouse co-ords.
Action -> 0 = move, 1 = left click, 2 = right click, 3 = right click and choose option
Set UpText to use and uptext check
Set Option when using Action 3 to choose an option in the list
*******************************************************************************}
function QuickMouse(TP, RP: TPoint; Action: (Move, LeftClick, RightClick, RClickOption); UpText, Option : string): Boolean;
var
MPos : TPoint;
begin
MMouse(TP.x, TP.y, RP.x, RP.y);
if not UpText = '' then
Result := WaitUpText(UpText, 500)
else
begin
srl_Warn('[QuickMouse] Uptext check is recommended', warn_AllVersions);
Result:= True;
end;
if ((Action = Move) or (not Result)) then
Exit;
GetMousePos(MPos.x, MPos.y);
case Action of
LeftClick: Mouse(MPos.x, MPos.y, 0, 0, True);
RightClick: Mouse(MPos.x, MPos.y, 0, 0, False);
RClickOption: begin
if Option = '' then
begin
srl_Warn('[QuickMouse] Action "RClickOption" is set, but not Option', warn_AllVersions);
Result:= False;
Exit;
end;
Mouse(MPos.x, MPos.y, 0, 0, False);
Result:= WaitOption(Option, 500);
end;
end else
srl_Warn('[QuickMouse] Action ' + Action + ' is not a valid Action', warn_AllVersions);
end;

Gu3st...

2011-01-30 13:27:06

From: Rich
EDIT: Improved the QuickMouse function (pretty much rewrote it):
You're still not using constants :<

Sir R. M8gic1an

2011-01-30 14:27:06

Why are we even talking integers or consts?

Types children, types. Now u go and get high.


Action = (Move, LeftClick, RightClick, None);

@Nava: Both me and Niels have contributed, so first you'd have to put a poll up in devs if you don't want it in the repos…

I will put it in once I start committing my stuff.

And SmartColors needs a re-write. SRL 5 is gonna be the shit.

~RM

Rich

2011-01-30 14:50:17

Changed the code to use constants. Hopefully that's more commit-able now.

Sir R. M8gic1an

2011-01-30 15:22:54

From: nielsie95

I thought you posted here after I pointed out the wrongs in the developers' section, so I'm sorry for reacting that way. But you still might want to actually compile before you post.


Heh. I was just coding away. Didn't even pop Simba open, just did it right here on the forums.

@Nava: Always told you it was about the ranks. Members -> SSRL -> Dev. it's not like you can skip steps.

~RM

Gu3st...

2011-01-30 16:32:03

From: Sir R. M8gic1an
Why are we even talking integers or consts?

Types children, types. Now u go and get high.


Action = (Move, LeftClick, RightClick, None);

@Nava: Both me and Niels have contributed, so first you'd have to put a poll up in devs if you don't want it in the repos…

I will put it in once I start committing my stuff.

And SmartColors needs a re-write. SRL 5 is gonna be the shit.

~RM
We use consts because it's integrated into Simba itself.
mouse_Left, mouse_Right, mouse_Move. They're all TMousePress.

E:
I don't like Action: (Move, LeftClick, RightClick, RClickOption); either

Nose Smasher

2011-01-30 17:24:45

From: Nava2
Where was this said?

This is not *just* your decision.


From: Sir R. M8gic1an
well, approved by me :)

rofl…

lordsaturn

2011-01-30 18:41:30

why not
function QuickMouse(TP, RP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
begin
MMouse(TP.x, TP.y, RP.x, RP.y);
Result := WaitUpText(UpText, 1500);
if Action = LeftClick then
ClickMouse2(True)
else
if Action = RightClick then
ClickMouse2(False);
end;

Edit:
function QuickMouse(TP, RP: TPoint; Action: (Move, LeftClick, RightClick); UpText: string): boolean;
begin
MMouse(TP.x, TP.y, RP.x, RP.y);
Result := WaitUpText(UpText, 1500);
if Action <> Move then
ClickMouse2(Boolean(iAbs(Integer(Action)-2)));
end;

:stirthepot: