Mikrotik scripting get value

hello all ;
I am new to mikrotik and now I need to write script to create port forwarding rules.
As you know for port forwarding , we need 2 rules . first in “/ip firewall filter” and second in “/ip firewall nat”
So for this purpose we need destination port and local ip address and local port . { mikrotik ip address (WAN) : port1 -------------------> server ip address(LAN) : port2(service) }
Can anyone help me to write a script to get port and ip address value and automatic write the two rules above ??
the variable is :
port1
serve ip address(LAN)
port2

tanx.