Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Dilara

Junior Member
Registered:
Posts: 4
Reply with quote  #1 
Hi everyone,

We want to stop the task execution at the end of the block and quit monkeylogic via the script. Is there a way to do this? We tried using the block selection function and setting the value of the new block to -1 but that didnt't work.

Thanks,
Dilara
0
neo3dot1415

Junior Member
Registered:
Posts: 29
Reply with quote  #2 
One suggestion would be stopping the task with Esc button: 

if kbdgetkey == 01
   return
end

This would stop the task regardless of monkey's performance. You can also control it through TrialRecord structure. 

0
Dilara

Junior Member
Registered:
Posts: 4
Reply with quote  #3 
Thanks for the response! I am actually looking for a way to automatically stop task execution after a specific duration. I was wondering if there is a way to exit the task using a conditional (e.g. stop task if x amount of time has elapsed since the beginning of the nth block) within the script without the need of manually hitting the Esc button. 

0
Jaewon

Administrator
Registered:
Posts: 423
Reply with quote  #4 
Do you need to stop the task right away after a specific time, even if you are in the middle of a trial? If you can wait until the trial finishes, you can call escape_screen() during the trial. That is the function called when the ESC key is hit.

If you are using ML2, there are other ways to stop the task.

TrialRecord.Pause = true;  % Pauses the task after this trial. The same as calling escape_screen()
TrialRecord.Quit = true;   % Quit the task after this trial
0
Dilara

Junior Member
Registered:
Posts: 4
Reply with quote  #5 
This is what I needed, thanks Jaewon!
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.