Results 1 to 12 of 12

Thread: Was just testing my script, and it won't compile

  1. #1
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Was just testing my script, and it won't compile

    I was just trying to test in parts...

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


    /////// Credits to YohoJo
    Const
      SERVER  = 61;     // Enter "0" to pick a random server.
      MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
      SRLStats_Username = ''; // Your SRL Stats Username
      SRLStats_Password = ''; // Your SRL Stats Password
      NumbOfPlayers= 1;     //How many players are you using
      StartPlayer=   0;     //Player to start auoting with! (0 means first char)

    ///////
    procedure DeclarePlayers; //Credits to YoHoJo
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
        Players[i].BoxRewards  := ['mote', 'ostume', 'XP', 'oins'];

      with Players[0] do
      begin
        Name        := '';     //Player username.
        Pass        := '';     //Player password.
        Nick        := ''; //Player nickname - 3-4 letters of Player username.
        Active      := True;
      end;

    end;
    ///////
    Var NCowsK, TXP:Integer;
    ///////
    procedure StatsGuise(wat:String);   //Credits to YoHoJo
    begin
      Status(wat);
      Disguise(wat);
    end;


    function FoundCow:Boolean;
    var
      x, y: Integer;
    begin
      FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

      WriteLn('Hooray, we found a cow!')
    end;

    begin
      SetupSRL;
      DeclarePlayers;
    //  repeat
        FoundCow();
    //  until(false);
    end.

    At line 64, which is my FindObjCustom line, it says that there was an identifier expected. I'm not quite sure what to do :/.

  2. #2
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Please post on pastebin this. I'll try to help later as I am on my phone now.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  3. #3
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    function FoundCow:Boolean;
    var
      x, y: Integer;
    begin
      FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

      WriteLn('Hooray, we found a cow!')
    end;

    You need an 'if' before your 'FindObjCustom' if you are trying to make an if .. then. If you are not trying to do that, you need to remove the 'then' at the end of it. Changing it to this:
    Simba Code:
    function FoundCow:Boolean;
    var
      x, y: Integer;
    begin
      FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20);

      WriteLn('Hooray, we found a cow!');
    end;

    Or this for an if .. then:
    Simba Code:
    function FoundCow:Boolean;
    var
      x, y: Integer;
    begin
      if FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then
      begin
        WriteLn('Hooray, we found a cow!');
      end;
    end;
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  4. #4
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Imagine View Post
    I was just trying to test in parts...

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


    /////// Credits to YohoJo
    Const
      SERVER  = 61;     // Enter "0" to pick a random server.
      MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
      SRLStats_Username = ''; // Your SRL Stats Username
      SRLStats_Password = ''; // Your SRL Stats Password
      NumbOfPlayers= 1;     //How many players are you using
      StartPlayer=   0;     //Player to start auoting with! (0 means first char)

    ///////
    procedure DeclarePlayers; //Credits to YoHoJo
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
        Players[i].BoxRewards  := ['mote', 'ostume', 'XP', 'oins'];

      with Players[0] do
      begin
        Name        := '';     //Player username.
        Pass        := '';     //Player password.
        Nick        := ''; //Player nickname - 3-4 letters of Player username.
        Active      := True;
      end;

    end;
    ///////
    Var NCowsK, TXP:Integer;
    ///////
    procedure StatsGuise(wat:String);   //Credits to YoHoJo
    begin
      Status(wat);
      Disguise(wat);
    end;


    function FoundCow:Boolean;
    var
      x, y: Integer;
    begin
      FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

      WriteLn('Hooray, we found a cow!')
    end;

    begin
      SetupSRL;
      DeclarePlayers;
    //  repeat
        FoundCow();
    //  until(false);
    end.

    At line 64, which is my FindObjCustom line, it says that there was an identifier expected. I'm not quite sure what to do :/.


    You forgot the if, i fixed it up a bit and added some stuff. Found below!

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


    /////// Credits to YohoJo
    Const
      SERVER  = 61;     // Enter "0" to pick a random server.
      MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
      SRLStats_Username = ''; // Your SRL Stats Username
      SRLStats_Password = ''; // Your SRL Stats Password
      NumbOfPlayers= 1;     //How many players are you using
      StartPlayer=   0;     //Player to start auoting with! (0 means first char)

    ///////
    procedure DeclarePlayers; //Credits to YoHoJo
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
        Players[i].BoxRewards  := ['mote', 'ostume', 'XP', 'oins'];

      with Players[0] do
      begin
        Name        := '';     //Player username.
        Pass        := '';     //Player password.
        Nick        := ''; //Player nickname - 3-4 letters of Player username.
        Active      := True;
      end;

    end;
    ///////
    Var NCowsK, TXP:Integer;
    ///////
    procedure StatsGuise(wat:String);   //Credits to YoHoJo
    begin
      Status(wat);
      Disguise(wat);
    end;


    function FoundCow:Boolean;//Changed up this function to work like a babe now! :P
    var
      x, y: Integer;
    begin
    if  FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then
    Wait(987);
    If InFight then
    Repeat
    WriteLn('Hooray, we found a cow!')
    Wait(1);
    Until (Not InFight);
    end;

    begin
      SetupSRL;
      DeclarePlayers;
    //  repeat
        FoundCow();
    //  until(false);
    end.



    Edit: LOL, well why i was typing stuff into the simba box for a fixup and addative to the script risk beat me! :P Good Job risk

  5. #5
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ^ Thanks both of you. It ran, but I couldn't find a way to exit the program because I must have set the colors up wrong.

    I tried using the esc key but that didn't work.

    Is there any way to kill the program?

    And also, what would the most defining color for a cow be? :/
    Last edited by Imagine; 02-19-2012 at 04:04 PM.

  6. #6
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You could try using SMART instead, like this:
    Simba Code:
    program new;
    {$i SRL/SRL/MISC/SMART.simba}
    {$i SRL/SRL.simba}

    const
      WORLD = 35;
      MEMBERS = False;

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

      with Players[0] do
      begin
        Name := '';
        Pass := '';

        Active := True;
      end;
    end;

    procedure MainLoop;
    begin
    end;

    procedure Setup;
    begin
      SMART_Server := WORLD;
      SMART_Members:= MEMBERS;

      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      SetAngle(SRL_ANGLE_HIGH);
      ClearDebug;


    end;

    begin
      Setup;
    end.

    This is the script skeleton I use. It will enable SMART and won't change the world each time you run the script. Allowing you to script with SMART active instead of having to deal with the standard Runescape client.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  7. #7
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I do have smart, but the problem there was that it takes a long time to startup smart and log in each time :/

    Does SMART adapt to script changes, or must you close and re-start SMART?

  8. #8
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    SMART will 'Adapt' to the changes you do in your script, yes. I'm scripting my fishing guild script right now with SMART and I'm doing a lot of changes. It works fine with each change. You just have to run the script again.
    As I said with my skeleton example, it won't reset each time you run the script.

    By the way, a cow's defining color would be the darker of it, right?
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  9. #9
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm going to try using the darker part of it, I'll update this to let you know how it goes.

    EDIT:

    And if my account is F2P, what do I change the

    SMART_Members:= MEMBERS;

    to?

  10. #10
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Why not PM me? In case I or someone else doesn't see this thread.

    E: Change the option at the top of the skeleton 'MEMBERS = False' depending on what you want. True = Members, False = Non-members.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  11. #11
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Now it is complaining that it needs an identifier at line 57, but it was fine before...

    Simba Code:
    program New;
      {$i SRL\SRL.simba}
      {$DEFINE SMART}



    /////// Credits to YohoJo
    Const
      SERVER  = 61;     // Enter "0" to pick a random server.
      MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
      SRLStats_Username = ''; // Your SRL Stats Username
      SRLStats_Password = ''; // Your SRL Stats Password
      NumbOfPlayers= 1;     //How many players are you using
      StartPlayer=   0;     //Player to start auoting with! (0 means first char)
      WORLD = 35;

    ///////
    procedure DeclarePlayers; //Credits to YoHoJo
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
        Players[i].BoxRewards  := ['mote', 'ostume', 'XP', 'oins'];

      with Players[0] do
      begin
        Name        := '';     //Player username.
        Pass        := '';     //Player password.
        Nick        := ''; //Player nickname - 3-4 letters of Player username.
        Active      := True;
      end;

    end;
    ///////
    Var NCowsK, TXP:Integer;
    ///////
    procedure StatsGuise(wat:String);   //Credits to YoHoJo
    begin
      Status(wat);
      Disguise(wat);
    end;

    //////
    procedure Setup;
    begin
      SMART_Server := WORLD;
      SMART_Members:= MEMBERS;

      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      SetAngle(SRL_ANGLE_HIGH);
      ClearDebug;
    //////

    Function FoundCow:Boolean;
    var
      x, y: Integer;
    begin
      if FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

      WriteLn('Hooray, we found a cow!')
    end;

    begin
      Setup;
    //  repeat
        FoundCow();
    //  until(false);
    end.

  12. #12
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You have no 'end' at the end of the 'Setup' procedure.
    Simba Code:
    procedure Setup;
    begin
      SMART_Server := WORLD;
      SMART_Members:= MEMBERS;

      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      SetAngle(SRL_ANGLE_HIGH);
      ClearDebug;
    end;
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

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
  •