Log in

View Full Version : Help with sending message



rj
11-26-2012, 03:55 AM
Trying to make a script that sends keys.. Ihave this but it gives me error:

[Error] C:\Simba\Scripts\dicer.simba(11:1): Unknown identifier 'TypeSend' at line 10
Compiling failed.

code:
program Dice;
var
outcome: Integer;
procedure start;
begin
outcome := Random(100);
ClearDebug;
//TypeSend(Host is Rolling dice . . .);
Wait(1000);
TypeSend('I hope I dont lose . . .');
wait(800);
TypeSend('I has rolled a ' + IntToStr(outcome) + ' on the percentile dice.');
wait(400);
if outcome >= 55 then
Writeln('You win!');
if outcome <= 55 then
Writeln ('You lose!');
end;
begin
start;
end.

Ian
11-26-2012, 04:01 AM
You need to include SRL at the start of the script, Typesend is a SRL function.

also consider changing "I has rolled" to "I have rolled" and "55" to "50"

P1ng
11-26-2012, 05:35 AM
after the program line include SRL with

{$i SRL/SRL.Simba}

rj
11-27-2012, 02:14 AM
how do i make it type faster lol?

Daniel
11-28-2012, 02:53 AM
how do i make it type faster lol?

If you open the TypeSend function declaration, you will notice that it makes a call to SendKeys. The default arguments it passes to this function for the minimum time a key is to be held down for, and an additional random time on top of that until it is released, is: 30 + Random(30), 30 + Random(30).

So, in your script, simply replace TypeSend with SendKeys, and have a lower wait time between keystrokes. For example, you could have:

SendKeys('Message', 20 + Random(20), 10 + Random(10)); // Quicker.
// or...
SendKeys('Message', 10 + Random(10), 5 + Random(5)); // Even quicker.

rj
11-28-2012, 03:07 AM
If you open the TypeSend function declaration, you will notice that it makes a call to SendKeys. The default arguments it passes to this function for the minimum time a key is to be held down for, and an additional random time on top of that until it is released, is: 30 + Random(30), 30 + Random(30).

So, in your script, simply replace TypeSend with SendKeys, and have a lower wait time between keystrokes. For example, you could have:

SendKeys('Message', 20 + Random(20), 10 + Random(10)); // Quicker.
// or...
SendKeys('Message', 10 + Random(10), 5 + Random(5)); // Even quicker.

How do i make that press enter i tried
SendKeys(vk_enter);

riwu
11-28-2012, 03:12 AM
TypeByte();
SendKeys accept strings as argument only.