Results 1 to 4 of 4

Thread: Massively confused making my first script

  1. #1
    Join Date
    Jun 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Massively confused making my first script

    I am working on my first script as I would love to learn how to make my own custom bots and also contribute to the forums.

    The first script should be fairly simple but I am having an awful time with it. What I want the script to do is simply stand there. When traded, I want the script to accept the trade offer, wait until something is placed in the trade screen, and then accept the trade on both trade windows.

    The bot will then continue to stand there until it gets another trade offer.

    I'll start off by saying I have read a few guides, and I have found that some are outdated which makes this a huge pain to find information. I have also found a script similar to what i am trying to make but it also is a few years outdated so I can't really learn anything form it.

    Here is what I have so far...

    SCAR Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;
    procedure Trade;
    var
    x, y : Integer;
    Begin
      repeat
        if(FindColorTolerance(x, y, 8388736, 0, 0, 790, 560, 4))then
        begin
          Mouse(x, y, 0, 0, true);
        end;
    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
    end.

    At the point all I am trying to do is get the script to click on the trade offer and bring up the trade window, and I can't even do that. I have two accounts for testing. I can't even get this to compile and I'v spent hours reading guides. If anyone could help me get past this first part of making the script I'd sure appreciate it as i am very frustrated at this point.

  2. #2
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;

    procedure Trade;
    var
    x, y : Integer;
    Begin
      repeat //You have a repeat but no until
        if(FindColorTolerance(x, y, 8388736, 0, 0, 790, 560, 4))then
        begin
          Mouse(x, y, 0, 0, true);
        end;
    End;

    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      Trade; //You also never call your function/procedure ever so it would never do anything
    end.

    That compiles without the repeat.

    Also try looking in the chat box...there are built in functions for that.
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  3. #3
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by 14578 View Post
    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;

    procedure Trade;
    var
    x, y : Integer;
    Begin
      repeat //You have a repeat but no until
        if(FindColorTolerance(x, y, 8388736, 0, 0, 790, 560, 4))then
        begin
          Mouse(x, y, 0, 0, true);
        end;
    End;

    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      Trade; //You also never call your function/procedure ever so it would never do anything
    end.

    That compiles without the repeat.

    Also try looking in the chat box...there are built in functions for that.
    Lower case b and lowercase e

    ]
    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;

    procedure Trade;
    var
    x, y : Integer;
    begin//here
      repeat //You have a repeat but no until
        if(FindColorTolerance(x, y, 8388736, 0, 0, 790, 560, 4))then
        begin
          Mouse(x, y, 0, 0, true);
        end;
      until(find what ever you want to repeat until)
    end;//here

    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      Trade; //You also never call your function/procedure ever so it would never do anything
    end.

    also if you are using smart declare it after "begin" and before "SetUpSRL"

    Hope that helps

  4. #4
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Quote Originally Posted by getdropped69 View Post
    Lower case b and lowercase e

    ]
    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;

    procedure Trade;
    var
    x, y : Integer;
    begin//here
      repeat //You have a repeat but no until
        if(FindColorTolerance(x, y, 8388736, 0, 0, 790, 560, 4))then
        begin
          Mouse(x, y, 0, 0, true);
        end;
      until(find what ever you want to repeat until)
    end;//here

    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      Trade; //You also never call your function/procedure ever so it would never do anything
    end.

    also if you are using smart declare it after "begin" and before "SetUpSRL"

    Hope that helps
    You don't have to have a lowercase b or e...that is just the way I like to script and I didn't feel changing everything....
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

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
  •