Results 1 to 17 of 17

Thread: Programming level: Pascal!

  1. #1
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Cool Programming level: Pascal - Easy!

    This is a guide to programming in the language: Pascal - Easy. [Currently Under Construction ]

    *Note 1 - I suggest reading and going through this tutorial before doing most scripting, as it makes everything else easier to understand.
    *Note 2 - This does not teach you how to script for RuneScape, it just teaches you the basics of pascal. This is meant to help you understand what others are talking about in scripts and tutorials, not to describe the different functions of SRL!
    *Note 3 - I will be making multiple levels of this TuT, this being level Easy. This is just a glimpse into what pascal can really do!
    *Note 4 - I suggest using turbo/free pascal to run these, as some common functions and decelerations are not compatible with Simba.

    Lets start from the beginning. The first part of your script should include the words "Program" and the name of the program (default is new, in Simnba).

    When you open up Simba, you get something like this:

    Simba Code:
    program new;
    begin

    end.

    The Begin-End is your Main Execution section. All the main things go on here

    Now comes the programming part:

    To output text, we use the format:
    Simba Code:
    Writeln(''); {put text in '', we do not use "". They are two different things}
    This would output a line. When you put Writeln, it outputs it, then puts the cursor to the next line. If you want the cursor to stay on that line, its:
    Simba Code:
    Write(''); {put text in ''}

    Now normally, to inputting information is:
    Simba Code:
    readln(); {put variable in () }
    However, that is not defined in Simba.

    Notice how I put a Semi-Colon after each line. This signifies the end of the line, without it, it would not compile.

    Variables - Variables are values that can be changed throughout the program.

    To set a variable, you would use:
    Simba Code:
    program new;
    begin
    Var
    x:integer;
    end.

    This sets the variable X as an integer (Whole numbers including zero).

    There are five main types of variables you should know: String, char, Integer, Boolean and real.

    Real is the same as an Integer, but it allows division, and can contain decimals.
    Boolean is a true or false value. Literally.
    Char is basically a single character. Could be a number, could be a letter.
    String is a set of Chars, an example is a word or a sentence.

    When setting the value of a variable, you use the format:
    Simba Code:
    program new;
    Var
    x:String;
    begin
    [B]x:='';[/B] {put your string in the ''}
    end.

    Now, taking what we learned so far, if we had to make a program which declared the variable x as a string, set it to "Hello world", then output it, It should go something like this:

    Simba Code:
    program TuT;
    Var
      x:string;
    begin
        x:= 'Hello World!';
        Writeln(x);
    end.

    You have just completed you first pascal script!


    I noticed many people are having trouble and I decided to make this! I am creating this series also so no one complains anymore about not understanding what a piece does, or what is going wrong. this is meant to help all the beginners. For all you leechers out there, learn how to use pascal, it will even help you guys.

    Pascal TuT for level: Medium - http://villavu.com/forum/showthread.php?p=1106362
    Last edited by Rezozo; 11-07-2012 at 02:42 AM.

  2. #2
    Join Date
    Jan 2012
    Location
    In A Farm
    Posts
    3,301
    Mentioned
    30 Post(s)
    Quoted
    444 Post(s)

    Default

    Nice guide, Hopefully people find it useful.

  3. #3
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by Silentcore View Post
    Nice guide, Hopefully people find it useful.
    I hope so as well. I get many a PM in these topics from leecherrs, as do many other members. I hope this will lessen those numbers!

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  4. #4
    Join Date
    Jan 2012
    Posts
    915
    Mentioned
    13 Post(s)
    Quoted
    87 Post(s)

    Default

    Great so far! I like this. Keep it up, bro!

    +Repped

  5. #5
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by Vinyl Scratch View Post
    Great so far! I like this. Keep it up, bro!

    +Repped
    Thanks, I hope to finally end the days of leeching with a little bit of teaching!

    My rhyming skizzells are unmatched.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  6. #6
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Bumpity Bump: I just realized I forgot to add this!
    If anyone has any trouble, needs an explanation, or wants me to add something. Feel free to ask! That is the reason I made this thread, that is why I am here.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  7. #7
    Join Date
    Aug 2007
    Posts
    213
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great job so far! I feel that you should combine your beginner and medium tuts together, it just makes more sense to me that way content-wise.

  8. #8
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by zertunami View Post
    Great job so far! I feel that you should combine your beginner and medium tuts together, it just makes more sense to me that way content-wise.
    Thank you! I really appreciate it!

    I thought of combining these two, but then realized that many just want to understand or just be able to read a script, not learn it. So keeping the medium section inside the Beginners section of Tutorial Island, allows the more dedicated beginners to have a place.

    Thanks for the suggestion though!

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  9. #9
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Not bad tutorial.
    7/10 would read again

  10. #10
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    Not bad tutorial.
    7/10 would read again
    Thanks NKN, I appreciate it!

    Im glad people like this, hopefully it will be useful in making people at least start scripting.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

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

    Default

    Thank you very much! i want to learn to write my own scripts and if all other tutorials are easy like this, ill be a master at scripting sometime :P

  12. #12
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by cadetlarouche View Post
    Thank you very much! i want to learn to write my own scripts and if all other tutorials are easy like this, ill be a master at scripting sometime :P
    You are very welcome! If you have any questions or suggestions about this, please feel free to ask.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  13. #13
    Join Date
    Oct 2012
    Location
    Singapore
    Posts
    163
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Nice TuT. But still don't get it. My brain is dead!!! Keep up the great work Rezozo and may you get SRL membership soon
    Perfection is not attainable, but if we chase perfection we can catch excellence.
    Vince Lombardi
    http://villavu.com/forum/showthread....t=newbie+guide
    Read through and followed all steps 3 times. Still doesn't get Simba scripting or any form of scripting for that matter. *retard*

  14. #14
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    God I hope so! The script I am gonna use for the Junior Competition, will be good enough for my application!

    Thanks for the compliment! If you think there is something I need to explain more, tell moi please. If you don't understand something, I am more than happy to help!

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  15. #15
    Join Date
    Oct 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    So, I'm trying to make a runescape bot, and if it can find a variable I would like it to do one thing and if it isn't able to find it do another such as if it finds it. It would continue on (example if it finds addy ore it would mine it) if it can't it would teleport and then run to where it knows where one is just in sense. Pretty much like if findcolorspiraltolerance (x,y,666666,0,0,1000,1000,15) then
    movemouse (x,y)
    clickmouse (x,y,1)
    so to speak... if it couldn't find that then what to do as a fail safe?

    ps, I'm really high don't hold it against me

  16. #16
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Lol, Definitely wont hold it against you

    1)Im gonna explain this part:
    if it can find a variable I would like it to do one thing and if it isn't able to find it do another such as if it finds it.
    You cannot just check if a variable exists, it is slightly more complicated than that.
    If it is an integer, then you could do:
    Code:
    if Variable>0 then
    SomeCode;
    If it is a string, you could do:

    Code:
    If length(string)>0 then
    SomeCode;
    For the example,
    I'd just use direct FindObj for this:
    Simba Code:
    If findobj(x, y, uptext, color, tolerance) then
    Mouse(x, y, 2, 3, true);//Clicks the obj
    Else
    SomeThing;//FailSafe

    For a Failsafe, in this situation, if you are too far and can't see that obj, make something to get closer first.
    Many ways to do this. I guess you could just use a
    Code:
    Mouse(x, y, 5, 5, true)
    to some point, giving a 5 up and down randomization.

    If the object is not there currently, and you have to wait till it is, put this:

    Code:
    Repeat
    Until(findobj(x, y, uptext, color, tolerance))
    Last edited by Rezozo; 11-03-2012 at 01:48 AM.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  17. #17
    Join Date
    Sep 2014
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    useful beginners guide into scripting, very easy and understandable, going to read the more advanced thread and see how well I cope and soon try to apply it to a bot
    thanks rez

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
  •