SRL Archive - Help

Multi-threading


pinoyid0l

2009-01-26 21:18:43

Is there a way within scar to multi-thread? or run functions at the same time?
But not running multiple scar instances.

Example: I want mining (finding ores) while responding to messages while simulating human behavior movements.

I did succeed combining a mining scar script here, to auto responder I made in VBscript (using database techniques, and it finds what message to respond faster in a big database of text). but I find this a dirty approach. Any help to it all within scar? also the database techniques.


Thank you.

Method

2009-01-26 21:42:09

You can use the SetTimeout procedure to call functions automatically every x seconds (where you set x in SetTimeout), but that's probably as close to multi-threading as you're going to get with SCAR.

EDIT: Also, there is usually some lag associated with that procedure, so use it carefully.

boberman

2009-01-26 23:08:30

From: Method
You can use the SetTimeout procedure to call functions automatically every x seconds (where you set x in SetTimeout), but that's probably as close to multi-threading as you're going to get with SCAR.

EDIT: Also, there is usually some lag associated with that procedure, so use it carefully.


That's not true multithreading though, its more like program interruption.

Method

2009-01-27 00:16:21

From: boberman
That's not true multithreading though, its more like program interruption.


Right, that's why I didn't say it was "true multithreading". :eek:

senrath

2009-01-27 03:01:23

Just be careful when using SetTimeout, so that whatever procedure or function it is calling doesn't interfere with the rest of the script. Ie, it's probably best not to use it with any procedure or function that moves the mouse.

pinoyid0l

2009-01-27 05:09:53

Many thanks for the reply.

I'm actually trying to take advantage of multi-core cpu's. SetTimeout, I had no problem with mouse movements since I did it in a separate function. But I found that it doesn't improve responsiveness which is my primary reason in doing this project..

I've done a dirty trick with auto-respond while mining. It work's fine.


Also, I wanted to know, is there a chance to approve a script here not made with scar? I wanted to release this to have free bug testers =).

MasterKill

2009-01-27 05:17:47

From: pinoyid0l
Also, I wanted to know, is there a chance to approve a script here not made with scar? I wanted to release this to have free bug testers =).


Programming General Programming Forum. For the Programming community.
Programming

good luck ;)