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.

matching problem

Old posts that have not been replied to for several years.
Locked
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

matching problem

Post by netux »

hi, i'm having trouble understanding the matching for more that 3 items with this code:

Code: Select all

} elseif {($sn == "language" && $ss != "en")||($sn == "language" && $ss != "pt")} {
this doesn't work and i can't see what's wrong with it
if i change to:

Code: Select all

} elseif {($sn == "language" && $ss != "en")} {
it works fine but i need to match other $ss can someone help me with this?
i have tryed many variants and still cant get it to work

thanks in advanced
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

if {($sn == "language") && ($ss != "en") && ($ss != "pt")} {
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

thanks qb.
can you explain what was wrong pls?
i only notice the change of || (or) to && (and) majoraty but i must be wrong.
thanks again.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

I just surrounded each check with parentheses.
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

lol i need some sleep badly
i re-read one of the tutorials and the person who made it highligths that, stranges things could appent if not use them, he said.
gess he was wrigth so do you :D
i got another small and so easy (its almost 6AM and i havent found it), i can't remember the code for this situation

Code: Select all

 puthelp "PRIVMSG $nick :line 1 $fcode line 2 $fcode line 3" 
well i need to know the code that replacing $fcode will output:
<botnick>line 1
<botnick>line 2
<botnick>line 3
tks to the one who can help me.
im going to bad.
enof of searching and reading for today, or just going to wait till my wife wake up and make a nice breakfast.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Use this:

Code: Select all

 puthelp "PRIVMSG $nick :line 1"
 puthelp "PRIVMSG $nick :line 2"
 puthelp "PRIVMSG $nick :line 3"
Or maybe, this might do it: :mrgreen:

Code: Select all

 puthelp "PRIVMSG $nick :line 1\n line 2\n line 3"
=
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

i tryed it with \n and it didnt work, but i think it's wrigth.
maybe it's because im testing the code in windrop from local pc.
tks anyway
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

If 'puthelp' accepted multiple lines, the right answer would be "\nPRIVMSG $nick :", but it doesn't so you have to call it multiple times.
Have you ever read "The Manual"?
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

user wrote:If 'puthelp' accepted multiple lines, the right answer would be "\nPRIVMSG $nick :", but it doesn't so you have to call it multiple times.
does putserv or other similar do? if so can you tell me what is it.
tks
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

'putdccraw' would handle it, but why don't you just split the data and loop through the lines?

Code: Select all

foreach line [split $crap \n] {puthelp $line}
Have you ever read "The Manual"?
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

user wrote:'putdccraw' would handle it, but why don't you just split the data and loop through the lines?

Code: Select all

foreach line [split $crap \n] {puthelp $line}
looks a lot better now ;]
thanks user
Locked