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!

Old posts that have not been replied to for several years.
Locked
D
Diablo
Voice
Posts: 12
Joined: Mon May 02, 2005 6:24 am

Bot request script!

Post by Diablo »

Hello!

if anybody know sicherheit @ qnet, then you know bots can be requested.

i am wondering if there is script when user msg bot with /msg <botnick> request #channel , then this <botnick> joins that channel and checks if there is enought user on it, if it is ok then some random bot join that chan.
does anybody know that script?

LP
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

And how does your bot communicate with the other rand bots ?
D
Dizzle
Op
Posts: 109
Joined: Thu Apr 28, 2005 11:21 am
Contact:

Post by Dizzle »

Wel i have this script for you, a friend of mine made it for me a long time ago

Modify it like you want, now its checking for op's L/Q on chan (Q-net) and number of users on channel

Its not sending an random bot, the bind is like this !request <botname> #channel modify the script at your desires

have fun with it

Code: Select all


set tbotnick "botname"

bind pub -|- !request pub:request

proc pub:request {n u h c t} {
  global tbotnick
  global bot
  set bot [lindex [split $t " "] 0]
  set ::nickk $n
  set ipmask [lindex [split [maskhost $n![getchanhost $n $c]] "@"] 1]
  set userm [lindex [split [getchanhost $n $c] "@"] 0]
  set ::userhost *!*$userm@$ipmask
  set ::channel [lindex [split $t " "] 1]
  if {$bot != $tbotnick} { return 0 }
  if {$c != "#pcw.be.priv"} { return 0 }
  if {$::channel == "#help" || $::channel == "#feds" || $::channel == "#0,0" || $::channel == "#quakenet" || $::channel == "#scripting" || $::channel == "#tcl" } { return 0 }
  if {$::channel == ""} {
        putserv "NOTICE $n :Wrong !request-format."
        putserv "NOTICE $n :To request use: 4!request botname #channel"
  } else {
          if {[string first "#" $::channel] == -1} {
          putserv "NOTICE $n :Wrong !request-format."
          putserv "NOTICE $n :To request use: 4!request botname #channel"
  } else {
    if {$::channel != ""} {
          set chan $::channel
          global check; global uhost
          channel add $::channel
          set uhost(chans) $u
          set check(chans) $n
          putserv "NOTICE $n :Request sent. Checking if the channel meets our Requirements, please wait..."
          utimer 15 check
     } else {
          putserv "NOTICE $n :Wrong !request-format."
          putserv "NOTICE $n :To request use: 4!request botname #channel"
            }
     }
  }
}

proc check { } {
global bot
global check
global uhost
putlog "check chans is $check(chans) and channel is $::channel"
   if {![isop $check(chans) $::channel]} {
      putlog "Yea, its sayin ure not opped.. [censored]"
      putquick "privmsg $::channel : $::nickk is not opped on $::channel!" -next
      utimer 5 remove_chan
   } else {
     set userz 0
     set limit 0
     set service 0
     foreach nickname [chanlist $::channel] {
        if { $nickname == "Q" || $nickname == "L" } { set service 1 }
           if { $userz < 20 } {
              incr userz
           } else { set limit 1 }
     }
   
     if { $limit > 0 && $service > 0 } {
         putquick "privmsg $::channel :User $::nickk Youre channel met the requirements, The bot will join in a second. Thank you for using out services"
     } else {
      if { $limit < 1 || $service < 1 } {
        set rando 1
        putlog "Channel $::channel removed for none complience"
        putquick "privmsg $::channel :Bot will not stay reason \( 20 users \[ $limit \]\) or \( L or Q \[ $service \]\)" -next
        utimer 5 remove_chan
      }
    }
   }
 }
 
 proc remove_chan { } {
 channel remove $::channel
 }

D
Diablo
Voice
Posts: 12
Joined: Mon May 02, 2005 6:24 am

Post by Diablo »

Sir_Fz wrote:And how does your bot communicate with the other rand bots ?
they are linked..
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

I've seen this script before and it's crappy as hell.
If someone were to request a bot to #FEDS or #HELP in caps, the bot would still join.

I wrote a small request script awhile back for someone that wanted it, i'll go see if i can find it
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Here is the script i was talking about, I have NO idea if it even works but try it out.

Code: Select all

# Configuration

# homechannel where they can request
set setting(home) "#v1per"
# users the channel needs atleast
set setting(needed) "20"
# deny request if there is no Q or L?
set setting(service) "1"
# the flags he wants
set setting(flags) "+ao"

# end of config

# don't touch this setting!
set setting(busy) 0

bind pub -|- !request    request:pub

proc request:pub {nick host hand chan arg} {
  global setting
  # ignore the request because it isn't the request channel
  if {![string equal $chan $setting(home)]} {
   return 0
  }
  if {$setting(busy)} {
   putquick "NOTICE $nick :There is currently already an request in progress."
   return 0
  }
  set channel [lindex [split $arg] 0]
  # tell him he needs to input a channel first
  if {$channel == ""} {
   putquick "NOTICE $nick :Please state the channel you wish to request for."
   return 0
  }
  if {[validchan $channel]} {
   return 0;
  }
  # activate the busy signal so no other requests can be done
  bind RAW -|- 315         request:endofwho
  set setting(busy) 1
  set setting(chan) "$channel"
  set setting(nick) "$nick"
  channel add $channel
}
  
proc request:endofwho {from key arg} {
   global setting
   if {$setting(busy)} {
    if {![onchan $setting(nick) $setting(chan)] || ![isop $setting(nick) $setting(chan)]} {
     set setting(busy) 0
     putquick "NOTICE $setting(nick) :You aren't on $setting(chan) or you're not opped. Request denied."
     channel remove $setting(chan)
     unbind RAW -|- 315         request:endofwho
     return 0
    }
   if {$setting(service)} {
    if {![onchan L $setting(chan)] && ![onchan Q $setting(chan)]} {
     set setting(busy) 0
     putquick "NOTICE $setting(nick) :Q or L was not found on $setting(chan). Request denied."
     channel remove $setting(chan)
     unbind RAW -|- 315         request:endofwho
     return 0
    }
   }
   if {[llength [chanlist $setting(chan)]] < $setting(needed)} {
     set setting(busy) 0
     putquick "NOTICE $setting(nick) :$setting(chan) has less than $setting(needed) users. Request denied."
     channel remove $setting(chan)
     unbind RAW -|- 315         request:endofwho
     return 0
   }
 if {![validuser [nick2hand $setting(nick)]]} {
  adduser $setting(nick) *!*@[lindex [split [getchanhost $setting(nick) $setting(chan)] @] 1]
 } 
  chattr [nick2hand $setting(nick)] |+n $setting(chan)
  putquick "NOTICE $setting(nick) :The request was succesfull. I will stay here. Please give me $setting(flags) on [request:service $setting(chan)]"
  putquick "PRIVMSG $setting(home) :$setting(nick) requested me for $setting(chan). The channel has [llength [chanlist $setting(chan)]] users. And they have the service bot: [request:service $setting(chan)]. Request was accepted."
  unset setting(chan); unset setting(nick)
  set setting(busy) 0
  unbind RAW -|- 315         request:endofwho
  return 1
  }
}

proc request:service {channel} {
  if {[onchan L $channel]} {
    return "L"
  } elseif {[onchan Q $channel]} {
    return "Q"
  }
}
If you need help with it, my nickname on Quakenet is metroid and you can find me in #v1per or #development
Locked