Request Script Error

Paste Your code(s) here, and state your problem.

Request Script Error

Postby chaps » Sat Nov 07, 2009 8:24 pm

Hey!

I have a problem with this script

Ok i put one botnick set botnicks "here"

But when i try to !request bot to channel i got error on dcc chat

[22:23] Tcl error [pub:request]: can't read "botnicks":
no such variable

What is wrong ?

Code: Select all
# BotRequest by popdog <Humpert.Ben@T-Online.de>, #Q-Control @ QuakeNet
# version 1.3 for eggdrop 1.5.x & 1.6.x
# 05-Nov-2001
# If you have suggestions -> #Q-Control @ QuakeNet

# some settings

set botnicks "botnick1 botnick2 botnick3"
# Enter every bots nickanme which is free for requesting.
set waittime "604800"
# Enter time in seconds the user have to wait before he can request again. (default "604800" = 1 week)
set receiver "$owner"
# Enter handle (or use $owner if the bot-owner shout receive it) of added user which should receive the request. If note should send to an user on another bot use handle@botname. (default "$owner")
# more users can be added if you remove the "#" in front of the line below


# YOU SHOULDN'T EDIT ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING !!

bind pub -|- !request pub:request

proc pub:request {nick uhost handle chan text} {
  set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
  set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
  set userhost *!*$userm@$ipmask
  set requestbot [lindex [split $text " "] 0]
  set channel [lindex [split $text " "] 1]
  set homepage [lindex [split $text " "] 2]
  if {[matchattr $handle +R]} {
    putserv "NOTICE $nick :Request not send."
    putserv "NOTICE $nick :You already requested a bot in the last 7 days!"
    putserv "NOTICE $nick :You have to wait more than 7 days after a successful Request."
    } else {
    if {$requestbot == ""} {
      putserv "NOTICE $nick :Wrong !request-format."
      putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
      putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
      } else {
      if {$channel == ""} {
        putserv "NOTICE $nick :Wrong !request-format."
        putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
        putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
        } else {
        if {[string first "#" $channel] == -1} {
          putserv "NOTICE $nick :Wrong !request-format."
          putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
          putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
          } else {
          if {[string first "http://" $homepage] == -1} {
            putserv "NOTICE $nick :Wrong !request-format."
            putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
            putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
            } else {
            if {[string first $requestbot $botnicks] != -1} {
              if {$channel != ""} {
                if {$homepage != ""} {
                  sendnote BotRequest $receiver "$nick want's $requestbot in $channel. His HP is $homepage."
#                  sendnote BotRequest user1 "$nick want's $requestbot in $channel. His HP is $homepage."
#                  sendnote BotRequest user2 "$nick want's $requestbot in $channel. His HP is $homepage."
                  adduser $nick $userhost
                  chattr $nick +R|
                  utimer $waittime "chattr $nick -R|"
                  putserv "NOTICE $nick :Request send."
                  } else {
                  putserv "NOTICE $nick :Wrong !request-format."
                  putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
                  putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
                }
              }
              } else {
              putserv "NOTICE $nick :You typed a wrong bot-nick. Known bot-nick's are:"
              putserv "NOTICE $nick :$botnicks"
            }
          }
        }
      }
    }
  }
}

putlog "BotRequest v1.3 by popdog loaded."
chaps
 

Re: Request Script Error

Postby fraguk » Sat Nov 07, 2009 8:47 pm

I have used this before, and i had the same error, but lucky for you i fix it ;)

change this...

# YOU SHOULDN'T EDIT ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING !!

bind pub -|- !request pub:request

to this ....

# YOU SHOULDN'T EDIT ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING !!

bind pub -|- !request pub:request

proc pub:request {nick uhost handle chan text} {
global botnicks
global receiver
global waittime
fraguk
 

Re: Request Script Error

Postby chaps » Sat Nov 07, 2009 9:06 pm

Sorry it didnt work

Bot was killed

[23:05] missing close-brace
while executing
"proc pub:request {nick uhost handle chan text} {
global botnicks
global receiver
global waittime

proc pub:request {nick uhost handle chan text} {
s..."
(file "scripts/request.tcl" line 21)
invoked from within
"source scripts/request.tcl"
(file "eggdrop.conf" line 1301)
[23:05] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
chaps
 

Re: Request Script Error

Postby fraguk » Sat Nov 07, 2009 9:28 pm

FragUK !request FBAnna

FBAnna: Request not send.
FBAnna: You already requested a bot in the last 10 minuites!
FBAnna: You have to wait more than 10 minuites after a successful Request.
fraguk
 

Re: Request Script Error

Postby fraguk » Sat Nov 07, 2009 9:47 pm

Code: Select all
 BotRequest by popdog <Humpert.Ben@T-Online.de>, #Q-Control @ QuakeNet
# version 1.3 for eggdrop 1.5.x & 1.6.x
# 05-Nov-2001
# If you have suggestions -> #Q-Control @ QuakeNet

# some settings

set botnicks "botnick1 botnick2 botnick3"
# Enter every bots nickanme which is free for requesting.
set waittime "604800"
# Enter time in seconds the user have to wait before he can request again. (default "604800" = 1 week)
set receiver "$owner"
# Enter handle (or use $owner if the bot-owner shout receive it) of added user which should receive the request. If note should send to an user on another bot use handle@botname. (default "$owner")
# more users can be added if you remove the "#" in front of the line below


# YOU SHOULDN'T EDIT ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING !!

bind pub -|- !request pub:request

proc pub:request {nick uhost handle chan text} {
global botnicks
global receiver
global waittime

  set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
  set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
  set userhost *!*$userm@$ipmask
  set requestbot [lindex [split $text " "] 0]
  set channel [lindex [split $text " "] 1]
  set homepage [lindex [split $text " "] 2]
  if {[matchattr $handle +R]} {
    putserv "NOTICE $nick :Request not send."
    putserv "NOTICE $nick :You already requested a bot in the last 7 days!"
    putserv "NOTICE $nick :You have to wait more than 7 days after a successful Request."
    } else {
    if {$requestbot == ""} {
      putserv "NOTICE $nick :Wrong !request-format."
      putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
      putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
      } else {
      if {$channel == ""} {
        putserv "NOTICE $nick :Wrong !request-format."
        putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
        putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
        } else {
        if {[string first "#" $channel] == -1} {
          putserv "NOTICE $nick :Wrong !request-format."
          putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
          putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
          } else {
          if {[string first "http://" $homepage] == -1} {
            putserv "NOTICE $nick :Wrong !request-format."
            putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
            putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
            } else {
            if {[string first $requestbot $botnicks] != -1} {
              if {$channel != ""} {
                if {$homepage != ""} {
                  sendnote BotRequest $receiver "$nick want's $requestbot in $channel. His HP is $homepage."
#                  sendnote BotRequest user1 "$nick want's $requestbot in $channel. His HP is $homepage."
#                  sendnote BotRequest user2 "$nick want's $requestbot in $channel. His HP is $homepage."
                  adduser $nick $userhost
                  chattr $nick +R|
                  utimer $waittime "chattr $nick -R|"
                  putserv "NOTICE $nick :Request send."
                  } else {
                  putserv "NOTICE $nick :Wrong !request-format."
                  putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel http://www.home.page"
                  putserv "NOTICE $nick :You also need a working homepage and 2 or more Members opped in the requested channel."
                }
              }
              } else {
              putserv "NOTICE $nick :You typed a wrong bot-nick. Known bot-nick's are:"
              putserv "NOTICE $nick :$botnicks"
            }
          }
        }
      }
    }
  }
}

putlog "BotRequest v1.3 by popdog loaded."
fraguk
 

Re: Request Script Error

Postby chaps » Sat Nov 07, 2009 9:59 pm

Still problems but il try another script
chaps
 

Re: Request Script Error

Postby r0t3n » Sat Nov 14, 2009 2:36 am

Code: Select all
set botnicks "[list botnick1 botnick2 botnick3 etc etc]"


and all those global's can be on one line..

Code: Select all
global botnicks receiver waittime
r0t3n
 


Return to TCL Scripting Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron