SRL Archive - SRL Suggestions

Aura Use


Le Jingle

2012-05-08 03:32:36

Here's a little something that might be nice for people's scripts (aura's can boost your skill training by 3-10% I think; some % relatively close). Might also make for an occasional, yet nifty antiban (if done right).

Note, there's Activate & Check, checking 1st obv

Program New;
{$DEFINE SRL5}
{$i SRL/srl.simba}

Function ActivateAura: Boolean;
Begin
Result:= False;
If GameTab(Tab_Equip) Then
MouseBox(585, 211, 617, 243, Mouse_Left);
Result:= True;
End;

Function CheckAura: Boolean;
Var
n: Integer;
Begin
Result:= False;
SetChat('hide', 1);
n:= GetCurrentTab;
GameTab(Tab_Equip);
MouseBox(585, 211, 617, 243, Mouse_Right);
ChooseOptionMultiEx(['ura time', 'me remain', 'remaining'], 'action', ClickLeft);
Wait(900+Random(100));
If FindBlackChatMessage('The aura has finished') Then
ActivateAura;
GameTab(n);
Result := True;
End;

Begin
SetupSRL;
CheckAura;
End.


Let me know what you think about this!
ciao! :>

Sin

2012-05-08 10:30:19

Won't work.
You don't get a red click when you use an aura.

Le Jingle

2012-05-08 12:58:14

Thanks, removed it, I think this works now, all feedback welcome ~

Brandon

2012-05-08 14:02:16

Uhhh I don't like the idea of right clicking to see if an item is there.. You could modify the gametab to check like so:


function EquipmentCoords(EquipSlot: Integer): TPoint;
begin
case EquipSlot of
1: Result := Point(640, 225);
2: Result := Point(600, 266);
3: Result := Point(640, 266);
4: Result := Point(684, 266);
5: Result := Point(588, 304);
6: Result := Point(644, 304);
7: Result := Point(700, 304);
8: Result := Point(642, 343);
9: Result := Point(588, 384);
10: Result := Point(643, 384);
11: Result := Point(700, 384);
12: Result := Point(600, 226);
else
begin
result := Point(-1,-1);
srl_warn('EquipmentCoords','Invalid EquipSlot('+inttostr(EquipSlot)+') passed',warn_AllVersions);
end;
end;
end;

function GetEquippedItemBounds(Which: Variant): TBox;
var
P: TPoint;
I: Integer;
begin
Result := IntToBox(0, 0, 0, 0);
I := -1;

case VarType(Which) of
varInteger: if (InRange(Which, 1, 11)) then
I := Which;

varString: case Which of
'helm', 'helmet' :
I := 1;
'cape' :
I := 2;
'amulet', 'neck', 'necklace' :
I := 3;
'arrows', 'bolts' :
I := 4;
'right hand', 'weapon' :
I := 5;
'plate', 'chest', 'platebody' :
I := 6;
'left hand', 'sheild', 'shield' :
I := 7;
'legs', 'platelegs', 'skirt', 'plateskirt' :
I := 8;
'gloves', 'gauntlets' :
I := 9;
'boots':
I := 10;
'ring' :
I := 11;
'aura':
I := 12;
end;
end;

if (I = -1) then
begin
SRL_Warn('GetEquiptItemBounds', 'Invalid entry (' + ToStr(Which) + ')', Warn_AllVersions);
Exit;
end;

P := EquipmentCoords(I);
Result := IntToBox(P.x - 11, P.y - 11, P.x + 11, P.y + 11);
end;


function CountEquippedItems: Integer;
var
I: Integer;
begin
Result := Integer(GameTab(tab_Equip)) - 2;
if (Result = -1) then exit;

for I := 1 to 12 do
if WearingItem(I) then
Inc(Result);
end;


Then in your functions you can do:

Function ActivateAura: Boolean;
begin
if WearingItem(12) then
begin
MouseEquippedItem('aura', MOUSE_RIGHT);
Result:= (WaitOptionMulti(['tivate', 'Activate', 'vate', 'ctiv'], 600)
end;
end;

Function AuraFinished: Boolean;
begin
if WearingItem(12) then
begin
MouseEquippedItem('aura', MOUSE_RIGHT);
if WaitOptionMulti(['ura time', 'me remain', 'remaining'], 'action', 600) then
begin
Wait(RandomRange(900+Random(100)));
Result:= FindBlackChatMessage('The aura has finished');
end;
end;
end;

Le Jingle

2012-05-08 14:07:55

Oh wow, that's much better. I hadn't thought of not having one equipped in the first place. I like yours moreover mine. ++

Kyle Undefined

2012-05-09 13:09:50

I had suggested this awhile ago :p

Le Jingle

2012-05-09 19:19:46

From: Kyle Undefined
I had suggested this awhile ago :p


Ahh, I hadn't known; (Found it! : http://villavu.com/forum/showthread.php?t=71454)

Will see what I can come up with, merging what yours and Brandon's code, just for fun, I suppose :>