this is my first script and its a auto typer
this is my first script and its a auto typer
<3 RISK, <3 P1nky
It's pretty simple but good for a first script.
However, you should remove the functions you took from SRL (TypeByte, TypeSend) or credit them (because there is no credits). You don't need to do that because just after Program you can put {.include SRL/SRL.scar}
Also, you should never have a endless loop. The until(False) should be something else such as until(IsFkeyDown(12)) or until(TimesTyped = TimesToType) etc.
And it is pretty good that you have correct standards. I didn't have correct standards until a long way after because I was to lazy to learn them. I see that they are not hard though now.
Try this one.
SCAR Code:program AutoTyper;
{.include SRL/SRL.scar}
var
Msgs : TStringArray;
TimesToType, TimesTyped, WaitTime : integer;
FKey : integer;
procedure Setup;
begin
Msgs := ['msg1', 'msg2', 'msg3', 'etc']; //The messages you want to type.
TimesToType := 5; {How many times you want to say the text. This will
increment when ALL the messages are said not just one.}
FKey := 12; //The FKey you want to use to stop the script when pressed.
WaitTime := 100; //Time to wait in between text.
if ((GetArrayLength(Msgs) = 0) or (TimesToType = 0)) then
exit;
end;
procedure TypeText(index : integer);
begin
if Msgs[index] = '' then exit;
if IsFKeyDown(FKey) then TerminateScript;
TypeSend(Msgs[Index]);
Wait(WaitTime + random(80));
end;
procedure TypeArray;
var
i : integer;
begin
for i := 0 to GetArrayLength(Msgs) - 1 do
TypeText(i);
TimesTyped := TimesTyped + 1; // Not inc because it's slower ;)
end;
begin
Setup;
repeat
TypeArray;
until((IsFKeyDown(FKey)) or (TimesTyped = TimesToType));
end.

Inc is faster..
and you don't need to credit SRL for SRL functions..
nice job
(just to let you know, you don't need to put the functions in the script.. take them out and do TypeSend('something'); and it will do the same thing
that's the whole point of {.include srl/srl.scar} and SetupSRL;)
No, inc is not faster dude. And I already told him he dosen't need to put the functions in. And I only told him to credit them at least because he put them in there like he was saying he did them.

orly?
run this..
SCAR Code:program FastTime;
var x,y: integer;
const Count = 1000000;
begin
ClearDebug;
WriteLn('Please wait a few seconds...');
X := GetSystemTime;
for Y:= 0 to Count do
Y := Y + 1;
ClearDebug;
WriteLn('Took '+IntToStr(GetSystemTime - X)+' ms to do '+Inttostr(Count)+' incs using Y := Y + 1;');
X := GetSystemTime;
for Y:= 0 to Count do
Inc(Y);
WriteLn('Took '+IntToStr(GetSystemTime - X)+' ms to do '+Inttostr(Count)+' incs using Inc(Y);');
WriteLn('');
WriteLn('Use Inc();!');
end.
Took 1295 ms to do 1000000 incs using Y := Y + 1;
Took 1108 ms to do 1000000 incs using Inc(Y);
Use Inc();!
Successfully executed
>.>
This is a lot better than my first script, good job![]()
Well I didn't want to prove it, but I read somewhere on the forums that Inc is faster, and it also was posted by a Developer (ray I think?).
And you proved him wrong not me.

I got that from Hy and he got it from Timer or something..
this has been discussed a lot.. Inc is faster for SCAR but a := a + 1; is faster for most things..
Yeah. Well I would have tested myself but I was to lazy.
Edit: I found it!
Unknown\unusual things in SCAR!
There are currently 1 users browsing this thread. (0 members and 1 guests)