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.

bot request script!

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

bot request script!

Post by smash »

Code: Select all

set botnicks "RailJunkie RailQuizz"

set waittime "604800"
 
set receiver "$owner"


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 "bla bla bla"
all works ok till you try the full request.

IE !request RailJunkie #mychan http://www.myhomepage.com
i get this error,
RailJunkie Tcl error [pub:request]: can't read "botnicks": no such variable
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Fix your post using code tags.

botnicks is not declared within the proc.

Code: Select all

global botnicks
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

Post by smash »

thanks for your reply, could you show ehere in the proc >? it should go
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

Post by smash »

here's the full script, not made by me i may add.

i would like to get this script workin OR if any 1 knows of a bot request script that work's ..? also i realy dont think the homepage bit is needed.

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

Post by Alchera »

Can't read? I asked that you used code tags. Your two posts are almost impossible to decipher.

Code: Select all

proc pub:request {nick uhost handle chan text} {
    global botnicks
    ....................
{
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

*off topic*
smash : I've fixed your posts twice. Don't let this happen one more time cos you will find your entire thread sent to 'Junk Yard' section pronto. Please at least read Help us to help you if not Things to do before posting.. threads.
Once the game is over, the king and the pawn go back in the same box.
Post Reply