Log in

View Full Version : IsRealKeyDown



m34tcode
03-12-2012, 05:15 PM
I am writing a utility that allows you to pick colors and test them through smart, but if the form is up, it seems to keep the script paused.

The only solution i can think of is to close the form after picking your colors, test them, reopen the form, change your colors, and close it again so you can see the colors being found in Runescape.

The problem: Smart is not allowing me to detect whether real keys are down, so i cant set a hot key to reopen the form.

I tried using the 'IsRealKeyDown function from ObjectDTM but I do not have the FindAndSetTarget function. I have updated srl/simba but I don't have the function. Anyone else have this function, or a different solution?

To better explain the functionality of my script, ill re-explain with how you would use it.

1) You run the script, and the form pops up.
2) you enter a few colors into the form.
3) You close the form, and the script will search the RS screen for the colors you entered.
4) every pixel matching the colors and tolerance will be painted in RuneScape.

EDIT: just noticed I was a registered user. I remember the rules for becoming a junior mem changed, but i think i already met those conditions. Hmm

Sex
03-12-2012, 05:23 PM
http://en.wikipedia.org/wiki/Modal_window
I think you can edit smart.simba to do what you want though.

m34tcode
03-12-2012, 05:33 PM
Yea Im not aware of making the form not a modal window, Thanks for the link btw.

Also havent seen the actual smart file. will check into that.

If i do that though anyone who uses the script will need to make the same changes

Sex
03-12-2012, 05:36 PM
You are correct. Iirc, the file overwrites the existing IsKeyDown, etc. all IO methods with the SMART ones. So all you'd do is set a function to the old IsKeydown before SMART overwrites it. You can do that and send a pull request and have it added to SRL :) (if they feel it is a good idea).

m34tcode
03-12-2012, 06:03 PM
AFAIK I would need to rename the function in smart.simba in order to use the real iskeydown method, which would break scripts that use simba with the normal iskeydown in smart.

Renaming the method did work. I may have misunderstood what you said about seting a function to the old one.

this was my interpretation:

function IsRealKeyDown(key:word):Boolean;
begin
result := IsKeyDown(key);
end;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/misc/paintsmart.simba}


This gives the error '[Error] (181:8): Unknown identifier 'IsRealKeyDown' at line 180' in smart.simba. Line 180 is the declaration of iskeydown.

Sex
03-12-2012, 06:10 PM
Yeah, on second thought, not sure if this would be possible..you would have to use a different name causing scripts to break..

m34tcode
03-12-2012, 06:24 PM
Yea. Thank you for the temp fix Idea though =]

The renaming in SMART.Simba will work for now. Anyone who uses the script should understand how to modify it ;]