| View previous topic :: View next topic |
| Author |
Message |
martpen69 Voice
Joined: 20 Jun 2005 Posts: 32
|
Posted: Sun Apr 16, 2006 8:23 pm Post subject: Script request |
|
|
Oper bot to ctcp version people when they join my channel and to +v them if they reply with a certain version.
I found some scripts which ive taken bits from and tried to put them together.
Not sure if this is correct.
| Code: |
bind ctcr - VERSION version:reply
bind join - * check:version
proc check:version {nick uhost hand chan} {
global cversion
set cversion([string tolower $nick]) 1
putserv "privmsg $nick :\001VERSION\001"
}
proc version:reply {nick uhost hand dest kw arg} {
global cversion
if {[isbotnick $dest] && [info exists cversion([string tolower $nick])]} {
if {[string match -nocase "*version here*" $arg]} {
{ pushmode $vchan +v $user }
unset cversion([string tolower $nick])
}
}
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Apr 16, 2006 8:36 pm Post subject: |
|
|
You're supposed to test it, not ask us if it works. Anyways
| Code: | | { pushmode $vchan +v $user } |
should be just
| Code: | | pushmode $vchan +v $user |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
martpen69 Voice
Joined: 20 Jun 2005 Posts: 32
|
Posted: Sun Apr 16, 2006 9:11 pm Post subject: Sorry |
|
|
I didnt know how to set the $vchan variable so i did this.
| Code: |
bind ctcr - VERSION version:reply
bind join - * check:version
proc check:version {nick uhost hand chan} {
global cversion
set cversion([string tolower $nick]) 1
putserv "privmsg $nick :\001VERSION\001"
}
proc version:reply {nick uhost hand dest kw arg} {
global cversion
if {[isbotnick $dest] && [info exists cversion([string tolower $nick])]} {
if {[string match -nocase "*mirc*" $arg]} {
pushmode #mychannel +v $nick
unset cversion([string tolower $nick])
}
}
}
|
Probably lame by your standards but it does the job.
Thanks again for the help.
 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Apr 17, 2006 4:27 am Post subject: |
|
|
| Code: | bind ctcr - VERSION version:reply
bind join - * check:version
proc check:version {nick uhost hand chan} {
global cversion
set cversion([string tolower $nick]) $chan
putserv "privmsg $nick :\001VERSION\001"
}
proc version:reply {nick uhost hand dest kw arg} {
global cversion
if {[isbotnick $dest] && [info exists cversion([set nick [string tolower $nick]])]} {
if {[string match -nocase "*mirc*" $arg]} {
pushmode $cversion($nick) +v $$nick
}
unset cversion($nick)
}
} |
this will work on all chans. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
CrazyEgg Halfop
Joined: 28 Jul 2005 Posts: 47
|
Posted: Mon Apr 17, 2006 11:12 am Post subject: |
|
|
if the bot is at least voice then change
privmsg with CPRIVMSG
to prevent msg "target change too fast wait for xxx sec" |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Apr 17, 2006 12:00 pm Post subject: |
|
|
CPRIVMSG? What is that? Must be a server side feature, right? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Apr 17, 2006 8:56 pm Post subject: |
|
|
| Quote: | 4.7 CPRIVMSG
CPRIVMSG
The CPRIVMSG parameter indicates that the server supports the
"CPRIVMSG" command. An extension for the PRIVMSG command, as defined
in RFC 1459 [2] section 4.4.1, it allows users with a specific status
in a channel to issue a PRIVMSG command to a user within that
channel, free of certain restrictions a server MAY apply to PRIVMSG.
The CPRIVMSG parameter MUST NOT be specified with a value. |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|