SRL Archive - SRL Archives

Something Text.scar needs


n3ss3s

2007-12-03 10:44:46

I noticed that SRL has no function for getting the name of a sender of some message.

I remember I had an attempt for this in my Program Files\SCAR 2.03\ in some script which never ended up released.

Anyways, now it works perfectly, and clears the ' : ' out of the end of the name.

So, returns only the name, and in its original caption.

Behold -


{*************************************************]
[ Function GetMessageChatter(Msg: String): String ]
[ By: n3ss3s ]
[ Description: If finds the message Msg in the ]
[ chatbox, returns who sent it. ]
[*************************************************}

Function GetMessageChatter(Msg: String): String;
Var
X, Y: Integer;
Begin
If (FindText(X, Y, Msg, Smallchars, MCX1, MCY1, MCX2, MCY2)) Then
Result := Replace(GetTextAtEx(10, y, 5, SmallChars, False, False, 0, 0,
0, 50, False, tr_allChars), ':', '');
End;

Simple isn't it, but works even better :)

Also, it is SantySafe which means that Santa_Clause has no hope of shortening it =]

King of Knives

2007-12-03 10:50:10

I made one for that more than 2 months ago for JackLKrawls Air Runner. He never got around to using it, though.

This is great for autoresponders. And when we are talking about them, I may aswell say that I'm thinking of making a giant one. I have nothing to do ATM anyways :p

-Knives

n3ss3s

2007-12-03 10:53:47

Nah, make something leeter, do something with DTMs never seen before in SRL's history :p

But I'm warning you, not that I want to ruin the party, but a huge autoresponder takes a lot effort, but it won't be used so much.

Though JuKKa's ChatBoxRespond was a hit obviously…

But, if you like to do stuff with text, only SKy is the limit :)

King of Knives

2007-12-03 11:03:37

Is SKy Scripter good with Text? I always though he was that guy who made SCARounter SRLStrike in forms :P

-Knives

n3ss3s

2007-12-03 11:16:33

Sorry, TYPO, I meant sky lol, used to type SKy -.-


Hey btw, do you have a link for SCARounter SRLStrike?

Wizzup?

2007-12-03 11:31:06

Use GetTextAtEx with color -1? Then copy(0, to pos(':') )?

n3ss3s

2007-12-03 11:45:29

The GetTextAtEx part doesn't need the -1 yet, waiting the moment when the multicoloured names come to rs :)

Admit it, my way is atleast as good as yours, your function would use 3 functions in the Result := part, mine has two :)

:p I won :)

King of Knives

2007-12-03 12:05:56

SCARounter SRLStrike is not a game :p I just made that up, lol.

And my way was exactly like yours, except that it was 10 times better, lol :P

-Knives

Wizzup?

2007-12-03 12:07:21

From: n3ss3s
The GetTextAtEx part doesn't need the -1 yet, waiting the moment when the multicoloured names come to rs :)

Admit it, my way is atleast as good as yours, your function would use 3 functions in the Result := part, mine has two :)

:p I won :)


FindBitmapMaskTolerance is very slow. ;)

EDIT: I would only use 2 lines. Maybe just 1…

n3ss3s

2007-12-03 12:20:35

How?

GetTextAtEx, Copy and Pos.

= 3 :)

Also, then what would you use for the finding of the text?
GetTextAtEx for every line? (not a bad idea btw, if its faster)

Wizzup?

2007-12-03 12:27:48

Result := Copy(GetTextAtEx, 1, Pos());

n3ss3s

2007-12-03 12:28:43

S := ?

Wizzup?

2007-12-03 12:32:43

From: n3ss3s
S := ?


There. Fixed. ;)

n3ss3s

2007-12-03 12:37:34

-.-

You use three functions there, I didn't say you are using three functions separated…

But, how is that better in any way than mine?

Is Copy 0.000000001 ms faster? :p

Wizzup?

2007-12-03 13:27:58

You use a bitmap and then get the text.
I just get ALL the text, limit it by, say, size 20. Do a pos ':', and copy everything from 1(start string) to that pos…

n3ss3s

2007-12-03 13:37:49

If you do GetTextAtEx with MCX1, MCY1 I don't think it gives you all the text in the chat box does it?

And what if it does, you can't get the X and Y of the text you found with the string functions which doesn't then allow you to get the right Y for the name :)

Wizzup?

2007-12-03 15:04:15

From: n3ss3s
If you do GetTextAtEx with MCX1, MCY1 I don't think it gives you all the text in the chat box does it?

And what if it does, you can't get the X and Y of the text you found with the string functions which doesn't then allow you to get the right Y for the name :)


What was the point of your function.. getting the name right? Then just use GetBlackChatMessages…

Macrosoft

2007-12-03 15:37:30

cool idea

now our auto responders can actually people's names!

n3ss3s

2007-12-04 08:44:52

Yeah, like

"Bitch: noob automacrobot! :<"

"SCAR123: Lol, stop bitching bitch"


@Wizzy: Wizzy I go test GetBlackChatMessage…

EDIT: Wizzy ffs, GetBlackChatMessage gets the sender of the newest message in the chatbox, and doesn't remove the ':' though thats nothing big. My function instead, finds the text the user wants to find the owner of and then returns the sender! :(

So, I won! :)

Jason2gs

2007-12-04 12:36:29

Love this thread :)

n3ss3s

2007-12-04 12:52:44

Rofl yeah, I was about to say yesterday that its funny how we have been conversating hours about a function :p

But, Wizzy got beaten, and now he ain't gonna post here no more :(

:p

mastaraymond

2007-12-04 13:52:20

From: n3ss3s
Rofl yeah, I was about to say yesterday that its funny how we have been conversating hours about a function :p

But, Wizzy got beaten, and now he ain't gonna post here no more :(

:p

I feel war coming..

Btw, if you want to make an autoresponder you probably would make your own functions o,0.

Santa_Clause

2007-12-05 05:05:36

From: n3ss3s
I noticed that SRL has no function for getting the name of a sender of some message.

I remember I had an attempt for this in my Program Files\SCAR 2.03\ in some script which never ended up released.

Anyways, now it works perfectly, and clears the ' : ' out of the end of the name.

So, returns only the name, and in its original caption.

Behold -


{*************************************************]
[ Function GetMessageChatter(Msg: String): String ]
[ By: n3ss3s ]
[ Description: If finds the message Msg in the ]
[ chatbox, returns who sent it. ]
[*************************************************}

Function GetMessageChatter(Msg: String): String;
Var
X, Y: Integer;
Begin
If (FindText(X, Y, Msg, Smallchars, MCX1, MCY1, MCX2, MCY2)) Then
Result := Replace(GetTextAtEx(10, y, 5, SmallChars, False, False, 0, 0,
0, 50, False, tr_allChars), ':', '');
End;

Simple isn't it, but works even better :)

Also, it is SantySafe which means that Santa_Clause has no hope of shortening it =]


Haha, I love you too n3ss3s. Surprised a function like this hasn't been made yet :eek:

n3ss3s

2007-12-05 09:08:58

Lol, and yes, I am suprised too.

I feel war coming..


I kinda don't think having a war with wizzy, he has luck in finding unique colors - O.o

But seriously, no war :)

King of Knives

2007-12-05 09:20:32

From: Santa_Clause
Surprised a function like this hasn't been made yet


I already said I made on more than 2 months ago! Now n3s goes here taking all the credit, lol :p

-Knives