As TonDiening suggested, take a look at the completed scripts to see the general method of processing this information. As to your specific problem of extracting the level information from the restrictions list, try the following. This assumes that the level restriction is always last in the list.
#TR {Object is restricted: (*) Level_(%d)} {
#ADDKEY newRecord Restrictions %replace("%1", " ", "|")
#ADDKEY newRecord Level %2
}
This will add the restrictions as a string list to your database. This works best if you make the Restrictions field "Option List" type. The level datum is added as a numeric value.
As far as the Affects are concerned, this is an opportunity. I prefer to make each Affect be an independent field in the database. This trigger would look like:
#TR {Affects: (%w) by (%n)} {#ADDKEY newRecord %1 %2}
The rest is up to you, but similar to what's been done in the past.
Troubadour