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.

variable problem [Solved]

Old posts that have not been replied to for several years.
Locked
s
sparta
Voice
Posts: 15
Joined: Sun Feb 27, 2005 10:02 am

variable problem [Solved]

Post by sparta »

I have this code:

Code: Select all

bind dcc n bchan sbch

proc sbch {channels i bc} {
 global sbch
 set sbch $bc
 putlog "S-Bitch channel(s) set to: $bc"
}
Now the problem is that it wont set the var sbch as $bc .. i have been asking in some channels.. and people tell me that it should work, but dosent. so anyone here that can help me?

this is what i want it to do, when i type ".myword #channel", then i want it to set var "sbch #channel" .. i dont get a error or anything, but it wont set the var.. how ever if i add in the tcl "set sbch #channel", then it add the var without any problem, but i want to be able to change the channel(s) true partyline, the reason for this is that i working on a extra-bitch TCL, and i want to be able to turn bitch on/off on channels.. and the bitchy will only happen on the channel or channels that are in that var. now when i try set the var true DCC i get this:

« MyNick » .bchan #channel
« BotNick » [15:07] S-Bitch channel(s) set to: #channel

And everything looks ok, now when i op somone that should be deoped i get this:

« BotNick » [15:07] S-Bitch channel(s) set to: #channel
« BotNick » [15:07] #channel: mode change '+o nick' by nick2!ident@host
« BotNick » [15:07] Tcl error [sbitch]: can't read "sbch": no such variable

so it say it set the variable, and i get no errors while set it, but when i want to call it its not there.. :? :(
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Try changing your var name to something different as at the moment its the same as your proc name.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

sparta wrote:so it say it set the variable, and i get no errors while set it, but when i want to call it its not there.. :? :(
The error is in the code trying to read the variable. Or some other proc unsetting it.
^DooM^ wrote:Try changing your var name to something different as at the moment its the same as your proc name.
That's not a problem.
Have you ever read "The Manual"?
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

I wasnt sure if that was a problem was just an attempt to eliminate all the easy solutions first then move onto the harder ones.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Plus I don't think you would need to set it global, if you don't use this variable in any other proc. Because using it as a local within the proc would also reduce and minimize the number of errors.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
s
sparta
Voice
Posts: 15
Joined: Sun Feb 27, 2005 10:02 am

Post by sparta »

I solved the problem with:

Code: Select all

proc set:sbch {nickc hand text} {
 global channels 
 set channels "$text"
 putlog "S-Bitch channel set to: $channels"
}
:roll:
Locked