Fixed to move the source from the oxt directory and copied the xba source into the oxt directory.

This commit is contained in:
2016-11-29 14:23:00 +08:00
parent fa28164aa6
commit 932c6bed77
10 changed files with 1162 additions and 0 deletions

View File

@ -1,9 +1,11 @@
' 0Main: The main module for the Pokémon Go IV calculator
' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-27
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="0Main" script:language="StarBasic">&apos; 0Main: The main module for the Pokémon Go IV calculator
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-27
Option Explicit
' The stats of a Pokémon.
&apos; The stats of a Pokémon.
Type aStats
sNo As String
sPokemon As String
@ -17,13 +19,13 @@ Type aStats
nMaxCP As Integer
End Type
' The amount of star dust to power-up.
&apos; The amount of star dust to power-up.
Type aStarDust
fLevel As Double
nStarDust As Integer
End Type
' The parameters to find the individual values.
&apos; The parameters to find the individual values.
Type aFindIVParam
sPokemon As String
nCP As Integer
@ -40,7 +42,7 @@ End Type
Private maBaseStats () As New aStats
Private mCPM () As Double, mStarDust () As Integer
' subMain: The main program
&apos; subMain: The main program
Sub subMain
Dim maIVs As Variant, nI As Integer, sOutput As String
Dim aQuery As New aFindIVParam, aBaseStats As New aStats
@ -50,32 +52,32 @@ Sub subMain
Exit Sub
End If
maIVs = fnFindIV (aQuery)
sOutput = ""
sOutput = &quot;&quot;
For nI = 0 To UBound (maIVs)
sOutput = sOutput _
& " Lv=" & maIVs (nI).fLevel _
& " Atk=" & maIVs (nI).nAttack _
& " Def=" & maIVs (nI).nDefense _
& " Sta=" & maIVs (nI).nStamina _
& " IV=" & fnFloor (maIVs (nI).nTotal * 100 / 45) & "%"
If aQuery.sPokemon <> maIVs (nI).sEvolveInto Then
&amp; &quot; Lv=&quot; &amp; maIVs (nI).fLevel _
&amp; &quot; Atk=&quot; &amp; maIVs (nI).nAttack _
&amp; &quot; Def=&quot; &amp; maIVs (nI).nDefense _
&amp; &quot; Sta=&quot; &amp; maIVs (nI).nStamina _
&amp; &quot; IV=&quot; &amp; fnFloor (maIVs (nI).nTotal * 100 / 45) &amp; &quot;%&quot;
If aQuery.sPokemon &lt;&gt; maIVs (nI).sEvolveInto Then
aBaseStats = fnGetBaseStats (maIVs (nI).sEvolveInto)
sOutput = sOutput & " Ev=" & maIVs (nI).sEvolveInto _
& " " & maIVs (nI).nEvolvedCP
sOutput = sOutput &amp; &quot; Ev=&quot; &amp; maIVs (nI).sEvolveInto _
&amp; &quot; &quot; &amp; maIVs (nI).nEvolvedCP
End If
If aQuery.nPlayerLevel <> 0 Then
sOutput = sOutput & " XCP=" & maIVs (nI).nMaxCP
If aQuery.nPlayerLevel &lt;&gt; 0 Then
sOutput = sOutput &amp; &quot; XCP=&quot; &amp; maIVs (nI).nMaxCP
End If
sOutput = sOutput & Chr (10)
sOutput = sOutput &amp; Chr (10)
Next nI
If sOutput = "" Then
MsgBox "Found no matching IV."
If sOutput = &quot;&quot; Then
MsgBox &quot;Found no matching IV.&quot;
Else
subSaveIV (aQuery, maIVs)
End If
End Sub
' fnFindIV: Finds the possible individual values of the Pokémon
&apos; fnFindIV: Finds the possible individual values of the Pokémon
Function fnFindIV (aQuery As aFindIVParam) As Variant
Dim aBaseStats As New aStats, maIV () As New aStats
Dim fLevel As Double, nStamina As Integer
@ -84,7 +86,7 @@ Function fnFindIV (aQuery As aFindIVParam) As Variant
Dim fStep As Double, nCount As Integer
Dim aEvBaseStats As new aStats, aTempIV As New aStats
If aQuery.sPokemon = "" Then
If aQuery.sPokemon = &quot;&quot; Then
fnFindIV = maIV
Exit Function
End If
@ -99,9 +101,9 @@ Function fnFindIV (aQuery As aFindIVParam) As Variant
nCount = -1
For fLevel = 1 To UBound (mStarDust) Step fStep
If mStarDust (CInt (fLevel - 0.5)) = aQuery.nStarDust Then
'For nI = 0 To UBound (maStarDust) Step nStep
' fLevel = maStarDust (nI).fLevel
' If maStarDust (nI).nStarDust = aQuery.nStarDust Then
&apos;For nI = 0 To UBound (maStarDust) Step nStep
&apos; fLevel = maStarDust (nI).fLevel
&apos; If maStarDust (nI).nStarDust = aQuery.nStarDust Then
For nStamina = 0 To 15
If fnCalcHP (aBaseStats, fLevel, nStamina) = aQuery.nHP Then
For nAttack = 0 To 15
@ -121,7 +123,7 @@ Function fnFindIV (aQuery As aFindIVParam) As Variant
.sEvolveInto = aBaseStats.sEvolveInto
.nEvolvedCP = fnCalcCP (aEvBaseStats, fLevel, nAttack, nDefense, nStamina)
End With
If aQuery.nPlayerLevel <> 0 Then
If aQuery.nPlayerLevel &lt;&gt; 0 Then
maIV (nCount).nMaxCP = fnCalcCP (aEvBaseStats, aQuery.nPlayerLevel + 1.5, nAttack, nDefense, nStamina)
Else
maIV (nCount).nMaxCP = -1
@ -133,10 +135,10 @@ Function fnFindIV (aQuery As aFindIVParam) As Variant
Next nStamina
End If
Next fLevel
' Sorts the IVs
&apos; Sorts the IVs
For nI = 0 To UBound (maIV) - 1
For nJ = nI + 1 To UBound (maIV)
If fnCompareIV (maIV (nI), maIV (nJ)) > 0 Then
If fnCompareIV (maIV (nI), maIV (nJ)) &gt; 0 Then
subCopyIV (maIV (nI), aTempIV)
subCopyIV (maIV (nJ), maIV (nI))
subCopyIV (aTempIV, maIV (nJ))
@ -146,39 +148,39 @@ Function fnFindIV (aQuery As aFindIVParam) As Variant
fnFindIV = maIV
End Function
' fnCompareIV: Compare two IVs for sorting
&apos; fnCompareIV: Compare two IVs for sorting
Function fnCompareIV (aIVa As aStats, aIVb As aStats) As Double
fnCompareIV = aIVb.nMaxCP - aIVa.nMaxCP
If fnCompareIV <> 0 Then
If fnCompareIV &lt;&gt; 0 Then
Exit Function
End If
fnCompareIV = aIVb.nEvolvedCP - aIVa.nEvolvedCP
If fnCompareIV <> 0 Then
If fnCompareIV &lt;&gt; 0 Then
Exit Function
End If
fnCompareIV = aIVb.nTotal - aIVa.nTotal
If fnCompareIV <> 0 Then
If fnCompareIV &lt;&gt; 0 Then
Exit Function
End If
fnCompareIV = aIVb.fLevel - aIVa.fLevel
If fnCompareIV <> 0 Then
If fnCompareIV &lt;&gt; 0 Then
Exit Function
End If
fnCompareIV = aIVb.nStamina - aIVa.nStamina
If fnCompareIV <> 0 Then
If fnCompareIV &lt;&gt; 0 Then
Exit Function
End If
fnCompareIV = aIVb.nAttack - aIVa.nAttack
If fnCompareIV <> 0 Then
If fnCompareIV &lt;&gt; 0 Then
Exit Function
End If
fnCompareIV = aIVb.nDefense - aIVa.nDefense
If fnCompareIV <> 0 Then
If fnCompareIV &lt;&gt; 0 Then
Exit Function
End If
End Function
' subCopyIV: Copies one IV to another
&apos; subCopyIV: Copies one IV to another
Function subCopyIV (aFrom As aStats, aTo As aStats) As Double
With aTo
.sNo = aFrom.sNo
@ -194,7 +196,7 @@ Function subCopyIV (aFrom As aStats, aTo As aStats) As Double
End With
End Function
' subSaveIV: Saves the found IV
&apos; subSaveIV: Saves the found IV
Sub subSaveIV (aQuery As aFindIVParam, maIVs () As aStats)
Dim oDoc As Object, oSheet As Object, oRange As Object
Dim nI As Integer, oColumns As Object
@ -202,12 +204,12 @@ Sub subSaveIV (aQuery As aFindIVParam, maIVs () As aStats)
Dim mProps () As New com.sun.star.beans.PropertyValue
oDoc = StarDesktop.loadComponentFromURL ( _
"private:factory/scalc", "_default", 0, mProps)
&quot;private:factory/scalc&quot;, &quot;_default&quot;, 0, mProps)
oSheet = oDoc.getSheets.getByIndex (0)
mData (0) = Array ( _
"No", "Pokemon", "CP", "HP", _
"Lv", "Atk", "Def", "Sta", "IV", _
"Evolve Into", "Evolved CP", "Max CP")
&quot;No&quot;, &quot;Pokemon&quot;, &quot;CP&quot;, &quot;HP&quot;, _
&quot;Lv&quot;, &quot;Atk&quot;, &quot;Def&quot;, &quot;Sta&quot;, &quot;IV&quot;, _
&quot;Evolve Into&quot;, &quot;Evolved CP&quot;, &quot;Max CP&quot;)
mData (1) = Array ( _
maIVs (0).sNo, aQuery.sPokemon, aQuery.nCP, aQuery.nHP, _
maIVs (0).fLevel, maIVs (0).nAttack, maIVs (0).nDefense, _
@ -216,7 +218,7 @@ Sub subSaveIV (aQuery As aFindIVParam, maIVs () As aStats)
maIVs (0).nMaxCP)
For nI = 1 To UBound (maIVs)
mData (nI + 1) = Array ( _
"", "", "", "", _
&quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, _
maIVs (nI).fLevel, maIVs (nI).nAttack, maIVs (nI).nDefense, _
maIVs (nI).nStamina, maIVs (nI).nTotal / 45, _
maIVs (nI).sEvolveInto, maIVs (nI).nEvolvedCP, _
@ -225,7 +227,7 @@ Sub subSaveIV (aQuery As aFindIVParam, maIVs () As aStats)
oRange = oSheet.getCellRangeByPosition ( _
0, 0, UBound (mData (0)), UBound (mData))
oRange.setDataArray (mData)
oRange.setPropertyValue ("VertJustify", _
oRange.setPropertyValue (&quot;VertJustify&quot;, _
com.sun.star.table.CellVertJustify.TOP)
oRange = oSheet.getCellRangeByPosition ( _
@ -242,62 +244,62 @@ Sub subSaveIV (aQuery As aFindIVParam, maIVs () As aStats)
oRange.merge (True)
oRange = oSheet.getCellRangeByPosition ( _
8, 1, 8, UBound (mData))
oRange.setPropertyValue ("NumberFormat", 10)
oRange.setPropertyValue (&quot;NumberFormat&quot;, 10)
oColumns = oSheet.getColumns
For nI = 0 To UBound (mData (0))
oColumns.getByIndex (nI).setPropertyValue ( _
"OptimalWidth", True)
&quot;OptimalWidth&quot;, True)
Next nI
End Sub
' fnFilterAppraisals: Filters the IV by the appraisals.
&apos; fnFilterAppraisals: Filters the IV by the appraisals.
Function fnFilterAppraisals (aQuery As aFindIVParam, nAttack As Integer, nDefense As Integer, nStamina As Integer) As Boolean
Dim nTotal As Integer, nMax As Integer, sBest As String
' The first appraisal.
&apos; The first appraisal.
nTotal = nAttack + nDefense + nStamina
If aQuery.nAppraisal1 = 1 And Not (nTotal >= 37) Then
If aQuery.nAppraisal1 = 1 And Not (nTotal &gt;= 37) Then
fnFilterAppraisals = True
Exit Function
End If
If aQuery.nAppraisal1 = 2 And Not (nTotal >= 30 And nTotal <= 36) Then
If aQuery.nAppraisal1 = 2 And Not (nTotal &gt;= 30 And nTotal &lt;= 36) Then
fnFilterAppraisals = True
Exit Function
End If
If aQuery.nAppraisal1 = 3 And Not (nTotal >= 23 And nTotal <= 29) Then
If aQuery.nAppraisal1 = 3 And Not (nTotal &gt;= 23 And nTotal &lt;= 29) Then
fnFilterAppraisals = True
Exit Function
End If
If aQuery.nAppraisal1 = 4 And Not (nTotal <= 22) Then
If aQuery.nAppraisal1 = 4 And Not (nTotal &lt;= 22) Then
fnFilterAppraisals = True
Exit Function
End If
' The best stats.
&apos; The best stats.
nMax = nAttack
If nDefense > nMax Then
If nDefense &gt; nMax Then
nMax = nDefense
End If
If nStamina > nMax Then
If nStamina &gt; nMax Then
nMax = nStamina
End If
If aQuery.sBest <> "" Then
sBest = ""
If aQuery.sBest &lt;&gt; &quot;&quot; Then
sBest = &quot;&quot;
If nAttack = nMax Then
sBest = sBest & "Atk "
sBest = sBest &amp; &quot;Atk &quot;
End If
If nDefense = nMax Then
sBest = sBest & "Def "
sBest = sBest &amp; &quot;Def &quot;
End If
If nStamina = nMax Then
sBest = sBest & "Sta "
sBest = sBest &amp; &quot;Sta &quot;
End If
If aQuery.sBest <> sBest Then
If aQuery.sBest &lt;&gt; sBest Then
fnFilterAppraisals = True
Exit Function
End If
End If
' The second appraisal.
&apos; The second appraisal.
If aQuery.nAppraisal2 = 1 And Not (nMax = 15) Then
fnFilterAppraisals = True
Exit Function
@ -306,18 +308,18 @@ Function fnFilterAppraisals (aQuery As aFindIVParam, nAttack As Integer, nDefens
fnFilterAppraisals = True
Exit Function
End If
If aQuery.nAppraisal2 = 3 And Not (nMax >= 8 And nMax <= 12) Then
If aQuery.nAppraisal2 = 3 And Not (nMax &gt;= 8 And nMax &lt;= 12) Then
fnFilterAppraisals = True
Exit Function
End If
If aQuery.nAppraisal2 = 4 And Not (nMax <= 7) Then
If aQuery.nAppraisal2 = 4 And Not (nMax &lt;= 7) Then
fnFilterAppraisals = True
Exit Function
End If
fnFilterAppraisals = False
End Function
' fnCalcCP: Calculates the combat power of the Pokémon
&apos; fnCalcCP: Calculates the combat power of the Pokémon
Function fnCalcCP (aBaseStats As aStats, fLevel As Double, nAttack As Integer, nDefense As Integer, nStamina As Integer) As Integer
fnCalcCP = fnFloor ((aBaseStats.nAttack + nAttack) _
* ((aBaseStats.nDefense + nDefense) ^ 0.5) _
@ -325,13 +327,13 @@ Function fnCalcCP (aBaseStats As aStats, fLevel As Double, nAttack As Integer, n
* (fnGetCPM (fLevel) ^ 2) / 10)
End Function
' fnCalcHP: Calculates the hit points of the Pokémon
&apos; fnCalcHP: Calculates the hit points of the Pokémon
Function fnCalcHP (aBaseStats As aStats, fLevel As Double, nStamina As Integer) As Integer
fnCalcHP = fnFloor ((aBaseStats.nStamina + nStamina) _
* fnGetCPM (fLevel))
End Function
' fnGetBaseStats: Returns the base stats of the Pokémon.
&apos; fnGetBaseStats: Returns the base stats of the Pokémon.
Function fnGetBaseStats (sPokemon As String) As aStats
Dim nI As Integer
@ -344,7 +346,7 @@ Function fnGetBaseStats (sPokemon As String) As aStats
Next nI
End Function
' fnGetCPM: Returns the combat power multiplier.
&apos; fnGetCPM: Returns the combat power multiplier.
Function fnGetCPM (fLevel As Double) As Double
Dim nI As Integer
@ -357,12 +359,12 @@ Function fnGetCPM (fLevel As Double) As Double
End If
End Function
' fnFloor: Returns the floor of the number
&apos; fnFloor: Returns the floor of the number
Function fnFloor (fNumber As Double) As Integer
fnFloor = CInt (fNumber - 0.5)
End Function
' subReadBaseStats: Reads the base stats table.
&apos; subReadBaseStats: Reads the base stats table.
Sub subReadBaseStats
Dim mData As Variant, nI As Integer
@ -382,16 +384,17 @@ Sub subReadBaseStats
End If
End Sub
' subReadCPM: Reads the CPM table.
&apos; subReadCPM: Reads the CPM table.
Sub subReadCPM
If UBound (mCPM) = -1 Then
mCPM = fnGetCPMData
End If
End Sub
' subReadStarDust: Reads the star dust table.
&apos; subReadStarDust: Reads the star dust table.
Sub subReadStarDust
If UBound (mStarDust) = -1 Then
mStarDust = fnGetStarDustData
End If
End Sub
</script:module>

View File

@ -1,326 +0,0 @@
' 1Dialog: The UI of the Pokémon IV calculator
' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-27
Option Explicit
' The parameters to find the individual values.
Type aFindIVParam
sPokemon As String
nCP As Integer
nHP As Integer
nStarDust As Integer
nPlayerLevel As Integer
bIsNew As Boolean
nAppraisal1 As Integer
sBest As String
nAppraisal2 As Integer
bIsCancelled As Boolean
End Type
' fnAskParam: Asks the users for the parameters for the Pokémon.
Function fnAskParam As aFindIVParam
Dim oDialog As Object, oDialogModel As Object
Dim oTextModel As Object, oListModel As Object
Dim oNumericModel As Object, oCheckBoxModel As Object
Dim oGroupModel As Object, oButtonModel As Object
Dim mListItems () As String, sTemp As String
Dim nI As Integer, nCount As Integer
Dim aQuery As New aFindIVParam
' Creates a dialog
oDialogModel = CreateUnoService ( _
"com.sun.star.awt.UnoControlDialogModel")
oDialogModel.setPropertyValue ("PositionX", 100)
oDialogModel.setPropertyValue ("PositionY", 100)
oDialogModel.setPropertyValue ("Height", 140)
oDialogModel.setPropertyValue ("Width", 220)
oDialogModel.setPropertyValue ("Title", "Pokémon Go IV Calculator")
' Adds a text label for the Pokémon list.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 5)
oTextModel.setPropertyValue ("PositionY", 5)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 30)
oTextModel.setPropertyValue ("Label", "~Pokémon:")
oDialogModel.insertByName ("txtPokemon", oTextModel)
' Adds the Pokémon list.
subReadBaseStats
ReDim mListItems (UBound (maBaseStats)) As String
For nI = 0 To UBound (maBaseStats)
mListItems (nI) = maBaseStats (nI).sPokemon
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 35)
oListModel.setPropertyValue ("PositionY", 4)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 50)
oListModel.setPropertyValue ("TabIndex", 0)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstPokemon", oListModel)
' Adds a text label for the CP field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 5)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "~CP:")
oDialogModel.insertByName ("txtCP", oTextModel)
' Adds the CP field.
oNumericModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlNumericFieldModel")
oNumericModel.setPropertyValue ("PositionX", 20)
oNumericModel.setPropertyValue ("PositionY", 19)
oNumericModel.setPropertyValue ("Height", 12)
oNumericModel.setPropertyValue ("Width", 20)
oNumericModel.setPropertyValue ("DecimalAccuracy", 0)
oDialogModel.insertByName ("numCP", oNumericModel)
' Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 50)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "~HP:")
oDialogModel.insertByName ("txtHP", oTextModel)
' Adds the HP field.
oNumericModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlNumericFieldModel")
oNumericModel.setPropertyValue ("PositionX", 65)
oNumericModel.setPropertyValue ("PositionY", 19)
oNumericModel.setPropertyValue ("Height", 12)
oNumericModel.setPropertyValue ("Width", 15)
oNumericModel.setPropertyValue ("DecimalAccuracy", 0)
oDialogModel.insertByName ("numHP", oNumericModel)
' Adds a text label for the star dust field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 90)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 30)
oTextModel.setPropertyValue ("Label", "S~tar dust:")
oDialogModel.insertByName ("txtStarDust", oTextModel)
' Adds the star dust field.
subReadStarDust
sTemp = " "
ReDim mListItems () As String
nCount = -1
For nI = 1 To UBound (mStarDust)
If InStr (sTemp, " " & CStr (mStarDust (nI)) & " ") = 0 Then
nCount = nCount + 1
ReDim Preserve mListItems (nCount) As String
mListItems (nCount) = CStr (mStarDust (nI))
sTemp = sTemp & CStr (mStarDust (nI)) & " "
End If
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 120)
oListModel.setPropertyValue ("PositionY", 19)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 30)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstStarDust", oListModel)
' Adds a text label for the player level field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 160)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 35)
oTextModel.setPropertyValue ("Label", "Player ~level:")
oDialogModel.insertByName ("txtPlayerLevel", oTextModel)
' Adds the player level field.
ReDim mListItems (39) As String
For nI = 0 To UBound (mListItems)
mListItems (nI) = CStr (nI + 1)
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 195)
oListModel.setPropertyValue ("PositionY", 19)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 20)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstPlayerLevel", oListModel)
' Adds the whether powered-up check box.
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 5)
oCheckBoxModel.setPropertyValue ("PositionY", 35)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 210)
oCheckBoxModel.setPropertyValue ("Label", _
"This Pokémon is ~newly-caught and was not powered-up yet.")
oCheckBoxModel.setPropertyValue ("State", 1)
oDialogModel.insertByName ("cbxIsNew", oCheckBoxModel)
' Adds a group for the appraisals
oGroupModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlGroupBoxModel")
oGroupModel.setPropertyValue ("PositionX", 5)
oGroupModel.setPropertyValue ("PositionY", 50)
oGroupModel.setPropertyValue ("Height", 65)
oGroupModel.setPropertyValue ("Width", 210)
oGroupModel.setPropertyValue ("Label", "Apprasals")
oDialogModel.insertByName ("grpApprasals", oGroupModel)
' Adds the first appraisal list.
mListItems = Array ( _
"1. Amazed me/wonder/best", _
"2. Strong/caught my attention", _
"3. Decent/above average", _
"4. Not great/not make headway/has room")
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 10)
oListModel.setPropertyValue ("PositionY", 64)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 200)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstApprasal1", oListModel)
' Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 10)
oTextModel.setPropertyValue ("PositionY", 80)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "Best:")
oDialogModel.insertByName ("txtBest", oTextModel)
' Adds the attack is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 25)
oCheckBoxModel.setPropertyValue ("PositionY", 80)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 30)
oCheckBoxModel.setPropertyValue ("Label", "~Attack")
oDialogModel.insertByName ("cbxAttackBest", oCheckBoxModel)
' Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 55)
oCheckBoxModel.setPropertyValue ("PositionY", 80)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 35)
oCheckBoxModel.setPropertyValue ("Label", "~Defense")
oDialogModel.insertByName ("cbxDefenseBest", oCheckBoxModel)
' Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 90)
oCheckBoxModel.setPropertyValue ("PositionY", 80)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 45)
oCheckBoxModel.setPropertyValue ("Label", "HP (~Stamina)")
oDialogModel.insertByName ("cbxHPBest", oCheckBoxModel)
' Adds the second appraisal list.
mListItems = Array ( _
"1. WOW/incredible/stats are best", _
"2. Excellent/impressed/impressive", _
"3. Get the job done/noticeable/some good stats", _
"4. No greatness/not out of the norm/kinda basic")
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 10)
oListModel.setPropertyValue ("PositionY", 95)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 200)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstApprasal2", oListModel)
' Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlButtonModel")
oButtonModel.setPropertyValue ("PositionX", 35)
oButtonModel.setPropertyValue ("PositionY", 120)
oButtonModel.setPropertyValue ("Height", 15)
oButtonModel.setPropertyValue ("Width", 60)
oButtonModel.setPropertyValue ("PushButtonType", _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue ("DefaultButton", True)
oDialogModel.insertByName ("btnOK", oButtonModel)
' Adds the cancel button.
oButtonModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlButtonModel")
oButtonModel.setPropertyValue ("PositionX", 125)
oButtonModel.setPropertyValue ("PositionY", 120)
oButtonModel.setPropertyValue ("Height", 15)
oButtonModel.setPropertyValue ("Width", 60)
oButtonModel.setPropertyValue ("PushButtonType", _
com.sun.star.awt.PushButtonType.CANCEL)
oDialogModel.insertByName ("btnCancel", oButtonModel)
' Adds the dialog model to the control and runs it.
oDialog = CreateUnoService ("com.sun.star.awt.UnoControlDialog")
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.getControl ("lstPokemon").setFocus
If oDialog.execute = 0 Then
aQuery.bIsCancelled = True
fnAskParam = aQuery
Exit Function
End If
With aQuery
.sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem
.nCP = oDialog.getControl ("numCP").getValue
.nHP = oDialog.getControl ("numHP").getValue
.nStarDust = CInt (oDialog.getControl ("lstStarDust").getSelectedItem)
.nPlayerLevel = CInt (oDialog.getControl ("lstPlayerLevel").getSelectedItem)
.nAppraisal1 = oDialog.getControl ("lstApprasal1").getSelectedItemPos + 1
.nAppraisal2 = oDialog.getControl ("lstApprasal2").getSelectedItemPos + 1
.bIsCancelled = False
End With
If oDialog.getControl ("cbxIsNew").getState = 1 Then
aQuery.bIsNew = True
Else
aQuery.bIsNew = False
End If
aQuery.sBest = ""
If oDialog.getControl ("cbxAttackBest").getState = 1 Then
aQuery.sBest = aQuery.sBest & "Atk "
End If
If oDialog.getControl ("cbxDefenseBest").getState = 1 Then
aQuery.sBest = aQuery.sBest & "Def "
End If
If oDialog.getControl ("cbxHPBest").getState = 1 Then
aQuery.sBest = aQuery.sBest & "Sta "
End If
fnAskParam = aQuery
End Function
sub subBtnOK_actionPerformed
MsgBox "OK"
End Sub
sub subBtnOK_disposing
MsgBox "OK"
End Sub

329
oxt/PokemonGoIV/1Dialog.xba Normal file
View File

@ -0,0 +1,329 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="1Dialog" script:language="StarBasic">&apos; 1Dialog: The UI of the Pokémon IV calculator
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-27
Option Explicit
&apos; The parameters to find the individual values.
Type aFindIVParam
sPokemon As String
nCP As Integer
nHP As Integer
nStarDust As Integer
nPlayerLevel As Integer
bIsNew As Boolean
nAppraisal1 As Integer
sBest As String
nAppraisal2 As Integer
bIsCancelled As Boolean
End Type
&apos; fnAskParam: Asks the users for the parameters for the Pokémon.
Function fnAskParam As aFindIVParam
Dim oDialog As Object, oDialogModel As Object
Dim oTextModel As Object, oListModel As Object
Dim oNumericModel As Object, oCheckBoxModel As Object
Dim oGroupModel As Object, oButtonModel As Object
Dim mListItems () As String, sTemp As String
Dim nI As Integer, nCount As Integer
Dim aQuery As New aFindIVParam
&apos; Creates a dialog
oDialogModel = CreateUnoService ( _
&quot;com.sun.star.awt.UnoControlDialogModel&quot;)
oDialogModel.setPropertyValue (&quot;PositionX&quot;, 100)
oDialogModel.setPropertyValue (&quot;PositionY&quot;, 100)
oDialogModel.setPropertyValue (&quot;Height&quot;, 140)
oDialogModel.setPropertyValue (&quot;Width&quot;, 220)
oDialogModel.setPropertyValue (&quot;Title&quot;, &quot;Pokémon Go IV Calculator&quot;)
&apos; Adds a text label for the Pokémon list.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 5)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 5)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 30)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~Pokémon:&quot;)
oDialogModel.insertByName (&quot;txtPokemon&quot;, oTextModel)
&apos; Adds the Pokémon list.
subReadBaseStats
ReDim mListItems (UBound (maBaseStats)) As String
For nI = 0 To UBound (maBaseStats)
mListItems (nI) = maBaseStats (nI).sPokemon
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 35)
oListModel.setPropertyValue (&quot;PositionY&quot;, 4)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 50)
oListModel.setPropertyValue (&quot;TabIndex&quot;, 0)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstPokemon&quot;, oListModel)
&apos; Adds a text label for the CP field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 5)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~CP:&quot;)
oDialogModel.insertByName (&quot;txtCP&quot;, oTextModel)
&apos; Adds the CP field.
oNumericModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlNumericFieldModel&quot;)
oNumericModel.setPropertyValue (&quot;PositionX&quot;, 20)
oNumericModel.setPropertyValue (&quot;PositionY&quot;, 19)
oNumericModel.setPropertyValue (&quot;Height&quot;, 12)
oNumericModel.setPropertyValue (&quot;Width&quot;, 20)
oNumericModel.setPropertyValue (&quot;DecimalAccuracy&quot;, 0)
oDialogModel.insertByName (&quot;numCP&quot;, oNumericModel)
&apos; Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 50)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~HP:&quot;)
oDialogModel.insertByName (&quot;txtHP&quot;, oTextModel)
&apos; Adds the HP field.
oNumericModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlNumericFieldModel&quot;)
oNumericModel.setPropertyValue (&quot;PositionX&quot;, 65)
oNumericModel.setPropertyValue (&quot;PositionY&quot;, 19)
oNumericModel.setPropertyValue (&quot;Height&quot;, 12)
oNumericModel.setPropertyValue (&quot;Width&quot;, 15)
oNumericModel.setPropertyValue (&quot;DecimalAccuracy&quot;, 0)
oDialogModel.insertByName (&quot;numHP&quot;, oNumericModel)
&apos; Adds a text label for the star dust field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 90)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 30)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;S~tar dust:&quot;)
oDialogModel.insertByName (&quot;txtStarDust&quot;, oTextModel)
&apos; Adds the star dust field.
subReadStarDust
sTemp = &quot; &quot;
ReDim mListItems () As String
nCount = -1
For nI = 1 To UBound (mStarDust)
If InStr (sTemp, &quot; &quot; &amp; CStr (mStarDust (nI)) &amp; &quot; &quot;) = 0 Then
nCount = nCount + 1
ReDim Preserve mListItems (nCount) As String
mListItems (nCount) = CStr (mStarDust (nI))
sTemp = sTemp &amp; CStr (mStarDust (nI)) &amp; &quot; &quot;
End If
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 120)
oListModel.setPropertyValue (&quot;PositionY&quot;, 19)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 30)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstStarDust&quot;, oListModel)
&apos; Adds a text label for the player level field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 160)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 35)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;Player ~level:&quot;)
oDialogModel.insertByName (&quot;txtPlayerLevel&quot;, oTextModel)
&apos; Adds the player level field.
ReDim mListItems (39) As String
For nI = 0 To UBound (mListItems)
mListItems (nI) = CStr (nI + 1)
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 195)
oListModel.setPropertyValue (&quot;PositionY&quot;, 19)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 20)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstPlayerLevel&quot;, oListModel)
&apos; Adds the whether powered-up check box.
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 5)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 35)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 210)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, _
&quot;This Pokémon is ~newly-caught and was not powered-up yet.&quot;)
oCheckBoxModel.setPropertyValue (&quot;State&quot;, 1)
oDialogModel.insertByName (&quot;cbxIsNew&quot;, oCheckBoxModel)
&apos; Adds a group for the appraisals
oGroupModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlGroupBoxModel&quot;)
oGroupModel.setPropertyValue (&quot;PositionX&quot;, 5)
oGroupModel.setPropertyValue (&quot;PositionY&quot;, 50)
oGroupModel.setPropertyValue (&quot;Height&quot;, 65)
oGroupModel.setPropertyValue (&quot;Width&quot;, 210)
oGroupModel.setPropertyValue (&quot;Label&quot;, &quot;Apprasals&quot;)
oDialogModel.insertByName (&quot;grpApprasals&quot;, oGroupModel)
&apos; Adds the first appraisal list.
mListItems = Array ( _
&quot;1. Amazed me/wonder/best&quot;, _
&quot;2. Strong/caught my attention&quot;, _
&quot;3. Decent/above average&quot;, _
&quot;4. Not great/not make headway/has room&quot;)
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 10)
oListModel.setPropertyValue (&quot;PositionY&quot;, 64)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 200)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstApprasal1&quot;, oListModel)
&apos; Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 10)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 80)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;Best:&quot;)
oDialogModel.insertByName (&quot;txtBest&quot;, oTextModel)
&apos; Adds the attack is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 25)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 80)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 30)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, &quot;~Attack&quot;)
oDialogModel.insertByName (&quot;cbxAttackBest&quot;, oCheckBoxModel)
&apos; Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 55)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 80)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 35)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, &quot;~Defense&quot;)
oDialogModel.insertByName (&quot;cbxDefenseBest&quot;, oCheckBoxModel)
&apos; Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 90)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 80)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 45)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, &quot;HP (~Stamina)&quot;)
oDialogModel.insertByName (&quot;cbxHPBest&quot;, oCheckBoxModel)
&apos; Adds the second appraisal list.
mListItems = Array ( _
&quot;1. WOW/incredible/stats are best&quot;, _
&quot;2. Excellent/impressed/impressive&quot;, _
&quot;3. Get the job done/noticeable/some good stats&quot;, _
&quot;4. No greatness/not out of the norm/kinda basic&quot;)
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 10)
oListModel.setPropertyValue (&quot;PositionY&quot;, 95)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 200)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstApprasal2&quot;, oListModel)
&apos; Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
oButtonModel.setPropertyValue (&quot;PositionX&quot;, 35)
oButtonModel.setPropertyValue (&quot;PositionY&quot;, 120)
oButtonModel.setPropertyValue (&quot;Height&quot;, 15)
oButtonModel.setPropertyValue (&quot;Width&quot;, 60)
oButtonModel.setPropertyValue (&quot;PushButtonType&quot;, _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue (&quot;DefaultButton&quot;, True)
oDialogModel.insertByName (&quot;btnOK&quot;, oButtonModel)
&apos; Adds the cancel button.
oButtonModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
oButtonModel.setPropertyValue (&quot;PositionX&quot;, 125)
oButtonModel.setPropertyValue (&quot;PositionY&quot;, 120)
oButtonModel.setPropertyValue (&quot;Height&quot;, 15)
oButtonModel.setPropertyValue (&quot;Width&quot;, 60)
oButtonModel.setPropertyValue (&quot;PushButtonType&quot;, _
com.sun.star.awt.PushButtonType.CANCEL)
oDialogModel.insertByName (&quot;btnCancel&quot;, oButtonModel)
&apos; Adds the dialog model to the control and runs it.
oDialog = CreateUnoService (&quot;com.sun.star.awt.UnoControlDialog&quot;)
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.getControl (&quot;lstPokemon&quot;).setFocus
If oDialog.execute = 0 Then
aQuery.bIsCancelled = True
fnAskParam = aQuery
Exit Function
End If
With aQuery
.sPokemon = oDialog.getControl (&quot;lstPokemon&quot;).getSelectedItem
.nCP = oDialog.getControl (&quot;numCP&quot;).getValue
.nHP = oDialog.getControl (&quot;numHP&quot;).getValue
.nStarDust = CInt (oDialog.getControl (&quot;lstStarDust&quot;).getSelectedItem)
.nPlayerLevel = CInt (oDialog.getControl (&quot;lstPlayerLevel&quot;).getSelectedItem)
.nAppraisal1 = oDialog.getControl (&quot;lstApprasal1&quot;).getSelectedItemPos + 1
.nAppraisal2 = oDialog.getControl (&quot;lstApprasal2&quot;).getSelectedItemPos + 1
.bIsCancelled = False
End With
If oDialog.getControl (&quot;cbxIsNew&quot;).getState = 1 Then
aQuery.bIsNew = True
Else
aQuery.bIsNew = False
End If
aQuery.sBest = &quot;&quot;
If oDialog.getControl (&quot;cbxAttackBest&quot;).getState = 1 Then
aQuery.sBest = aQuery.sBest &amp; &quot;Atk &quot;
End If
If oDialog.getControl (&quot;cbxDefenseBest&quot;).getState = 1 Then
aQuery.sBest = aQuery.sBest &amp; &quot;Def &quot;
End If
If oDialog.getControl (&quot;cbxHPBest&quot;).getState = 1 Then
aQuery.sBest = aQuery.sBest &amp; &quot;Sta &quot;
End If
fnAskParam = aQuery
End Function
sub subBtnOK_actionPerformed
MsgBox &quot;OK&quot;
End Sub
sub subBtnOK_disposing
MsgBox &quot;OK&quot;
End Sub
</script:module>

View File

@ -1,253 +0,0 @@
' 2Data: The Pokémon Go data for IV calculation
' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-28
' Generated with _3Load.subReadDataSheets ()
Option Explicit
' fnGetBaseStatsData: Returns the base stats data.
Function fnGetBaseStatsData As Variant
fnGetBaseStatsData = Array( _
Array ("Bulbasaur", "001", 90, 118, 118, "Venusaur"), _
Array ("Ivysaur", "002", 120, 151, 151, "Venusaur"), _
Array ("Venusaur", "003", 160, 198, 198, "Venusaur"), _
Array ("Charmander", "004", 78, 116, 96, "Charizard"), _
Array ("Charmeleon", "005", 116, 158, 129, "Charizard"), _
Array ("Charizard", "006", 156, 223, 176, "Charizard"), _
Array ("Squirtle", "007", 88, 94, 122, "Blastoise"), _
Array ("Wartortle", "008", 118, 126, 155, "Blastoise"), _
Array ("Blastoise", "009", 158, 171, 210, "Blastoise"), _
Array ("Caterpie", "010", 90, 55, 62, "Butterfree"), _
Array ("Metapod", "011", 100, 45, 64, "Butterfree"), _
Array ("Butterfree", "012", 120, 167, 151, "Butterfree"), _
Array ("Weedle", "013", 80, 63, 55, "Beedrill"), _
Array ("Kakuna", "014", 90, 46, 86, "Beedrill"), _
Array ("Beedrill", "015", 130, 169, 150, "Beedrill"), _
Array ("Pidgey", "016", 80, 85, 76, "Pidgeot"), _
Array ("Pidgeotto", "017", 126, 117, 108, "Pidgeot"), _
Array ("Pidgeot", "018", 166, 166, 157, "Pidgeot"), _
Array ("Rattata", "019", 60, 103, 70, "Raticate"), _
Array ("Raticate", "020", 110, 161, 144, "Raticate"), _
Array ("Spearow", "021", 80, 112, 61, "Fearow"), _
Array ("Fearow", "022", 130, 182, 135, "Fearow"), _
Array ("Ekans", "023", 70, 110, 102, "Arbok"), _
Array ("Arbok", "024", 120, 167, 158, "Arbok"), _
Array ("Pikachu", "025", 70, 112, 101, "Raichu"), _
Array ("Raichu", "026", 120, 193, 165, "Raichu"), _
Array ("Sandshrew", "027", 100, 126, 145, "Sandslash"), _
Array ("Sandslash", "028", 150, 182, 202, "Sandslash"), _
Array ("Nidoran♀", "029", 110, 86, 94, "Nidoqueen"), _
Array ("Nidorina", "030", 140, 117, 126, "Nidoqueen"), _
Array ("Nidoqueen", "031", 180, 180, 174, "Nidoqueen"), _
Array ("Nidoran♂", "032", 92, 105, 76, "Nidoking"), _
Array ("Nidorino", "033", 122, 137, 112, "Nidoking"), _
Array ("Nidoking", "034", 162, 204, 157, "Nidoking"), _
Array ("Clefairy", "035", 140, 107, 116, "Clefable"), _
Array ("Clefable", "036", 190, 178, 171, "Clefable"), _
Array ("Vulpix", "037", 76, 96, 122, "Ninetales"), _
Array ("Ninetales", "038", 146, 169, 204, "Ninetales"), _
Array ("Jigglypuff", "039", 230, 80, 44, "Wigglytuff"), _
Array ("Wigglytuff", "040", 280, 156, 93, "Wigglytuff"), _
Array ("Zubat", "041", 80, 83, 76, "Golbat"), _
Array ("Golbat", "042", 150, 161, 153, "Golbat"), _
Array ("Oddish", "043", 90, 131, 116, "Vileplume"), _
Array ("Gloom", "044", 120, 153, 139, "Vileplume"), _
Array ("Vileplume", "045", 150, 202, 170, "Vileplume"), _
Array ("Paras", "046", 70, 121, 99, "Parasect"), _
Array ("Parasect", "047", 120, 165, 146, "Parasect"), _
Array ("Venonat", "048", 120, 100, 102, "Venomoth"), _
Array ("Venomoth", "049", 140, 179, 150, "Venomoth"), _
Array ("Diglett", "050", 20, 109, 88, "Dugtrio"), _
Array ("Dugtrio", "051", 70, 167, 147, "Dugtrio"), _
Array ("Meowth", "052", 80, 92, 81, "Persian"), _
Array ("Persian", "053", 130, 150, 139, "Persian"), _
Array ("Psyduck", "054", 100, 122, 96, "Golduck"), _
Array ("Golduck", "055", 160, 191, 163, "Golduck"), _
Array ("Mankey", "056", 80, 148, 87, "Primeape"), _
Array ("Primeape", "057", 130, 207, 144, "Primeape"), _
Array ("Growlithe", "058", 110, 136, 96, "Arcanine"), _
Array ("Arcanine", "059", 180, 227, 166, "Arcanine"), _
Array ("Poliwag", "060", 80, 101, 82, "Poliwrath"), _
Array ("Poliwhirl", "061", 130, 130, 130, "Poliwrath"), _
Array ("Poliwrath", "062", 180, 182, 187, "Poliwrath"), _
Array ("Abra", "063", 50, 195, 103, "Alakazam"), _
Array ("Kadabra", "064", 80, 232, 138, "Alakazam"), _
Array ("Alakazam", "065", 110, 271, 194, "Alakazam"), _
Array ("Machop", "066", 140, 137, 88, "Machamp"), _
Array ("Machoke", "067", 160, 177, 130, "Machamp"), _
Array ("Machamp", "068", 180, 234, 162, "Machamp"), _
Array ("Bellsprout", "069", 100, 139, 64, "Victreebel"), _
Array ("Weepinbell", "070", 130, 172, 95, "Victreebel"), _
Array ("Victreebel", "071", 160, 207, 138, "Victreebel"), _
Array ("Tentacool", "072", 80, 97, 182, "Tentacruel"), _
Array ("Tentacruel", "073", 160, 166, 237, "Tentacruel"), _
Array ("Geodude", "074", 80, 132, 163, "Golem"), _
Array ("Graveler", "075", 110, 164, 196, "Golem"), _
Array ("Golem", "076", 160, 211, 229, "Golem"), _
Array ("Ponyta", "077", 100, 170, 132, "Rapidash"), _
Array ("Rapidash", "078", 130, 207, 167, "Rapidash"), _
Array ("Slowpoke", "079", 180, 109, 109, "Slowbro"), _
Array ("Slowbro", "080", 190, 177, 194, "Slowbro"), _
Array ("Magnemite", "081", 50, 165, 128, "Magneton"), _
Array ("Magneton", "082", 100, 223, 182, "Magneton"), _
Array ("Farfetch'd", "083", 104, 124, 118, "Farfetch'd"), _
Array ("Doduo", "084", 70, 158, 88, "Dodrio"), _
Array ("Dodrio", "085", 120, 218, 145, "Dodrio"), _
Array ("Seel", "086", 130, 85, 128, "Dewgong"), _
Array ("Dewgong", "087", 180, 139, 184, "Dewgong"), _
Array ("Grimer", "088", 160, 135, 90, "Muk"), _
Array ("Muk", "089", 210, 190, 184, "Muk"), _
Array ("Shellder", "090", 60, 116, 168, "Cloyster"), _
Array ("Cloyster", "091", 100, 186, 323, "Cloyster"), _
Array ("Gastly", "092", 60, 186, 70, "Gengar"), _
Array ("Haunter", "093", 90, 223, 112, "Gengar"), _
Array ("Gengar", "094", 120, 261, 156, "Gengar"), _
Array ("Onix", "095", 70, 85, 288, "Onix"), _
Array ("Drowzee", "096", 120, 89, 158, "Hypno"), _
Array ("Hypno", "097", 170, 144, 215, "Hypno"), _
Array ("Krabby", "098", 60, 181, 156, "Kingler"), _
Array ("Kingler", "099", 110, 240, 214, "Kingler"), _
Array ("Voltorb", "100", 80, 109, 114, "Electrode"), _
Array ("Electrode", "101", 120, 173, 179, "Electrode"), _
Array ("Exeggcute", "102", 120, 107, 140, "Exeggutor"), _
Array ("Exeggutor", "103", 190, 233, 158, "Exeggutor"), _
Array ("Cubone", "104", 100, 90, 165, "Marowak"), _
Array ("Marowak", "105", 120, 144, 200, "Marowak"), _
Array ("Hitmonlee", "106", 100, 224, 211, "Hitmonlee"), _
Array ("Hitmonchan", "107", 100, 193, 212, "Hitmonchan"), _
Array ("Lickitung", "108", 180, 108, 137, "Lickitung"), _
Array ("Koffing", "109", 80, 119, 164, "Weezing"), _
Array ("Weezing", "110", 130, 174, 221, "Weezing"), _
Array ("Rhyhorn", "111", 160, 140, 157, "Rhydon"), _
Array ("Rhydon", "112", 210, 222, 206, "Rhydon"), _
Array ("Chansey", "113", 500, 60, 176, "Chansey"), _
Array ("Tangela", "114", 130, 183, 205, "Tangela"), _
Array ("Kangaskhan", "115", 210, 181, 165, "Kangaskhan"), _
Array ("Horsea", "116", 60, 129, 125, "Seadra"), _
Array ("Seadra", "117", 110, 187, 182, "Seadra"), _
Array ("Goldeen", "118", 90, 123, 115, "Seaking"), _
Array ("Seaking", "119", 160, 175, 154, "Seaking"), _
Array ("Staryu", "120", 60, 137, 112, "Starmie"), _
Array ("Starmie", "121", 120, 210, 184, "Starmie"), _
Array ("Mr. Mime", "122", 80, 192, 233, "Mr. Mime"), _
Array ("Scyther", "123", 140, 218, 170, "Scyther"), _
Array ("Jynx", "124", 130, 223, 182, "Jynx"), _
Array ("Electabuzz", "125", 130, 198, 173, "Electabuzz"), _
Array ("Magmar", "126", 130, 206, 169, "Magmar"), _
Array ("Pinsir", "127", 130, 238, 197, "Pinsir"), _
Array ("Tauros", "128", 150, 198, 197, "Tauros"), _
Array ("Magikarp", "129", 40, 29, 102, "Gyarados"), _
Array ("Gyarados", "130", 190, 237, 197, "Gyarados"), _
Array ("Lapras", "131", 260, 186, 190, "Lapras"), _
Array ("Ditto", "132", 96, 91, 91, "Ditto"), _
Array ("Eevee", "133", 110, 104, 121, "Vaporeon"), _
Array ("Vaporeon", "134", 260, 205, 177, "Vaporeon"), _
Array ("Jolteon", "135", 130, 232, 201, "Jolteon"), _
Array ("Flareon", "136", 130, 246, 204, "Flareon"), _
Array ("Porygon", "137", 130, 153, 139, "Porygon"), _
Array ("Omanyte", "138", 70, 155, 174, "Omastar"), _
Array ("Omastar", "139", 140, 207, 227, "Omastar"), _
Array ("Kabuto", "140", 60, 148, 162, "Kabutops"), _
Array ("Kabutops", "141", 120, 220, 203, "Kabutops"), _
Array ("Aerodactyl", "142", 160, 221, 164, "Aerodactyl"), _
Array ("Snorlax", "143", 320, 190, 190, "Snorlax"), _
Array ("Articuno", "144", 180, 192, 249, "Articuno"), _
Array ("Zapdos", "145", 180, 253, 188, "Zapdos"), _
Array ("Moltres", "146", 180, 251, 184, "Moltres"), _
Array ("Dratini", "147", 82, 119, 94, "Dragonite"), _
Array ("Dragonair", "148", 122, 163, 138, "Dragonite"), _
Array ("Dragonite", "149", 182, 263, 201, "Dragonite"), _
Array ("Mewtwo", "150", 212, 330, 200, "Mewtwo"), _
Array ("Mew", "151", 200, 210, 209, "Mew"))
End Function
' fnGetCPMData: Returns the combat power multiplier data.
Function fnGetCPMData As Variant
fnGetCPMData = Array( _
-1, _
9.4E-02, _
0.16639787, _
0.21573247, _
0.25572005, _
0.29024988, _
0.3210876, _
0.34921268, _
0.37523559, _
0.39956728, _
0.42250001, _
0.44310755, _
0.46279839, _
0.48168495, _
0.49985844, _
0.51739395, _
0.53435433, _
0.55079269, _
0.56675452, _
0.58227891, _
0.59740001, _
0.61215729, _
0.62656713, _
0.64065295, _
0.65443563, _
0.667934, _
0.68116492, _
0.69414365, _
0.70688421, _
0.71939909, _
0.7317, _
0.73776948, _
0.74378943, _
0.74976104, _
0.75568551, _
0.76156384, _
0.76739717, _
0.7731865, _
0.77893275, _
0.78463697, _
0.78463697)
End Function
' fnGetStarDustData: Returns the star dust data.
Function fnGetStarDustData As Variant
fnGetStarDustData = Array( _
-1, _
200, _
200, _
400, _
400, _
600, _
600, _
800, _
800, _
1000, _
1000, _
1300, _
1300, _
1600, _
1600, _
1900, _
1900, _
2200, _
2200, _
2500, _
2500, _
3000, _
3000, _
3500, _
3500, _
4000, _
4000, _
4500, _
4500, _
5000, _
5000, _
6000, _
6000, _
7000, _
7000, _
8000, _
8000, _
9000, _
9000, _
10000, _
10000)
End Function

256
oxt/PokemonGoIV/2Data.xba Normal file
View File

@ -0,0 +1,256 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="2Data" script:language="StarBasic">&apos; 2Data: The Pokémon Go data for IV calculation
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-28
&apos; Generated with _3Load.subReadDataSheets ()
Option Explicit
&apos; fnGetBaseStatsData: Returns the base stats data.
Function fnGetBaseStatsData As Variant
fnGetBaseStatsData = Array( _
Array (&quot;Bulbasaur&quot;, &quot;001&quot;, 90, 118, 118, &quot;Venusaur&quot;), _
Array (&quot;Ivysaur&quot;, &quot;002&quot;, 120, 151, 151, &quot;Venusaur&quot;), _
Array (&quot;Venusaur&quot;, &quot;003&quot;, 160, 198, 198, &quot;Venusaur&quot;), _
Array (&quot;Charmander&quot;, &quot;004&quot;, 78, 116, 96, &quot;Charizard&quot;), _
Array (&quot;Charmeleon&quot;, &quot;005&quot;, 116, 158, 129, &quot;Charizard&quot;), _
Array (&quot;Charizard&quot;, &quot;006&quot;, 156, 223, 176, &quot;Charizard&quot;), _
Array (&quot;Squirtle&quot;, &quot;007&quot;, 88, 94, 122, &quot;Blastoise&quot;), _
Array (&quot;Wartortle&quot;, &quot;008&quot;, 118, 126, 155, &quot;Blastoise&quot;), _
Array (&quot;Blastoise&quot;, &quot;009&quot;, 158, 171, 210, &quot;Blastoise&quot;), _
Array (&quot;Caterpie&quot;, &quot;010&quot;, 90, 55, 62, &quot;Butterfree&quot;), _
Array (&quot;Metapod&quot;, &quot;011&quot;, 100, 45, 64, &quot;Butterfree&quot;), _
Array (&quot;Butterfree&quot;, &quot;012&quot;, 120, 167, 151, &quot;Butterfree&quot;), _
Array (&quot;Weedle&quot;, &quot;013&quot;, 80, 63, 55, &quot;Beedrill&quot;), _
Array (&quot;Kakuna&quot;, &quot;014&quot;, 90, 46, 86, &quot;Beedrill&quot;), _
Array (&quot;Beedrill&quot;, &quot;015&quot;, 130, 169, 150, &quot;Beedrill&quot;), _
Array (&quot;Pidgey&quot;, &quot;016&quot;, 80, 85, 76, &quot;Pidgeot&quot;), _
Array (&quot;Pidgeotto&quot;, &quot;017&quot;, 126, 117, 108, &quot;Pidgeot&quot;), _
Array (&quot;Pidgeot&quot;, &quot;018&quot;, 166, 166, 157, &quot;Pidgeot&quot;), _
Array (&quot;Rattata&quot;, &quot;019&quot;, 60, 103, 70, &quot;Raticate&quot;), _
Array (&quot;Raticate&quot;, &quot;020&quot;, 110, 161, 144, &quot;Raticate&quot;), _
Array (&quot;Spearow&quot;, &quot;021&quot;, 80, 112, 61, &quot;Fearow&quot;), _
Array (&quot;Fearow&quot;, &quot;022&quot;, 130, 182, 135, &quot;Fearow&quot;), _
Array (&quot;Ekans&quot;, &quot;023&quot;, 70, 110, 102, &quot;Arbok&quot;), _
Array (&quot;Arbok&quot;, &quot;024&quot;, 120, 167, 158, &quot;Arbok&quot;), _
Array (&quot;Pikachu&quot;, &quot;025&quot;, 70, 112, 101, &quot;Raichu&quot;), _
Array (&quot;Raichu&quot;, &quot;026&quot;, 120, 193, 165, &quot;Raichu&quot;), _
Array (&quot;Sandshrew&quot;, &quot;027&quot;, 100, 126, 145, &quot;Sandslash&quot;), _
Array (&quot;Sandslash&quot;, &quot;028&quot;, 150, 182, 202, &quot;Sandslash&quot;), _
Array (&quot;Nidoran♀&quot;, &quot;029&quot;, 110, 86, 94, &quot;Nidoqueen&quot;), _
Array (&quot;Nidorina&quot;, &quot;030&quot;, 140, 117, 126, &quot;Nidoqueen&quot;), _
Array (&quot;Nidoqueen&quot;, &quot;031&quot;, 180, 180, 174, &quot;Nidoqueen&quot;), _
Array (&quot;Nidoran♂&quot;, &quot;032&quot;, 92, 105, 76, &quot;Nidoking&quot;), _
Array (&quot;Nidorino&quot;, &quot;033&quot;, 122, 137, 112, &quot;Nidoking&quot;), _
Array (&quot;Nidoking&quot;, &quot;034&quot;, 162, 204, 157, &quot;Nidoking&quot;), _
Array (&quot;Clefairy&quot;, &quot;035&quot;, 140, 107, 116, &quot;Clefable&quot;), _
Array (&quot;Clefable&quot;, &quot;036&quot;, 190, 178, 171, &quot;Clefable&quot;), _
Array (&quot;Vulpix&quot;, &quot;037&quot;, 76, 96, 122, &quot;Ninetales&quot;), _
Array (&quot;Ninetales&quot;, &quot;038&quot;, 146, 169, 204, &quot;Ninetales&quot;), _
Array (&quot;Jigglypuff&quot;, &quot;039&quot;, 230, 80, 44, &quot;Wigglytuff&quot;), _
Array (&quot;Wigglytuff&quot;, &quot;040&quot;, 280, 156, 93, &quot;Wigglytuff&quot;), _
Array (&quot;Zubat&quot;, &quot;041&quot;, 80, 83, 76, &quot;Golbat&quot;), _
Array (&quot;Golbat&quot;, &quot;042&quot;, 150, 161, 153, &quot;Golbat&quot;), _
Array (&quot;Oddish&quot;, &quot;043&quot;, 90, 131, 116, &quot;Vileplume&quot;), _
Array (&quot;Gloom&quot;, &quot;044&quot;, 120, 153, 139, &quot;Vileplume&quot;), _
Array (&quot;Vileplume&quot;, &quot;045&quot;, 150, 202, 170, &quot;Vileplume&quot;), _
Array (&quot;Paras&quot;, &quot;046&quot;, 70, 121, 99, &quot;Parasect&quot;), _
Array (&quot;Parasect&quot;, &quot;047&quot;, 120, 165, 146, &quot;Parasect&quot;), _
Array (&quot;Venonat&quot;, &quot;048&quot;, 120, 100, 102, &quot;Venomoth&quot;), _
Array (&quot;Venomoth&quot;, &quot;049&quot;, 140, 179, 150, &quot;Venomoth&quot;), _
Array (&quot;Diglett&quot;, &quot;050&quot;, 20, 109, 88, &quot;Dugtrio&quot;), _
Array (&quot;Dugtrio&quot;, &quot;051&quot;, 70, 167, 147, &quot;Dugtrio&quot;), _
Array (&quot;Meowth&quot;, &quot;052&quot;, 80, 92, 81, &quot;Persian&quot;), _
Array (&quot;Persian&quot;, &quot;053&quot;, 130, 150, 139, &quot;Persian&quot;), _
Array (&quot;Psyduck&quot;, &quot;054&quot;, 100, 122, 96, &quot;Golduck&quot;), _
Array (&quot;Golduck&quot;, &quot;055&quot;, 160, 191, 163, &quot;Golduck&quot;), _
Array (&quot;Mankey&quot;, &quot;056&quot;, 80, 148, 87, &quot;Primeape&quot;), _
Array (&quot;Primeape&quot;, &quot;057&quot;, 130, 207, 144, &quot;Primeape&quot;), _
Array (&quot;Growlithe&quot;, &quot;058&quot;, 110, 136, 96, &quot;Arcanine&quot;), _
Array (&quot;Arcanine&quot;, &quot;059&quot;, 180, 227, 166, &quot;Arcanine&quot;), _
Array (&quot;Poliwag&quot;, &quot;060&quot;, 80, 101, 82, &quot;Poliwrath&quot;), _
Array (&quot;Poliwhirl&quot;, &quot;061&quot;, 130, 130, 130, &quot;Poliwrath&quot;), _
Array (&quot;Poliwrath&quot;, &quot;062&quot;, 180, 182, 187, &quot;Poliwrath&quot;), _
Array (&quot;Abra&quot;, &quot;063&quot;, 50, 195, 103, &quot;Alakazam&quot;), _
Array (&quot;Kadabra&quot;, &quot;064&quot;, 80, 232, 138, &quot;Alakazam&quot;), _
Array (&quot;Alakazam&quot;, &quot;065&quot;, 110, 271, 194, &quot;Alakazam&quot;), _
Array (&quot;Machop&quot;, &quot;066&quot;, 140, 137, 88, &quot;Machamp&quot;), _
Array (&quot;Machoke&quot;, &quot;067&quot;, 160, 177, 130, &quot;Machamp&quot;), _
Array (&quot;Machamp&quot;, &quot;068&quot;, 180, 234, 162, &quot;Machamp&quot;), _
Array (&quot;Bellsprout&quot;, &quot;069&quot;, 100, 139, 64, &quot;Victreebel&quot;), _
Array (&quot;Weepinbell&quot;, &quot;070&quot;, 130, 172, 95, &quot;Victreebel&quot;), _
Array (&quot;Victreebel&quot;, &quot;071&quot;, 160, 207, 138, &quot;Victreebel&quot;), _
Array (&quot;Tentacool&quot;, &quot;072&quot;, 80, 97, 182, &quot;Tentacruel&quot;), _
Array (&quot;Tentacruel&quot;, &quot;073&quot;, 160, 166, 237, &quot;Tentacruel&quot;), _
Array (&quot;Geodude&quot;, &quot;074&quot;, 80, 132, 163, &quot;Golem&quot;), _
Array (&quot;Graveler&quot;, &quot;075&quot;, 110, 164, 196, &quot;Golem&quot;), _
Array (&quot;Golem&quot;, &quot;076&quot;, 160, 211, 229, &quot;Golem&quot;), _
Array (&quot;Ponyta&quot;, &quot;077&quot;, 100, 170, 132, &quot;Rapidash&quot;), _
Array (&quot;Rapidash&quot;, &quot;078&quot;, 130, 207, 167, &quot;Rapidash&quot;), _
Array (&quot;Slowpoke&quot;, &quot;079&quot;, 180, 109, 109, &quot;Slowbro&quot;), _
Array (&quot;Slowbro&quot;, &quot;080&quot;, 190, 177, 194, &quot;Slowbro&quot;), _
Array (&quot;Magnemite&quot;, &quot;081&quot;, 50, 165, 128, &quot;Magneton&quot;), _
Array (&quot;Magneton&quot;, &quot;082&quot;, 100, 223, 182, &quot;Magneton&quot;), _
Array (&quot;Farfetch&apos;d&quot;, &quot;083&quot;, 104, 124, 118, &quot;Farfetch&apos;d&quot;), _
Array (&quot;Doduo&quot;, &quot;084&quot;, 70, 158, 88, &quot;Dodrio&quot;), _
Array (&quot;Dodrio&quot;, &quot;085&quot;, 120, 218, 145, &quot;Dodrio&quot;), _
Array (&quot;Seel&quot;, &quot;086&quot;, 130, 85, 128, &quot;Dewgong&quot;), _
Array (&quot;Dewgong&quot;, &quot;087&quot;, 180, 139, 184, &quot;Dewgong&quot;), _
Array (&quot;Grimer&quot;, &quot;088&quot;, 160, 135, 90, &quot;Muk&quot;), _
Array (&quot;Muk&quot;, &quot;089&quot;, 210, 190, 184, &quot;Muk&quot;), _
Array (&quot;Shellder&quot;, &quot;090&quot;, 60, 116, 168, &quot;Cloyster&quot;), _
Array (&quot;Cloyster&quot;, &quot;091&quot;, 100, 186, 323, &quot;Cloyster&quot;), _
Array (&quot;Gastly&quot;, &quot;092&quot;, 60, 186, 70, &quot;Gengar&quot;), _
Array (&quot;Haunter&quot;, &quot;093&quot;, 90, 223, 112, &quot;Gengar&quot;), _
Array (&quot;Gengar&quot;, &quot;094&quot;, 120, 261, 156, &quot;Gengar&quot;), _
Array (&quot;Onix&quot;, &quot;095&quot;, 70, 85, 288, &quot;Onix&quot;), _
Array (&quot;Drowzee&quot;, &quot;096&quot;, 120, 89, 158, &quot;Hypno&quot;), _
Array (&quot;Hypno&quot;, &quot;097&quot;, 170, 144, 215, &quot;Hypno&quot;), _
Array (&quot;Krabby&quot;, &quot;098&quot;, 60, 181, 156, &quot;Kingler&quot;), _
Array (&quot;Kingler&quot;, &quot;099&quot;, 110, 240, 214, &quot;Kingler&quot;), _
Array (&quot;Voltorb&quot;, &quot;100&quot;, 80, 109, 114, &quot;Electrode&quot;), _
Array (&quot;Electrode&quot;, &quot;101&quot;, 120, 173, 179, &quot;Electrode&quot;), _
Array (&quot;Exeggcute&quot;, &quot;102&quot;, 120, 107, 140, &quot;Exeggutor&quot;), _
Array (&quot;Exeggutor&quot;, &quot;103&quot;, 190, 233, 158, &quot;Exeggutor&quot;), _
Array (&quot;Cubone&quot;, &quot;104&quot;, 100, 90, 165, &quot;Marowak&quot;), _
Array (&quot;Marowak&quot;, &quot;105&quot;, 120, 144, 200, &quot;Marowak&quot;), _
Array (&quot;Hitmonlee&quot;, &quot;106&quot;, 100, 224, 211, &quot;Hitmonlee&quot;), _
Array (&quot;Hitmonchan&quot;, &quot;107&quot;, 100, 193, 212, &quot;Hitmonchan&quot;), _
Array (&quot;Lickitung&quot;, &quot;108&quot;, 180, 108, 137, &quot;Lickitung&quot;), _
Array (&quot;Koffing&quot;, &quot;109&quot;, 80, 119, 164, &quot;Weezing&quot;), _
Array (&quot;Weezing&quot;, &quot;110&quot;, 130, 174, 221, &quot;Weezing&quot;), _
Array (&quot;Rhyhorn&quot;, &quot;111&quot;, 160, 140, 157, &quot;Rhydon&quot;), _
Array (&quot;Rhydon&quot;, &quot;112&quot;, 210, 222, 206, &quot;Rhydon&quot;), _
Array (&quot;Chansey&quot;, &quot;113&quot;, 500, 60, 176, &quot;Chansey&quot;), _
Array (&quot;Tangela&quot;, &quot;114&quot;, 130, 183, 205, &quot;Tangela&quot;), _
Array (&quot;Kangaskhan&quot;, &quot;115&quot;, 210, 181, 165, &quot;Kangaskhan&quot;), _
Array (&quot;Horsea&quot;, &quot;116&quot;, 60, 129, 125, &quot;Seadra&quot;), _
Array (&quot;Seadra&quot;, &quot;117&quot;, 110, 187, 182, &quot;Seadra&quot;), _
Array (&quot;Goldeen&quot;, &quot;118&quot;, 90, 123, 115, &quot;Seaking&quot;), _
Array (&quot;Seaking&quot;, &quot;119&quot;, 160, 175, 154, &quot;Seaking&quot;), _
Array (&quot;Staryu&quot;, &quot;120&quot;, 60, 137, 112, &quot;Starmie&quot;), _
Array (&quot;Starmie&quot;, &quot;121&quot;, 120, 210, 184, &quot;Starmie&quot;), _
Array (&quot;Mr. Mime&quot;, &quot;122&quot;, 80, 192, 233, &quot;Mr. Mime&quot;), _
Array (&quot;Scyther&quot;, &quot;123&quot;, 140, 218, 170, &quot;Scyther&quot;), _
Array (&quot;Jynx&quot;, &quot;124&quot;, 130, 223, 182, &quot;Jynx&quot;), _
Array (&quot;Electabuzz&quot;, &quot;125&quot;, 130, 198, 173, &quot;Electabuzz&quot;), _
Array (&quot;Magmar&quot;, &quot;126&quot;, 130, 206, 169, &quot;Magmar&quot;), _
Array (&quot;Pinsir&quot;, &quot;127&quot;, 130, 238, 197, &quot;Pinsir&quot;), _
Array (&quot;Tauros&quot;, &quot;128&quot;, 150, 198, 197, &quot;Tauros&quot;), _
Array (&quot;Magikarp&quot;, &quot;129&quot;, 40, 29, 102, &quot;Gyarados&quot;), _
Array (&quot;Gyarados&quot;, &quot;130&quot;, 190, 237, 197, &quot;Gyarados&quot;), _
Array (&quot;Lapras&quot;, &quot;131&quot;, 260, 186, 190, &quot;Lapras&quot;), _
Array (&quot;Ditto&quot;, &quot;132&quot;, 96, 91, 91, &quot;Ditto&quot;), _
Array (&quot;Eevee&quot;, &quot;133&quot;, 110, 104, 121, &quot;Vaporeon&quot;), _
Array (&quot;Vaporeon&quot;, &quot;134&quot;, 260, 205, 177, &quot;Vaporeon&quot;), _
Array (&quot;Jolteon&quot;, &quot;135&quot;, 130, 232, 201, &quot;Jolteon&quot;), _
Array (&quot;Flareon&quot;, &quot;136&quot;, 130, 246, 204, &quot;Flareon&quot;), _
Array (&quot;Porygon&quot;, &quot;137&quot;, 130, 153, 139, &quot;Porygon&quot;), _
Array (&quot;Omanyte&quot;, &quot;138&quot;, 70, 155, 174, &quot;Omastar&quot;), _
Array (&quot;Omastar&quot;, &quot;139&quot;, 140, 207, 227, &quot;Omastar&quot;), _
Array (&quot;Kabuto&quot;, &quot;140&quot;, 60, 148, 162, &quot;Kabutops&quot;), _
Array (&quot;Kabutops&quot;, &quot;141&quot;, 120, 220, 203, &quot;Kabutops&quot;), _
Array (&quot;Aerodactyl&quot;, &quot;142&quot;, 160, 221, 164, &quot;Aerodactyl&quot;), _
Array (&quot;Snorlax&quot;, &quot;143&quot;, 320, 190, 190, &quot;Snorlax&quot;), _
Array (&quot;Articuno&quot;, &quot;144&quot;, 180, 192, 249, &quot;Articuno&quot;), _
Array (&quot;Zapdos&quot;, &quot;145&quot;, 180, 253, 188, &quot;Zapdos&quot;), _
Array (&quot;Moltres&quot;, &quot;146&quot;, 180, 251, 184, &quot;Moltres&quot;), _
Array (&quot;Dratini&quot;, &quot;147&quot;, 82, 119, 94, &quot;Dragonite&quot;), _
Array (&quot;Dragonair&quot;, &quot;148&quot;, 122, 163, 138, &quot;Dragonite&quot;), _
Array (&quot;Dragonite&quot;, &quot;149&quot;, 182, 263, 201, &quot;Dragonite&quot;), _
Array (&quot;Mewtwo&quot;, &quot;150&quot;, 212, 330, 200, &quot;Mewtwo&quot;), _
Array (&quot;Mew&quot;, &quot;151&quot;, 200, 210, 209, &quot;Mew&quot;))
End Function
&apos; fnGetCPMData: Returns the combat power multiplier data.
Function fnGetCPMData As Variant
fnGetCPMData = Array( _
-1, _
9.4E-02, _
0.16639787, _
0.21573247, _
0.25572005, _
0.29024988, _
0.3210876, _
0.34921268, _
0.37523559, _
0.39956728, _
0.42250001, _
0.44310755, _
0.46279839, _
0.48168495, _
0.49985844, _
0.51739395, _
0.53435433, _
0.55079269, _
0.56675452, _
0.58227891, _
0.59740001, _
0.61215729, _
0.62656713, _
0.64065295, _
0.65443563, _
0.667934, _
0.68116492, _
0.69414365, _
0.70688421, _
0.71939909, _
0.7317, _
0.73776948, _
0.74378943, _
0.74976104, _
0.75568551, _
0.76156384, _
0.76739717, _
0.7731865, _
0.77893275, _
0.78463697, _
0.78463697)
End Function
&apos; fnGetStarDustData: Returns the star dust data.
Function fnGetStarDustData As Variant
fnGetStarDustData = Array( _
-1, _
200, _
200, _
400, _
400, _
600, _
600, _
800, _
800, _
1000, _
1000, _
1300, _
1300, _
1600, _
1600, _
1900, _
1900, _
2200, _
2200, _
2500, _
2500, _
3000, _
3000, _
3500, _
3500, _
4000, _
4000, _
4500, _
4500, _
5000, _
5000, _
6000, _
6000, _
7000, _
7000, _
8000, _
8000, _
9000, _
9000, _
10000, _
10000)
End Function
</script:module>

View File

@ -1,163 +0,0 @@
' 3Load: The Pokémon Go IV data
' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-28
Option Explicit
' subReadDataSheets: Reads the data sheets and shows the data as
' OpenOffice Basic arrays
Sub subReadDataSheets
Dim sOutput as String, mData As Variant
sOutput = "" _
& "' 2Data: The Pokémon Go data for IV calculation" & Chr (10) _
& "' by imacat <imacat@mail.imacat.idv.tw>, " & Format (Date (), "yyyy-mm-dd") & Chr (10) _
& "' Generated with _3Load.subReadDataSheets ()" & Chr (10) _
& Chr (10) _
& "Option Explicit"
sOutput = sOutput & Chr (10) & Chr (10) & fnReadBaseStatsSheet
sOutput = sOutput & Chr (10) & Chr (10) & fnReadCPMSheet
sOutput = sOutput & Chr (10) & Chr (10) & fnReadStarDustSheet
subShowBasicData (sOutput)
End Sub
' subShowBasicData: Shows the data table as Basic arrays
Sub subShowBasicData (sContent As String)
Dim oDialog As Object, oDialogModel As Object
Dim oEditModel As Object, oButtonModel As Object
' Creates a dialog
oDialogModel = CreateUnoService ( _
"com.sun.star.awt.UnoControlDialogModel")
oDialogModel.setPropertyValue ("PositionX", 100)
oDialogModel.setPropertyValue ("PositionY", 100)
oDialogModel.setPropertyValue ("Height", 130)
oDialogModel.setPropertyValue ("Width", 200)
oDialogModel.setPropertyValue ("Title", "Pokémon Go Data")
' Adds the content area
oEditModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlEditModel")
oEditModel.setPropertyValue ("PositionX", 5)
oEditModel.setPropertyValue ("PositionY", 5)
oEditModel.setPropertyValue ("Height", 100)
oEditModel.setPropertyValue ("Width", 190)
oEditModel.setPropertyValue ("MultiLine", True)
oEditModel.setPropertyValue ("Text", sContent)
oEditModel.setPropertyValue ("ReadOnly", True)
oDialogModel.insertByName ("edtContent", oEditModel)
' Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlButtonModel")
oButtonModel.setPropertyValue ("PositionX", 70)
oButtonModel.setPropertyValue ("PositionY", 110)
oButtonModel.setPropertyValue ("Height", 15)
oButtonModel.setPropertyValue ("Width", 60)
oButtonModel.setPropertyValue ("PushButtonType", _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue ("DefaultButton", True)
oDialogModel.insertByName ("btnOK", oButtonModel)
' Adds the dialog model to the control and runs it.
oDialog = CreateUnoService ("com.sun.star.awt.UnoControlDialog")
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.execute
End Sub
' fnReadBaseStatsSheet: Reads the base stats sheet.
Function fnReadBaseStatsSheet As String
Dim oSheet As Object, oRange As Object, mData As Variant
Dim nI As Integer, sOutput As String
Dim nJ As Integer, sEvolveInto As String
oSheet = ThisComponent.getSheets.getByName ("basestat")
oRange = oSheet.getCellRangeByName ("BaseStats")
mData = oRange.getDataArray
sOutput = "" _
& "' fnGetBaseStatsData: Returns the base stats data." & Chr (10) _
& "Function fnGetBaseStatsData As Variant" & Chr (10) _
& Chr (9) & "fnGetBaseStatsData = Array( _" & Chr (10)
For nI = 1 To UBound (mData) - 1
For nJ = 9 To 7 Step -1
If mData (nI) (nJ) <> "" Then
sEvolveInto = mData (nI) (nJ)
nJ = 6
End If
Next nJ
sOutput = sOutput _
& Chr (9) & Chr (9) & "Array (""" & mData (nI) (0) _
& """, """ & mData (nI) (1) _
& """, " & mData (nI) (3) _
& ", " & mData (nI) (4) _
& ", " & mData (nI) (5) _
& ", """ & sEvolveInto & """), _" & Chr (10)
Next nI
nI = UBound (mData)
For nJ = 9 To 7 Step -1
If mData (nI) (nJ) <> "" Then
sEvolveInto = mData (nI) (nJ)
nJ = 6
End If
Next nJ
sOutput = sOutput _
& Chr (9) & Chr (9) & "Array (""" & mData (nI) (0) _
& """, """ & mData (nI) (1) _
& """, " & mData (nI) (3) _
& ", " & mData (nI) (4) _
& ", " & mData (nI) (5) _
& ", """ & sEvolveInto & """))" & Chr (10) _
& "End Function"
fnReadBaseStatsSheet = sOutput
End Function
' fnReadCPMSheet: Reads the combat power multiplier sheet.
Function fnReadCPMSheet As String
Dim oSheet As Object, oRange As Object, mData As Variant
Dim nI As Integer, sOutput As String
oSheet = ThisComponent.getSheets.getByName ("cpm")
oRange = oSheet.getCellRangeByName ("CPM")
mData = oRange.getDataArray
sOutput = "" _
& "' fnGetCPMData: Returns the combat power multiplier data." & Chr (10) _
& "Function fnGetCPMData As Variant" & Chr (10) _
& Chr (9) & "fnGetCPMData = Array( _" & Chr (10) _
& Chr (9) & Chr (9) & "-1, _" & Chr (10)
For nI = 1 To UBound (mData) - 2 Step 2
sOutput = sOutput _
& Chr (9) & Chr (9) & mData (nI) (1) & ", _" & Chr (10)
Next nI
nI = UBound (mData) - 2
sOutput = sOutput _
& Chr (9) & Chr (9) & mData (nI) (1) & ")" & Chr (10) _
& "End Function"
fnReadCPMSheet = sOutput
End Function
' fnReadStarDustSheet: Reads the star dust sheet.
Function fnReadStarDustSheet As String
Dim oSheet As Object, oRange As Object, mData As Variant
Dim nI As Integer, sOutput As String
oSheet = ThisComponent.getSheets.getByName ("lvup")
oRange = oSheet.getCellRangeByName ("A2:D81")
mData = oRange.getDataArray
sOutput = "" _
& "' fnGetStarDustData: Returns the star dust data." & Chr (10) _
& "Function fnGetStarDustData As Variant" & Chr (10) _
& Chr (9) & "fnGetStarDustData = Array( _" & Chr (10) _
& Chr (9) & Chr (9) & "-1, _" & Chr (10)
For nI = 1 To UBound (mData) - 1 Step 2
sOutput = sOutput _
& Chr (9) & Chr (9) & mData (nI) (2) & ", _" & Chr (10)
Next nI
nI = UBound (mData)
sOutput = sOutput _
& Chr (9) & Chr (9) & mData (nI) (2) & ")" & Chr (10) _
& "End Function"
fnReadStarDustSheet = sOutput
End Function

166
oxt/PokemonGoIV/3Load.xba Normal file
View File

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="3Load" script:language="StarBasic">&apos; 3Load: The Pokémon Go IV data
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-28
Option Explicit
&apos; subReadDataSheets: Reads the data sheets and shows the data as
&apos; OpenOffice Basic arrays
Sub subReadDataSheets
Dim sOutput as String, mData As Variant
sOutput = &quot;&quot; _
&amp; &quot;&apos; 2Data: The Pokémon Go data for IV calculation&quot; &amp; Chr (10) _
&amp; &quot;&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, &quot; &amp; Format (Date (), &quot;yyyy-mm-dd&quot;) &amp; Chr (10) _
&amp; &quot;&apos; Generated with _3Load.subReadDataSheets ()&quot; &amp; Chr (10) _
&amp; Chr (10) _
&amp; &quot;Option Explicit&quot;
sOutput = sOutput &amp; Chr (10) &amp; Chr (10) &amp; fnReadBaseStatsSheet
sOutput = sOutput &amp; Chr (10) &amp; Chr (10) &amp; fnReadCPMSheet
sOutput = sOutput &amp; Chr (10) &amp; Chr (10) &amp; fnReadStarDustSheet
subShowBasicData (sOutput)
End Sub
&apos; subShowBasicData: Shows the data table as Basic arrays
Sub subShowBasicData (sContent As String)
Dim oDialog As Object, oDialogModel As Object
Dim oEditModel As Object, oButtonModel As Object
&apos; Creates a dialog
oDialogModel = CreateUnoService ( _
&quot;com.sun.star.awt.UnoControlDialogModel&quot;)
oDialogModel.setPropertyValue (&quot;PositionX&quot;, 100)
oDialogModel.setPropertyValue (&quot;PositionY&quot;, 100)
oDialogModel.setPropertyValue (&quot;Height&quot;, 130)
oDialogModel.setPropertyValue (&quot;Width&quot;, 200)
oDialogModel.setPropertyValue (&quot;Title&quot;, &quot;Pokémon Go Data&quot;)
&apos; Adds the content area
oEditModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlEditModel&quot;)
oEditModel.setPropertyValue (&quot;PositionX&quot;, 5)
oEditModel.setPropertyValue (&quot;PositionY&quot;, 5)
oEditModel.setPropertyValue (&quot;Height&quot;, 100)
oEditModel.setPropertyValue (&quot;Width&quot;, 190)
oEditModel.setPropertyValue (&quot;MultiLine&quot;, True)
oEditModel.setPropertyValue (&quot;Text&quot;, sContent)
oEditModel.setPropertyValue (&quot;ReadOnly&quot;, True)
oDialogModel.insertByName (&quot;edtContent&quot;, oEditModel)
&apos; Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
oButtonModel.setPropertyValue (&quot;PositionX&quot;, 70)
oButtonModel.setPropertyValue (&quot;PositionY&quot;, 110)
oButtonModel.setPropertyValue (&quot;Height&quot;, 15)
oButtonModel.setPropertyValue (&quot;Width&quot;, 60)
oButtonModel.setPropertyValue (&quot;PushButtonType&quot;, _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue (&quot;DefaultButton&quot;, True)
oDialogModel.insertByName (&quot;btnOK&quot;, oButtonModel)
&apos; Adds the dialog model to the control and runs it.
oDialog = CreateUnoService (&quot;com.sun.star.awt.UnoControlDialog&quot;)
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.execute
End Sub
&apos; fnReadBaseStatsSheet: Reads the base stats sheet.
Function fnReadBaseStatsSheet As String
Dim oSheet As Object, oRange As Object, mData As Variant
Dim nI As Integer, sOutput As String
Dim nJ As Integer, sEvolveInto As String
oSheet = ThisComponent.getSheets.getByName (&quot;basestat&quot;)
oRange = oSheet.getCellRangeByName (&quot;BaseStats&quot;)
mData = oRange.getDataArray
sOutput = &quot;&quot; _
&amp; &quot;&apos; fnGetBaseStatsData: Returns the base stats data.&quot; &amp; Chr (10) _
&amp; &quot;Function fnGetBaseStatsData As Variant&quot; &amp; Chr (10) _
&amp; Chr (9) &amp; &quot;fnGetBaseStatsData = Array( _&quot; &amp; Chr (10)
For nI = 1 To UBound (mData) - 1
For nJ = 9 To 7 Step -1
If mData (nI) (nJ) &lt;&gt; &quot;&quot; Then
sEvolveInto = mData (nI) (nJ)
nJ = 6
End If
Next nJ
sOutput = sOutput _
&amp; Chr (9) &amp; Chr (9) &amp; &quot;Array (&quot;&quot;&quot; &amp; mData (nI) (0) _
&amp; &quot;&quot;&quot;, &quot;&quot;&quot; &amp; mData (nI) (1) _
&amp; &quot;&quot;&quot;, &quot; &amp; mData (nI) (3) _
&amp; &quot;, &quot; &amp; mData (nI) (4) _
&amp; &quot;, &quot; &amp; mData (nI) (5) _
&amp; &quot;, &quot;&quot;&quot; &amp; sEvolveInto &amp; &quot;&quot;&quot;), _&quot; &amp; Chr (10)
Next nI
nI = UBound (mData)
For nJ = 9 To 7 Step -1
If mData (nI) (nJ) &lt;&gt; &quot;&quot; Then
sEvolveInto = mData (nI) (nJ)
nJ = 6
End If
Next nJ
sOutput = sOutput _
&amp; Chr (9) &amp; Chr (9) &amp; &quot;Array (&quot;&quot;&quot; &amp; mData (nI) (0) _
&amp; &quot;&quot;&quot;, &quot;&quot;&quot; &amp; mData (nI) (1) _
&amp; &quot;&quot;&quot;, &quot; &amp; mData (nI) (3) _
&amp; &quot;, &quot; &amp; mData (nI) (4) _
&amp; &quot;, &quot; &amp; mData (nI) (5) _
&amp; &quot;, &quot;&quot;&quot; &amp; sEvolveInto &amp; &quot;&quot;&quot;))&quot; &amp; Chr (10) _
&amp; &quot;End Function&quot;
fnReadBaseStatsSheet = sOutput
End Function
&apos; fnReadCPMSheet: Reads the combat power multiplier sheet.
Function fnReadCPMSheet As String
Dim oSheet As Object, oRange As Object, mData As Variant
Dim nI As Integer, sOutput As String
oSheet = ThisComponent.getSheets.getByName (&quot;cpm&quot;)
oRange = oSheet.getCellRangeByName (&quot;CPM&quot;)
mData = oRange.getDataArray
sOutput = &quot;&quot; _
&amp; &quot;&apos; fnGetCPMData: Returns the combat power multiplier data.&quot; &amp; Chr (10) _
&amp; &quot;Function fnGetCPMData As Variant&quot; &amp; Chr (10) _
&amp; Chr (9) &amp; &quot;fnGetCPMData = Array( _&quot; &amp; Chr (10) _
&amp; Chr (9) &amp; Chr (9) &amp; &quot;-1, _&quot; &amp; Chr (10)
For nI = 1 To UBound (mData) - 2 Step 2
sOutput = sOutput _
&amp; Chr (9) &amp; Chr (9) &amp; mData (nI) (1) &amp; &quot;, _&quot; &amp; Chr (10)
Next nI
nI = UBound (mData) - 2
sOutput = sOutput _
&amp; Chr (9) &amp; Chr (9) &amp; mData (nI) (1) &amp; &quot;)&quot; &amp; Chr (10) _
&amp; &quot;End Function&quot;
fnReadCPMSheet = sOutput
End Function
&apos; fnReadStarDustSheet: Reads the star dust sheet.
Function fnReadStarDustSheet As String
Dim oSheet As Object, oRange As Object, mData As Variant
Dim nI As Integer, sOutput As String
oSheet = ThisComponent.getSheets.getByName (&quot;lvup&quot;)
oRange = oSheet.getCellRangeByName (&quot;A2:D81&quot;)
mData = oRange.getDataArray
sOutput = &quot;&quot; _
&amp; &quot;&apos; fnGetStarDustData: Returns the star dust data.&quot; &amp; Chr (10) _
&amp; &quot;Function fnGetStarDustData As Variant&quot; &amp; Chr (10) _
&amp; Chr (9) &amp; &quot;fnGetStarDustData = Array( _&quot; &amp; Chr (10) _
&amp; Chr (9) &amp; Chr (9) &amp; &quot;-1, _&quot; &amp; Chr (10)
For nI = 1 To UBound (mData) - 1 Step 2
sOutput = sOutput _
&amp; Chr (9) &amp; Chr (9) &amp; mData (nI) (2) &amp; &quot;, _&quot; &amp; Chr (10)
Next nI
nI = UBound (mData)
sOutput = sOutput _
&amp; Chr (9) &amp; Chr (9) &amp; mData (nI) (2) &amp; &quot;)&quot; &amp; Chr (10) _
&amp; &quot;End Function&quot;
fnReadStarDustSheet = sOutput
End Function
</script:module>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="PokemonGoIV" library:readonly="false" library:passwordprotected="false"/>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="PokemonGoIV" library:readonly="false" library:passwordprotected="false">
<library:element library:name="3Load"/>
<library:element library:name="0Main"/>
<library:element library:name="1Dialog"/>
<library:element library:name="2Data"/>
</library:library>