| View previous topic :: View next topic |
| Author |
Message |
stephers Voice
Joined: 18 Jan 2011 Posts: 1
|
Posted: Tue Jan 18, 2011 1:13 am Post subject: Repeating proc help |
|
|
| Code: |
bind pub - !spam pub:!spam
proc pub:!spam {nick host handle chan text} {
if {[ishalfop $nick $chan] == 1 || [isop $nick $chan] == 1} {
#Set the channel to advertise on
set channame "#sa"
#Set your advertising message
set advertmsg "it works"
timer 1 msg:chan
proc msg:chan {} {
global channame advertmsg
puthelp "PRIVMSG $channame :$advertmsg"
timer 1 msg:chan
}
} else {
puthelp "PRIVMSG $chan :BEEP"
}
}
|
First timer goes off and then I receive this,
Error received: Cannot find channame variable. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Jan 18, 2011 11:04 am Post subject: Re: Repeating proc help |
|
|
channame exists only inside proc pub:!spam.
Add it as a global variable, in proc pub:!spam
| Code: |
proc pub:!spam {nick host handle chan text} {
global channame
..
...
|
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Jan 18, 2011 11:52 am Post subject: |
|
|
Move the msg:chan proc and
| Code: |
#Set the channel to advertise on
set channame "#sa"
#Set your advertising message
set advertmsg "it works"
|
outside the pub:!spam proc and should work. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|