SRL Archive - OSR Help

Key Pressed/Hotkeys Not working.. :( Help pls?


Brandon

2011-03-05 16:51:39

Im trying to do a procedure that When a key is pressed, It opens a msg box for the user to type in and then sends the message to the SMART Client.. Or Sends the KeyPressed..

But For some reason its NOT detecting If the F1 Key is pressed :S..

reason for doing this Procedure: Dont like having to constantly press disable smart in order to type.. Id rather have a hotkey for typing..

Is that even possible?? So far it works except that it doesnt detect the F1 key.. or any Hotkey Pressed.. :spongebob:

[PHP]
program new;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
var
Value : string;

Procedure ChatMessager;
Begin
If (IsFKeyDown(1)) then //If Fkey is down then Open MessageBox Popup..
Begin
Value := '';
format('[%s] the value = [%s]',[booltostr(InputQuery('Enter A Message','ENTER HERE:',value)),value]);
if not (Value = '') then //If Value Is not *Blank* then Send User Message…
begin
TypeSend(value);
end else
if (Value = 'Enter') then //Type 'Enter' in the message box To Open QuickChat…
begin
SendKeys(Chr(13));
end;
end else
If (IsKeyDown(27)) then //If Escape key Pressed, SendKey *Escape*…
Begin
SendKeys(Chr(27));
End;
End;

begin
ChatMessager;
end.[/PHP]

Train

2011-03-05 16:54:09

Loop the ChatMessager; procedure.

Brandon

2011-03-05 17:07:07

hmm… Not sure I made the question clear enough? How Would I go about doing that if the ChatMessager; is in a program like this (in the main loop):

[PHP]
program new;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
var
Value : string;

Procedure ChatMessager;
Begin
If (IsFKeyDown(1)) then //If Fkey is down then Open MessageBox Popup..
Begin
Value := '';
format('[%s] the value = [%s]',[booltostr(InputQuery('Enter A Message','ENTER HERE:',value)),value]);
if not (Value = '') then //If Value Is not *Blank* then Send User Message…
begin
TypeSend(value);
end else
if (Value = 'Enter') then //Type 'Enter' in the message box To Open QuickChat…
begin
SendKeys(Chr(13));
end;
end else
If (IsKeyDown(27)) then //If Escape key Pressed, SendKey *Escape*…
Begin
SendKeys(Chr(27));
End;
End;




//Main Loop…
begin
R_FindRandoms;

R_OpenBankBooth('eb');
OpenBankCheck;

ChatMessager; //<—- Here.. It's Inbetween Open Bank And Deposit bank..

wait(2500);

ChatMessager; //<—- And Here..

Repeat
If(not(InvEmpty)) then
begin
depositall;
end;
end.
[/PHP]

Train

2011-03-05 17:09:45

Yes, you need to loop it.

Brandon

2011-03-05 17:19:28

:S Not exactly sure If Im doing it right…
[PHP]
begin
Repeat
ChatMessager;
Until(not(isFKeyDown(1)));
end.[/PHP]

Train

2011-03-05 17:35:40

^yes, but add some wait.
or do
Mark := GetSystemTime;
while (GetSystemTime - Mark < 2500) do
begin
ChatMessager;
Wait(50);
end;

weequ

2011-03-05 18:21:44

Sadly IsFKeyDown recognizes smart keypresses when smart is enabled. At least I had the problem last time I tried to recognize user input…

Brandon

2011-03-05 18:31:34

*sigh* Your right.. I noticed that just now after u posted.. I took out the lines:

{$DEFINE SMART}
{$i reflection\reflection.simba}

And the keypress works… :( is there a way to get it to actually just work with smart?