Player Experience Upgrade

version 2/111127 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Rules

    A smarter parser rule (this is the strip misspelled articles rule):
        if stripping "(teh|th)" is fruitful:
            identify error as strip misspelled articles rule;
            reparse the command.

    A smarter parser rule (this is the Poor Man's Mistype rule):
        let wnum be the position of first bad word;
        if wnum > 0:
            let badword be indexed text;
            now badword is word number wnum in reborn command;
            if the number of characters in badword < 3, no match;
            let first3 be indexed text;
            now first3 is "[character number 1 in badword][character number 2 in badword][character number 3 in badword]";
            let candidate be indexed text;
            repeat with item running through things enclosed by location:
                if item is visible:
                    now candidate is printed name of item in lower case;
                    if candidate matches the regular expression "\b[first3]":
                        repeat with wordcounter running from 1 to the number of words in candidate:
                            if word number wordcounter in candidate matches the regular expression "\b[first3]":
                                replace the regular expression "\b[badword]\b" in the reborn command with "[word number wordcounter in candidate]";
                                identify error as the Poor Man's Mistype rule;
                                reparse the command.

    A smarter parser rule (this is the most common verb misspellings rule):
        if the latest parser error is the not a verb I recognise error:
            if input contains "^(lok|loook|ook)":
                identify error as most common verb misspellings rule;
                replace the regular expression text matching subexpression 1 in the reborn command with "look";
                reparse the command;
            if input contains "^(tkae)":
                identify error as most common verb misspellings rule;
                replace the regular expression text matching subexpression 1 in the reborn command with "take";
                reparse the command.