Harry
2008-04-10 13:05:32
Hi again :p
As LinearWalkEx is ATM, if it has an error, it never wirteLn's the error
because it exits before it is able to do so. Oh yeah, and srl_Warn there too
;)
Here is how it should be:
Here is how it is now
Also, just a thought … could we have a boolean in MakeCompass, like
"MakeCompass('N',True);", with the Boolean in there means Perfect degrees if
it is True, and if it is False, it will have the direction have a Randomness
of 10 added, and subtract 10, from the DirectionDeg, for anti-ban ya know? ;)
Example:
MakeCompass('S',False);
When a user puts that in, the compass has a possibility of being from 190
degreese, to 170.
MakeCompass('S',True);
When a user puts that in, the compass goes to exactly 180 degreese.
You get where I am going with this?
(Would be troublesome for a few users if/when it is added into SRL … but
it'd be worth it :P)
Also…
time (not by much, but every little bit helps).
Yes, there is more (I am really bored right now :p )
In BoredHuman, when it Makes the compass North, what if you had the compass
at South, or something? It could mess everything up you are doing.
SetBar in GameTab.scar.
Globals.scar
these warnings or not. Else, you have to tell everyone to go to Globals.scar
and change that if you don't want your script to tell people that info.
(Like if a non-experienced SCAR user gets "** WARNING **" in their debug,
they act weird sometimes :rolleyes: )
Inventory.scar
have MMouse(x, y, 2, 2) at the end? What is the point of that? Shouldn't it
be
Login.scar
on RS atm, so I can't make the MouseBox ATM, but I know it will work).
Why is Setup.scar still in the Core? As far as I can see, it is not used by
any Core SRL features. Move to Misc folder please? It isn't even called by
SetupSRL, or even Compile SRL.scar! :p It is broken anyways.. Line 102:
[Error] (21732:1): Unknown identifier 'Filename' in script C:\Program
Files\SCAR 3.15\Includes\SRL\SRL\Misc\Setup.scar (I added to my Includes list
just to see if it even still works).
Thanks for reading.
~ Harry.
EDIT: Sorry for the spaces after some lines, I wrote in Notepad, and when I copied and pasted it here, it got weird :|
{**********************************************************************
*********
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;
Direction: Integer; Radius: Integer): Boolean;
By: Nielsie95
Description: Finds TheColor from Radial (scanning outwards) for Radius
Distance.
Valid Arguments:
tpa: Result points.
Direction: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse
clicks. Use numbers 20-72
*****************************************************************************
**}
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;
Direction: Integer; Radius: Integer): Boolean;
var
i, SD, ED: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
i := GetSystemTime;
Direction := Direction mod 360;
if (Direction < 50) then
SD := ((Direction + 360) - 50)
else
SD := (Direction - 50);
ED := (Direction + 50);
while (SD > 360) do
SD := SD - 360;
while (ED > 360) do
ED := ED - 360;
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
LinearSort(tpa, cx, cy, Direction, False);
Result := (Length(tpa) > 0);
except Exit; WriteLn('LWex error!'); end;
// Uncomment this for debug
// WriteLn('LWex time: '+IntToStr(GetSystemTime - i)+'ms. Found points:
'+IntToStr(Length(tpa)));
end;As LinearWalkEx is ATM, if it has an error, it never wirteLn's the error
because it exits before it is able to do so. Oh yeah, and srl_Warn there too
;)
Here is how it should be:
{**********************************************************************
*********
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;
Direction: Integer; Radius: Integer): Boolean;
By: Nielsie95
Description: Finds TheColor from Radial (scanning outwards) for Radius
Distance.
Valid Arguments:
tpa: Result points.
Direction: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse
clicks. Use numbers 20-72
*****************************************************************************
**}
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;
Direction: Integer; Radius: Integer): Boolean;
var
i, SD, ED: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
i := GetSystemTime;
Direction := Direction mod 360;
if (Direction < 50) then
SD := ((Direction + 360) - 50)
else
SD := (Direction - 50);
ED := (Direction + 50);
while (SD > 360) do
SD := SD - 360;
while (ED > 360) do
ED := ED - 360;
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
LinearSort(tpa, cx, cy, Direction, False);
Result := (Length(tpa) > 0);
except WriteLn('LWex error!'); Exit; end;
// Uncomment this for debug
// WriteLn('LWex time: '+IntToStr(GetSystemTime - i)+'ms. Found points:
'+IntToStr(Length(tpa)));
end;Same as above with RadialWalkEx.Here is how it is now
except Exit; srl_Warn('RadialWalkEx', 'An exception has occured',
warn_AllVersions); end;
and this is how it should be:
except srl_Warn('RadialWalkEx', 'An exception has occured',
warn_AllVersions); Exit; end;
Also, just a thought … could we have a boolean in MakeCompass, like
"MakeCompass('N',True);", with the Boolean in there means Perfect degrees if
it is True, and if it is False, it will have the direction have a Randomness
of 10 added, and subtract 10, from the DirectionDeg, for anti-ban ya know? ;)
Example:
MakeCompass('S',False);
When a user puts that in, the compass has a possibility of being from 190
degreese, to 170.
MakeCompass('S',True);
When a user puts that in, the compass goes to exactly 180 degreese.
You get where I am going with this?
(Would be troublesome for a few users if/when it is added into SRL … but
it'd be worth it :P)
Also…
procedure Wait2(timetowait: Integer; Randoms: Boolean);
var
starttime: Integer;
randcounter: Integer;
randamount: Integer;
idlecounter: Integer;
idleamount: Integer;
......
Compress those integers into one integer line? It will decrease the compiling time (not by much, but every little bit helps).
procedure Wait2(timetowait: Integer; Randoms: Boolean);
var
starttime,randcounter,randamount,idlecounter,idleamount: Integer;
Yes, there is more (I am really bored right now :p )
In BoredHuman, when it Makes the compass North, what if you had the compass
at South, or something? It could mess everything up you are doing.
procedure BoredHuman;
var
i, x, y: Integer;
begin
for i := 1 to (3 + Random(11)) do
begin
MMouse(Random(MSX2), Random(MSY2), 0, 0);
if IsUpText('opti') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('Examine');
end;
FindNormalRandoms;
case Random(6) of
0: SendArrowSilentWait(((Random(2) * 2) + 1), 1000 + Random(200));
1: SendArrowSilentWait(((Random(2) * 2)), 1000 + Random(200));
2: SendArrowSilentWait(((Random(2) * 2) + 1), 200 + Random(200));
3: SendArrowSilentWait(((Random(2) * 2)), 200 + Random(200));
4: SendArrowSilentWait(((Random(2) * 2) + 1), 20 + Random(20));
5: SendArrowSilentWait(((Random(2) * 2)), 20 + Random(20));
end;
FindNormalRandoms;
end;
MakeCompass('N');
SendArrowSilentWait(0, 750 + Random(500));
end;
to
procedure BoredHuman;
var
i, x, y, Deg: Integer;
begin
Deg := rs_GetCompassAngleDegrees;
for i := 1 to (3 + Random(11)) do
begin
MMouse(Random(MSX2), Random(MSY2), 0, 0);
if IsUpText('opti') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('Examine');
end;
FindNormalRandoms;
case Random(6) of
0: SendArrowSilentWait(((Random(2) * 2) + 1), 1000 + Random(200));
1: SendArrowSilentWait(((Random(2) * 2)), 1000 + Random(200));
2: SendArrowSilentWait(((Random(2) * 2) + 1), 200 + Random(200));
3: SendArrowSilentWait(((Random(2) * 2)), 200 + Random(200));
4: SendArrowSilentWait(((Random(2) * 2) + 1), 20 + Random(20));
5: SendArrowSilentWait(((Random(2) * 2)), 20 + Random(20));
end;
FindNormalRandoms;
end;
MakeCompass(IntToStr(Deg));
SendArrowSilentWait(0, 750 + Random(500));
end;
so it will set the compass back to the way you had it to before changing it.SetBar in GameTab.scar.
else WriteLn('ERROR: Unknown bar!');
srl_Warn can be used here ;) Globals.scar
Const
ShowWarnings = False;
Can this be a Global var please? :) So in SetupSRL you can choose if you want these warnings or not. Else, you have to tell everyone to go to Globals.scar
and change that if you don't want your script to tell people that info.
(Like if a non-experienced SCAR user gets "** WARNING **" in their debug,
they act weird sometimes :rolleyes: )
Inventory.scar
procedure DragItem(inv1, inv2: Integer);
var
x, y: Integer;
begin
MMouseItem(Inv1);
GetMousePos(x, y);
HoldMouse(x, y, True);
Wait(150 + Random(50));
MMouseItem(Inv2);
GetMousePos(x, y);
ReleaseMouse(x, y, True);
Wait(100 + Random(100));
MMouse(x, y, 2, 2)
end;
Moves the mouse to where you just dropped the item? :confused: Why does it have MMouse(x, y, 2, 2) at the end? What is the point of that? Shouldn't it
be
procedure DragItem(inv1, inv2: Integer);
var
x, y: Integer;
begin
MMouseItem(Inv1);
GetMousePos(x, y);
HoldMouse(x, y, True);
Wait(150 + Random(50));
MMouseItem(Inv2);
GetMousePos(x, y);
ReleaseMouse(x, y, True);
Wait(100 + Random(100));
end;
Login.scar
function Logout: Boolean;
var
c, i: Integer;
begin
Result := (not (LoggedIn));
if Result = True then
Exit;
if GameTab(14) = False then
Exit;
Wait(200 + Random(100));
while (LoggedIn) or (c < 10) do
begin
Inc(c);
if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
for i := 0 to 10 do
begin
Wait(1000);
if not(LoggedIn)then
begin
Result := True;
Exit;
end;
end;
end;
end;
MouseBox on the LogOut button please? Not the ClickText on 'here'. (I am not on RS atm, so I can't make the MouseBox ATM, but I know it will work).
Why is Setup.scar still in the Core? As far as I can see, it is not used by
any Core SRL features. Move to Misc folder please? It isn't even called by
SetupSRL, or even Compile SRL.scar! :p It is broken anyways.. Line 102:
[Error] (21732:1): Unknown identifier 'Filename' in script C:\Program
Files\SCAR 3.15\Includes\SRL\SRL\Misc\Setup.scar (I added to my Includes list
just to see if it even still works).
Thanks for reading.
~ Harry.
EDIT: Sorry for the spaces after some lines, I wrote in Notepad, and when I copied and pasted it here, it got weird :|