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.

whats wrong on my !onair trigger..

Old posts that have not been replied to for several years.
Locked
l
loze

Post by loze »

Code: Select all

...
                        regsub -all "</SONGTITLE>" $line "" line
                        set onairlat $line"
                }
        }
        close $sock
}


bind pub -|- !onair pub:onairdisplay

proc pub:onairdisplay {nick uhand handle chan input} {
        putserv "PRIVMSG $chan : Just nu sänder $onairdj med låten $onairlat"
}
I dont know what to do. It's something wrong on the $onair* variabels, Do i need the global... or what.. please help a tcl noob :wink:
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

yes, you need to global the var. actually calling the proc that updates that variable from the bind proc would help too
l
loze

Post by loze »

Code: Select all

proc pub:onairdisplay {nick uhand handle chan input} {
        global onairdj onairlat
        putserv "PRIVMSG $chan : Just nu sänder $onairdj med låten $onairlat"
}
Doesn't work.. I have a timer thats update the variables every 10 seconds.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Besides using the global command in the proc where the var will be used, it is also needed in the proc that read it into the var (IE, the proc at the top of you post, where you can't see the top).

Note, you may want to consider removing the update timer, and move to updating only when the trigger is called. Allthough this would only be effective, if the trigger is used less than every 10 seconds.
l
loze

Post by loze »

thanks for the help..
Locked