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.

Script request

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
martpen69
Voice
Posts: 32
Joined: Mon Jun 20, 2005 3:56 pm

Script request

Post by martpen69 »

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: Select all

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]) 
  } 
 } 
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You're supposed to test it, not ask us if it works. Anyways

Code: Select all

{ pushmode $vchan +v $user }
should be just

Code: Select all

pushmode $vchan +v $user
m
martpen69
Voice
Posts: 32
Joined: Mon Jun 20, 2005 3:56 pm

Sorry

Post by martpen69 »

I didnt know how to set the $vchan variable so i did this.

Code: Select all

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.

:D
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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.
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

if the bot is at least voice then change

privmsg with CPRIVMSG

to prevent msg "target change too fast wait for xxx sec"
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
Post Reply