Howdy, Stranger!

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

Supported by

Problem executing an event in a created extension

I have created an extension as described in the official documentation but I can't figure out how to execute an event inside the extension.

Comments

  • Hi Chris,

    You can fire events from within an extension like so:

    self.extension_manager.fire('some_event', argument1=value1, argument2=value2)
    

    This will then result in the following event-handler functions being called:

    def event_some_event(self, argument1, argument2):
    

    The event name can be anything, so extensions can also make up their own events if they need to, for example to communicate with each other. If no-one is listening to the event, it will simply be ignored. And the arguments have to be passed as keywords, i.e. not by order. I hope this clears things up! (And thanks for pointing out that this information is missing in the docs.)

    Cheers,

    Sebastiaan

  • Hello Sebastian and thank you for your quick response,

    I am a bit confused with the answer you gave me. So I have added the

    example extension given at the documentation to my OpenSesame extensions directory and it recognizes it.

    How can I now make that extension start when I run an experiment ?

    I understand that some extensions start when the OpenSesame software starts. But I would like the experiment to trigger some of the extension's events while running and not just when it starts.

    Thank you,

    Chris

  • Hi Chris,

    Most likely an error occurs while loading the extension. To develop an extension, it's useful to enable a console with an inprocess kernel (Menu → Tools → Preferences), because this allows you to access the OpenSesame internals. (Normally, the console will have its own kernel.) This requires OpenSesame 3.3. Once you've enabled that, and restarted OpenSesame, the console labeled 'Python (1)' will have an opensesame object in it, which corresponds to the application itself. And with this you can test whether your extension loads, like so (but of course change the name of the extension from after_experiment to your extension):

    You'll probably see some errors when you try this, and then you can start debugging from there!

    Sebastiaan

  • Thank you Sebastian for the quick reply once again.

    I managed to make the extension load when the OpenSesame software runs just by changing the disabled: true setting from the .yaml file.

    I also tried the commands you suggested and I get this error:

    Moreover, the problem I have and I want to figure out is, how to execute a specific event of an extension while running a certain experiment ? For example should that be coded in an inline_script ? Can also be executed for example in a sequence ? And if yes, how ?


    Thank you very much for your time and help,

    Christos

  • I also tried the commands you suggested and I get this error:

    You have to enable the inprocess console, as I explained in my previous post.

    Moreover, the problem I have and I want to figure out is, how to execute a specific event of an extension while running a certain experiment ? For example should that be coded in an inline_script ? Can also be executed for example in a sequence ? And if yes, how ?

    There's a distinction between plugins and extensions.

    • An extension lives in the user interface; for example, the console is an extension. You'll also see that all the events, which extensions can fire and listen to, are related to the user interface.
    • A plugin is an additional item that you can use in your experiment; for example, the pygaze items are plugins.

    From your question, it seems like you actually want to create a plugin. Is that correct? If so, then the next step would be to define exactly what you want to do (which is not clear from your question) and only then how to do it!

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