Results 1 to 12 of 12

Thread: How do I detect human input when using SMART?

  1. #1
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default How do I detect human input when using SMART?

    Any other ways than using file reading functions?
    I tested IsKeyDown and it don't work because I think it reads smart keypresses which is stupid...

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

    Default

    IsFKeyDown, then ReadLn?

  3. #3
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    IsFKeyDown, then ReadLn?
    I have tried IsFKeyDown and it didn't work.

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

    Default

    Both IsFKeyDown and IsKeyDown works perfectly, you just have to use it in the correct way. Have it in a loop with a short time interval always work - but finding that place in the script is the hard part. The best you can do is to have a form with a TEdit and TButton - so when you click the button it will TypeSend() the text in the box. More complex idea would be an IRC bot where you can do .type TextHere and the bot would type the text, but that requires more work and is not needed at all.


  5. #5
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by Cazax View Post
    Both IsFKeyDown and IsKeyDown works perfectly, you just have to use it in the correct way. Have it in a loop with a short time interval always work - but finding that place in the script is the hard part. The best you can do is to have a form with a TEdit and TButton - so when you click the button it will TypeSend() the text in the box. More complex idea would be an IRC bot where you can do .type TextHere and the bot would type the text, but that requires more work and is not needed at all.
    Try it yourself to belive
    Simba Code:
    program MYID;
    {$DEFINE SMART}
    {$i srl\srl.scar}
    {$i reflection\reflection.simba}


    begin
      SmartSetupEx(134, False, True, False);
      SetTargetArray(SmartImageArray, 765,503);
      Wait(3000);
      repeat
        while ((not IsFKeyDown(7)) and (not IsKeyDown(GetKeyCode('a')))) do wait(10);
        WriteLn('Worked!');
        Wait(1000);
      until(false);
    end.

  6. #6
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ^ Does not work for me aswell I works when not useing smart though, so would it be a bug in smart code not srl coding?
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  7. #7
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by Troll Man View Post
    ^ Does not work for me aswell I works when not useing smart though, so would it be a bug in smart code not srl coding?
    I think it reads smart inputs and it's quite useless...

  8. #8
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by antti mies View Post
    Try it yourself to belive
    Simba Code:
    program MYID;
    {$DEFINE SMART}
    {$i srl\srl.scar}
    {$i reflection\reflection.simba}


    begin
      SmartSetupEx(134, False, True, False);
      SetTargetArray(SmartImageArray, 765,503);
      Wait(3000);
      repeat
        while ((not IsFKeyDown(7)) and (not IsKeyDown(GetKeyCode('a')))) do wait(10);
        WriteLn('Worked!');
        Wait(1000);
      until(false);
    end.
    Quote Originally Posted by Troll Man View Post
    ^ Does not work for me aswell I works when not useing smart though, so would it be a bug in smart code not srl coding?
    So in other words: It works perfectly if you're using it the correct way (which is what Cazax said in the first place) It's not a bug. Check smart.scar in SRL/Core

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

    Default

    Hmm, SMART replaces IsKeyDown to SmartisKeyDown so that's the problem I think. Try making a form, that should work.


  10. #10
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Why does SRL need to know if Smart is holding down a key...

  11. #11
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I don't know anything about anything and barely read the thread and I'm on the toilet on my phone but would adding SetupSRL help?

  12. #12
    Join Date
    Feb 2006
    Location
    Berkeley, CA
    Posts
    1,837
    Mentioned
    52 Post(s)
    Quoted
    60 Post(s)

    Default

    Quote Originally Posted by MylesMadness View Post
    Why does SRL need to know if Smart is holding down a key...
    Well, essentially it doesn't, I suppose. But way back in the day when I wrote the first Smart.scar I overrode all of the basic mouse/key events, and that was one of them. At that point in time, the only thing that was ever detected was whether the script had a key held (idk why, tbh) and no one ever wanted user input. It could be removed, or made optional with a define, but that is up to SRL, not me.

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
  •