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.

Add things to this script

Old posts that have not been replied to for several years.
Locked
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Add things to this script

Post by Moose »

here is the request script i was made. what i want to do is add a peice of script to this to make the bot send a message to the channel where the bot service is saying Request being handled.

Can anyone help with that

here is the script.



# This file is loaded on the request bot

setudef flag requested

bind pub -|- !request botrequest

# Replace botname/botname2/botname3 with names of bots
# You can have as many as needed.
# Put the bot name in lowercase (no caps).
set requestable(|logical|) 1
set requestable(|icute|) 1
set requestable(|exode|) 1

set requestor(null) 0

set rbots(null) 0

proc botrequest { nick address handle chan text } {
set channel [join [lindex [split $text] 0]]
set bot [join [lindex [split $text] 1]]
global requestable
if { ![info exists requestable([string tolower $bot])] } {
puthelp "NOTICE $nick :Sorry, that isn't requestable."
return
}
if { [validchan $channel] } {
puthelp "NOTICE $nick :Sorry, I already seem to be on that channel."
return
}
channel add $channel
channel set $channel +requested
global requestor
global rbots
set requestor([string tolower $channel]) $nick
set rbots([string tolower $channel]) $bot
}

bind join -|- * botjoin3

proc botjoin3 { bnick address handle channel } {
global nick
if { [string tolower $bnick] == [string tolower $nick] } {
if { [channel get $channel requested] } {
utimer 5 [list checkjoin $channel]
channel set $channel -requested
}
}
}

proc checkjoin { channel } {
global requestor
set request $requestor([string tolower $channel])
if { ![isop $request $channel] } {
channel remove $channel
puthelp "NOTICE $request :Leaving channel $channel - requestor not opped"
return
}
set list [chanlist $channel]
set length [llength [split $list]]
if { $length < 5 } {
channel remove $channel
puthelp "NOTICE $request :You must have more than 5 people in the channel to request a bot."
return
}
global rbots
botjoin $rbots([string tolower $channel]) $channel
channel remove $channel
}

proc botjoin { bot channel } {
set code "blah"; append code [string tolower $channel]; putserv "PRIVMSG $bot :join $channel [md5 $code]"
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

putserv "PRIVMSG $channel :Request being handled." ($channel depends on the channel's arg"

where exactly do u want it to do that ?
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

its ok now ive done it
Locked