Ok downloading now.
You need to do something in the Python side of your Auto block to wake up the auto translate. The translation should appear in the JS side.
Delete the import commands and the random seed section. Iâm guessing you come from a MATLAB background. Python and JavaScript both seed randomly by default.
Are you using random, math or time elsewhere? If so, youâll need to rewrite your Python code.
Thank you after I removed the import command and random seed sections the code did translate. However I do use the random function in some other sections of the task, how would I trigger this now?

Here is what it looks like.
random()*100 is I believe the same as your random uniform command.
Your code component is showing as Py not Auto.
Have you seen randint on my crib sheet?
Please have a read through my crib sheet.
I think you want randint (which is a uniform distribution) but youâve also missed that all loops in JS have to be addressed as trials
Remove the dollar sign
Remove random. from randint
Nevermind I figured this out. I will be testing running it in a minute.
By âit wonât translate â what do you mean? It looks like you havenât clicked into the Python side to activate the translation
Yes I realized it after I had sent the message. So a first run through on my desktop crashed when it tried to close my practice game loop, which had initially been named âpracloopâ. It says âtrialsâ isnât defined. I have another game loop in the task and both loops canât be named trials so how would I work around this? Or can this version of the task only work through Pavlovia and Javascript?
After youâve done the auto translation switch auto to both and change the loop names to trials in the JS side only
Thank you. I have made additional adjustments to the task based on your crib sheet and now when I run the task the visual stimuli are pulled from the excel file now! The only issue is that the event.clearEvents() function isnât clearing my previous responses for the game. Is event.clearEvents() supposed to translate into something else when in JS format?
clearEvents just clears the keyboard buffer.
Do you have a bunch of variables that need to be reset in Begin Routine?
Is the problem that the routine starts as soon as the previous routine has finished and therefore the key is still pressed. Do you have an ISI to allow the participant to lift their finger?
Yes my âISIâ periods are points in which the participant is anticipating a response from their partner.
Taking a look at the flowchart at the bottom of the image, decisions are made in the âDecisionPracâ routine of the loop, then one of the âAntiâ loops is triggered and one of the âFeedâ loops is triggered, all sequentially, before returning to DecisionPrac.









