Results 1 to 9 of 9

Thread: Small Coding Problem

  1. #1
    Join Date
    Jul 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Small Coding Problem

    This is what I'm looking to do...
    1)Click Space bar
    2)Wait for 3 seconds
    3)Click Shift bar
    4)Wait for 2 seconds
    5)Repeat

    I tried using this...

    begin
    repeat
    KeyDown(GetKeyCode('space'));
    Sleep(400);
    KeyUp(GetKeyCode('space'));
    KeyDown(GetKeyCode('shift'));
    Sleep(300);
    KeyUp(GetKeyCode('shift'));
    until(False);
    end.

    But I keep getting an error 'Line 4: [Error] (4:29): Type mismatch in script'

  2. #2
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you cant use GetKeyCode... its KeyDown(Chr(13)) for enter and KeyDown(Chr(42)) for space i think
    The truth finally came out...


  3. #3
    Join Date
    Jul 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It still has error

  4. #4
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what is the error?
    The truth finally came out...


  5. #5
    Join Date
    Jul 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Line 4: [Error] (4:16): Type mismatch in script

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

    Default

    did you add in the Program new;

  7. #7
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    This should be it:
    SCAR Code:
    Program Stuff;

    begin
      repeat
        KeyDown(GetKeyCode(' '))
        Wait(20)
        KeyUp(GetKeyCode(' '))
        KeyUp(GetKeyCode(' '))
        Wait(3000)
        KeyDown(VK_Shift)
        Wait(20)
        KeyUp(VK_Shift)
        KeyUp(VK_Shift)
        Wait(2000)
      until(false)
    end.

  8. #8
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Works just fine for me.
    Administrator's Warning:


  9. #9
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    What works just fine?

    -Knives

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Small Problem
    By lilpaintballer in forum OSR Help
    Replies: 9
    Last Post: 09-27-2008, 10:04 PM

Posting Permissions

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