Howdy, Stranger!

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

Supported by

[solved] change target colors

edited March 2012 in OpenSesame

Hi Sebastiaan,
I have a problem with the colors of my targets and the randomization. I want to present rectangles in different colors. So I created two sketchpads in my trial sequence (fixation dot and target). I modificated the Edit script of the target by substitute the code of the color by the variable „target_color“, which I had defined in the block loop (according to he hexadecimal RGB notation). I defined it like this:
target_color
1 =#00ff00
2 =#ff0000
3 =#0000ff

It didn´t work and I have no other ideas. What could I change , that it will work?
Thanks a lot for your help!
kind regards, Anna

Comments

  • edited 10:34AM

    Hi Anna,

    It seems that your general approach is correct, so there's probably some simple mistake in there (a typo, or incorrect syntax). Could you perhaps provide some more details on what you did exactly (e.g., show the script) and what kind of error you get?

    Cheers,
    Sebastiaan

  • edited March 2012

    Hi Sebastiaan,

    Thanks for your help! That´s the target script. I changed the color in my variable [target_colour]. I also copied the error message.

    set duration "300"
    set description "Displays stimuli"
    set start_response_interval "no"
    draw rect -64 -64 128 128 fill=1 penwidth=1 color=[target_colour] show_if="always"
    draw textline 0 -128 "[target_number]" center=1 color=white font_family=mono font_size=18 show_if="always"

    Error: Runtime error
    Description: Failed to evaluate '#00ff00' in loop item 'block_loop_right': unexpected EOF while parsing (, line 1)

    Kind regards, Anna

  • edited March 2012

    Hi Anna,

    You probably used '=#00ff00' for the variable target_colour, and not '#00ff00' (without the '=' sign), right?

    It is a little advertised feature of OpenSesame that you can define variables in loop items using Python statements. You indicate this by prepending an '=' sign, kind of like you would do in a spreadsheet. So, for example, using '=randint(0,10)' would give you a random integer between 0 and 10 (link).

    In your case, '=#00ff00' leads OpenSesame to evaluate the string '#00ff00' as Python code. This is just a comment (# = comment), so there's nothing to evaluate, and you get this obscure error message. But the solution is simple: Just omit the '=' sign.

    Please let me know if this doesn't work for you!

    Kindest regards,
    Sebastiaan

  • edited 10:34AM

    It works :) Again: Thank you very much for your help!

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