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.

if command not working

Old posts that have not been replied to for several years.
Locked
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

if command not working

Post by TurboChicken »

Code: Select all

   set est [format %.2f $estPerMonth]
   if {$est < 800.00} {
     putserv "PRIVMSG $c :\002IN BW:\002  $in GB >>>>>> \002OUT BW:\002  $out GB >>>>>> \002TOTAL:\002  $tot GB >>>>>> \002ESTIMATED:\002 \0039 $est\003 GB"
   }
   else {
     putserv "PRIVMSG $c :\002IN BW:\002  $in GB >>>>>> \002OUT BW:\002  $out GB >>>>>> \002TOTAL:\002  $tot GB >>>>>> \002ESTIMATED:\002 \0034 $est\003 GB"
   }
if the value of $est is more than 800.00 it doesn't do anything.

it works fine for though that are below.

have missed something in the syntax?

P.s. the putserv's are on 1 line in the code
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

   set est [format %.2f $estPerMonth]
   if {$est < 800.00} {
     putserv "PRIVMSG $c :\002IN BW:\002  $in GB >>>>>> \002OUT BW:\002  $out GB >>>>>> \002TOTAL:\002  $tot GB >>>>>> \002ESTIMATED:\002 \0039 $est\003 GB"
   }
   if {$est > 800.00} {
     putserv "PRIVMSG $c :\002IN BW:\002  $in GB >>>>>> \002OUT BW:\002  $out GB >>>>>> \002TOTAL:\002  $tot GB >>>>>> \002ESTIMATED:\002 \0034 $est\003 GB"
   }
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

that is really weird now.... it's not coming out with any colour at all....

on either one....

but both instances should have colour on them.... that is really weird
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

weird chanmodes

who'd have thought that +S strips colours

+S is usually SSL connections only is what i thought

but it worked thanx anyway
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Just use normal mIRC character color codes with tcl they work fine as well, you don't need to use \002 for bold, when you can just simply use the characters which are represented by a box. Sorry this html forum doesn't support characters like that so I am unable to paste them over here.

And same goes for the rest.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

awyeah wrote:Just use normal mIRC character color codes with tcl they work fine as well, you don't need to use \002 for bold, when you can just simply use the characters which are represented by a box. Sorry this html forum doesn't support characters like that so I am unable to paste them over here.

And same goes for the rest.
+S is color stripping on most networks, so that was the issue, nothing else.

btw... no copy&paste of control characters? I wonder whats this:

Code: Select all

bold 4red
I tried reverse paste and the codes work so there are correctly displayed from forum side. If they aren't on your browser its simply your browsers fault, not the forums ;).

to the main issue... your fault was to write:
}
else {
you MUST write:
} else {
I am sure you got a TCL error about else not beeing recognized. If you didn't see it, type ".set errorInfo" after running it again to verify.
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...
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

and there's no point in encouraging people to use mirc codes, using the proper codes for color/bold/whatever is always better.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

If they work, theres no point. And they especially make life more easier working with colors. For 8-10 codes for just one color you can do just that will simple mIRC control codes.

I have seen scripts regsub control codes and outputting \002 and other chars, heh.

As for:

}
else {

&

} else {

They really don't make a difference.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

awyeah wrote: As for:

}
else {

&

} else {

They really don't make a difference.
Actually they do, if else is on a new line it will be considered a command (which is an invalid one). Besides, else should do the job fine instead of using "if" twice.
Locked