SRL Archive - General

Counting up.


Failure

2011-08-01 06:37:27

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.

KingKong

2011-08-01 07:08:06

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


program new;

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

Failure

2011-08-01 07:11:59

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


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

masterBB

2011-08-01 07:12:30

added an extra wait:

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.

KingKong

2011-08-01 07:14:43

From: masterBB
added an extra wait:

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.

masterBB

2011-08-01 07:18:23

From: KingKong
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:


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.

Failure

2011-08-01 07:55:10

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

Brandon

2011-08-01 12:28:21

From: Failure
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:

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..