This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How to do a variable for 9 lines ?

Old posts that have not been replied to for several years.
Locked
S
S0nnY
Voice
Posts: 8
Joined: Tue Sep 07, 2004 9:52 am
Location: Germany

How to do a variable for 9 lines ?

Post by S0nnY »

Hi i have 9 lines i need in 8 procs, how to add these lines in one variable ?

thx
S0nnY
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

save as global string, list or array, depending how you need them ^-^. There are almost no limits ;). if you tell us more details we might be able to recommned you one these 3 methodes ^-^.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
S
S0nnY
Voice
Posts: 8
Joined: Tue Sep 07, 2004 9:52 am
Location: Germany

Post by S0nnY »

for example

i have some procs where i need these 7 lines
"
line1
line2
line3
line4
line5
line6
line7
"
but i don't want to write everyone in every proc
i want do have
putserv "PRIVMSG $chan : $var"
and my bot will post these 7 lines one after the other one just like
putserv "PRIVMSG $chan :line1"
putserv "PRIVMSG $chan :line2"
...and so on
how it is possible ?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

probably an array is easiest then.

Code: Select all

set mylines(1) "bla..."
...
set mylines(7) "bla..."
...
proc ...
   for {set i 1} {$i <= 7} {incr i} {
      puthelp "PRIVMSG $chan :$::mylines($i)"
   }
dont forget to adjust '$i <= 7' if you change the number of lines, you can even set something like:
set mylines(count) 7
and check via:
$i <= $::mylines(count)
however, if the number changes often you should consider using a list ;).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked