egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

request.tcl script need help...!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Owner^
Voice


Joined: 07 Dec 2005
Posts: 3

PostPosted: Wed Dec 07, 2005 2:56 pm    Post subject: request.tcl script need help...! Reply with quote

Code:

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 ?
Back to top
View user's profile Send private message
]Kami[
Owner


Joined: 24 Jul 2003
Posts: 590
Location: Slovenia

PostPosted: Wed Dec 07, 2005 3:54 pm    Post subject: Reply with quote

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

So delete

Code:
bind msg -|- "request" [namespace current]::management

_________________
Slovene Eggdrop Page
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Dec 07, 2005 8:08 pm    Post subject: Reply with quote

Edit your original post Owner^ and set code tags.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Owner^
Voice


Joined: 07 Dec 2005
Posts: 3

PostPosted: Thu Dec 08, 2005 7:47 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
rt
Voice


Joined: 08 Jul 2005
Posts: 25

PostPosted: Sat Dec 10, 2005 3:55 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Dec 10, 2005 4:34 am    Post subject: Reply with quote

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:
# 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
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Dec 11, 2005 3:07 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Owner^
Voice


Joined: 07 Dec 2005
Posts: 3

PostPosted: Sun Dec 11, 2005 7:09 am    Post subject: Reply with quote

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..
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Dec 12, 2005 9:52 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Dec 12, 2005 8:00 pm    Post subject: Reply with quote

Code:
# 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
Back to top
View user's profile Send private message Visit poster's website
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Dec 13, 2005 2:43 am    Post subject: Reply with quote

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]
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Dec 13, 2005 3:34 am    Post subject: Reply with quote

True MeTroiD, it is a sad sad world.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber