egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Script request

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
martpen69
Voice


Joined: 20 Jun 2005
Posts: 32

PostPosted: Sun Apr 16, 2006 8:23 pm    Post subject: Script request Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Apr 16, 2006 8:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
martpen69
Voice


Joined: 20 Jun 2005
Posts: 32

PostPosted: Sun Apr 16, 2006 9:11 pm    Post subject: Sorry Reply with quote

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.

Very Happy
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Apr 17, 2006 4:27 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
CrazyEgg
Halfop


Joined: 28 Jul 2005
Posts: 47

PostPosted: Mon Apr 17, 2006 11:12 am    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Apr 17, 2006 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Apr 17, 2006 8:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber