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!!![]()
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!!![]()
Thank you i plan on soon trying to write my own scripts once i get my labtop back from the shop = /
Sweet, gives me a good start, I like it.
Something that I can understand, thanks![]()
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
nicehopefully i will become decent scripter and release some public stuff
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:Code:Failed when compiling Line 6: [Error] (6:1): Semicolon (';') expected in script
plz help.Code:program script; const Message1= 'Hello world!' procedure Hello; begin wait(1000) Writeln(Message1); end; begin repeat hello; until(false) End.![]()
.........(*,*)
<fly like a penguin>
........./___\
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.
my bad
wait...
why did it say line 6 if it meant line 4?
.........(*,*)
<fly like a penguin>
........./___\
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.
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.
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
ty helped much
Thanks alot dudette (girl dude)
Really helped me a lot, gunno read some more tuts now![]()
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?
Thnx 4 dat I made my first script with it.
thanks so much
im on my way to becoming a scripter....slowly but surely![]()
METAL HEAD FOR LIFE!!!
RELI CONFUSON :S.... would u be able to make me a script... for www.s-racerz.com... its a simple text based game
![]()
Nice long guide, explained alot. Easy to read 10/10
Great Tutorial, I just learned how to do this in c++ too lol
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![]()
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.
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?
There are currently 1 users browsing this thread. (0 members and 1 guests)