CUSTOM INPUT IN BLOCK TCP

BLOCK:TcpConnect host = $"<bughost>" port = $"<input.PORTA>" useSSL = True timeoutMilliseconds = 3000 SAFE ENDBLOCK

I get the following error when trying to add a CUSTOM INPUT in a tcp block

image

what should i do to resolve this? could someone help me.

Explain more exactly the problem

image

i would like to add a CUSTOM INPUT on the block tcp port

Hello @HuuD
Change the type to VAR and look for your variable
Capture
For my part I made a constantblockinteger that I called PORT

1 Like

image
image

@WannaCry my PORTA variable is a custom input

@HuuD
Present :

@WannaCry @Ruri I’m doing exactly that, but I get this error from print, this error only happens in TCP block

image

It’s normal you have to import it using the old system the VAR mode from what I understand does not include the CUSTOM variables so do it like this
Capture
Capture
As you can see I got my default value “443” then this value is in string
and now i can call this var into my TCP block
Capture

BLOCK:ConstantString
  value = $"<input.PORTA>"
  => VAR @constantStringOutput
ENDBLOCK

//int StrToInt = int.Parse(constantStringOutput);  If you ever want to convert it to integer

BLOCK:TcpConnect
  port = @constantStringOutput
ENDBLOCK

WannaCry

1 Like

how did I not think of this before, what a shame and thank you so much @WannaCry for all the clarification

image
:smiling_face_with_three_hearts:

1 Like

Hopefully this issue should be fixed in the new version of OB2, I think I made a patch for this exact case in the past but it didn’t make it to a release yet. Then you will be able to use input.PORTA directly.

2 Likes