Results 1 to 21 of 21

Thread: need help with menu

  1. #1
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default need help with menu

    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.

    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;

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    SCAR Code:
    ChooseOption(); ChooseOptionEx(); or ChooseOptionMulti(); ChooseOptionMultiEx();

    I think those were the chooseoptions.
    There used to be something meaningful here.

  3. #3
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    i dont understand?

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by hello to you all View Post
    i dont understand?
    Those functions will choose an option from the menu.

    Like:
    SCAR Code:
    ChooseOption('ttack');

    And that chooses the "Attack" option.
    There used to be something meaningful here.

  5. #5
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    what needs to be included to do that?

  6. #6
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Just SRL. But I guess you already include that.
    There used to be something meaningful here.

  7. #7
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

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

  8. #8
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Well then chooseoption might not work. Try making a DTM of the text and search for it and click on it.
    There used to be something meaningful here.

  9. #9
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    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

  10. #10
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    You can make a DTM of text in a menu?

    this is a quick print screen of what i wanna click

  11. #11
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    anyone got any ideas?

  12. #12
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use ChooseOption or WaitOption.

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

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

  13. #13
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

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

  14. #14
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    any other ideas?

  15. #15
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    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.

  16. #16
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    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.

  17. #17
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You perhaps forgot SetupSRL;
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  18. #18
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Cigue View Post
    You perhaps forgot SetupSRL;

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

  19. #19
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

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

  20. #20
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

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

    It may be easier if you showed the whole script.

  21. #21
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    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.
    There used to be something meaningful here.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •