Page 12 of 12 FirstFirst ... 2101112
Results 276 to 295 of 295

Thread: THE Beginner's Simba Tutorial

  1. #276
    Join Date
    Mar 2014
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    So I have a question, which I'm sure I'll learn later on but am just curious. I understand how the syntax works etc etc but the only thing in curious of, which I'm sure I'll learn later just want a brief description of, is how does sima know what a maple log is? A yew log? How does it know what a bank is, how does it know what the in game items are? What references the code to these particular items? The physical items ingame? Or when the inv is full etc etc

    EDIT: I looked at table of contents on next tutorial lol
    Last edited by Chrispyme; 03-31-2014 at 05:23 PM.

  2. #277
    Join Date
    May 2013
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Thank you Coh3n for the tutorial. I have started to code myself. Good luck to those who are just starting out.

  3. #278
    Join Date
    Apr 2014
    Posts
    323
    Mentioned
    0 Post(s)
    Quoted
    131 Post(s)

    Default

    found a spelling error

    an 'is' that should be 'it'



    at the beginning of the tut

    "and run IS as you please"

  4. #279
    Join Date
    Jul 2014
    Posts
    125
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    The pdf download link for this tutorial is broken by the way. I don't need it just thought I'd let people know.

  5. #280
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by JSmooth View Post
    The pdf download link for this tutorial is broken by the way. I don't need it just thought I'd let people know.
    Thanks, I'll add that to my to-do list. I've removed the link for now.

  6. #281
    Join Date
    Nov 2014
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    I'm not seeing the images for this tutorial. Just an image that says "click and discover imageshack" but when I click on it nothing happens.

  7. #282
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by SRLnoob View Post
    I'm not seeing the images for this tutorial. Just an image that says "click and discover imageshack" but when I click on it nothing happens.
    Thank you for pointing this out; they must have expired on ImageShack. I've updated the links.

  8. #283
    Join Date
    Mar 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    In sript
    Simba Code:
    program TryExceptFinallyExample;

    (**
     * Will write the string 'Text' to the file 'FileName'
     * There are several procedures/functions I use in this example that you've
     * never seen before. Don't panic! Click on the triangle beside 'Files' in the
     * functions list and you'll see them all
     *)

    function WriteToFile(Text, FileName: string): Boolean;
    var
      thePath: string;
      theFile: Integer; // When working with files, they are always of the Integer type
    begin
      // When setting the path, be sure you always end with a '\', otherwise you will get errors
      thePath := AppPath + 'Scripts\'; // This will save the file in Simba/Scripts (AppPath = Application Path)

      try
        theFile := RewriteFile(thePath + FileName, False); // Saves the file to thePath and names it 'FileName'
      except // An exception would be thrown most likely if there was an invalid file name
        WriteLn('Error opening file!');
      finally
        WriteLn('Done trying to open file');
      end;
      // Notice how I assigned the opened or created file to 'theFile', this is so we can use it later in the procedure

      if (WriteFileString(theFile, Text)) then
        Result := True;

      CloseFile(theFile); // Remember to ALWAYS close the file when you're finished! If you don't it can cause memory leaks and your script will run very slowly
    end;

    begin
      ClearDebug;
      if (WriteToFile('Test!', 'TestFile.txt')) then
        WriteLn('Successfully wrote to file!')
      else
        WriteLn('Error writing to file');
    end.
    Open Simba/Scripts/TestFile.txt and a notepad file should open that looks something like this: Test!

    I need looks something like this: Test! Test! Test! Test! Test! Test! Test! Test!...

    For example: X := 123456...n, I need Write to file X-time string Test!

  9. #284
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Quote Originally Posted by Andrmolja View Post
    In sript
    Simba Code:
    program TryExceptFinallyExample;

    (**
     * Will write the string 'Text' to the file 'FileName'
     * There are several procedures/functions I use in this example that you've
     * never seen before. Don't panic! Click on the triangle beside 'Files' in the
     * functions list and you'll see them all
     *)

    function WriteToFile(Text, FileName: string): Boolean;
    var
      thePath: string;
      theFile: Integer; // When working with files, they are always of the Integer type
    begin
      // When setting the path, be sure you always end with a '\', otherwise you will get errors
      thePath := AppPath + 'Scripts\'; // This will save the file in Simba/Scripts (AppPath = Application Path)

      try
        theFile := RewriteFile(thePath + FileName, False); // Saves the file to thePath and names it 'FileName'
      except // An exception would be thrown most likely if there was an invalid file name
        WriteLn('Error opening file!');
      finally
        WriteLn('Done trying to open file');
      end;
      // Notice how I assigned the opened or created file to 'theFile', this is so we can use it later in the procedure

      if (WriteFileString(theFile, Text)) then
        Result := True;

      CloseFile(theFile); // Remember to ALWAYS close the file when you're finished! If you don't it can cause memory leaks and your script will run very slowly
    end;

    begin
      ClearDebug;
      if (WriteToFile('Test!', 'TestFile.txt')) then
        WriteLn('Successfully wrote to file!')
      else
        WriteLn('Error writing to file');
    end.
    Open Simba/Scripts/TestFile.txt and a notepad file should open that looks something like this: Test!

    I need looks something like this: Test! Test! Test! Test! Test! Test! Test! Test!...

    For example: X := 123456...n, I need Write to file X-time string Test!
    Here's some code that might help you. I'm not used to using for loops in Simba because I prefer Java, but I think that repeat loops are good enough. If you have trouble following the code, just let me know.

    Simba Code:
    program TryExceptFinallyExample;
    var
      input : string;
      x, i : integer;

    (**
     * Will write the string 'Text' to the file 'FileName'
     * There are several procedures/functions I use in this example that you've
     * never seen before. Don't panic! Click on the triangle beside 'Files' in the
     * functions list and you'll see them all
     *)

    function WriteToFile(Text, FileName: string): Boolean;
    var
      thePath: string;
      theFile: Integer; // When working with files, they are always of the Integer type
    begin
      // When setting the path, be sure you always end with a '\', otherwise you will get errors
      thePath := AppPath + 'Scripts\'; // This will save the file in Simba/Scripts (AppPath = Application Path)

      try
        theFile := RewriteFile(thePath + FileName, False); // Saves the file to thePath and names it 'FileName'
      except // An exception would be thrown most likely if there was an invalid file name
        WriteLn('Error opening file!');
      finally
        WriteLn('Done trying to open file');
      end;
      // Notice how I assigned the opened or created file to 'theFile', this is so we can use it later in the procedure

      if (WriteFileString(theFile, Text)) then
        Result := True;

      CloseFile(theFile); // Remember to ALWAYS close the file when you're finished! If you don't it can cause memory leaks and your script will run very slowly
    end;

    begin
      ClearDebug;
      //EDIT THIS
      x := 5;
      //END EDIT
      i := 0;
      input := '';
      repeat
        input := input + 'Test!';
        inc(i);
      until i >= x;

      if (WriteToFile(input, 'TestFile.txt')) then
        WriteLn('Successfully wrote to file!')
      else
        WriteLn('Error writing to file');
    end.

  10. #285
    Join Date
    Mar 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thank you. It's ok, but I wantto keep the previous string. When restart, click on "Run", I want to keep the old strings. TEST! TEST! TEST! TES TEST! When I start again RUN, I want to have a TEST! TEST! TEST! TES TEST! TEST! TEST! TEST! TES TEST! Please, help?

  11. #286
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Andrmolja View Post
    Thank you. It's ok, but I wantto keep the previous string. When restart, click on "Run", I want to keep the old strings. TEST! TEST! TEST! TES TEST! When I start again RUN, I want to have a TEST! TEST! TEST! TES TEST! TEST! TEST! TEST! TES TEST! Please, help?
    Use AppendFile() instead of RewriteFile()
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  12. #287
    Join Date
    Mar 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Yes it's ok. Thank you very much. Thanks KeepBotting and yourule97.

  13. #288
    Join Date
    Apr 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    For my declare players i think i set everything correctly but it wont log in

    heres the code i used:

    program DeclarePlayers;

    {$DEFINE SMART}
    {$i srl-6/srl.simba}

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

    Players[0].Name := ''; // Username
    Players[0].Pass := ''; // Password
    Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
    Players[0].Active := True;
    Players[0].Pin := '';
    end;

    begin
    ClearDebug;
    SetupSRL;
    DeclarePlayers;
    LoginPlayer;
    end.

    Can any1 help me find my mistake? For some reason it won't login

  14. #289
    Join Date
    Jan 2015
    Location
    My grotto
    Posts
    32
    Mentioned
    2 Post(s)
    Quoted
    9 Post(s)

    Default

    Is this guide outdated?
    EDIT: im gonna be studying programming next year, and i can't wait x.D

  15. #290
    Join Date
    Jan 2015
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Thank you very much for your guide! it helped me getting into it a bit.

  16. #291
    Join Date
    Apr 2014
    Posts
    323
    Mentioned
    0 Post(s)
    Quoted
    131 Post(s)

    Default

    I found a spelling error near the top

    and run is as you please.
    If all pork-chops were perfect, we wouldn't have hot-dogs.

  17. #292
    Join Date
    Apr 2016
    Posts
    126
    Mentioned
    1 Post(s)
    Quoted
    37 Post(s)

    Default

    Thanks for this awesome guide!
    I couldnt find your intermediate guide, does it exist or not? And if not, could someone recommend me a good intermediate guide?

  18. #293
    Join Date
    May 2016
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Thanks!

  19. #294
    Join Date
    Jan 2018
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thank you so much, You helped me.

  20. #295
    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Amazing still useful to this day

Page 12 of 12 FirstFirst ... 2101112

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
  •