Results 1 to 11 of 11

Thread: help with my merching script

  1. #1
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default help with my merching script

    k..well i need some help with my script, obviously.

    its usable as it is, but i'd like to expand on it, first of all, heres the script

    SCAR Code:
    program merchhelper;
    {.include srl/srl.scar}
    {.include srl/srl/skill/buysell.scar}
    {.include srl/srl/misc/trade.scar}

    var
    x,y: integer;

    const
      message = 'green:slide:Selling chaos 130 ea - drizzt';
      fixedprice = false; //must be true for priceofobj to do its thing
      priceofobj = '1350000'; //only works with fer-X, offers an amount
      offertype= 'fer-X'; //fer-X, fer-All, fer, fer-5, fer-10, get it?

    function Findit(color,x1,y1,x2,y2: Integer; Nick: string): boolean;
      begin
        if Findcolor(x,y,color,x1,y1,x2,y2) then
        begin
          MMouse(x,y,0,0)
          Wait(50+Random(50));
          if (IsUpText(nick)) then
          begin
            Result := True;
          end
        end
      end;
     

    Function TradetheFool: Boolean;
      begin
        if Findcolor(x,y,8388736,10,445,231,456) then
        begin
        mouse(x,y,0,10,true);
        Result:=true
        end
        begin
        Result := true;
        end
      end;


    begin
      setupsrl;
      activateclient;
      mouse(314,492,10,10,true);
      repeat
        repeat
          sendkeys(message);
          wait(500);
          sendkeys(chr(13));
          wait(2350+random(2500));
        until (tradethefool = true)
        if tradescreen = true then
        begin
          mouse(577,228,5,5,false);
          wait(250);
          chooseoption(offertype);
          if fixedprice = true then
          begin
            wait(1250);
            typesend(Priceofobj);
          end
          repeat
            wait(500);
          until (tradescreen = false) and (tradescreen2 = false);
        end
      until (not(loggedin))
    end.

    i would like to make the script so i could have two seperate setups, one for buying, one for selling, and just press a hotkey to switch between the two.

    i think i'd need a case statement in here? idk how to make those, so if someone would steer me in the direction of a good tut that explains them, or if you could explain how to fix my script yourself, it would be greatly appreciated
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  2. #2
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    All you have to do is for the seperate procedures you can have:

    SCAR Code:
    if (IsFKeyDown(4)) then
    ect...

    if(IsFKeyDown(5)) then
    ect...

    Hope this helps.
    Formerly known as Cut em2 it

  3. #3
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well if i do that, wont i have to keep holding the key to keeo it going?
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  4. #4
    Join Date
    Jul 2007
    Location
    Players[CurrentPlayer].Loc:='Bank'
    Posts
    875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I thought about this. How can you do a buying script with anti-scam? If you're buying 10k yews what's stopping someone from giving you 10k willows and getting the same pay?
    Quote Originally Posted by sirlaughsalot
    .... Obama had the devil jump out of his ass, run and stab Hillary in the back...
    ILMMTYAEAFHPY.

  5. #5
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by drizzt View Post
    well if i do that, wont i have to keep holding the key to keeo it going?
    yep, to avoid that i would suggest something like

    SCAR Code:
    Var
      i: Integer;  //Make it a global variable

    Procedure Modeselect;
    begin
      if (IsFKeyDown(4)) then
        i := 0;
      if(IsFKeyDown(5)) then
        i := 1;
      case i of
        0: BuyProcedure;
        1: SellProcedure;
      end;
    end;

  6. #6
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    that's what i'm talking about, thanks psych
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  7. #7
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    anytime

  8. #8
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by richk1693 View Post
    I thought about this. How can you do a buying script with anti-scam? If you're buying 10k yews what's stopping someone from giving you 10k willows and getting the same pay?
    well, it really doesnt accept the trade for you, for not that reason, because it could look at the second screen and figure that they are yews not willows, but the fact that for some reason SCAR will not find the value for me
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  9. #9
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by drizzt View Post
    well, it really doesnt accept the trade for you, for not that reason, because it could look at the second screen and figure that they are yews not willows, but the fact that for some reason SCAR will not find the value for me
    What did you try to get the amount? Cause there are a few SRL functions in amount.scar that can counts stacks.

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

    Default

    i used every function possible in amount.scar...and it never returned right, or maybe it was the rest of my script that messed it up, idk
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

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

    Default

    I don't remember if the "0"'s with lines through got fixed...

    If they didn't, you can surely find a thread to fix it.

    -Knives

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
  •