Page 6 of 8 FirstFirst ... 45678 LastLast
Results 126 to 150 of 200

Thread: How to create your first script

  1. #126
    Join Date
    Apr 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    havnt tryed it out yet.. but from what i see it looks very helpful...

    thx for posting this up.. im gona try it out soon!!

  2. #127
    Join Date
    Apr 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  3. #128
    Join Date
    Apr 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thank you i plan on soon trying to write my own scripts once i get my labtop back from the shop = /

  4. #129
    Join Date
    Apr 2007
    Location
    Here
    Posts
    109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sweet, gives me a good start, I like it.

  5. #130
    Join Date
    Apr 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Something that I can understand, thanks

  6. #131
    Join Date
    Apr 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know some C++ this seems like a very easy thing to learn

    look its based on that type of language.

    one thing i dont get is, is this script suppose to be saying this in game? after i compile it and run it it just loops my string in the SCAR display window at the bottom. not in my RS window

    :edit: ok i got this to work but i have to be on my rs page and then press ctrl+alt+r to start and then it will type in the game window

    nice hopefully i will become decent scripter and release some public stuff

  7. #132
    Join Date
    Dec 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i feel like an noob. I did everything and it doesn't work. I even copied it straight out of the thread and it still doesn't work.

    error:
    Code:
    Failed when compiling
    Line 6: [Error] (6:1): Semicolon (';') expected in script
    code:
    Code:
    program script;
    
    const
    Message1= 'Hello world!'
    
    procedure Hello;
    begin
    wait(1000)
    Writeln(Message1);
    end;
    
    begin
    repeat
    hello;
    until(false)
    
    End.
    plz help.
    .........(*,*)
    <fly like a penguin>
    ........./___\

  8. #133
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    You need a semi-colon after the constant is defined:
    SCAR Code:
    program SilkBuyer;

    const
    Message1= 'Hello world!'; <-- There

    procedure Hello;
    begin
      wait(1000)
      Writeln(Message1);
    end;

    begin
     repeat
      hello;
     until(false)
    end.

  9. #134
    Join Date
    Dec 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default oh

    my bad
    wait...
    why did it say line 6 if it meant line 4?
    .........(*,*)
    <fly like a penguin>
    ........./___\

  10. #135
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    It looks like it was fine with there not being a semi-colon on the end of the constant until the identifier "procedure" was called.

  11. #136
    Join Date
    May 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Excellent tutorial! Thank you very much!

    Here's the script I made...

    SCAR Code:
    {
      Smiley
      by Slonskiy
    }


    program smiley;

    procedure smile;
    begin
      wait(1000)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('S')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Sm')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smi')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smil')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smile')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
        Writeln('Smiley')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smiley f')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smiley fa')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smiley fac')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smiley face')
      wait(200)
      cleardebug;
        Writeln('  | |  ')
        Writeln('  | |  ')
        Writeln('\_____/')
      Writeln('Smiley face!')
      wait(3000)
    end;


    begin
     repeat
      smile;
     until(false)
    end.

  12. #137
    Join Date
    Apr 2007
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well detailed, OK tut!

    ill give it 8/10 for ultimate basics
    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly. - put this in your sig

    http://www.fenjer.com/adnan/SRL/20/33/BucketX.png

    http://www.fenjer.com/adnan/SRLStats/742.png

  13. #138
    Join Date
    May 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ty helped much

  14. #139
    Join Date
    Apr 2007
    Posts
    151
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot dudette (girl dude)
    Really helped me a lot, gunno read some more tuts now

  15. #140
    Join Date
    Apr 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know this might, actually it will sound stupid but is Scar case sensitive? For example, for the procedure Writeln, does it make a difference if you write writeln?

  16. #141
    Join Date
    May 2007
    Location
    http://www.srl-forums.com
    Posts
    265
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thnx 4 dat I made my first script with it.

  17. #142
    Join Date
    Apr 2007
    Location
    NSW, Sydney
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  18. #143
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)
    thanks so much

    im on my way to becoming a scripter....slowly but surely
    METAL HEAD FOR LIFE!!!

  19. #144
    Join Date
    Jun 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    RELI CONFUSON :S.... would u be able to make me a script ... for www.s-racerz.com... its a simple text based game

  20. #145
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Nice long guide, explained alot. Easy to read 10/10

  21. #146
    Join Date
    Jun 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great Tutorial, I just learned how to do this in c++ too lol

  22. #147
    Join Date
    Jun 2007
    Location
    Kentucky, United States of America
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a good bit. I'm hoping to make a bit more complicated auto talker/merchanter using this as a base.

  23. #148
    Join Date
    Jun 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol every script i looked at looks all confusing but after this i got a grasp on it...a little bit. thank you this was my first script ever and i totally understood it

  24. #149
    Join Date
    Jun 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i am new here and i saw scar and used it while ago and never knew about scripting.
    i have looked at countless scripts and it is just not falling into place.
    i know about bolean and integers and procedures after reading countless guides but scripting seems way to complicated
    i have no earlier excperience in programming and i would like to learn.

  25. #150
    Join Date
    Jun 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey thanks for this tutorial, really great for the start-off with scripting for me.
    However, I am having trouble when I'm trying to type a string using "SendKeys()" when the string incorporates an apostrophe.

    for example: (it's not finished, but I need help before I go on )
    SCAR Code:
    {A simple program that creats the
    traditional "Hello World" script in
    another tab.

    Made by Scuzzinator}


    program TutScriptMaker;

    procedure ProgName;
    begin
     MoveMouseSmoothEx(218,67,20,40,45,20,20);
     Wait(1000+random(1000));
     ClickMouse(218,67,True);
     Wait(1000+random(500));
     MoveMouseSmoothEx(94,93,20,40,45,20,20);
     Wait(1000+random(500));
     ClickMouse(94,93,True);
     Wait(1000+random(500));
     MoveMouseSmoothEx(114,114,20,40,45,20,20);
     HoldMouse(114,114,True);
     Wait(1000+random(500));
     MoveMouseSmoothEx(143,114,20,40,45,20,20);
     Wait(1000+random(500));
     ReleaseMouse(143,114,True);
     Wait(1000+random(500));
     SendKeys('HelloWorld;'+chr(13));
     Wait(1000+random(1000));
    end;

    procedure Consts;
    begin
     SendKeys(chr(13));
     SendKeys('c');
     Wait(250+random(100));
     SendKeys('o');
     Wait(250+random(100));
     SendKeys('n');
     Wait(250+random(100));
     SendKeys('s');
     Wait(250+random(100));
     SendKeys('t');
     Wait(500+random(100));
     SendKeys(chr(13)+'M');
     Wait(100+random(100));
     SendKeys('e');
     Wait(100+random(100));
     SendKeys('ss');
     Wait(100+random(100));
     SendKeys('a');
     Wait(100+random(100));
     SendKeys('ge');
     Wait(100+random(100));
     SendKeys('1=');
     Wait(100+random(100));
     SendKeys(''Hello world!'')
    end;

    procedure Proc;
    begin
    end;

    procedure MainLine;
    begin
    end;

    begin
     ProgName;
     Consts;
     Proc;
     MainLine;
    end.

    Line 55 is where i'm having the problem. I want SendKeys(''Hello world!'') to have " 'Hello world!' " as a string using the outer two apostrophes as the string indicators. However, what it does is it uses all apostrophes as string indicators and leaves "Hello world!" not as a string so I get the errors:

    Failed when compiling
    Line 56: [Error] (56:10): String error in script
    Line 56: [Error] (56:10): Syntax error in script

    Is there a way to make it so that i have " 'Hello world!' " as a string in this script?

Page 6 of 8 FirstFirst ... 45678 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. create short script...
    By supersayian2224 in forum OSR Help
    Replies: 6
    Last Post: 01-16-2009, 03:30 AM
  2. For all that want to create a first script
    By Spiritualowl in forum OSR Help
    Replies: 3
    Last Post: 03-16-2008, 02:49 AM
  3. Someone help me create first script?
    By Immortal_DemiGod in forum OSR Help
    Replies: 13
    Last Post: 12-23-2007, 03:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •