Convertisort : Différence entre versions

De Prima-jdr Wiki
Aller à : navigation, rechercher
(Page créée avec « Convertisort converti le texte copié du .pdf du Livre du Joueur et collé dans un fichier "input.txt", en texte formaté pour être directement ajouté dans le Wiki. Ce t... »)
(Aucune différence)

Version du 24 février 2012 à 06:37

Convertisort converti le texte copié du .pdf du Livre du Joueur et collé dans un fichier "input.txt", en texte formaté pour être directement ajouté dans le Wiki. Ce texte est stocké dans le fichier "output.txt".

Script

Const ELEMENT = "Air"

Set fso = CreateObject("Scripting.FileSystemObject") Set input = fso.OpenTextFile("input.txt", 1) Set output = fso.CreateTextFile("output.txt", True) X = input.readAll input.close

Dim KeyWord(7) KeyWord(0) = "Temps d'incantation-" KeyWord(1) = "Portée-" KeyWord(2) = "Durée-" KeyWord(3) = "Zone-" KeyWord(4) = "Effet-" KeyWord(5) = "Spécial-" KeyWord(6) = "Utilisation alternative-"

output.write "" & vbcrlf

For i = 0 to 6 For j = i+1 to 6 Z = "-" debut = KeyWord(i) fin = KeyWord(j)

if i >= 4 then Z = vbcrlf if j >= 6 then fin = vbEndOfFile end if end if

Y = getStr(debut, fin, X) Y = Replace(Y, " ", " ") Y = Replace(Y, " ", " ") Y = Replace(Y, " ", " ")

if Y <> "" then output.write "*" & mid(KeyWord(i), 1, len(KeyWord(i)) - 1) & Z & Y exit for end if Next Next

output.write vbcrlf & "" & vbcrlf & "" output.close

Function getStr(strStart, strEnd, text) posStart = inStr(text, strStart) lenStart = len(strStart) posEnd = inStr(text, strEnd) lenGet = posEnd - posStart - lenStart if posStart = 0 then ret = "" elseIf posEnd = 0 then ret = "" elseIf lenGet < 0 then ret = mid(text, posStart + lenStart) else ret = mid(text, posStart + lenStart, lenGet) end if getStr = ret End Function