Results 1 to 4 of 4

Thread: Simba just shuts down

  1. #1
    Join Date
    May 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Simba just shuts down

    Trying to write my own combat script (first one), and I've followed YoHoJo's video tutorial (this one http://www.youtube.com/watch?v=qfumZ...=youtu.be&hd=1), and for some reason, when I compile my script, Simba just shuts down.

    Here's the script:
    Code:
    program DustDevils;
    //{$i DEFINE SMART}
    {$i srl/srl/misc/smart.simba}
    {$i srl/srl.simba}
    {$i srl/srl/misc/debug.simba}
    
    
    const
      Username        =     'xxxxxx';
      Password        =     'xxxxxx';
      TrainedSkill    =     'Attack';                                               // Attack, Strength, Defence, Range
      XPCounter       =     2;                                                      // 1,2,3 (1st is usually total xp counter, so set trained level's counter to 2nd)
      EatAt           =     650;
      Version         =     1.0;
    
    procedure DeclarePlayers;
    begin
      NumberOfPlayers(1);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name := UserName;
        Pass := Password;
        Active := True;                                                          //Blue Charms
      end;
    end;
    
    procedure Attack;
    var
      cx,cy :Integer;
    begin
     //FindObjCustom(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol: Integer): Boolean;
     If FindObjCustom(cx,cy,['Attack Dust' , 'Dust' , 'Devil', 't d'], ['5810887', '4818599', '4622238', '6006479'], 10) Then
       WriteLn('Founda a Dust Devil!');
    End;
    
    
    
    
    begin
      SetupSRL;
      DeclarePlayers;
      //Repeat
        Attack;
      //Until (false);
    end.
    It's a really basic script, just trying to test how well it can find certain objects (this case, dust devils).

  2. #2
    Join Date
    Apr 2012
    Location
    Brampton
    Posts
    29
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    remove the two slashes, both places... you commented out the repeat statement so now it just goes through the script once and exits..

    You use the slash to write comments in your script or to remove lines of code, anything after the two slashes will be skipped by the program. If you have large blocks of code you want to 'comment out' then use {these brackets around the code} ..

    Simba Code:
    begin
      SetupSRL;
      DeclarePlayers;
      //Repeat
        Attack;
      //Until (false);
    end.
    Last edited by Fletcher; 05-04-2012 at 06:03 PM.

  3. #3
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Simba Code:
    program DustDevils;
    //{$i srl/srl/misc/smart.simba}
    {$i srl/srl.simba}
    {$i srl/srl/misc/debug.simba}


    const
      Username        =     'xxxxxx';
      Password        =     'xxxxxx';
      TrainedSkill    =     'Attack';                                               // Attack, Strength, Defence, Range
      XPCounter       =     2;                                                      // 1,2,3 (1st is usually total xp counter, so set trained level's counter to 2nd)
      EatAt           =     650;
      Version         =     1.0;

    procedure DeclarePlayers;
    begin
      NumberOfPlayers(1);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name := UserName;
        Pass := Password;
        Active := True;                                                          //Blue Charms
      end;
    end;

    procedure Attack;
    var
      cx,cy :Integer;
    begin
     //FindObjCustom(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol: Integer): Boolean;
     If FindObjCustom(cx,cy,['Attack Dust' , 'Dust' , 'Devil', 't d'], [5810887, 4818599, 4622238, 6006479], 10) Then
       WriteLn('Founda a Dust Devil!');
    End;




    begin
      SetupSRL;
      DeclarePlayers;
      //Repeat
        Attack;
      //Until (false);
    end.


    Problems:

    I removed Define Smart, because you included already as a Include.
    + I commented out the Current Include SMART Line, so you can test this directly in browser.

    Second thing is
    Simba Code:
    If FindObjCustom(cx,cy,['Attack Dust' , 'Dust' , 'Devil', 't d'], [5810887, 4818599, 4622238, 6006479], 10)

    As you can see, now it is correctly, you were using Strings when it was asking Integers (Colors).

    TStringArray = ['1', '2', '3', '4']
    TIntegerArray = [1, 2, 3, 4]

    Above are just an example how they should be declared.

    Hit me up with questions, if any.

    Keep it up mate!

    ~Home
    Last edited by Home; 05-04-2012 at 08:02 PM.

  4. #4
    Join Date
    May 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by fletcher18 View Post
    remove the two slashes, both places... you commented out the repeat statement so now it just goes through the script once and exits..

    You use the slash to write comments in your script or to remove lines of code, anything after the two slashes will be skipped by the program. If you have large blocks of code you want to 'comment out' then use {these brackets around the code} ..

    Simba Code:
    begin
      SetupSRL;
      DeclarePlayers;
      //Repeat
        Attack;
      //Until (false);
    end.
    I intended to comment out the cycle, since I only wanted to test it once. And as of my experience with other compilers (mostly C++), the compiler itself doesn't close, only then Console

    Quote Originally Posted by Home View Post
    Hit me up with questions, if any.

    Keep it up mate!

    ~Home
    Thank you, nice to see that people here are nice and helpful to new ones

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
  •