Results 1 to 14 of 14

Thread: working on my auto-seller/buyer and offering stuff

  1. #1
    Join Date
    Oct 2006
    Posts
    334
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default working on my auto-seller/buyer and offering stuff

    did i set up my "offeritem" function right? this is the first time ive ever done anything with a custom function. i included the full version of my typer.
    i also can't get the "usefkeys" thing to work. if anybody wants to point out my errors please do so :P

    SCAR Code:
    procedure trade;//clicks purple trade text
    var x, y: integer;
    begin
         if findcolor(x,y,8388736,18,415,236,431) then
            begin
              writeln('found trade')
              MMouse(x,y,0,0);
              wait(100+random(50))
              Mouse(x,y,0,0,true);
              writeln('accepted trade')
              wait(6000)
              typesend('how much each?')
              wait(5000);
              Offeritem(offer);
            end;
    end;


    Function Offeritem(offeramount: integer;);
    var x, y: integer;
    begin
    MouseBox(568, 215, 591, 237, False);
    wait(100+random(300));
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, false);
    wait(100+random(500));
    ChooseOption('Offer-X');
    wait(100+random(500));
    Typesend(offeramount);
    end;
    edit: i forgot to say that the item you want offered needs to be in the first inventory slot.

  2. #2
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I'll fix your OfferItem and tell you what's wrong:

    SCAR Code:
    Procedure Offeritem(offeramount: integer);// New*
    var x, y: integer;
    begin
      MMouse(568,215,22,22);// New again**
      wait(100+random(300));
      GetMousePos(x, y);
      Mouse(x, y, 0, 0, false);
      wait(100+random(500));
      ChooseOption('Offer-X');
      wait(100+random(500));
      Typesend(IntToStr(offeramount));// More New***
    end;
    *OfferAmount isn't a function unless it returns something. And yours just does something, and returns nothing. Therefore it's a procedure.

    **Had to change this to MMouse in order to make it work...

    ***You can't type an integer, as you would have it do in yours. You always type a string, so IntToStr is used here.

    That should be it. I also fixed some waiting times.

    -Knives

  3. #3
    Join Date
    Oct 2006
    Posts
    334
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    ty, so if theres a constant at the beginning of the script:
    SCAR Code:
    offeramount = 100000; //enters 100k of item in first inv. slot

  4. #4
    Join Date
    Oct 2006
    Posts
    334
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    heres where i need the help now. please download my full script to see whats going wrong
    SCAR Code:
    procedure trade;//clicks purple trade text
    var x, y: integer;
    begin
         if findcolor(x,y,8388736,18,415,236,431) then
            begin
              writeln('found trade')
              MMouse(x,y,0,0);
              wait(100+random(50))
              Mouse(x,y,0,0,true);
              writeln('accepted trade')
              wait(6000)
              typesend('how much each?')
              wait(5000);
              Offeritem(IntToStr(offer));//how do i do this?  its the reason i thought i needed "funtion Offeritem"
            end;
    end;

    //MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

    Procedure Offeritem(offeramount: integer);
    var x, y: integer;
    begin
      MMouse(568,215,22,22);
      wait(100+random(300));
      GetMousePos(x, y);
      Mouse(x, y, 0, 0, false);
      wait(100+random(500));
      ChooseOption('Offer-X');
      wait(100+random(500));
      Typesend(IntToStr(offeramount));
    end;

  5. #5
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    This is the way:
    SCAR Code:
    Program NameHere;
    {.include SRL/SRL.scar}

    const
      Offer= 100;

    Procedure Offeritem(offeramount: integer);
    begin
      Mouse(568,215,22,22,false);
      wait(300+random(500));
      ChooseOption('Offer-X');
      wait(300+random(500));
      Typesend(IntToStr(offeramount));
    end;

    procedure trade;//clicks purple trade text
    var x, y: integer;
    begin
      if findcolor(x,y,8388736,18,415,236,431) then
      begin
        writeln('found trade')
        Mouse(x,y,3,1,true);
        writeln('accepted trade')
        wait(5000+random(1000))
        typesend('how much each?')
        wait(4500+random(700));
        Offeritem(Offer);
      end;
    end;

    begin
      Trade;
    end.
    A procedure you need to use, always comes before the place where you use it. Take a look and see what I mean.

    -Knives

  6. #6
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Needs alot of work... you need failsafes in between each step so that it doesnt go wrong and you should have more find color spirals etc... so x and y are updated
    The truth finally came out...


  7. #7
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    What I do, is make stuff compile I never do anything people don't request.

    He wanted it to work. I make it work

    -Knives

  8. #8
    Join Date
    Mar 2007
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i used the script by the way, and it works fine

  9. #9
    Join Date
    Oct 2006
    Posts
    334
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    ty guys. where would i ad a failsafe? please just be a little more precise
    also, what function would i use for looking for text in the chatbox?
    in the color black, although i doubt anybody would say it.

  10. #10
    Join Date
    Sep 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    look in srl/srl/core/text.scar

  11. #11
    Join Date
    Oct 2006
    Posts
    334
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    the command i think i want is "chatsblacktext" but i don't know how to use it. manual doen't help and neither does text.scar

  12. #12
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    InChat(Message: String) I think it is.

    or FindBlackChatMessage(Message: String)

    Not sure, though.

    -Knives

  13. #13
    Join Date
    Sep 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this is what was in my text.scar [srl4]
    {************************************************* ******************************
    function GetBlackChatMessage: String;
    By: Wizzup?
    Description: Gets text with color 0 in last chat line.
    ************************************************** *****************************}

    function GetBlackChatMessage: string;
    Var
    TextP: TPoint;
    begin
    TextP := TextCoords(8);
    Result := Trim(GetTextAtEx(TextP.X - 2, TextP.Y - 2, 0, SmallChars, False,
    False, 0, 1, 0, 80, False, tr_AllChars));
    end;

    {************************************************* ******************************
    function FindBlackChatMessage(ChatMsg: String): Boolean;
    By: Wizzup?
    Description: Returns True if text with color 0 in last chat line is found.
    ************************************************** *****************************}

    function FindBlackChatMessage(ChatMsg: string): Boolean;
    begin
    Result := (Pos(ChatMsg, GetBlackChatMessage) <> 0);
    end;
    what i think you would wanna use is the FindBlackChatMessage(ChatMsg: string)
    ex. if FindBlackChatMessage('out of logs') then

  14. #14
    Join Date
    Oct 2006
    Posts
    334
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    that sounds good
    thanks saiko, ill post with info on working/not

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need a Auto Seller
    By aznpimpsturr in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 06-06-2008, 04:56 AM
  2. need help with my auto seller
    By sunny in forum OSR Help
    Replies: 14
    Last Post: 04-22-2008, 04:06 PM
  3. A working powerchopper/rimmington seller.
    By you won in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 11-23-2007, 10:24 PM
  4. Need Help With My Auto-Seller/Buyer
    By F1r3Fox in forum OSR Help
    Replies: 7
    Last Post: 09-16-2007, 09:03 PM

Posting Permissions

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