Results 1 to 9 of 9

Thread: Easy Question, Trading

  1. #1
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default Easy Question, Trading

    I have a script, and it trades the shopkeeper, it gets it good mostly, but if someone is standing on him, (likely in lumby gen store) it trades them. If i use uptext'shopkeeper' or something, it presses talk, and 'e Shop', for some reason makes it press cancel? Is there some reason for this. Would it have anything to do with dif colors in the text, trade is yellow or white or something and shopkeeper is blue. Why does it seem to want to cancel and it thinks trade shopkeeper isnt there.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  2. #2
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    What's the color of the white words in the popup menu? Is it 502? If so then copy this function:

    SCAR Code:
    function ChooseOption(x, y: Integer; txt: string): Boolean;
    var
      x1, y1, x2, y2, LeftCorner, RightCorner: Integer;
    begin
      LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
        '411A600064715CEA914500CACE13F0');
      RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
        'C5200D30002E35F8C501C9C013F0');
      if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
      begin
        if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
        begin
          Result := True;
          Mouse(x + Length(txt) * 3, y + 3, 2, 2, True);
        end
        else if (FindText(x, y, 'Cancel', upchars, x1, y1, x2, 502)) then
          Mouse(x + 9, y + 3, 2, 2, True);
      end;
      FreeBitmap(LeftCorner);
      FreeBitmap(RightCorner);
    end;

    And instead of "502" in FindText, put in the color of the words you want.

    Edit: And you might want to change the name of the function. If you don't, it'll most likely give you an error.

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    what if i want it to have both? The trade color, so it doesnt talk to him, and the shopkeeper so it doesnt trade some random person, and i think im using your find NPC thing too...

    EDIT: I spent my 100th post being a noob

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  4. #4
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    In that case, try setting the color to -1

    With GetTextAtEx, if you set the color to -1, it'll get any word color.

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    actually its just chooseoption?
    SCAR Code:
    procedure NPCFinder(NPCColor, Tol: Integer; Name: String);
     var
     Tries : Integer;
      begin
       repeat
       if(FindColorSpiralTolerance(x, y, NPCColor, MSX1, MSY1, MSX2, MSY2, Tol))then
        Wait(500 + Random(100));
        MMouse(x, y, 1, 1);
        Tries := Tries + 1;
        if(Tries >= 5)then
         begin
          KeyDown(37);
          Wait(1000 + Random(500));
          KeyUp(37);
          Tries := 0;
         end;
       until(IsUpText(Name));
        Mouse(x, y, 0, 0, False);
        wait(100)
        ChooseOption(x, y, 'Trade');// if i change this to 'e shop' then it clicks cancel?
      end;

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  6. #6
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    If you just have it choose 'Trade' for the option, it could trade any random player...
    Interested in C# and Electrical Engineering? This might interest you.

  7. #7
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Oops, I'm sorry, you misunderstood me.

    I was just giving you an example of where "-1" was used. Correct me if I'm wrong, but I believe it's a wildcard color.

    Edit:

    Just to make sure I'm perfectly clear.

    The function I gave you was copied from the Text.Scar, it's the ChooseOption function. If you paste the function in your script, and change the name, you'll be able to modify it to search for a different color.

  8. #8
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Smartzkid View Post
    If you just have it choose 'Trade' for the option, it could trade any random player...
    That was my problem in the beginning.. Thats what i was trying to solve, but putting e shop makes it press cancel?

    Quote Originally Posted by Jason2gs View Post
    Oops, I'm sorry, you misunderstood me.

    I was just giving you an example of where "-1" was used. Correct me if I'm wrong, but I believe it's a wildcard color.

    Edit:

    Just to make sure I'm perfectly clear.

    The function I gave you was copied from the Text.Scar, it's the ChooseOption function. If you paste the function in your script, and change the name, you'll be able to modify it to search for a different color.
    I would not know if you were wrong, im sorta not great at scripting if you didnt notice, and where exactly is text.scar? i looked a bit but it seemed that i dont know where to look,,, Scar? Scar Includes? I looked through most of my folders, but it doesnt seem to be there? I am pretty sure i know what to do once i find the chooseoption function, but until then, i will hope trade works.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  9. #9
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    SRL Includes >>> Core >>> Text

    And not knowing is part of scripting. Test something out, if it works, good. If it doesn't, try something else. If all else fails, make a bitmap of "Trade Shopkeeper"

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. i must say that this is a very easy question..
    By Camaro' in forum OSR Help
    Replies: 2
    Last Post: 03-03-2008, 08:51 PM
  2. EaSy QUeStiON!!!
    By noahthepoo in forum OSR Help
    Replies: 3
    Last Post: 11-04-2007, 09:20 AM
  3. Easy question
    By rkroxpunk in forum OSR Help
    Replies: 6
    Last Post: 03-24-2007, 02:36 AM

Posting Permissions

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