ardeangangkasa6
Member
Sub shcurl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Dim jsP As JSONParser
Dim mp, lstItems, listStatus, items, cond As Map
Dim lstData, data, data6, listItems2 As List
Dim name As String
Dim flagAccessible,x As Int
Dim timedate As Long
Dim isAccessible As Boolean
DateTime.DateFormat = "yyyyMMddHHmm"
timedate = DateTime.Now
lstItems.Initialize
listItems2.Initialize
items.Initialize
listStatus.Initialize
lstData.Initialize
mp.Initialize
cond.Initialize
data.Initialize
data6.Initialize
jsP.Initialize(StdOut)
If Success And ExitCode = 0 Then
mp = jsP.NextObject
lstData = mp.GetValueAt(3)
For i = 0 To lstData.Size - 1
lstItems= lstData.Get(i)
listItems2.Add(lstItems)
Next
For Each lstItems As Map In listItems2
If lstItems.ContainsKey("status") Then
listStatus = lstItems.Get("status")
Log("Success")
If listStatus.ContainsKey("conditions") Then
data=listStatus.Get("conditions")
Log("Success2")
' For Each cond As Map In data
For o = 0 To data.Size - 1
totalData = data.Size
cond = data.Get(o)
If cond.Get("type") = "ContainersReady" Then
name=cond.Get("type")
Dim boolList As List
boolList.Initialize
isAccessible=cond.Get("type") = "ContainersReady"
ConvertBooleanToList(isAccessible)
' Dim myBool As Boolean = True
Dim myList As List = ConvertBooleanToList(isAccessible)
boolList=myList
Dim trueCount As Int = 0
Dim falseCount As Int = 0
For Each b As Boolean In boolList
If b Then
trueCount = trueCount + 1
sh2.Initialize("shbottelegram", "java", Array As String("-jar", "bot.jar", key, trueCount))
Else
falseCount = falseCount + 1
End If
Next
Log("Total True: " & trueCount)
Log("Total False: " & falseCount)
Dim boolList2 As List
boolList2.Initialize
boolList2.Add(True)
boolList2.Add(False)
boolList2.Add(True)
boolList2.Add(True)
Dim trueCount2 As Int = 0
Dim falseCount2 As Int = 0
For Each r As Boolean In boolList2
If r Then
trueCount2 = trueCount2 + 1
Else
falseCount2 = falseCount2 + 1
End If
Next
Log("Total True: " & trueCount2)
Log("Total False: " & falseCount2)
End If
Next
End If
End If
Next
Else
Log("Error: " & StdErr)
' ExitApplication
End If
End Sub
on this code: "listItems2.Add(lstItems)" how to use listitems2 (List) to get me attribute: containersready? (If cond.Get("type") = "ContainersReady" Then), so far i'm using lstItems (Map)
Dim jsP As JSONParser
Dim mp, lstItems, listStatus, items, cond As Map
Dim lstData, data, data6, listItems2 As List
Dim name As String
Dim flagAccessible,x As Int
Dim timedate As Long
Dim isAccessible As Boolean
DateTime.DateFormat = "yyyyMMddHHmm"
timedate = DateTime.Now
lstItems.Initialize
listItems2.Initialize
items.Initialize
listStatus.Initialize
lstData.Initialize
mp.Initialize
cond.Initialize
data.Initialize
data6.Initialize
jsP.Initialize(StdOut)
If Success And ExitCode = 0 Then
mp = jsP.NextObject
lstData = mp.GetValueAt(3)
For i = 0 To lstData.Size - 1
lstItems= lstData.Get(i)
listItems2.Add(lstItems)
Next
For Each lstItems As Map In listItems2
If lstItems.ContainsKey("status") Then
listStatus = lstItems.Get("status")
Log("Success")
If listStatus.ContainsKey("conditions") Then
data=listStatus.Get("conditions")
Log("Success2")
' For Each cond As Map In data
For o = 0 To data.Size - 1
totalData = data.Size
cond = data.Get(o)
If cond.Get("type") = "ContainersReady" Then
name=cond.Get("type")
Dim boolList As List
boolList.Initialize
isAccessible=cond.Get("type") = "ContainersReady"
ConvertBooleanToList(isAccessible)
' Dim myBool As Boolean = True
Dim myList As List = ConvertBooleanToList(isAccessible)
boolList=myList
Dim trueCount As Int = 0
Dim falseCount As Int = 0
For Each b As Boolean In boolList
If b Then
trueCount = trueCount + 1
sh2.Initialize("shbottelegram", "java", Array As String("-jar", "bot.jar", key, trueCount))
Else
falseCount = falseCount + 1
End If
Next
Log("Total True: " & trueCount)
Log("Total False: " & falseCount)
Dim boolList2 As List
boolList2.Initialize
boolList2.Add(True)
boolList2.Add(False)
boolList2.Add(True)
boolList2.Add(True)
Dim trueCount2 As Int = 0
Dim falseCount2 As Int = 0
For Each r As Boolean In boolList2
If r Then
trueCount2 = trueCount2 + 1
Else
falseCount2 = falseCount2 + 1
End If
Next
Log("Total True: " & trueCount2)
Log("Total False: " & falseCount2)
End If
Next
End If
End If
Next
Else
Log("Error: " & StdErr)
' ExitApplication
End If
End Sub
on this code: "listItems2.Add(lstItems)" how to use listitems2 (List) to get me attribute: containersready? (If cond.Get("type") = "ContainersReady" Then), so far i'm using lstItems (Map)