Well, got it to work.
script CreateLoopbackInterface (NCM.Nodes @ContextNode, string @LoopbackSubnet)
{
{
string @ThirdOctet
string @LoopbackIP
string @ip
@ip = @ContextNode.AgentIP
@ThirdOctet = GetOctet(@ip, 3)
@LoopbackIP = SetOctet(@LoopbackSubnet, 4, @ThirdOctet)
}
// Enter configuration mode configure a new loopback interface.
CLI
{
configure
set interfaces lo0 unit 0 family inet address @LoopbackIP
commit
exit
}
}