Results 1 to 5 of 5

Thread: tpye mismatch

  1. #1
    Join Date
    Feb 2007
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default tpye mismatch

    why do i get the error "Line 4: [Error] (4:21): Type mismatch in script" with this script?

    thanks

    SCAR Code:
    program New;
    begin
    repeat
    if not iskeydown(86)then
    begin
    keydown(getkeycode('b'));
    wait(40);
    keyup(getkeycode('b'));
    wait(40);
    keydown(getkeycode('n'));
    wait(40);
    keyup(getkeycode('n'));
    wait(40);
    end;
    until(false)
    end.

  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    IsKeyDown the key is supposed to be a char so something like IsKeyDown('p') then blah.

    SCAR Code:
    program New;
    begin
    repeat
    if not iskeydown('V')then
    begin
    keydown(getkeycode('b'));
    wait(40);
    keyup(getkeycode('b'));
    wait(40);
    keydown(getkeycode('n'));
    wait(40);
    keyup(getkeycode('n'));
    wait(40);
    end;
    until(false)
    end.

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    IsKeyDown takes char's (single letter like 'm' or '1') while you've put in a byte. Do IsByteDown if you want to use bytes or change it to the appropriate char.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Feb 2007
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks
    by char i thought it meant the keycode

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol mixster, IsByteDown isn't a function

    SCAR Code:
    Function IsByteDown(b : byte) : Boolean;
    Begin
    Result := IsKeyDown(Chr(b));
    End;

    And now it is

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. type mismatch
    By Maxcore in forum OSR Help
    Replies: 12
    Last Post: 11-10-2007, 12:54 AM
  2. Why am i getting mismatch errors?
    By RudeBoiAlex in forum OSR Help
    Replies: 5
    Last Post: 10-29-2007, 09:18 PM
  3. mismatch
    By Stevee in forum OSR Help
    Replies: 2
    Last Post: 07-27-2007, 04:55 AM

Posting Permissions

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