SRL Archive - SRL Bugs

Bug with Cast


senrath

2009-04-24 08:27:51

Date: 4/24/09

Public/Development: Public
Revision #: 32

File Involved (if known): Magic.scar


The Cast function doesn't currently click. Taking a peak inside the code, I found out why:

if (Result) then
begin
MouseBox(B.X1, B.Y1, B.X2, B.Y2, 3);
Wait(500 + Random(500));
end;

For some reason, it's using the movement only version of MouseBox when it finds the spell to cast.

ZephyrsFury

2009-04-24 08:59:58

Ah that would have been from when I was making/testing the function. Thanks for picking that up. :)

Dark Arcana

2009-04-24 09:03:41

I thought I was the only one having that problem.

ZephyrsFury

2009-04-24 09:18:24

From: Dark Arcana
I thought I was the only one having that problem.


Why didn't you post about it then?

Nava2

2009-04-24 17:53:16

Closed, Fix added to list.

Wizzup?

2009-04-25 03:34:37

From: ZephyrsFury
Ah that would have been from when I was making/testing the function. Thanks for picking that up. :)


We need constants for Mousebox. ;)

Nava2

2009-04-25 05:44:12

From: Wizzup?
We need constants for Mousebox. ;)


Agreed.

ZephyrsFury

2009-04-25 06:02:25

From: Wizzup?
We need constants for Mousebox. ;)


Feel Free to add them then. But I still think we should make some universal constants for LeftClick, RightClick, Move and Nothing which could be used in FindTextTPA and other similar functions too.

EDIT: Reopened, people might like to discuss this.

Wizzup?

2009-04-25 14:19:05

From: ZephyrsFury
Feel Free to add them then. But I still think we should make some universal constants for LeftClick, RightClick, Move and Nothing which could be used in FindTextTPA and other similar functions too.

EDIT: Reopened, people might like to discuss this.


Types should always be started with a t. And, Type wat = (a, b, c) is just an enum.
There is no big difference between the two, except for the calc one can perform more calculations with constants. (One can only perform a == with an enum. That generally only fits for a case)
Constants can also be used for bitwise operations, thus allowing much more flexibility. (This might not be extremely useful in the case of clicks, but it is still nice and good practice to do so. It also allows some nice bitwise coding.)

Like this:


const
srl_MoveOnly = 0;
srl_LeftClick = 1;
srl_RightClick = 2;
srl_MiddleClick = 4;

type
SRLClickType = Integer;

var
myClick: SRLClickType;

begin
myClick := srl_MoveOnly or srl_MiddleClick;
end.

Nava2

2009-04-25 19:07:52

Isn't there already a type in SRL for clicking?

{ type fnct_ActionOptions;
Description: Action options. }
type
fnct_ActionOptions = (ClickLeft, ClickRight, Move, Nothing);

That…