SRL Archive - SRL Archives

DoEmote


Naum

2009-07-19 12:31:51

Finally, again I hope it will be added. Its very outdated 9 new emotes had been added and the co-ords were off along with the colors.

{*******************************************************************************
procedure DoEmote(EmoteNumber:ShortInt);
By: NaumanAkhlaQ and Sumilion
Description: Clicks on an emote specified by EmoteNumber (1 to 46)
*******************************************************************************}

Procedure DoEmote(EmoteNumber : ShortInt);
Var I, X, Y, Row, Col : Integer;
Begin
If Not InRange(EmoteNumber, 1, 47) Then
Begin
srl_Warn('DoEmote', 'Invalid EmoteNumber: ' + IntToStr(EmoteNumber) + ', Valid Emotes: 1..46', warn_AllVersions);
Exit;
End;
Case EmoteNumber Of
01..20 : If (GetColor(723, 226) = 2106924) Then
Mouse(723, 226, 8, 4, True);
21..40 : If (GetColor(727, 364) = 1975337) Then
Mouse(727, 364, 4, 1, True);
41..46 : If GetColor(725, 438) = 1975337 Then
Mouse(725, 438, 5, 5, True);
End;
Wait(300 + Random(200));
If InRange(EmoteNumber, 21, 40) Then I := 20;
If InRange(EmoteNumber, 41, 46) Then I := 28;
DecEx(EmoteNumber, I);

Row := Trunc(EmoteNumber / 4) + 1;
If ((EmoteNumber Mod 4) = 0) Then Dec(Row);
Col := (EmoteNumber Mod 4);
If (Col = 0) Then Col := 4;

X := 550 + (44 * (Col-1));
Y := 219 + (49 * (Row-1));
Mouse(X, Y, 26, 39, True);
End;

marpis

2009-07-19 16:47:20


Procedure DoEmote(EmoteNumber : ShortInt);

If you wanna be that 1337, byte is enough ;)
Nice that someone updates these not-so-necessary functions too!

edit: is byte actually even smaller than shortint? range is the same but shortint goes below 0?

Naum

2009-07-20 23:47:14

From: marpis

Procedure DoEmote(EmoteNumber : ShortInt);

If you wanna be that 1337, byte is enough ;)
Nice that someone updates these not-so-necessary functions too!

edit: is byte actually even smaller than shortint? range is the same but shortint goes below 0?


type ShortInt = -128..127;
type Byte = 0..255;

They both amount to the same ;).
But thanks for commenting :)

EDIT:
Updated first post!

Da 0wner

2009-07-22 20:21:50

Great..should be added.

Smarter Child

2009-07-22 21:05:55

lol, nice. to think i was gonna use it in my script. :p

Naum

2009-07-22 21:16:44

Thanks all, Fixed a massive bug, there should have been 1 more increment on the cases, also I added a wait after the case statement.

Thanks to who ever added it :)

Sir R. M8gic1an

2009-07-23 17:45:29

From: NaumanAkhlaQ
Thanks all, Fixed a massive bug, there should have been 1 more increment on the cases, also I added a wait after the case statement.

Thanks to who ever added it :)



Could you please comment your code as i have not idea what all the hard coded values are? :p

~RM