can someone help me with $lines in a goto loop, :) - 07/09/04 12:59 PM
this doesnt seem to be working for me,
i made an alias to return the lines in a text file
and it always says if invalid parameters
line 233
which is the $lines line
even when i type
//echo $lines(textfile.txt)
it wont work any ideas
heres the code:
-----------------------------------------------------------------------------------------------------------
on *:chat:example: {
if ($example1 == 0)
{
msg =$nick No Lines To Display
goto end
}
if ($example1 < 2)
{
msg =$nick There Is Only 1 example
var %read = $read(example.txt, 1)
tokenize 1 %read
msg =$nick Nick: $1 Address: $2 message: $3-
}
if ($example1 >= 2)
{
msg = $nick There Are $example1 lines
showallexample $nick
}
:end
}
alias example1 {
var %lines = $lines(example.txt)
return %lines
}
alias showallexample {
var %examplename = $1
var %exampletotal = $lines(example.txt)
var %examplenumber = 0
:regroup
if (%examplenumber >= %exampletotal)
{
msg =%examplename ---- example List End ----
goto end
}
inc %examplenumber 1
var %read = $read(example.txt, %examplenumber)
tokenize 1 %read
msg =%examplename line: %examplenumber Nick: $1 Address: $2 message: $3-
goto regroup
:end
}
-------------------------------------------------------------------------------------------------------------
this isnt the same as my script cuz it was hard to explain
but this is what i want
please help me
thanks alot
i made an alias to return the lines in a text file
and it always says if invalid parameters
line 233
which is the $lines line
even when i type
//echo $lines(textfile.txt)
it wont work any ideas
heres the code:
-----------------------------------------------------------------------------------------------------------
on *:chat:example: {
if ($example1 == 0)
{
msg =$nick No Lines To Display
goto end
}
if ($example1 < 2)
{
msg =$nick There Is Only 1 example
var %read = $read(example.txt, 1)
tokenize 1 %read
msg =$nick Nick: $1 Address: $2 message: $3-
}
if ($example1 >= 2)
{
msg = $nick There Are $example1 lines
showallexample $nick
}
:end
}
alias example1 {
var %lines = $lines(example.txt)
return %lines
}
alias showallexample {
var %examplename = $1
var %exampletotal = $lines(example.txt)
var %examplenumber = 0
:regroup
if (%examplenumber >= %exampletotal)
{
msg =%examplename ---- example List End ----
goto end
}
inc %examplenumber 1
var %read = $read(example.txt, %examplenumber)
tokenize 1 %read
msg =%examplename line: %examplenumber Nick: $1 Address: $2 message: $3-
goto regroup
:end
}
-------------------------------------------------------------------------------------------------------------
this isnt the same as my script cuz it was hard to explain
but this is what i want
please help me
thanks alot