SRL Archive - OSR Help

need help with menu


seany

2010-08-05 18:57:44

im using this script to open up a shop… and it works fine until people are standing near the NCP… and their name is also in the menu

so to it works when just the NCPs values are in the menu… but when a players name is included in the menu it doesnt recognise the menu properly and mess's up


here's the code.


function OpenShop: Boolean;
var
x, y, I, II, III, A: Integer;
NewX: Integer;
begin
repeat
if IsFKeyDown(10) then TerminateScript;
MoveMouse(ShopX-257+X1, ShopY);
begin
Wait(10);
A := A + 1;
if A = 150 then
begin
ClickMouse(790-258+X1, 253, True);
Wait(80);
ClickMouse(790-258+X1, 253, True);
Wait(80);
MoveMouse(ShopX-257+X1, ShopY-50);
end;
if A = 300 then
begin
for A := 300 to 400 do
begin
NewX := ShopX+A-300;
MoveMouse(NewX-257+X1, ShopY-75);
Wait(100);
if (CountColorTolerance(255463, 315-258+X1, 5, 360-258+X1, 15, 35) > 6) then Break;
NewX := ShopX-A+300;
MoveMouse(NewX-257+X1, ShopY);
Wait(100);
if (CountColorTolerance(255463, 315-258+X1, 5, 360-258+X1, 15, 35) > 6) then Break;
end;
if A < 400 then ShopX := NewX
else TerminateScript;
end;
end;
ClickMouse(ShopX-257+X1, ShopY, False);
III := 0;
while (III < 50) do
begin
if FindColor(x, y, 65535, ShopX-280+X1, ShopY-30, ShopX-255+X1, ShopY+80) then
begin
ClickMouse(ShopX-75, Y+20, True);
Break;
end;
Inc(III);
Wait(5)
end;
if III > 49 then Continue;
//Wait(100);
//ClickMouse(ShopX-258+X1, ShopY+42, True);
I := 0;
repeat
Wait(10);
I := I+1;
until(ShopScreen or (I > 200));
until(ShopScreen);
MoveMouse(445-258+X1, 130);
Wait(50);
ClickMouse(445-258+X1, 130, False);
wait(50);
ClickMouse(435-258+X1, 216, True);
Wait(100);
CloseShop;
repeat
Wait(10);
II := II+1
until(((GetColor(960-258+X1, 450) <> 3357765) and (GetColor(920-258+X1, 450) <> 3357765))) or (II > 200);
end;

Frement

2010-08-05 18:59:48

ChooseOption(); ChooseOptionEx(); or ChooseOptionMulti(); ChooseOptionMultiEx();

I think those were the chooseoptions.

seany

2010-08-05 19:00:33

i dont understand?

Frement

2010-08-05 19:01:39

From: hello to you all
i dont understand?


Those functions will choose an option from the menu.

Like:
ChooseOption('ttack');

And that chooses the "Attack" option.

seany

2010-08-05 19:03:33

what needs to be included to do that?

Frement

2010-08-05 19:08:49

Just SRL. But I guess you already include that.

seany

2010-08-05 19:09:52

no im using a script for a private server… trying to get it working perfectly… unsucessfully i might add lol

Frement

2010-08-05 19:14:59

Well then chooseoption might not work. Try making a DTM of the text and search for it and click on it.

seany

2010-08-05 19:18:24

From: Frement
Well then chooseoption might not work. Try making a DTM of the text and search for it and click on it.


i dont know how to do that >.<

ill look it up :)

seany

2010-08-05 19:23:55

You can make a DTM of text in a menu?

this is a quick print screen of what i wanna click

seany

2010-08-06 09:23:12

anyone got any ideas?

Rick

2010-08-06 09:35:39

Use ChooseOption or WaitOption.

Assuming you want to trade with "Dommik" use something like so:


WaitOption('rade', 300 + Random(100));

seany

2010-08-06 17:23:51

but thats in a menu with trade with (players name) so rade wouldnt work.

seany

2010-08-06 18:56:14

any other ideas?

i luffs yeww

2010-08-06 23:23:08

Change 'rade' to 'rade Dom' or something. And NPC interactions will always (I think) be above players, and it searches from top to bottom so it should work fine.

seany

2010-08-08 13:27:17

From: i luffs yeww
Change 'rade' to 'rade Dom' or something. And NPC interactions will always (I think) be above players, and it searches from top to bottom so it should work fine.


doesnt work… it just scrolls slowly down the menu and nothing is clicked.

Cigue

2010-08-08 14:02:53

You perhaps forgot SetupSRL; :)

seany

2010-08-08 14:09:12

From: Cigue
You perhaps forgot SetupSRL; :)



so i dont just have to include SRL but i also have to add that too?

seany

2010-08-08 14:16:12

even after adding that it still doesn't click to trade.

i luffs yeww

2010-08-08 18:43:15

You have to include SRL and SetupSRL; (at the beginning of your main loop).

It may be easier if you showed the whole script.

Frement

2010-08-08 22:14:50

This is for a private server, for some private servers the text recognition does not work, you can try by creating your own font of that private servers font, or use DTM's to detect text.