\$cmd = \$cmd[0]

Recommended Posts

```\$auth = StringRegExp(\$srcv, ':(.*?)!(.*?)@(.*?) (.*?) (.*) :(.*)', 1)
For \$i = 0 To UBound(\$auth) -1
Select
Case \$i = 0
\$nick_as_target = StringStripWS(\$auth[0], 8)
Case \$i = 2
\$foundhost = StringStripWS(\$auth[\$i], 8)
Case \$i = 4
\$cmdtarget = StringStripWS(\$auth[\$i], 8)
If (StringLeft(\$cmdtarget,1) <> "#") Then
\$cmdtarget = \$nick_as_target
EndIf
Case \$i = 5
\$cmdstring = \$auth[\$i]
EndSelect
Next
If (\$foundhost = \$hostmatch) Then
\$cmdl = StringRegExp(\$cmdstring, \$triggerchar & '(.*?) (.*)', 1)
\$cmdsplit = StringSplit(\$cmdl, " ")
\$countarray = UBound(\$cmdsplit)
For \$i = 0 To \$countarray - 1
Select
Case \$i = 1
\$cmdparam_1 = StringStripWS(\$cmdsplit[\$i], 8)
Case \$i = 2
\$cmdparam_2 = StringStripWS(\$cmdsplit[\$i], 8)
Case \$i = 3
\$cmdparam_3 = StringStripWS(\$cmdsplit[\$i], 8)
EndSelect
Next
If (\$cmdl <> 0) Then
\$cmd = \$cmdl[0]
_commands()
EndIf
EndIf```

i think there is a misstake somewhere in

```If (\$cmdl <> 0) Then
\$cmd = \$cmdl[0]
_commands()
EndIf```

because the script works without any problems when i run it as *.au3, by compiling it and running the .exe there is an error

at \$cmd = \$cmdl[0]

```\$cmd = \$cmdl[0]
\$cmd = \$cmdl^ ERROR

Error: Subscript used with non-Array variable.```

i think there is something wrong with the if (\$cmdl <> 0) then

any reason why it doesnt work as .exe but as *.au3? how can i fix this?

Share on other sites

where did you define \$cmdl[0] ????

`\$cmd = \$cmdl[0]`

this also defines \$cmdsplit[0] as a "total number" of how many splits were made

8)

Edited by Valuater

Share on other sites

where did you define \$cmdl[0] ????

\$cmdl = StringRegExp(\$cmdstring, \$triggerchar & '(.*?) (.*)', 1)

Create an account

Register a new account