SRL Archive - RS has been updated.

New Chat Interfaces [Dec 13]


Harry

2011-12-13 12:51:57

Today they changed the chat interfaces. clicktocontinue changed, and I think npctext did too. Very ugly too. At least you can clicktocontinue with spacebar now.

Currently broken:
ClickToContinue: [X] - Green button whos position does not change.
FindNPCChatText: [X] - Uses UpChars's font now. Easy to fix, fonts don't even need updating. Different font/size for the "top" option. Spaces do not work.

RISK

2011-12-13 12:53:01

Actually I find it easier to click thru conversations now. :o Just use a while .. do for the green bar color and you're set.

nokkasiili

2011-12-13 13:00:00

Here is picture of it
http://img140.imageshack.us/img140/426/38706601.png


legoace

2011-12-13 13:04:34

can anyone confirm if the font used is the same as in the old interface or not? It looks the same but I don't have access to my scripting stuff right now.

shstiger2009

2011-12-13 13:08:15

From: legoace
can anyone confirm if the font used is the same as in the old interface or not? It looks the same but I don't have access to my scripting stuff right now.


The font looks different to me just looking at it, I'm pretty sure it changed.

Kyle Undefined

2011-12-13 13:39:14

What about something like this? Obviously it's an easy fix, but all I had to work with was an image. I broke it down to use that image, and it found the colors, but obviously they'll change since they're most likely dynamic.

It's a start, feel free to tear it apart.


function ClickContinue(Click, Wait: Boolean): Boolean;
var
bTxt, wTxt, SearchTPA{, TextTPA, Matches} : TPointArray;
Search2D : T2DPointArray;
b : TBox;
{Height, }i, x, y : Integer;
colors : TIntegerArray;
begin
Result := false;
colors := [607259, 1800267];
FindColors(bTxt, colors[0], MCX1, MCY1, MCX2, MCY2);
FindColors(wTxt, colors[1], MCX1, MCY1, MCX2, MCY2);

SearchTPA := CombineTPA(bTxt, wTxt);
if Length(SearchTPA) < 1 then
Exit;

Search2D := SplitTPAEx(SearchTPA, 20, 2);

//TextTPA := LoadTextTPA('here to conti', NPCChars, Height);
for i := 0 to High(Search2D) do
begin
//Result := FindTextTPAinTPA(Height, TextTPA, Search2D[i], Matches);
Result := FindColor(x, y, colors[i], MCX1, MCY1, MCX2, MCY2);
if Result and Click then
begin
b := GetTPABounds(Search2D[i]);
GetMousePos(x, y);
if PointInBox(Point(x, y), b) then
Mouse(x, y, 2, 1, True)
else
with b do
Mouse(RandomRange(x1, x2), RandomRange(y1 + 2, y2 - 2), 2, 1, True);
if Wait then
ChatWait
end;
if Result then
Break;
end;
end;

RISK

2011-12-13 13:43:06

They aren't dynamic, as far as I can tell. Just use CTS2 to detect the full non-hovered button (Excluding the button's gray/white boundaries). When the button is not hovered, it has lighter colors. But when it is hovered, it has lighter than the non-hovered colors. When it is pressed, it has darker colors.
There is a slight green "Line" on the hovered bar/pressed bar alteration that is similar to the non-hovered though.

E: Example:
Non-hovered:

Hovered:

Home

2011-12-13 13:47:00

function ClickContinue(UseSpace, UseWait :Boolean): Boolean;
var
GreArr :TPointArray;

begin
Result := False;
FindColors(GreArr, 10263709, 220, 460, 299, 474)

If Length(GreArr) = 5 then
if UseSpace then TypeSendEx(' ', False)
else
Mouse(MiddleTPA(GreArr).X, MiddleTPA(GreArr).Y, 10, - 3, True);
If UseWait then Wait(RandomRange(500, 900));
end;


function FindNPCChatText(txt: string; Action: fnct_ActionOptions): Boolean;
var
tx, ty, S: Integer;
begin
Result := False;
if txt = '' then
begin
srl_Warn('FindNPCChatText', 'txt is empty', warn_AllVersions);
Exit;
end;
S := CreateBitmapMaskFromText(txt, UpChars);
if FindBitmapMaskTolerance(S, tx, ty, 9, 348, 523, 471, 50, 10) then
begin
Result := True;
case Action of
Move: MMouse(tx, ty + 2, Random(Length(txt) * 5), 4);
ClickLeft: Mouse(tx, ty + 2, Random(Length(txt) * 5), 4, True);
ClickRight: Mouse(tx, ty + 2, Random(Length(txt) * 5), 4, False);
end;
end;
FreeBitmap(S);
end;


~Home

Kyle Undefined

2011-12-13 13:55:34

From: RISK
They aren't dynamic, as far as I can tell. Just use CTS2 to detect the full non-hovered button (Excluding the button's gray/white boundaries). When the button is not hovered, it has lighter colors. But when it is hovered, it has lighter than the non-hovered colors. When it is pressed, it has darker colors.
There is a slight green "Line" on the hovered bar/pressed bar alteration that is similar to the non-hovered though.

E: Example:
Non-hovered:

Hovered:


Ah ok, I only had a non hovered image to work with.

Home

2011-12-13 13:57:40

People, those functios that I posted should work fine. Please test and see.


~Home

Kyle Undefined

2011-12-13 14:00:02

I like Home's better than mine, he implemented the Space option. Mine should work too, even though there is no hover color since it finds the color and moves the mouse towards it, so hover doesn't even come into play.

Harry

2011-12-13 14:01:08

function PleaseWait : Boolean;
var x,y:integer;
begin
Result := false;
Result := FindColor(x,y, 3067775, 221, 457, 295, 474); // hilighted green in box
end;

function ClickContinue(Click, Waiting: Boolean): Boolean;
var
x, y : Integer;
begin
Result := false;
Result := FindColor(x,y, 938793, 221, 457, 295, 474); // normal green, click continue bounds
{if not Result then // not sure if I want this, don't want it pressing space when it doesn't need to.
begin
Result := FindColor(x,y, 3067775, 221, 457, 295, 474);// hilight activated green
if not Result then
Exit;
end;}

if Click and Result then
begin
TypeSendEx(' ', False);
if Waiting then
ChatWait;
end;
end;
Here's my fix for clicktocontinue. I like it better than others :p

RISK

2011-12-13 14:03:08

Yes, but you all, as far as I can tell, do not take in to account that what if the person wants to click thru the conversation twice? The hover color will be there if they do not choose to use the space bar as the mouse will not move from the last click thru.

Or is Home not using the green of the bar for his function?

Home

2011-12-13 14:10:45

From: RISK
Yes, but you all, as far as I can tell, do not take in to account that what if the person wants to click thru the conversation twice? The hover color will be there if they do not choose to use the space bar as the mouse will not move from the last click thru.

Or is Home not using the green of the bar for his function?


In my fix, it doesn't matter if your mouse is already at GreenArrow.


~Home

Gu3st...

2011-12-13 15:55:34

function NPCChatActive : Boolean;
begin
Result := (GetColor(blah, blah) = blah) or (GetColor(blah, blah) = blah);
end;

procedure NPCChatContinue;
var
P : TPoint;
begin
if not NPCChatActive then
Exit;

GetMousePos(P.X, P.Y);
if PointInBox(P, IntToBox(blah, blah, blah, blah)) then
Mouse(P.X, P.Y, 0, 0, True)
else
TypeSendEx(' ', False);
end;

Why make something this simple more complicated than what it has to be?

Home

2011-12-13 15:56:29

From: Zyt3x
function NPCChatActive : Boolean;
begin
Result := (GetColor(blah, blah) = blah) or (GetColor(blah, blah) = blah);
end;

procedure NPCChatContinue;
var
P : TPoint;
begin
if not NPCChatActive then
Exit;

GetMousePos(P.X, P.Y);
if PointInBox(P, IntToBox(blah, blah, blah, blah)) then
Mouse(P.X, P.Y, 0, 0, True)
else
TypeSendEx(' ', False);
end;

Why make something this simple more complicated than what it has to be?


Because of the future.

~Home

Gu3st...

2011-12-13 16:04:09

From: Home
Because of the future.

~Home
Then CountColorTolerance() instead of GetColor in NPCChatActive

Home

2011-12-13 16:29:51

From: Zyt3x
Then CountColorTolerance() instead of GetColor in NPCChatActive


See, Tadaa!


~Home

Brandon

2011-12-13 16:50:32

[ATTACH]12370[/ATTACH]


Teleport option for familiars also changed..

I use this to click it.. not perfect but efficient enough!



Foo:= BitmapFromString(76, 11, 'meJzVVUFuwkAM7A+icqAiAdRUAo' +
'E48P8f8KxOGTJx1vYmwKmrUbRyvF6Px3Euh+6yDNfzTs//hX67Am7' +
'DOvZr4HSH3QNw3rcrPGHkKeI4eGZQKN6IjS5SqMLfGmdvmc2EBPH8' +
'uC/uQyC97uvTc7QlsiuLoxvfB2oOLAwOdnLQPuMoy3fbAM8mj6zgt' +
't80f3AZvo8l5a1wZK/WOTL5UGWfBjzDt2EzyEj5VCsZDz9deFaVpF' +
'tGMNQxrFLRP7xLKY06thNBbX3CaoxlmR73qlnPB4b4FQU9RyZDHQm' +
'fnhcl5OgrbwvlOWbErVjPtmjRq+iHsQcM0wrHwiJB6/lkdDJj5caw' +
'1KEndeRQtV9iheNs471G5wUd++HHoSVjyJEdXgwWxQ8HkZ8qVlO95' +
'dlwbszGEUfFHL/HHEX+6FJwZK8+Jn+Eoi3rYe1YUNvfouHsiWT/nf' +
'LGTfML1j8CLg==');

repeat
if FindBitmapToleranceIn(Foo, x, y, 145, 383, 503, 472, 5) then
begin
MMouse(x + 65, y + 9, 0, 0);
wait(1500);
ClickMouse2(true);
break;
end;
MMouse(MSCX, MSCY, 10, 10); //Moves the mouse off of the bitmap after clicking..
until(False)

Er1k

2011-12-13 20:06:23

I think for some chat options they're also numbered so you can press the number keys to proceed instead of clicking.

Brandon

2011-12-13 20:15:20

From: nosaj.421
I think for some chat options they're also numbered so you can press the number keys to proceed instead of clicking.



You still have to detect the interface somehow.. and figure out WHEN to press that number key.. you don't want to end up like those edgeville fletch bots that constantly say "24" when they're stuck withdrawing stuff.. Thats a big no-no/instaban.

Those are just bad fails.. I'd rather use that bitmap which is actually working 100% right now.. but I only posted to see if someone had a better idea.

belbn

2011-12-13 21:30:12

From: ggzz
You still have to detect the interface somehow.. and figure out WHEN to press that number key.. you don't want to end up like those edgeville fletch bots that constantly say "24" when they're stuck withdrawing stuff.. Thats a big no-no/instaban.

Those are just bad fails.. I'd rather use that bitmap which is actually working 100% right now.. but I only posted to see if someone had a better idea.


Bitmaps give me alot of trouble, especially when screens are running different color bit modes.

Why not just click the coordinate? I don't think the chat box is ever going to change location!

Brandon

2011-12-13 21:45:41

From: belbn
Bitmaps give me alot of trouble, especially when screens are running different color bit modes.

Why not just click the coordinate? I don't think the chat box is ever going to change location!



*sigh* read what I said above.. Bitmaps absolutely do not give any trouble.. there are tolerances applied to the bitmap I posted above.. All of us here are running smart in SAFEMODE.. so there are no other "Screen modes".. All scripts here at SRL work perfectly in safemode.

As for "why not just click the coordinate".. because if I did that, I'd never know when the button is on screen. You have to have some sort of procedure to know WHEN to click that coordinate.. Thus I use a bitmap to see if the button is on screen.. if it is, move the mouse to where it is found and click it..

It's never a good idea to just "Coordinate click".. a small lag can mess up everything!

Harry

2011-12-14 12:47:31

Any devs getting onto this? Simple fixes really.

Home

2011-12-14 13:22:20

There are working fixes in this thread.. Yet nothing happens?

~Home

Gu3st...

2011-12-14 16:20:18

Wrong section

Home

2011-12-14 16:27:53

From: Zyt3x
Wrong section


Come on..

Unless your function is in SRL Developing section, there is no chance that Devs could take a look at it?

~Home

Gu3st...

2011-12-14 16:30:14

From: Home
Come on..

Unless your function is in SRL Developing section, there is no chance that Devs could take a look at it?

~Home
I didn't say that?

It's easier for them to notice it if it's in the correct section

Home

2011-12-14 16:34:26

From: Zyt3x
I didn't say that?

It's easier for them to notice it if it's in the correct section


Sorry, misunderstood then.

Yes that's true. But I don't really get your point.


Dev: Ohh new RS update, let's take a look (At forums)
Dev: Ahh someone has already created some functions. Let's do some testing, or something.

I think that this is extremely important section for dev to look.

These are my points.

I hope no one gets butt hurted :)

~Home

Claymore

2011-12-14 21:42:47

The UpText font looks similar to the new option interface text (see "teleport" for Graahk options.) So if someone can tell me what the hell i use for FindText id gladly try.

EDIT:


if FindText(x,y, 'eleport', UpChars, 69, 364, 478, 480) then
begin
writeln('found it');
mouse(x, y, 1, 1, true);

BOOM HEADSHOT. Works. Back to my abyss crafter <m<

Brandon

2011-12-14 22:21:26

From: Deathscytex
The UpText font looks similar to the new option interface text (see "teleport" for Graahk options.) So if someone can tell me what the hell i use for FindText id gladly try.

EDIT:

Simba Code:
[LEFT]if FindText(x,y, 'eleport', UpChars, 69, 364, 478, 480) then
begin
writeln('found it');
mouse(x, y, 1, 1, true);
[/LEFT]


BOOM HEADSHOT. Works. Back to my abyss crafter <m<



Hmm Confirmed working.. You are indeed correct. It's actually the exact same font.. I compared both the uptext to the teleport font.. it's a couple pixels off sometimes but it actually finds it 100% of the time.. I tried it 21 times using ur function.

Guess I no longer need my bitmap :D

Rep++

Gu3st...

2011-12-15 03:06:25

From: Home
Sorry, misunderstood then.

Yes that's true. But I don't really get your point.


Dev: Ohh new RS update, let's take a look (At forums)
Dev: Ahh someone has already created some functions. Let's do some testing, or something.

I think that this is extremely important section for dev to look.

These are my points.

I hope no one gets butt hurted :)

~Home
Why would anyone get butt-hurt because of you posting something like this? :rolleyes:

My point is this: Not all people check all the forums; maybe they only check the ones they're really interested in (i.e the SRL Development forum), or, maybe they're in a hurry and don't have time to check through all the forums for the interesting posts.

Sin

2011-12-15 10:13:52

I can't bot Prayer because of this crap >.>
Deathscythe's solution works perfectly as I see it, can you implement it in SRL ASAP?

'Toxin

2011-12-15 10:58:13

From: S1N
I can't bot Prayer because of this crap >.>
Deathscythe's solution works perfectly as I see it, can you implement it in SRL ASAP?


Just copy his code and paste it in your SRL local copy ….

Sin

2011-12-15 11:15:18

From: XxX Toxin XxX
Just copy his code and paste it in your SRL local copy ….


And I didn't think of this why…?

shstiger2009

2011-12-15 13:45:35

From: S1N
And I didn't think of this why…?


Probably your first time using open source stuff. :)

We can do everything the Devs can in our local files, that's what makes it so great.

Sin

2011-12-15 15:47:11

How do i post in in my local file o.o

Kyle Undefined

2011-12-15 16:49:48

Open up where you installed Simba, then in the Includes folder there will be SRL/MSI folders where you can drill down to what you need to change.

Harry

2011-12-15 19:18:48

In FindNPCChatText, spaces do not work (will not detect text). How to fix?

Brandon

2011-12-15 20:41:36

From: Harry
In FindNPCChatText, spaces do not work (will not detect text). How to fix?


GetChooseOptions is broken.. for Bird's Eye Jack on lunar island options text, it comes up as:

ecoil?!?>??.?? ank?.oler.??. Instead of Bank 'Bird's-Eye' Jack


The function by deathscythe finds the uptext which has "spaces" in it though.. :S What npc text are you trying to find?

Harry

2011-12-15 20:50:44

From: ggzz
The function by deathscythe finds the uptext which has "spaces" in it though.. :S What npc text are you trying to find?

No it doesn't. "eleport" has no spaces in it. If I am searching for "Take a look at the store", it fails due to spaces.

Brandon

2011-12-15 20:55:21

From: Harry
No it doesn't. "eleport" has no spaces in it. If I am searching for "Take a look at the store", it fails due to spaces.


Umm I didn't search for teleport :S It finds text like: "What would you like to"… You know.. that text when you just talk to a banker instead of quickly banking. It finds that for me :S

Where can I find this store?

Harry

2011-12-15 22:07:47

From: ggzz
Umm I didn't search for teleport :S It finds text like: "What would you like to"… You know.. that text when you just talk to a banker instead of quickly banking. It finds that for me :S

Where can I find this store?

Talk to Bob Axe in Lumby.

Run Writeln(FindText(x,y, 'items for me', UpChars, 69, 364, 478, 480));
Will says False, due to the space. Make it just search for 'items' or such and it'll return true.

I am talking about the NPC choose option menu thing.

NCDS

2011-12-16 01:13:10

I've committed a fix for ClickContinue that should work out. It was working well for me while I was testing it anyways.

World

2011-12-19 20:35:57

I like the new chat interfaces, for lazy people like me :P its nice for quests and such where i cbf to keep clicking my damn mouse.

legoace

2011-12-20 21:37:26

FindNPCChatText is still broken, from what I've seen.

The name of the person/NPC speaking, the dialogue, and possible options all use different fonts.