Results 1 to 8 of 8

Thread: Counting up.

  1. #1
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Counting up.

    Heey there, I have a little question

    SendKeys('100000');
    Wait(30);
    SendKeys(Chr(13));

    How do I let it count up to 1000000 ? Thank you.

  2. #2
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Um, so you want to press numbers from 1 to 1mil, is that right? If so then, use a loop, like this:

    Simba Code:
    program new;

    var
      a: Integer;
    begin
      for a:= 1 to 100 do
      begin
        SendKeys(IntToStr(a));
        Wait(30);
        SendKeys(Chr(13));
      end;
    end.

  3. #3
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by KingKong View Post
    Um, so you want to press numbers from 1 to 1mil, is that right? If so then, use a loop, like this:

    Simba Code:
    program new;

    var
      a: Integer;
    begin
      for a:= 1 to 100 do
      begin
        SendKeys(IntToStr(a));
        Wait(30);
        SendKeys(Chr(13));
      end;
    end.
    I want it to count from 100,000 to 1,000,000

  4. #4
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    added an extra wait:

    Simba Code:
    program new;

    var
      a: Integer;
    begin
      for a:= 1 to 1000*1000 do
      begin
        SendKeys(IntToStr(a));
        Wait(30);
        SendKeys(Chr(13));
        Wait(30);
      end;
    end.
    Working on: Tithe Farmer

  5. #5
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    added an extra wait:

    Simba Code:
    program new;

    var
      a: Integer;
    begin
      for a:= 1 to 1000*1000 do
      begin
        SendKeys(IntToStr(a));
        Wait(30);
        SendKeys(Chr(13));
        Wait(30);
      end;
    end.
    Should remove the multiplier and just write 1mil, or else its gonna calculate it every time, a million times.

  6. #6
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by KingKong View Post
    Should remove the multiplier and just write 1mil, or else its gonna calculate it every time, a million times.
    Personal preference. This script doesn't need much power. So I added the multiplier for the readability.

    edit:

    Simba Code:
    program new;

    var
      a: Integer;
    begin
      for a:= 100000 to 1000000 do
      begin
        SendKeys(IntToStr(a));
        Wait(30);
        SendKeys(Chr(13));
        Wait(30);
      end;
    end.
    Working on: Tithe Farmer

  7. #7
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Still doesn't send ::reward [from 100000-1000000]

  8. #8
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Failure View Post
    Still doesn't send ::reward [from 100000-1000000]
    SendKeys doesn't work how u want it.. ur probably trying to send keys to an inactive window.. and thats just not the case.. The window you want to send keys to, must be active and TopMost..

    You can always try TypeSendEx instead of sendkeys, but again the window must be active. Only way to "Sendkeys" to an inactive window is to use ::SendMessage..

    U'd have to write an extension for that though or a plugin because Simba doesn't have Windows API functionality.

    For an extension you'd do something like:

    Code:
    Function FindWindow(ClassName, WindowName: PChar): HWND; external 'FindWindowA@User32.dll stdcall'; // <-- That will find the window u want to send it to..
    
    Function SendMsg(Handle: HWND, Msg: Cardinal, WP: WPARAM, LP: LPARAM): &Long; external 'SendMessageA@User32.dll stdcall';  //<-- Will send the msg to inactive window..
    I don't know how to make a function return a pointer to a long in simba so instead I put &Long.. Get someone to show u how and u can make ur own extension for doing that..
    Last edited by Brandon; 08-01-2011 at 04:30 PM.
    I am Ggzz..
    Hackintosher

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
  •