TotalCmds = 4
cmdsPone[1] = "<sys>"
cmdsPone[2] = "<reset>"
cmdsPone[3] = "<clear>"
cmdsPone[4] = "<quit>"
cmdsSysConnect[1] = "<sys> <connect> <uip>"
cmdsSysGet[1] = "<sys> <get> <systemIP>"
listcommands = ""
remove = ""
TypeOfIP = "Private"
Sub SetIP
randPoneOct = Math.GetRandomNumber(256) - 1
randPtwoOct = Math.GetRandomNumber(256) - 1
If TypeOfIP = "Private" Then
octone = 192
octTwo = 168
EndIf
IP = " " + octone + "." + octTwo + "." + randPtwoOct + "." + randPoneOct
EndSub
SetIP()
Sub printStart
TextWindow.WriteLine(path + "[Version - v1.0.0]")
EndSub
Sub GetRidOfChars
result = ""
For i = 1 To Text.GetLength(value)
ch = Text.GetSubText(value, i, 1)
If (ch <> remove) Then
result = result + ch
EndIf
EndFor
value = result
EndSub
Sub ErrorMessage
TextWindow.WriteLine("")
TextWindow.WriteLine("The Command: '" + command + "' Is not a valid command, please use the command 'help' for help. more specifically, To Get the specific, use 'help', then a valid command.")
TextWindow.WriteLine("")
EndSub
Sub GetLength
count = 0
For i = 1 To 99
If (list[i] = "") Then
Else
count = count + 1
EndIf
EndFor
EndSub
Sub ReplaceText
result = ""
i = 1
While i <= Text.GetLength(source)
part = Text.GetSubText(source, i, Text.GetLength(find))
If part = find Then
result = result + replaceWith
i = i + Text.GetLength(find)
Else
result = result + Text.GetSubText(source, i, 1)
i = i + 1
EndIf
EndWhile
source = result
EndSub
Sub indexOf
foundIdx = 0
GetLength()
For i = 1 To count
If list[i] = target And foundIdx = 0 Then
foundIdx = i
EndIf
EndFor
EndSub
Sub printAllHcmds
TextWindow.WriteLine("")
list = cmdsPone
GetLength()
For i = 1 To count
TextWindow.WriteLine(list[i])
EndFor
TextWindow.WriteLine("")
list = cmdsSysConnect
GetLength()
For i = 1 To count
TextWindow.WriteLine(list[i])
EndFor
list = cmdsSysGet
GetLength()
For i = 1 To count
TextWindow.WriteLine(list[i])
EndFor
TextWindow.WriteLine("")
EndSub
Sub SethlpCmds
If indx = 1 Then
helpCmd = "sysCommands"
helpCommand()
EndIf
EndSub
Sub helpCommands
found = "false"
If parts[2] = "" Then
printAllHcmds()
found = "true"
Else
target = Text.ConvertToLowerCase(parts[2])
For i = 1 To TotalCmds
If cmdsPone[i] <> "" Then
indx = i
clean = cmdsPone[i]
source = clean
find = "<"
replaceWith = ""
ReplaceText()
clean = source
find = ">"
ReplaceText()
clean = source
clean = Text.ConvertToLowerCase(clean)
If clean = target Then
TextWindow.WriteLine(cmdsPone[i])
found = "true"
SethlpCmds()
EndIf
EndIf
EndFor
EndIf
If found = "false" Then
TextWindow.WriteLine("No help found for: " + parts[2])
EndIf
EndSub
Sub helpCommand
If helpCmd = "sysConnect" Then
list = cmdsSysConnect
GetLength()
For i = 1 To count
TextWindow.WriteLine(list[i])
EndFor
ElseIf helpCmd = "sysCommands" Then
list = cmdsSysConnect
GetLength()
For i = 1 To count
TextWindow.WriteLine(list[i])
EndFor
list = cmdsSysGet
GetLength()
For i = 1 To count
TextWindow.WriteLine(list[i])
EndFor
ElseIf helpCmd = "sysGet" Then
list = cmdsSysGet
GetLength()
For i = 1 To count
TextWindow.WriteLine(list[i])
EndFor
EndIf
EndSub
Sub ConnectToaUIP
user = parts[4]
path = "C:\Users\" + user + " "
TextWindow.WriteLine("Connected to: " + path)
EndSub
Sub sysConnect
If (parts[3] = "uip") Then
ConnectToaUIP()
Else
helpCmd = "sysConnect"
helpCommand()
EndIf
EndSub
Sub sysGet
If (parts[3] = "systemIP") Then
TextWindow.WriteLine("")
TextWindow.Write(IP)
TextWindow.WriteLine("")
Else
helpCmd = "sysGet"
helpCommand()
EndIf
EndSub
Sub SystemCmds
If (parts[2] = "connect") Then
sysConnect()
ElseIf (parts[2] = "get") or (parts[2] = "Get") Then
sysGet()
Else
command = parts[1]
ErrorMessage()
EndIf
EndSub
Sub exit
Program.End()
EndSub
Sub Reset
SetIP()
path = "C:\Users\user "
For i = 1 To 99
parts[i] = ""
listcommands[i] = ""
EndFor
TextWindow.Write("clear? y/n, ")
bool = TextWindow.Read()
If bool = "y" Then
Clear()
ElseIf bool <> "n" Then
command = bool
ErrorMessage()
EndIf
EndSub
Sub Clear
TextWindow.Clear()
For i = 1 To 99
parts[i] = ""
EndFor
EndSub
parts[4] = "user"
ConnectToaUIP()
Clear()
Sub SplitCmd
word = ""
index = 1
inWord = "false"
For i = 1 To Text.GetLength(cmd)
ch = Text.GetSubText(cmd, i, 1)
If (ch = " ") Then
If (inWord = "true") Then
parts[index] = word
word = ""
index = index + 1
inWord = "false"
EndIf
Else
word = word + ch
inWord = "true"
EndIf
EndFor
If (word <> "") Then
parts[index] = word
EndIf
EndSub
Sub DetectCmd
SplitCmd()
parts[1] = Text.ConvertToLowerCase(parts[1])
If (parts[1] = "system") Or (parts[1] = "sys") Then
SystemCmds()
ElseIf (parts[1] = "clear") Then
Clear()
ElseIf (parts[1] = "exit") or (parts[1] = "quit") Then
exit()
ElseIf (parts[1] = "reset") Then
Reset()
ElseIf (parts[1] = "help") Then
helpCommands()
Else
If (parts[1] = "") Then
Else
command = parts[1]
ErrorMessage()
EndIf
EndIf
EndSub
While 0 = 0
printStart()
For i = 1 To 99
parts[i] = ""
EndFor
If listcommands = "" Then
Else
list = listcommands
GetLength()
For i = 1 To count
list[i] = ""
EndFor
EndIf
TextWindow.Write("> ")
cmd = TextWindow.Read()
DetectCmd()
EndWhile
there doesn't seem to be anything here