SRL Archive - SRL Archives

ArmourOff(What: String);


Neonknight77

2006-04-11 14:19:37

[PHP]{.Include SRL/SRL.scar}
Procedure ArmourOff(What: String);
Begin
GameTab(5);
Case What Of
'Helmet' : MMouse(648,225,2,2);
'Cape' : MMouse(608,265,2,2);
'Amulet' : MMouse(648,265,2,2);
'Arrow' : MMouse(690,263,2,2);
'Weapon' : MMouse(593,302,2,2);
'Plate' : MMouse(648,304,2,2);
'Shield' : MMouse(704,302,2,2);
'Legs' : MMouse(648,346,2,2);
'Gloves' : MMouse(594,383,2,2);
'Boots' : MMouse(648,384,2,2);
'Ring' : MMouse(704,385,2,2);
End;
Sleep(100+Random(100));
If(IsUpText('Remove'))Then
Begin
GetMousePos(X,Y);
Sleep(100+Random(100));
Mouse(X,Y,0,0,True);
Sleep(500+Random(500));
End;
End;[/PHP]

inferno

2006-04-11 14:33:32

Good work Neon :)
I made some changes so it doesn't matter if the first letter is a capital or not ;)

[PHP]{.Include SRL/SRL.scar}
Procedure ArmourOff(What: String);
Var
Item : String;
Begin
GameTab(5);
Item := LowerCase(What);
Case Item Of
'helmet' : MMouse(648,225,2,2);
'cape' : MMouse(608,265,2,2);
'amulet' : MMouse(648,265,2,2);
'arrow' : MMouse(690,263,2,2);
'weapon' : MMouse(593,302,2,2);
'plate' : MMouse(648,304,2,2);
'shield' : MMouse(704,302,2,2);
'legs' : MMouse(648,346,2,2);
'gloves' : MMouse(594,383,2,2);
'boots' : MMouse(648,384,2,2);
'ring' : MMouse(704,385,2,2);
End;
Sleep(100+Random(100));
If(IsUpText('Remove'))Then
Begin
GetMousePos(X,Y);
Sleep(100+Random(100));
Mouse(X,Y,0,0,True);
Sleep(500+Random(500));
End;
End;[/PHP]

Doesn't SRL already have something like this though?

Neonknight77

2006-04-11 16:32:58

Yeah, TakeOff I think. Oh well.

Krazy_Meerkat

2006-04-11 17:30:53

Cases require an end as far as I remember, I'm just going to change it a bit too..
Try this:
[php]{.Include SRL/SRL.scar}
Procedure ArmourOff(What: String);
Var
i : Integer;
Begin
GameTab(5);
What := LowerCase(What);
Case What Of
'helmet' : MMouse(648,225,2,2);
'cape' : MMouse(608,265,2,2);
'amulet' : MMouse(648,265,2,2);
'arrow' : MMouse(690,263,2,2);
'weapon' : MMouse(593,302,2,2);
'plate' : MMouse(648,304,2,2);
'shield' : MMouse(704,302,2,2);
'legs' : MMouse(648,346,2,2);
'gloves' : MMouse(594,383,2,2);
'boots' : MMouse(648,384,2,2);
'ring' : MMouse(704,385,2,2);
End;
Repeat
Sleep(100+Random(100));
i:= i + 1;
Until(IsUpText('Remove'))or(i > 6)
if(IsUpText('Remove'))then
Begin
GetMousePos(X,Y);
Sleep(100+Random(100));
Mouse(X,Y,0,0,True);
Sleep(500+Random(500));
End;
End;[/php]
Quite a useful procedure :)

inferno

2006-04-11 17:34:29

It already had an end; It just wasn't indented ;)

Krazy_Meerkat

2006-04-11 17:38:18

:p How strange…

Pwnd

2006-04-11 17:48:39

I am extremely surprised that SRL didn't have this already. :\

Sdcit

2006-04-11 17:58:23

well we err.. do


{*******************************************************************************
procedure TakeOff(i : Integer);
By: RsN
Description: UnEquips Item specified in i Needs specification!! (what is 1-i??)
*******************************************************************************}
procedure TakeOff(i : Integer);
var
T : TPoint;
begin
GameTab(5);
T := EquipmentCoords(i);
if (WearingItem(i)) then
Mouse(T.x, T.y, 5, 5, True);
end;

WT-Fakawi

2006-04-11 18:35:48

It has the brilliance of RsN' s work all over it.


function EquipmentCoords(i: Integer): TPoint;
By: RsN
Description:
Returns X and Y of the coordinates of the specified equipment item

function WearingItem(i: Integer): Boolean;
By: RsN
Description:
Results True if an item is equiped at i

procedure TakeOff(i: Integer);
By: RsN
Description:
UnEquips Item specified in i.

But ArmourOff one is not to bad.

Pwnd

2006-04-11 18:58:57

You should bring back RsN's mouse methods as well :)

WT-Fakawi

2006-04-11 19:11:22

They are in my friend. They have always been in. In fact, RsN/Mutant's MMouse was the first thing I "illegally" copied to my own personal include :)

[PHP]{*******************************************************************************
procedure MMouse(X, Y, RandX, RandY: integer);
By: BenLand100/RsN/Mutant Squirrle
Description: Moves the mouse along a spline to (X, Y) with an ending randomness of RandX and RandY (If BenMouse=True (Default))
Global var BenMouse determines the behaviour of MMouse.
*******************************************************************************}
procedure MMouse(dx, dy, RandX, RandY: integer);
var
Path: TPointArray;
i, cx, cy, Lx, Ly, xx, yy, Math, Dist: integer;
Error: boolean;
Step, SlowDown : Extended;
begin
if BenMouse then
begin
getmousepos(cx,cy)
if (Cx - dx = 0) and (Cy - dy = 0) then Error:= true
if not(Error) then
begin
Path:= MakeMouseSplinePath(cx,cy,dx,dy,randx,randy,3,50,75);
Lx:= cx;
Ly:= cy;
for i:= 0 to GetArrayLength(Path) - 1 do
begin
MoveMouse(Path.X, Path.Y);
Dist:= Round(Sqrt((Path.X - Dx) * (Path.X - Dx) + (Path.Y - Dy) * (Path.Y - Dy)));
if Dist < 50 then
begin
SlowDown:= SlowDown + (0.05 * MouseSpeed);
end;
Wait(Round(((Random(2) + MouseSpeed) / 10) * Sqrt(Sqr(Path.X - Lx) + Sqr(Path.Y - Ly)) + SlowDown));
Lx:= Path.X;
Ly:= Path.Y;
end;
end;
end // End BenLand MMouse

if Not BenMouse then // Start Mutant/RsN MMouse
begin
step := 4;
xx := Random(RandX);
yy := Random(RandY);
Math := Random(4) + 1;
case Math of
1 :
begin
dx := dx + xx;
dy := dy + yy;
end;
2 :
begin
dx := dx - xx;
dy := dy + yy;
end;
3 :
begin
dx := dx + xx;
dy := dy - yy;
end;
4 :
begin
dx := dx - xx;
dy := dy - yy;
end;
end;
GetMousePos(x, y);
repeat
if (Distance(x, y, dx, dy) < 100) then
if (not (Distance(x, y, dx, dy) = 0)) then
step := step - (10 / Distance(x, y, dx, dy));
if (step < 1) then
step := 1;
x := x + Round((dx - x) / step);
y := y + Round((dy - y) / step);
MoveMouse(x, y);
Wait(MouseSpeed);
until (Distance(x, y, dx, dy) = 0);
end;
end;
[/PHP]

Pwnd

2006-04-11 19:18:24

I don't like Mutant though. ;D

Neonknight77

2006-04-11 20:41:08

Can you guys please stop getting off track in my thread?

Renax

2006-04-11 20:49:31

any one who posts something without correct standards should get a 1 day temp ban :rolleyes: its so ugly, never capitalize bold words please.

XxKanexX

2006-04-11 23:41:03

From: Renax
any one who posts something without correct standards should get a 1 day temp ban :rolleyes: its so ugly, never capitalize bold words please.

No. That is stupid an extremely unfair, sorry.

Alot of new people don't know standards and don't wish to learn them as they try to concentrate on actually learning scar.

And some people also use their own standards. Bans should not be abused.

WhiteShadow

2006-04-11 23:46:13

From: Renax
any one who posts something without correct standards should get a 1 day temp ban :rolleyes: its so ugly, never capitalize bold words please.


Alot of people like to capitalize the bold. :p

Not I though.

Wizzup?

2006-04-12 04:17:29

On Topic : Nice function.

Off Topic, I do capitalize the bold letters it looks so cool. :p

XxKanexX

2006-04-12 04:23:27

From: Wizzup?
On Topic : Nice function.

Off Topic, I do capitalize the bold letters it looks so cool. :p

You're going to have to Ban yourself then. :p

Starblaster100

2006-04-12 08:49:12

From: Wizzup?
On Topic : Nice function.

Off Topic, I do capitalize the bold letters it looks so cool. :p


so do i ;)

XxKanexX

2006-04-12 09:02:23

I don't think it looks ugly. But i don't do it either.

I capitalise when i want to. Mostly on procedures and functions i think. And having a lowercase character then uppercase characters in variables look cool, too ;):p


var sTemp: integer;