Need scripting help...

06/22/2015 10:34 Angelsblood#1
Hello everyone,

i made a simple Script, which needs another Script to work fully. It actually collects Items through color detection, but each 2minutes i need the script to pause to click onto another 2 things (coordinates) and wait another 90 seconds, afterwards it should start collecting again... and again...


Greetings Angel

Leave me a message here or privately :)
06/22/2015 12:04 alpines#2
Pausing the other script is actually pretty easy. You can use NtSuspendThread for this.
To resume the process just use NtResumeThread.

Here's an UDF for AutoIt.
[Only registered and activated users can see links. Click Here To Register...]

With this way you have to click the "2 things" with the script which pauses the main one.
So either you edit the script you want to pause or you'll do it this way.
06/23/2015 18:01 lolkop#3
Quote:
Originally Posted by alpines View Post
Pausing the other script is actually pretty easy. You can use NtSuspendThread for this.
To resume the process just use NtResumeThread.

Here's an UDF for AutoIt.
[Only registered and activated users can see links. Click Here To Register...]

With this way you have to click the "2 things" with the script which pauses the main one.
So either you edit the script you want to pause or you'll do it this way.
I guess he's actually not trying to suspend any other scripts^^ Instead he's trying to do some actions every x seconds.

In that case, you might take a look @ the AdlibRegister function. That function interrupts your script in specified periods to do some other actions
06/23/2015 20:11 alpines#4
That's why I suggested both ways.
06/23/2015 21:40 Angelsblood#5
Could someone add the AdlibRegister thingy to this Source code... It should run 2minutes pause and run Func "2" whichs needs to be made too (just a template to click on 2 coordinates and pause another 2 minutes) then repeat from the beginning....


06/23/2015 22:09 lolkop#6
Quote:
Originally Posted by Angelsblood View Post
Could someone add the AdlibRegister thingy to this Source code... It should run 2minutes pause and run Func "2" whichs needs to be made too (just a template to click on 2 coordinates and pause another 2 minutes) then repeat from the beginning....
Just add this on top of your script...
Code:
AdlibRegister('extra', 120000)
Func extra()
   MouseClick('left', 1, 1)
   MouseClick('left', 100, 100)
EndFunc
It'll call the "extra" function every 120 seconds.
06/23/2015 22:14 Angelsblood#7
Thanks for this - how do i make the other Func pause while it does those clicks?

E: Also need a code to detect a point to click (x, y) in my defined area (444, 46, 1464, 802) which is connected to my $color... //but i need it without the color to do the 2 requested clicks...
06/23/2015 23:21 lolkop#8
Quote:
Originally Posted by Angelsblood View Post
Thanks for this - how do i make the other Func pause while it does those clicks?

E: Also need a code to detect a point to click (x, y) in my defined area (444, 46, 1464, 802) which is connected to my $color... //but i need it without the color to do the 2 requested clicks...
Like I said, before... adlib interrups the script while it executes it's function.

The "extra function in this case will get executed every 120seconds no matter what's currently going on in your script. when the function finishes, the script will go on, from the point it got interrupted.

So if you need to add stuff to the "extra" function, simply add it...

But keep in mind, that every second the "extra" function wastes, the rest of the script stays inactive. So you should try to keep it simple and efficient.
06/23/2015 23:31 Angelsblood#9
Okay now i have to figure out how to make sure it walks/clicks (no matter where my character stays...) to the point it needs to stay befor doing "extra" :D
06/24/2015 16:41 lolkop#10
Quote:
Originally Posted by Angelsblood View Post
Okay now i have to figure out how to make sure it walks/clicks (no matter where my character stays...) to the point it needs to stay befor doing "extra" :D
Well that's up to you.

Coding/scripting wouldn't be fun (or even necessary), if there were no problems to solve :P