Results 1 to 7 of 7

Thread: Help with sending message

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default Help with sending message

    Trying to make a script that sends keys.. Ihave this but it gives me error:
    Code:
    [Error] C:\Simba\Scripts\dicer.simba(11:1): Unknown identifier 'TypeSend' at line 10
    Compiling failed.
    code:
    Simba 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.

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    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"
    Last edited by Ian; 11-26-2012 at 04:04 AM.

  3. #3
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    after the program line include SRL with

    {$i SRL/SRL.Simba}

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    how do i make it type faster lol?

  5. #5
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    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:
    Simba Code:
    SendKeys('Message', 20 + Random(20), 10 + Random(10));  // Quicker.
    // or...
    SendKeys('Message', 10 + Random(10), 5 + Random(5)); // Even quicker.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  6. #6
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Daniel View Post
    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:
    Simba Code:
    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);

  7. #7
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    TypeByte();
    SendKeys accept strings as argument only.

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
  •