Results 1 to 4 of 4

Thread: keyisdown code

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

    Default keyisdown code

    hi, what is the procedure to say a const like this

    SCAR Code:
    const
    spam1 = ;

    function spama;
    begin
    if keyisdown (F1)
    then
    sendkeys (spam1)
    if
    keyisdown (F2)
    then
    *stop auto-ing*

    Sorry, i havent used scar in months
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  2. #2
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Here is what you need:

    SCAR Code:
    if IsFKeyDown(1) then
    begin
    //WHatever
    end;
    if IsFKeyDown(2) then
    begin
      TerminateScript;
    end;
    Formerly known as Cut em2 it

  3. #3
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thnx alot, also is this right

    SCAR Code:
    Const
    spam1 = ;
    spam1amount:= 5




    begin
    repeat
    TypeSend(spam1);
    until spam1 < spam1amount;


    so it talks until the number on the var
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  4. #4
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    try this

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var
     counter: integer;
    const
     Spam ='blablabla';
     TimesToSpam = 10;
    begin
      repeat
      begin // i just like to put the begins and ends in :)
        TypeSend(Spam);
        Counter:=Counter + 1;  //add to counter
      end;
      until (Counter = TimesToSpam); //Repeat until Counter is = TimesToSpam
    end.                              //because counter is added each time:
                                      //It will spam TimesToSmap times.

    You want it to repeat until the counter, which is increased with each spam, is equal to TimesToSpam. See if you can understand what iv done.

    The way you had it, spam1 would have to be an int and a string. Typesend types a string of characters (like a word). If spam1 is a string, then it cant be added to or compared or integers. You also forgot to add to the counter each time.

    Ask more questions if needed.

    P.S. :Also, a For loop would probable be better in this case.

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var
     counter: integer;
    const
     Spam ='blablabla';
     TimesToSpam = 10;
    begin
     for counter := 0 {counter starts at one} to TimesToSpam do //counter goes up by one every time and the loop goes until counter is equal to TimesToSpam
      begin
        TypeSend(Spam);
      end;
    end.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do you code?
    By Wrycu in forum C/C++ Help and Tutorials
    Replies: 17
    Last Post: 10-27-2008, 02:10 PM
  2. What is the code...
    By Boonce in forum OSR Help
    Replies: 13
    Last Post: 01-13-2008, 01:38 PM
  3. Code Box
    By Bam Bam in forum News and General
    Replies: 2
    Last Post: 08-15-2006, 10:45 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
  •