User:Bookofjude/wikilinks.ice

Usage

 * Press Control-S to bring up Script Editor
 * Paste into a new script file
 * Hit "update and close" in the Main menu.

Code
Function WikiMatch(TextToMatch) Dim regEx, CurrentMatch, CurrentMatches, ActualLink, Links, CurrentSearch Set regEx = New RegExp regEx.Pattern = "\[\[([^\|\]]*)(\|[^\]]*)?\]\]" regEx.IgnoreCase = True regEx.Global = True regEx.MultiLine = True Set CurrentMatches = regEx.Execute(TextToMatch) For Each CurrentSearch in CurrentMatches ActualLink = Replace(CurrentSearch,"", "")                                  ActualLink = Replace(ActualLink, "", "") ActualLink = Replace(ActualLink, "", "") ActualLink = Replace(ActualLink, " ", "_") if ActualLink <> "" Then WikiMatch = Wikimatch + " http://en.wikipedia.org/wiki/" + ActualLink End If                            Next End Function

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber) Dim Matches Matches = WikiMatch(Message) If Matches <> "" Then SendCommand "/echo " + Channel + " " + Matches, ServerNumber End If     End Sub

Sub ONQUERY(Message,Nickname,Host,ServerNumber) Dim Matches Matches = WikiMatch(Message) If Matches <> "" Then SendCommand "/echo =" + Nickname + " " + Matches, ServerNumber End If     End Sub