Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Syntax errors converting JavaScript (from OSWeb script) into Python

Hello,

I've looked into the syntax differences between JavaScript and Python as I'm trying to adapt inline JavaScript into inline script for a new experiment in OpenSesame. However, it comes up with '[pyFlakes] invalid syntax' error but I can't figure out what is wrong with it?


Comments

  • Hi @Pikachu ,


    Is it possible that there is an invisible character after the colon on line 1? Or that you are using a type of quotation marks that is not the regular one?


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited December 2022

    Hi @1vanderlinden,


    Thanks for your reply. There wasn't any invisible character after the colon on line 1 and the quotation marks were the regular ones. The exclamation mark error went away though after I copied, deleted and then pasted all the code again. A bit of a weird one!

    Now, I have a different problem. I've got a variable named 'audio' (a .wav file), whose value is set in the main loop (or in the table of that loop) and passed to a sampler item in a coroutine. The volume of the audio is set and changes dynamically in an inline script (the option to set the volume in the sampler is disabled). However, OpenSesame can't find the volume variable (X) - it says it does not exist. I've checked the variable inspector and yes, it's not there but I'm confused as to where it's pulling X from because basically, there are 2 volumes (X1 and X2), which are among the variables in the inspector. Sorry if this sounds confusing - let me know if it would be helpful to attach the OS script.


    Cheers,

    Pikachu

  • Hi Pikachu,

    I've checked the variable inspector and yes, it's not there but I'm confused as to where it's pulling X from because basically, there are 2 volumes (X1 and X2), which are among the variables in the inspector.

    That part is indeed quite confusing.

    Apart from that, audio might not be the best name, as there is a good chance, that internally some things are called audio that would be overwritten (best to avoid those kind of names, even if this specific one might not cause problems)

    let me know if it would be helpful to attach the OS script

    That might be helpful. Best provide the entire experiment (with an example audio file attached).

    Eduard

    Buy Me A Coffee

  • Hi Eduard,

    Thank you for your reply (and for the advice - I naively named a variable 'background' once, which interfered with a built-in variable of the same name! 😅).

    It's ok - all sorted now. Turns out that there was still a variable X in the script view which I neglected to update. Thanks though! There seems to be a slight issue with the metronome but I'll post in the other thread about that.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games