Howdy, Stranger!

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

Click again in Harlow

Hi there:

I've written something like this:
(if: $Wama is not 0)[Waschmaschine aus dem Weg räumen. (click: "räumen")[(set: $Zeit to $Zeit +5)(if:$Meister is 1)[(set: $Wama to $Wama - 10)](else:)[(set: $Wama to $Wama - 5)]]]

Problem is, I can only click "räumen" ONCE. I want to click it multiple times untill $Wama has reached 0. But how?

I could do all this with a seperate passage, sure. But I want to make it nice and slim.

Comments

  • Replace your (click:) macro with a (link-repeat: ) macro.

    eg. Change (click: "räumen")[ to be (link-repeat: "räumen")[
  • That fixes the one-click problem.

    But the passage stays unaffected by the change until I refresh it somehow.

    When $Wama reaches 0 it does not display the text.
  • Gman wrote: »
    When $Wama reaches 0 it does not display the text.
    The example you gave contained no code related to displaying text when the $Wama variable reaches zero, people can't supply solutions to questions that are not asked.
    You example needs to contain everything to wanted to happen.

    To do what you want you first have to indicate where you want the text to be displayed and secondly check the variable each time you change it's value so you know when to display the text.

    Try something like the following which uses a combination of a named hook and a (replace: ) macro.
    (set: $Wama to 10)(set: $Meister to 0)
    
    (if: $Wama is not 0)[{
    Waschmaschine aus dem Weg räumen. 
    (link-repeat: "räumen")[{
    	(set: $Zeit to $Zeit +5)
    	(if: $Meister is 1)[(set: $Wama to $Wama - 10)]
    	(else:)[(set: $Wama to $Wama - 5)]
    	(if: $Wama is 0)[(replace: ?msg)[Text to display when Wama is zero]]
    }]}]
    
    |msg>[]
    
    ... I added line-breaks and indentation to make the example slightly more readable.
  • Your right, sorry. Thanks anyway.

    In the end I used this code and created a loop with the passage.
    (if: $X is not $Y)[(set:$Zeit to $Zeit +5)(set: $Wama to $Wama -5)(if: $Meister is 1)[(set: $Wama to $Wama - 5)Du rückst die Waschmaschine ein Stück zur Seite]]
    (if: $X is not $Y)[(if: $Wama is not 0)[[[Die Waschmaschine aus dem Weg räumen->Waschmaschine entfernen]]
    [[Die Waschmaschine in Ruhe lassen->Location]]]] 
    (if: $Wama <= 0)[Die Waschmaschine ist aus dem Weg.[[Wohnung betreten->Franzi]]]
    
Sign In or Register to comment.