Simulate HTLC in regtest c-lightning I have three nodes in regtest environment l1, l2, and l3
l1 create a channel with l2
l2 create a channel with l3
l3 create an invoice for l1.
l1 can pays it because use the route l1-l2-l3
I presume that here c-lightning use HTLC to accomplish it.
Where can I debug the script?
I'd like to see something like this
IF
  # Payment if you have the secret R
  HASH160 &lt;H&gt; EQUALVERIFY
ELSE
# Refund after timeout.
&lt;locktime&gt; CHECKLOCKTIMEVERIFY DROP &lt;Payee Pubic Key&gt; CHECKSIG
ENDIF
In order for you to see these scripts you'll have to force the channel on-chain, along with the HTLC. Only then will the HTLC be swept using the script, otherwise you'll only see the P2WSH output for the HTLC being added and then removed if the payment succeeds or fails.
Under normal operation you wouldn't therefore see the HTLC. When testing c-lightning we do however force this case, to verify that it is being handled correctly. There are two ways to force on-chain settlement:

Write a small plugin that simply holds on to the incoming HTLC on either l2 or l3 depending on which channel you want to observe the script.
If you compiled with DEVELOPER=1 you can also provide a file with instructions to disconnect if certain messages are seen. This is a bit more involved, but here's a test that shows how that works. It instrucs the l1 to disconnect as soon as it gets a WIRE_REVOKE_AND_ACK message which completes the addition of the HTLC.

Once the HTLC is stuck at some point you can generate a number of blocks until the HTLC timeout approaches, at which point the nodes will publish a unilateral close. Once the channel is closed, and the HTLC timeout expired, the nodes will sweep the HTLC output with the script you're looking for.