Page 2 of 12 FirstFirst 1234 ... LastLast
Results 26 to 50 of 295

Thread: THE Beginner's Simba Tutorial

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

    Default

    Quote Originally Posted by Red Fuel Tank View Post
    Nice tutorial Coh3n.

    Any chance you could make a worksheet or quiz-sheet to exercise what is learned from the tutorial?
    (i.e. - "Make a script that..." or "What does ______ do?")

    I hope I don't sound silly asking this.
    You don't sound silly. I like the idea and would do it if I had the time. However, I barely have any time nowadays.

    Quote Originally Posted by Troll Man View Post
    Great this has helped me loads, thanks.

    Just one question how can you have three all in ones? Won't it be All in Three?

    Anyway thanks for this
    Lol.

    All-in-one Beginner, All-in-one Intermediate and All-in-one Advanced. That's the plan anyway, but I don't think I'll have time to write those for a while.

  2. #27
    Join Date
    Jul 2006
    Posts
    80
    Mentioned
    1 Post(s)
    Quoted
    27 Post(s)

    Default

    Great intro to programming, covered alot of basics as well as the specific RS ones.

    Thanks alot

  3. #28
    Join Date
    Jan 2007
    Location
    Ausrtalia, Melbourne
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Now.. this is abit stupd but i'm just doing this for fun to learn.

    Simba Code:
    program FindStart;

    const
      NUMBER_PREF = 67;
      LOWEST_NUM = 0;
      HIGHEST_NUM = 1000;
    procedure FindCalc;
    begin
      Writeln('Prepare for the answer...')
      Wait(700)
      Writeln('Anytime now!')
      Wait(1700 + Random(420))
      Writeln('The random number generated between ' + IntToStr(LOWEST_NUM) + ' and ' + IntToStr(HIGHEST_NUM) + ' is!')
        Wait(3500 + Random(540))
      if (Random(HIGHEST_NUM) < (NUMBER_PREF)) then
        Writeln('Less Than ' + IntToStr(NUMBER_PREF) + '!')
      else
        Writeln('Greater Than ' + IntToStr(NUMBER_PREF) + '!');
    end;

    begin;
      ClearDebug;
      FindCalc;
    end.

    There is one part which I'm not sure what to do..

    Simba Code:
    if (Random(HIGHEST_NUM) < (NUMBER_PREF)) then

    How can i generate Random Number between, HIGHEST_NUM and LOWEST_NUM ?

    Edit: Oh, and what should I do to generate the random number the script has created?

    So I could say that the number is not (NUMBER_PREF) but instead the random number given?


    I might be on the right track with one of the problems but I may have approached it in the wrong way.
    Simba Code:
    if (RandomRange(StrToInt(HIGHEST_NUM),StrToInt(LOWEST_NUM) < (NUMBER_PREF))

    or

      if (RandomRange(HIGHEST_NUM;LOWEST_NUM) < (NUMBER_PREF)) then
    Last edited by the smith400; 11-11-2010 at 01:37 AM.

  4. #29
    Join Date
    Jun 2008
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the smith400, you would do something like this

    Simba Code:
    if (RandomRange(LOWEST_NUM,HIGHEST_NUM) < (NUMBER_PREF)) then

  5. #30
    Join Date
    Jun 2007
    Location
    Greenville, SC
    Posts
    1,149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wouldn't this also work(?):

    Code:
    if ((Random(HIGHEST_NUM) - LOWEST_NUM) <  (NUMBER_PREF)) then

  6. #31
    Join Date
    Jan 2007
    Location
    Ausrtalia, Melbourne
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Runescape Pro View Post
    Wouldn't this also work(?):

    Code:
    if ((Random(HIGHEST_NUM) - LOWEST_NUM) <  (NUMBER_PREF)) then
    Not really.
    I understand how you would think that. If you subtract the lowest by the highest you'll have that many posible solutions. Example, 1000-100 will equal 900. But if you want 950 to be your preferred number, then it will be outside the difference range of 0 to 900.

    I'm looking for the number between 100 and 1000 and not the number between the difference of 100 and 1000.


    One more thing, how can I post in the debug box the random number that was generated?

  7. #32
    Join Date
    Jun 2007
    Location
    Greenville, SC
    Posts
    1,149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oooooh. I got it.

    Umm.. I would set the generated number as a variable. Like "RanNumGen: Integer;"

    The you can print that by "Writeln(IntToStr(RanNumGen));"

    To get the number in the variable would be: "RanNumGen:=RandomRange(LOWEST_NUM,HIGHEST_NUM );"

    I believe that's how it's done.

    In the order:
    1: Set the variable name/type.
    2: Generate the random number.
    3: Use writeln to get it into the debug box.

    Note: hope this helps. I wrote it as easy to understand as I could.
    Last edited by Runescape Pro; 11-11-2010 at 01:59 AM. Reason: further explanation.

  8. #33
    Join Date
    Jun 2008
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    to post the number to the debug box, do something like this

    Simba Code:
    writeln(IntToStr(NUMBER_PREF));

    E: didnt see runescape pro's post. And his way would be better, to have the random number set to a variable then Writeln() the variable.

  9. #34
    Join Date
    Jan 2007
    Location
    Ausrtalia, Melbourne
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Runescape Pro View Post
    Oooooh. I got it.

    Umm.. I would set the generated number as a variable. Like "RanNumGen: Integer;"

    The you can print that by "Writeln(IntToStr(RanNumGen));"

    To get the number in the variable would be: "RanNumGen:=RandomRange(LOWEST_NUM,HIGHEST_NUM );"

    I believe that's how it's done.

    In the order:
    1: Set the variable name/type.
    2: Generate the random number.
    3: Use writeln to get it into the debug box.

    Note: hope this helps. I wrote it as easy to understand as I could.
    Worked like charm!
    Thank you!

  10. #35
    Join Date
    Oct 2010
    Location
    Brasil PR Ponta Grossa
    Posts
    96
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    iTS VERRY HARD!!!!

  11. #36
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    [offtopic]
    Quote Originally Posted by otavioafm View Post
    iTS VERRY HARD!!!!
    Yes it is. But you will get there, and once you do, there is nothing going to stop you!

    [/offtopic]
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  12. #37
    Join Date
    Aug 2008
    Location
    Kelowna, B.C
    Posts
    188
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great tutorial, thanks.
    Very to the point

  13. #38
    Join Date
    Mar 2011
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dude this has so much information! Great guide.. thanks sooo much

  14. #39
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    Pretty nice guide, I actually learned something. I never knew exactly how try except finally worked, but that's because I never felt the need to use it.

    One thing though, you say Random(60) generates a random number 0-60. It actually generates 60 random numbers, 0-59, so ExamineInv would never get called since you have it as 60 in the case. Just letting you know so you can fix it in the tut.

  15. #40
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Wow gotta change my script ...
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

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

    Default

    Quote Originally Posted by Baked0420 View Post
    Pretty nice guide, I actually learned something. I never knew exactly how try except finally worked, but that's because I never felt the need to use it.

    One thing though, you say Random(60) generates a random number 0-60. It actually generates 60 random numbers, 0-59, so ExamineInv would never get called since you have it as 60 in the case. Just letting you know so you can fix it in the tut.
    Hm, I'm sure I would have tested that. Oh well, thanks for pointing it out. I'll fix it now.

  17. #42
    Join Date
    Apr 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you so much for this guide. I lost my account my old account that used to be just a junior member and I never really took the time to learn scipriting. But I now have the motivation to do so thanks for this guide.

  18. #43
    Join Date
    May 2011
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Guide seems nice and everything seems explained very well for a beginner. But for some iffy reason I am unable to compile any scripts, everytime I try to compile it debugger gives this error on function Writeln:
    [Error] (9:20): Invalid number of parameters at line 8
    Compiling failed.

    this one was given when I tried to compile your second example "puttingthebasicstogether". Any ideas what could be wrong? I have installed Simba exactly like told in guide you linked in the beginning of your tutorial. I am willing to learn but this started pretty badly! Hopefully I get some answers :P!
    This is my code which I simply copied to simba (Didn't c&p):
    Code:
    program Laitetaan_kamat_kasaan;
    
    var
    Logs: Integer;
    Exp: Extended;
    
    const
    NUMBER_OF_LOGS = 500;
    TREE_TO_CUT = 'Magic';
    
    procedure HowManyLogs;
    begin
    Logs:= 250;
    Exp:= 195.5;
    
    Writeln***40;'We have chopped' + IntToStr***40;Logs***41; + 'logs this session!'***41;;
    Wait***40;500***41;;
    Writeln***40;'We Want to chop' + IntToStr***40;NUMBER_OF_LOGS***41; + 'logs.'***41;;
    Wait***40;500***41;;
    Writeln***40;'We are chopping' + TREE_TO_CUT + 'trees!'***41;;
    Wait***40;500***41;;
    Writeln***40;'We have gained' + FloatToStr***40;Logs * Exp***41; + 'xp this session!'***41;;
    end;
    
    function WeAreBored: string;
    var
    s:String;
    begin
    Result:= 'What are we going to do now';
    s:= 'we are very bored chopping all these logs!'
    Wait***40;500***41;;
    Writeln***40;s***41;;
    end;
    begin
    ClearDebug;
    HowManyLogs;
    Writeln***40;WeAreBored***41;;
    end.
    Last edited by I am new; 05-27-2011 at 10:52 PM.

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

    Default

    Quote Originally Posted by I am new View Post
    Guide seems nice and everything seems explained very well for a beginner. But for some iffy reason I am unable to compile any scripts, everytime I try to compile it debugger gives this error on function Writeln:
    [Error] (9:20): Invalid number of parameters at line 8
    Compiling failed.

    this one was given when I tried to compile your second example "puttingthebasicstogether". Any ideas what could be wrong? I have installed Simba exactly like told in guide you linked in the beginning of your tutorial. I am willing to learn but this started pretty badly! Hopefully I get some answers :P!
    This is my code which I simply copied to simba (Didn't c&p):
    Code:
    program Laitetaan_kamat_kasaan;
    
    var
    Logs: Integer;
    Exp: Extended;
    
    const
    NUMBER_OF_LOGS = 500;
    TREE_TO_CUT = 'Magic';
    
    procedure HowManyLogs;
    begin
    Logs:= 250;
    Exp:= 195.5;
    
    Writeln***40;'We have chopped' + IntToStr***40;Logs***41; + 'logs this session!'***41;;
    Wait***40;500***41;;
    Writeln***40;'We Want to chop' + IntToStr***40;NUMBER_OF_LOGS***41; + 'logs.'***41;;
    Wait***40;500***41;;
    Writeln***40;'We are chopping' + TREE_TO_CUT + 'trees!'***41;;
    Wait***40;500***41;;
    Writeln***40;'We have gained' + FloatToStr***40;Logs * Exp***41; + 'xp this session!'***41;;
    end;
    
    function WeAreBored: string;
    var
    s:String;
    begin
    Result:= 'What are we going to do now';
    s:= 'we are very bored chopping all these logs!'
    Wait***40;500***41;;
    Writeln***40;s***41;;
    end;
    begin
    ClearDebug;
    HowManyLogs;
    Writeln***40;WeAreBored***41;;
    end.
    Please upload it to attachment

    ~Home

  20. #45
    Join Date
    May 2011
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    There You go

  21. #46
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by I am new View Post
    There You go
    There is currently a bug within these forums. They display code wrong: replace ***40; with ( and ***41; with )

    edit: included fixed file.

  22. #47
    Join Date
    May 2011
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thank you very much

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

    Default

    Yeah sorry about that. Running this (or what Home posted) will work. Hopefully the foum bug is fixed soon.
    Progress Report:
    program Laitetaan_kamat_kasaan;
    
    var
      Logs: Integer;
      Exp: Extended;
    
    const
      NUMBER_OF_LOGS = 500;
      TREE_TO_CUT = 'Magic';
    
    procedure HowManyLogs;
    begin
      Logs:= 250;
      Exp:= 195.5;
    
      Writeln('We have chopped ' + IntToStr(Logs) + 'logs this session!');
      Wait(500);
      Writeln('We Want to chop ' + IntToStr(NUMBER_OF_LOGS) + 'logs.');
      Wait(500);
      Writeln('We are chopping ' + TREE_TO_CUT + 'trees!');
      Wait(500);
      Writeln('We have gained ' + FloatToStr(Logs * Exp) + 'xp this session!');
    end;
    
    function WeAreBored: string;
    var
      s:String;
    begin
      Result:= 'What are we going to do now';
      s:= 'we are very bored chopping all these logs!'
      Wait(500);
      Writeln(s);
    end;
    
    begin
      ClearDebug;
      HowManyLogs;
      Writeln(WeAreBored);
    end.

  24. #49
    Join Date
    May 2011
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Okay I have now read entire tutorial and all I can say is damn nice job! It was easy to understand and your guidance was easy to follow!

    Here comes few questions:

    I am not interested in current version of rs but I'd like to make few scripts to one private server which is running on 317 cache.

    How should i make simba run the script on the servers client?
    Could I anyhow load server's client with S.M.A.R.T or is it designed just for RuneScape? If it's like that my only opinion is select the client with simba's client selection tool and I can't run it hidden, right?

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

    Default

    Quote Originally Posted by I am new View Post
    How should i make simba run the script on the servers client?
    Could I anyhow load server's client with S.M.A.R.T or is it designed just for RuneScape? If it's like that my only opinion is select the client with simba's client selection tool and I can't run it hidden, right?
    Unless you know Java well enough to modify the SMART source to load from the private server then yes, using the web client is your only option (i.e. it will take control of your mouse).

    I'm glad you liked the guide.

Page 2 of 12 FirstFirst 1234 ... LastLast

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
  •