SRL Archive - Research & Development Lounge

Give commands to the script while its running


Shatterhand

2012-02-19 16:32:43

Hey everyone!

Ok so, my problem is: I usually baby sit my bots, so if someone talks to me, I would answer them. Sadly, SMART wont let me type sometimes. I have to enable/disable it, and/or minimaze/maximaze it, and sometimes I manage to be able to type while SMART is enabled. Too difficult.

Is there any way I could communicate with the script while its running? I mean I want to give commands for the script while its running. This would be good for lot of things, like: chatting, checking XPs when u want, looking at friend list.
This would happen in a simple form window, with simple commands, or options, I dont know.
I guess this is something like multi threading.
Any solutions?

Thanks in advance,
hunt3rx3

Justin

2012-02-19 21:27:48

You could make a new procedure to check for whatever you want it to do and you could call it after every other procedure?

Its not exactly the best way to do things but it should be fine for what you are wanting to do.

DemiseScythe

2012-02-19 22:41:05

Make it check for when a key is pressed, if key is down or something similar, do [call what you want it to do] and then it will continue with the script once it has done that

Shatterhand

2012-02-20 09:33:24

From: DemiseScythe
Make it check for when a key is pressed, if key is down or something similar, do [call what you want it to do] and then it will continue with the script once it has done that

This would be the best solution, but will smart detect when I press a key? Its just not typing it sometimes?
This way I should turn off somehow typing (sometimes I can type while SMART is enabled). How to do that?

masterBB

2012-02-20 09:38:11

It don't think its smart who is detecting it but simba. You can try it anyway.

Sex

2012-02-20 09:42:21

What kind of commands do you want to run? You can use the CallProc procedure to call whatever procedure you want.

You can run a user defined hook (?) that checks if a key is down such as F5 and when it is, a form/input box will pop up and let you do whatever. I remember Zeph had something like this in his old script that when you pressed F5 a form popped up and you could do various things.

masterBB

2012-02-20 09:46:09

  repeat
wait(100);
if(IsKeyDown( 32)) then
writeln('you pressed space');
until(false);

Edit:
You know what I will create this.

Shatterhand

2012-02-20 10:08:20

From: masterBB
  repeat
wait(100);
if(IsKeyDown( 32)) then
writeln('you pressed space');
until(false);

Edit:
You know what I will create this.

Ok this is cool, but how to prevent smart to type something accidently?

Mark

2012-02-20 10:19:54

that should work fine if i understand properly as nothing will be typed into smart if you use f1-f12 but it might mess up the bot if it changes your game tabs

you could also try looking to see if ctrl+a is pressed

Shatterhand

2012-02-20 10:27:16

From: CRU1Z1N
that should work fine if i understand properly as nothing will be typed into smart if you use f1-f12 but it might mess up the bot if it changes your game tabs

you could also try looking to see if ctrl+a is pressed

Yea that can mess the bot up. What ctrl+a does?


OFFTOPIC:
Why SMART keeps pressing tab key when enabling/disabling it? (tab is for answering PMs)
Last time I disabled/enabled SMART, I got a random immediately! Jagex can easily detect us this way!! :S

masterBB

2012-02-20 10:56:19

I will not create this, the brilliant idea I had will make simba crash :(