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.

addition 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:

addition to this script

Post by Moose »

I have a request script but i cant make it put mode +m on when someone types !request <#channe> <botnick> here is the request script. could you please show me where it should go and what the part of the script is i think it is 'pushmode $channel +m' if that is right i dont know where to put it.

setudef flag requested

bind pub -|- !request botrequest
bind pub o|o !request-rules botrequestrules
bind pub o|o !request-format botrequestformat
bind pub o|o !request-website botrequestwebsite

proc botrequestwebsite {nick host handle channel arg} {
putserv "NOTICE $nick :You can also request bots from the website, it is slightly slower but you can allways request there even if the status in the channel is offline. The website address is http://www.sdweb.co.uk."
}

proc botrequestformat {nick host handle channel arg} {
putserv "NOTICE $nick :Please type '!request <#channel> <botnick>' to request a bot."
}

proc botrequestrules {nick host handle channel arg} {
set line [split $arg @]
set line1 [lindex $line 0]
set line2 [lindex $line 1]
set line3 [lindex $line 3]
set line4 [lindex $line 4]
putserv "NOTICE $nick :Here are the rules: $line1"
putserv "NOTICE $nick :Do not request flood the bot. $line2"
putserv "NOTICE $nick :Do not try to request more than one bot. $line3"
putserv "NOTICE $nick :Do not try to request when you have a bot in your channel already. $line4"
}

# 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]]
puthelp "NOTICE $nick :Your request is being handled"
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 10 [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]"[/code]
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

in your botrequest proc:
proc botrequest { nick address handle chan text } {
set channel [join [lindex [split $text] 0]]
set bot [join [lindex [split $text] 1]]
[snip]
I don't know from where u got this join command, or why u add it.
anywaym it should be:

Code: Select all

proc botrequest { nick address handle chan text } { 
set channel "[lindex [split $text] 0] "
set bot "[lindex [split $text] 1] "
#...
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

it does not seem to work when i do that
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

any ideas on how to do the mode +m in the script
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

pushmode $chan +m
putserv "MODE $chan +m"
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

thx
Locked