x
ChatBox

Please log in with password to access chatbox.
visitor stats
Index | Back | Reply | New Topic

Help

How us bases and contrôle it ? ( Final-Version 2)
2023-02-13 23:33
athomecls

########################
#
# 2023-02-14 00:10:20Z
# Copyright @renas
# France
#
# File Name :
# DownloadString-from-Mv-bases.ps1
#
# Us any Powershell version
# Non restriction
#
########################

$Xxt = [string] "#text"

$XxmlUrl = "http://xenia.miniville.fr/xml"
[xml]$Xxml = (new-object System.Net.WebClient).DownloadString($XxmlUrl)

$Xxpop = ([xml]$Xxml).selectSingleNode("city/population").$Xxt
$Xxbcom = ([xml]$Xxml).selectSingleNode("city/bases/@com").$Xxt
$Xxbenv = ([xml]$Xxml).selectSingleNode("city/bases/@env").$Xxt
$Xxbind = ([xml]$Xxml).selectSingleNode("city/bases/@ind").$Xxt
$Xxbsec = ([xml]$Xxml).selectSingleNode("city/bases/@sec").$Xxt
$Xxbtra = ([xml]$Xxml).selectSingleNode("city/bases/@tra").$Xxt
""
Get-Date -Format (Get-culture).DateTimeFormat.UniversalSortableDateTimePattern

""
"""[Load up from your].Miniville.fr/xml,"""
"""and replace and us your values"""
""
"[1 ($Xxbenv - ($Xxpop/2)) ] = " + [math]::round($Xxbenv-($Xxpop/2))
"[2 (($Xxbind+$Xxbcom) - ($Xxpop/3)) ] = " + [math]::round(($Xxbind+$Xxbcom)-($Xxpop/3))
"[3 ($Xxbsec - ($Xxpop/4)) ] = " + [math]::round($Xxbsec-($Xxpop/4))
"[4 ($Xxbtra - ($Xxpop/5)) ] = " + [math]::round($Xxbtra-($Xxpop/5))
""
"""This Miniville is not equal !"""
"Pop's 50 % = "+$Xxpop
$Xxtot = ($Xxbenv+" ("+($Xxbind+" ( "+$Xxbcom)+" )) "+$Xxbsec+" "+$Xxbtra)
"Bases <> 50 % = ""env,(ind+(com)),sec,tra"" = " + $Xxtot

clear-variable X* -scope global
""

# End of the scripte
2023-02-25 09:25
athomeVersion ter

==============

cls

########################
#
# Synopsys:
#
# Creat
# 2023-02-14 00:33:07Z
# Modif
# 2023-02-14 10:25:47Z (last)
#
# Copyright @renas alias (athome)
# France
#
# File Name :
# DownloadString-from-Mv-bases.ps1
#
# Us any Powershell version
# All Info are cumule
# Non restriction
#
# The convention is:
# 1 klick env for 2 pop
# 1 klick ind or *com for 3 pop
# 1 klick sec for 4 pop
# 1 klick tra for 5 pop
#
# * "com" is obsolete "Y?????????, nicht verwenden, not tu use!
#
# Bases: pop/- us [math]::round(bases 1..4) = somme
#
# That's all to do. Great to hear from you.
#
########################

$Xt = [string] "#text"

# your Miniville city name
$XmlUrl = "http://burschi.miniville.fr/xml"
[xml]$Xml = (new-object System.Net.WebClient).DownloadString($XmlUrl)

$Xpop = ([xml]$Xml).selectSingleNode("city/population").$Xt
$Xcom = ([xml]$Xml).selectSingleNode("city/bases/@com").$Xt
$Xenv = ([xml]$Xml).selectSingleNode("city/bases/@env").$Xt
$Xind = ([xml]$Xml).selectSingleNode("city/bases/@ind").$Xt
$Xsec = ([xml]$Xml).selectSingleNode("city/bases/@sec").$Xt
$Xtra = ([xml]$Xml).selectSingleNode("city/bases/@tra").$Xt
""
""" Last update Date/Time (yyyy-mm-dd hh:mm:ss) """
Get-Date -Format (Get-culture).DateTimeFormat.UniversalSortableDateTimePattern
""
"Bases: pop/- us [math]::round(bases 1..4) = somme"
""
"[1 (($Xpop/2) - $Xenv ] = " + [math]::round(($Xpop/2) - $Xenv)
"[2 (($Xpop/3) - ($Xind + $Xcom)) ] = " + [math]::round(($Xpop/3) - ($Xind + $Xcom))
"[3 (($Xpop/4) - $Xsec) ] = " + [math]::round(($Xpop/4) - $Xsec)
"[4 (($Xpop/5) - $Xtra) ] = " + [math]::round(($Xpop/5) - $Xtra)
""
""" This Miniville is not equal ! """
"Pop's 50 % = "+[int]$Xpop

$Xtot = [int]$Xenv + [int]$Xind + [int]$Xcom + [int]$Xsec + [int]$Xtra

$Xplus_minus = [int]$Xtot - [int]$Xpop
"Somme Bases <> 50 % = ""env,(ind+(com)),sec,tra"" = " + $Xtot + " ""[ " + "{0:### ###}" -f ($Xplus_minus) + " ]"""

clear-variable X* -scope global -F
""
"I hope this helps your situation. If not, I'd be happy to revisit"
""
2023-04-20 09:35
athomeImage from 18 avril 2023 - évolutive

Copy link to see the modify of the scripte:

http://www.interplanete.com/forum/index.php?topic=793.0

@