Results 1 to 12 of 12

Thread: IsFKeyDown wont work

  1. #1
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default IsFKeyDown wont work

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    begin
    repeat
    wait(25)
    until isFKeyDown(10)
    Writeln(':)')
    end.

    This script will never write even though I have the f10 key held down.

    Does anyone know why it wont work? Is it a simba bug, or some kind of mess up that I don't know about?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  2. #2
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    I never got it to work on SCAR either, not problem with simba I guess.

    Edit : wait, I got it to work using while statement instead of repeat...

  3. #3
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    IsFKeyDown is true when you press the key, not when it's already pressed(the event of KeyDown and KeyUp, not only KeyDown) so 25 milliseconds is too fast to press a key. Try wait(500) and press F10 many times.

    EDIT: Hmm it's not working either...
    Last edited by Cazax; 06-15-2010 at 06:16 PM.


  4. #4
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Dr D. Dervish View Post
    I never got it to work on SCAR either, not problem with simba I guess.

    Edit : wait, I got it to work using while statement instead of repeat...
    It wont work for me either way.. :\

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  5. #5
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Ah, that's a bug in Simba.simba, it should be:

    SCAR Code:
    function IsFKeyDown(FKey : integer) : boolean;
    begin
      if not InRange(FKey,1,12) then
        raiseexception(erCustomError,'FKey not in range 1..12');
      result := IsKeyDown(VK_F1 + FKey - 1);
    end;

    For now, you can use IsKeyDown(VK_F10).


    Quote Originally Posted by Cazax View Post
    IsFKeyDown is true when you press the key, not when it's already pressed(the event of KeyDown and KeyUp, not only KeyDown) so 25 milliseconds is too fast to press a key. Try wait(500) and press F10 many times.

    EDIT: Hmm it's not working either...
    No, it's true when the key is down

  6. #6
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by nielsie95 View Post
    Ah, that's a bug in Simba.simba, it should be:

    SCAR Code:
    function IsFKeyDown(FKey : integer) : boolean;
    begin
      if not InRange(FKey,1,12) then
        raiseexception(erCustomError,'FKey not in range 1..12');
      result := IsKeyDown(VK_F1 + FKey - 1);
    end;

    For now, you can use IsKeyDown(VK_F10).
    I can live without it for a while. It was for debugging purposes, but I can't figure out what I'm debugging anyway yet, so it will have to wait a while.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  7. #7
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Also, {$i SRL/SRL.scar}.

    (Pointing out the correct way to include SRL/SRL.scar in Pascal. ^^)

  8. #8
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Also, {$i SRL/SRL.scar}.

    (Pointing out the correct way to include SRL/SRL.scar in Pascal. ^^)
    I've known about it, silly. I just don't think it matters, does it?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  9. #9
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    It's better practice. I'd always suggest doing it.

    Also, your signature says "Rediculously."

  10. #10
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Also, {$i SRL/SRL.scar}.

    (Pointing out the correct way to include SRL/SRL.scar in simba. ^^)
    Fixed your post...

  11. #11
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Fixed your post...
    How would you include it in Pascal then?

    But $i isn't better than .include. In fact, if you want SCAR compatibility, you'll have to use .include.

    edit: committed.
    Last edited by nielsie95; 06-17-2010 at 01:48 PM.

  12. #12
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Fixed your post...
    Try using {.include <FILE>} in Delphi Object Pascal of Free Pascal. He said it correctly.

    Still missing the point of your post.

    E: Plus, AFAIK, Freddy is moving away from .include as well.
    Last edited by Wizzup?; 06-17-2010 at 04:16 PM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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
  •