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.

request.tcl script need help...!

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
O
Owner^
Voice
Posts: 3
Joined: Wed Dec 07, 2005 2:51 pm

request.tcl script need help...!

Post by Owner^ »

Code: Select all

namespace eval request { 
# copyright info, dont change these variables, or make your own request script 
variable author "Tosser" 
variable version "1.0.0.0" 
# what trigger would you like, for example !request 
variable trigger "\?request" 
# this is where you set the requirements 
# do you need a network/channel service, for example the Q/L bot on quakenet [1=yes/0=no] 
variable service "1" 
# how many users are needed 
variable needed "30" 
# set here the flags the bot needs on Q/L if variable service is set to 1 
variable flags "ao" 
### please note, this script does not include a clonescan !! 
# set here your home channel, please note this will be the only channel people can request from 
variable homechan "#extreme-network" 
##### DONT NOT TOUCH THIS VARIABLE !! 
variable busy "0" 
# the binds, there is no need to change these binds 
# public (channel) binds 
bind pub -|- "$trigger" [namespace current]::request 
bind pub -|- "\?bots" [namespace current]::bots 
bind pub -|- "\?rules" [namespace current]::rules 
# The bot managment bind, allows you the user to message the bot to add/remove/list requestable bots 
bind msg -|- "request" [namespace current]::management 
} 

setudef flag request 

proc request::bots {nickname hostname handle channel arg} { 
  set requestable {} 
  foreach user [userlist] { 
    if {[matchattr $user b] && [matchattr $user R]} { 
      lappend requestable [hand2nick $user] 
    } 
  } 
  putserv "NOTICE $nickname :Here is a list of my requestable bots:" 
  putserv "NOTICE $nickname :[join $requestable ", "]"
} 

proc request::rules {nickname hostname handle channel arg} { 
  putserv "NOTICE $nickname :Only 1 bot allowed per channel" 
  putserv "NOTICE $nickname :The bot must have +$request::flags on Q/L" 
  putserv "NOTICE $nickname :The bot must have op on the channel at all times" 
  putserv "NOTICE $nickname :You are not allowed to deop/ban/kick the bot at any time for any reason" 
  putserv "NOTICE $nickname :If you dont agree to these rules, then dont not request a bot" 
  putserv "NOTICE $nickname :If any of these rules are broken, for any reason, then your channel will be shitlisted" 
  putserv "NOTICE $nickname :Please note, an admin can remove/shitlist your channel at any time for any reason without any notice" 
} 

proc request::request {nickname hostname handle channel text} { 
  if {![channel get $request::homechan request]} { 
    putserv "NOTICE $nickname :Sorry, but request is currenty offline" 
    } elseif {![string match -nocase $request::homechan $channel]} { 
    putserv "NOTICE $nickname :Error: you can only request a bot from my homechannel, which is $request::homechan" 
    } elseif {![string match -nocase "*users.quakenet.org" $hostname]} { 
    putserv "NOTICE $nickname :Sorry, but you need to be authed with Q and have mode +x set before you can request a bot" 
    } elseif {$request::busy == "1"} { 
    putserv "NOTICE $nickname :Sorry, but another request is taking place, please wait a few seconds" 
    } else { 
    set thechan [lindex [split $text] 0] 
    if {$thechan == ""} { 
      putserv "NOTICE $nickname :Please enter a channel name using !request #channel" 
      return 0 
    } 
    if {[string index $thechan 0] != "#"} { 
      putserv "NOTICE $nickname :Please enter a channel name starting with '#' using !request #channel" 
      return 0 
    } 
    set request::busy "1" 
    request::check $nickname $hostname $thechan 
  } 
} 

proc request::check {nickname hostname thechan} { 
  if {$request::busy} { 
    if {![validchan $thechan]} { 
      channel add $thechan 
      foreach user [userlist bR] { 
        if {[onchan [hand2nick $user] $thechan]} { 
          putserv "NOTICE $nickname :Request failed: Bot $user in already on $thechan" 
          putlog "Request failed: Channel: $thechan By: $nickname \($hostname\) Reason: $user was on $thechan" 
          channel remove $thechan 
          set request::busy "0" 
          save 
          return 0 
        } 
      } 
      if {![onchan $nickname $thechan]} { 
        putserv "NOTICE $nickname :Request failed: You are not on $thechan" 
        putlog "Request failed: Channel: $thechan By: $nickname \($hostname\) Reason: not on $thechan" 
        channel remove $thechan 
        set request::busy "0" 
        save 
        return 0 
      } 
      if {![isop $nickname $thechan]} { 
        putserv "NOTICE $nickname :Request failed: You are not opped on $thechan" 
        putlog "Request failed: Channel: $thechan By: $nickname \($hostname\) Reason: not opped on $thechan" 
        channel remove $thechan 
        set request::busy "0" 
        save 
        return 0 
      } 
      if {![onchan L $thechan] && ![onchan Q $thechan]} { 
        putserv "NOTICE $nickname :Request failed: No Q/L found on $thechan" 
        putlog "Request failed: Channel: $thechan By: $nickname \($hostname\) Reason: No Q/L found on $thechan" 
        channel remove $thechan 
        set request::busy "0" 
        save 
        return 0 
      } 
      if {[llength [chanlist $thechan]] < $request::needed} { 
        putserv "NOTICE $nickname :Request failed: There is not enough users on $thechan" 
        putlog "Request failed: Channel: $thechan By: $nickname \($hostname\) Reason: less than $request::needed users" 
        channel remove $thechan 
        set request::busy "0" 
        save 
        return 0 
      } 
      if {[llength [bots]] >= 1} { 
        set bot [lindex [bots] [rand [llength [bots]]]] 
        putbot $bot "addchan $thechan $nickname $hostname" 
        putserv "NOTICE $nickname :Request accepted: bot [hand2nick $bot] should join $thechan soon, if [hand2nick $bot] does not join, please report this to an admin in $request::homechan" 
      } 
    } 
  } 
} 

putlog "Request.tcl v$request::version by $request::author loaded !!"
the error is

[20:13] Tcl error [::request::management]: invalid command name "::request::management"


can some1 fix it for me maby ?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

No wonder, because proc request::management doesn't exist :P

So delete

Code: Select all

bind msg -|- "request" [namespace current]::management 
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Edit your original post Owner^ and set code tags.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
O
Owner^
Voice
Posts: 3
Joined: Wed Dec 07, 2005 2:51 pm

Post by Owner^ »

ok now i want that if i typ ?request #channel..the bot will join channel..look up of channel is accepting the rules..like 30+ idlers needed + a service bot ...then a bot will join..cause i typ now ?request #channel..bot says
<Owner^> ?request
-eX|Request- Sorry, but request is currenty offline
can some1 make the script..better or edit it? it would be nice
r
rt
Voice
Posts: 25
Joined: Fri Jul 08, 2005 4:00 pm

Post by rt »

You're such a moron. Ripping scripts suck; learn to code.

metroid made a script, and it's ironic that his script looks exactly the same to yours.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

I just don't understand why people just change the copyright on scripts that aren't theirs and then pretend they wrote it because they seemingly added 3 lines and then break it.

I will never give support for a script that someone basically _completely_ ripped from me and then breaks it.

This is the original code, it looks familiar, doesn't it?
Next time, get a clue about what your doing, i would have helped you when you first asked me if you hadn't blatantly shown me disrespect.

Code: Select all

# Basic Request script

# GNU License
# This program is free software; you can redistribute it and/or modify      
# it under the terms of the GNU General Public License as published by      
# the Free Software Foundation; either version 2 of the License, or         
# (at your option) any later version.                                       
#                                                                           
# This program is distributed in the hope that it will be useful,           
# but WITHOUT ANY WARRANTY; without even the implied warranty of            
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             
# GNU General Public License for more details.                              
#                                                                           
# You should have received a copy of the GNU General Public License         
# along with this program; if not, write to the Free Software               
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

# /* This is a basic request script, It will join the channel, check some settings and stay/part if accepted.
# *  This does NOT add other bots to that channel.
# *  If you want it to do that, You will have to make it do that yourself :)
# *  If you have any questions about this script, feel free to ask me in #v1per on irc.quakenet.org
# *  Also, if you find any bugs, the same channel, my nickname is metroid
# *  Also, leave my copyright in, If you want to put your own copyright in MY script, Make your own script completely from scratch.
# */

# /* Installing the request script
# *  First, put the script into your /home/user/*eggdrop name*/scripts folder.
# *  Then at the end of your eggdrop.conf, Put:
# *  source scripts/request.tcl
# *  Just rehash the bot after you've done this and it should work.
# */

# /* This is a VERY basic idea of what you can use for a request system with eggdrops.
# *  It's very flexible as it's really easy to just add whatever you want to it :)
# *  Good luck with making your own request script and if you need some help, you can contact me.
# */

namespace eval request {
 variable version "1.0"
 variable author  "metroid"
 
 # Configuration!
 # Our homechannel, they can only request here.
 variable homechan "#v1per"
 # Ammount of people we require.
 variable needed   "30"
 # Do we want a Q or L?
 variable service  "1"
 
 # Do we send a message to the homechannel when a request fails?
 variable tell     "1"
 
 # End of Config!
 # Do NOT edit anything below these lines
 
 variable busy     "0"
 
 bind PUB  -|-  !request  [namespace current]::request
}

proc request::request {nickname hostname handle channel arguments} {
 if {[string equal -nocase $channel $request::homechan]} {
  if {!$request::busy} {
   set chan [lindex [split $arguments] 0]
   if {$chan != "" && ![validchan $chan]} {
    if {[string index $chan 0] == "#"} {
     set request::busy 1
	 bind RAW -|- 315 [namespace current]::who
	 utimer 30 [list [namespace current]::timeout $chan]
	 channel add $chan
	 set ::info "$nickname $chan"
	} else {
	 putquick "NOTICE $nickname :A channel name starts with an #."
	}
   } else {
    putquick "NOTICE $nickname :You seem to have given an improper syntax for the channel."
   }
  } else {
   putquick "NOTICE $nickname :Sorry, there is already a request in progress."
  }
 }
}

proc request::who {server raw arguments} {
unbind RAW -|- 315 [namespace current]::who
if {$request::busy} {
 if {![info exists ::info]} { return 0 }
 set nickname [lindex [split $::info] 0]
 set channel [lindex [split $::info] 1]
 unset ::info
 set request::busy 0
 if {![onchan $nickname $channel] || ![isop $nickname $channel]} {
  putquick "NOTICE $nickname :You are not on $channel or you aren't opped."
  if {$request::tell} {
   putquick "PRIVMSG $request::homechan :Request for $channel failed. $nickname is not on $channel or is not opped."
  }
  channel remove $channel
  return 0
 }
 if {$request::service} {
   if {![onchan L $channel] && ![onchan Q $channel]} {
    set busy 0
    putquick "NOTICE $nickname :Q or L was not found on $channel."
    if {$request::tell} {
     putserv "PRIVMSG $request::homechan :Request for $channel failed. There is no Q or L on $channel."
    }
    channel remove $channel
    return 0
   }
  }
  if {[llength [chanlist $channel]] < $request::needed} {
    putquick "NOTICE $nickname :$channel has less than $request::needed users."
    if {$request::tell} {
     putserv "PRIVMSG $request::homechan :Request for $channel failed. There are not enough users on $channel (There are [llength [chanlist $channel]] users)."
    }
    channel remove $channel
    return 0
  }
  # Request is accepted
  putquick "NOTICE $nickname :Your request is accepted. I will stay on $channel."
  putquick "PRIVMSG $request::home :Request from $nickname for $channel was accepted. The channel has [llength [chanlist $channel]] users."
  if {![validuser [nick2hand $nickname]]} {
   adduser $nickname *![getchanhost $nickname]
   chattr $nickname |+n $channel
  } else {
   chattr [nick2hand $nickname] |+n $channel
  }
 }
}
  
proc request::timeout {chan} {
 if {[validchan $chan] && ![botonchan $chan]} {
  channel remove $chan
  putquick "PRIVMSG $request::homechan :Request for $chan failed. Bot cannot join $chan."
  if {[info exists ::info]} { unset ::info }
 }
}

proc request::version {} {
 putlog "Basic Request script version: $request::version by $request::author was loaded successfully."
}
	
request::version
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

1) Owner^ did not say they wrote the script.
2) Owner^ pointed to a script error.
3) Owner^ posted in the wrong forum.
4) Owner^ requested an alteration.

]Kami[ posted a fix as indicated.

Our old "friend" Tosser is the one to vent anger at as that is the one taking credit for MeTroiD's excellent script.

I personally would like all and sundry that blatantly rip other's codes to have their accounts deleted and their IP's banned. I think the proposed rating system (if it gets off the ground) would be just one way to stop these ripoff's.

@ Owner^: I suggest you download the original MeTroiD script and load into your bot and you might just discover it's error free. :wink:

/me now hopes all is well with the world.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
O
Owner^
Voice
Posts: 3
Joined: Wed Dec 07, 2005 2:51 pm

Post by Owner^ »

Lol..i didn't say i writed that scripts..you noob...and metroid...i dont got the script from you..i just founded the script on this forum @ tosser his nick...and dont..blame that i stole the script..
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Im sorry guys, i took ideas from metroid's script, and added some other stuff, i never ment for it to be public, i posted it to get help with an error, not to release it publicly. Im sorry, all credit to Metroid !!
r0t3n @ #r0t3n @ Quakenet
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

# copyright info, dont change these variables, or make your own request script
variable author "Tosser"
variable version "1.0.0.0"
Speaks for itself.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

The thing is just that this isn't the first time Alchera, this is also why i am no longer releasing my scripts.
[rant]I made this request script purely so other could modify it to their needs but i also specifically ask them to keep me in the copyright but for reason Tosser/Owner^ don't understand that and that's a sad thing.

This reason makes more and more scripters not release their scripts because it's just lame to release scripts that aren't yours whilst you take full credit for making them.
[/rant]
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

True MeTroiD, it is a sad sad world.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply