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 script - Beta

Support & discussion of released scripts, and announcements of new releases.
Post Reply
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Request script - Beta

Post by r0t3n »

Hey, i have been fixing my request script for a long time now, time to re-release it.

Request v1.12
Download Here

It has been tested, please note clonescan is in beta stage, and may not work 100%. The shitlist managment proc has to be rewritten, so another update will be coming soon. It would be great if you guys could maybe test the script a little bit, and i will look forward to your feedback.

Thanks guys,
Chris!
r0t3n @ #r0t3n @ Quakenet
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

I had a look at your script and i think it's sad that eventhough you've almost completely ripped my script (which isn't a suprise) you STILL manage to script useless things.

<tosserbashing>
Let me just show you some things:

request:

Code: Select all

  # This is the global flag which will be used to identify any bots
  variable botflag "b|"
well what do you know, did you even realise that only bots in the botnet have this flag?

Code: Select all

  if {[string match -nocase "$request::channel" "$request::reqchan"]} {
    putserv "NOTICE $nickname :Nice try, please dont abuse the request system."
    return 0
  }
Did you even consider the possibility that it's just alot smarter to just use:

Code: Select all

if {[validchan $request:reqchan]} {
So let's move on

Code: Select all

  utimer 30 [list request::timeout $nickname [set channel $request::reqchan]]
  if {$request::shitlist == "1"} {
    set shitlist [open $request::shitfile r]
    if {$shitlist == ""} {
      putlog "Channel $request::reqchan is not shitlisted."
      request::start $nickname [set channel $request::reqchan]
    } else {
      set data [split [read $shitlist] \n]
      if {[llength $data] == "1"} {
        if {[string match -nocase $request::reqchan [lindex [split $data] 0]]} {
          putserv "NOTICE $nickname :Request failed: $request::reqchan is currently shitlisted."
          putlog "Channel $request::reqchan is shitlisted."
          close $shitlist
          unset data
          } else {
            close $shitlist
            unset data
            request::start $nickname [set channel $request::reqchan]
          }
      } else {
        set found "0"
        foreach schan [split $data] {
          if {$schan == ""} { return }
          if {[string match -nocase $request::reqchan [lindex [split $schan] 0]]} {
            set found "1"
            break
          }
        }
        if {$found == "1"} {
          putserv "NOTICE $nickname :Request failed: $request::reqchan is currently shitlisted."
          putlog "Channel $request::reqchan is shitlisted."
          close $shitlist
          unset data
        } else {
          request::start $nickname [set channel $request::reqchan]
          close $shitlist
          unset data
        }
      }
    }
  } elseif {$request::shitlist == "0"} {
    request::start $nickname [set channel $request::reqchan]
  }
What exactly is all this useless stuff. Why not do the remote smart thing and simply loop through it once instead of using multiple if's which prove to be really useless.

Also, why do you keep using [set channel $request::reqchan], what is the point of this? You don't even use the variable channel.

This is probably one of the messiest codes ever. You don't even appear to close the file if the 'shitlist' is empty.

I'll do you a favor by showing you what real TCL is like:

Code: Select all

if {$request::shitlist} {
  set shitlist [open $request::shitfile r]; set lines [split [read $shitlist] \n]; close $shitlist
  set found 0
  foreach channel $lines {
    # I will assume that you atleast know how to write a file properly.
    if {[string equal -nocase $channel $request::reqchan]} {
      set found 1; break
    }
  }
  if {$found} {
    putserv "NOTICE $nickname :Request failed: $request::reqchan is currently shitlisted."
    putlog "Channel $request::reqchan is shitlisted."
  } else {
    start $nickname $request::reqchan
  }
} else {
  start $nickname $request::reqchan
}
Oh wow, this does the exact same as your big useless piece of scripting.

Code: Select all

  utimer 10 [list request::request2 $nickname $channel]
Why are you using a 10 second utimer to trigger a check, do you even know for sure that the eggdrop has finished doing it's WHO's and it's MODE's? No you don't. I would have expected that you learned from ripping my script but i guess you didn't. at all.

Code: Select all

proc request::request2 {nickname channel} {
  set request::reqchan $channel
  if {![onchan $nickname $request::reqchan]} {
    putserv "NOTICE $nickname :Request failed: You are not on $request::reqchan."
    channel remove $request::reqchan
    set request::request "0"
    putlog "$nickname is not at $request::reqchan."
  } else {
    putlog "$nickname is at $request::reqchan."
    utimer 5 [list request::opcheck $nickname $request::reqchan]
  }
}
Now you probably haven't got the slighest clue how IRC works but i can assure you that IF and only IF the bot has already found out who the users on the channels are then the eggdrop will already know if the user is opped or voiced or neither aswell, the mere fact that you invoke a 5 second timer to check for op shows me that you have absolutely no clue at all.

Also, your setting of request::reqchan is pointless.

I won't even comment on the following procs as what i just said above this pretty much applies: request::opcheck, request::botcheck, request::service.

Your clonescanner is also a piece of useless scripting, there are much easier and more efficient ways of checking for multiple users from the same hosts.

Now we move on to the next proc, request::accepted.

Code: Select all

proc request::accepted {nickname channel} {
  set request::reqchan $channel
  # Request is now accepted, so you need to send a message to a random bot through a botnet
  # please note, if you dont want to send this message though a botnet, then modify this part of the script as required
  set rbot [channel get $request::channel rbot]
  if {$::request::service} {
    if {[onchan L $request::reqchan]} {
      set service "L"
    } else {
      set service "Q"
    }
    putquick "PRIVMSG $request::adminchan :$rbot requestadd [set text "$request::reqchan $nickname $service"]"
    putlog "Request accepted for $request::reqchan by $nickname. Bot $rbot will join. \(Service: $service\)"
  } else {
    putquick "PRIVMSG $request::adminchan :$rbot requestadd [set text "$request::reqchan $nickname"]"
    putlog "Request accepted for $request::reqchan by $nickname. Bot $rbot will join."
  }
  putserv "NOTICE $nickname :Request accepted: Bot $rbot should join shortly"
  putlog "Request: - Accepted - $request::reqchan - $nickname\([getchanhost $nickname $request::reqchan]\) - $rbot will join -"
  channel remove $request::reqchan
  set request::request "0"
}
And oh my god, this proc checks for services AGAIN. I mean come on, were you sleeping when you were writing this?
You talk about a botnet part, which isn't there, at all. You comment on a 'random bot' which isn't even allowed by your scripting.

You simply use some kind of debugging script to add the bot to a channel by making it invoke a procedure, did it EVER cross your mind that not ALL bots have debug scripts, nevermind public debug scripts and even less bots have debug scripts that have binds on their current nicknames.

You again use [set text] but i won't go into that because i've already told you that it's pointless and dumb.

So now, we move on to request-leaf:

At this point i'm getting concerned if my post will even get through because it's quite long so far already.

Code: Select all

setudef str service

proc requestadd {channel nickname {service ""}} {
  if {![validchan $channel]} {
    channel add $channel
  }
  if {[info exists service]} {
    channel set $channel service "$service"
  }
  if {[validuser [nick2hand $nickname]]} {
    chattr [nick2hand $nickname] |+almnov $channel
    putserv "NOTICE $nickname :Hello $nickname. You are now the owner of $channel. Your handle is [nick2hand $nickname] and you are added with the hostname [getuser [nick2hand $nickname] hosts]."
    if {$service != ""} {
      putserv "NOTICE $nickname :For me to function properly, please add me to [channel get $channel service] on $channel with +amo. /msg [channel get $channel service] chanlev $channel $::botnick +amo."
    }
  } else {
    set hostname [getchanhost $nickname $channel]
    if {[string match -nocase "*users.quakenet.org" "$hostname"]} {
      set hostname "*!*@[lindex [split $hostname @] 1]"
    } else {
      set hostname "*!$hostname"
    }
    adduser $nickname $hostname
    chattr $nickname |+almnov $channel
    putserv "NOTICE $nickname :Hello $nickname. You are now the owner of $channel. Your handle is [nick2hand $nickname] and you are added with the hostname [getuser [nick2hand $nickname] hosts]."
    if {$service != ""} {
      putserv "NOTICE $nickname :For me to function properly, please add me to [channel get $channel service] on $channel with +amo. /msg [channel get $channel service] chanlev $channel $::botnick +amo."
    }
  }
}
This is your 'leaf' 'script'.

(also, please note that you defined an variable containing +ao in request.tcl which incidently you don't use at all. And you request +amo in this script)

A much better, more compact and generally more common sense kind of code would be:

Code: Select all

setudef str service

proc requestadd {channel nickname {service ""}} {
  if {![validchan $channel]} {
    channel add $channel
  }
  if {![validuser [set hand [nick2hand $nickname]]]} {
    set host [expr {[string match *users.quakenet.org* [set host [getchanhost $nickname]]] ? "*!*@[lindex [split $host @] 1]" : "[string map {~ *} *!$host]"}]
    if {![validuser $nickname]} {
      adduser [set hand $nickname] $host
    } else {
      # add a random number from 0-99 to limit the odds of the nickname occuring again
      adduser [set hand $nickname[rand 100]] $host
    }
  }
  # we don't need to define +lmno because eggdrop adds that by default upon +n
  chattr $hand |+an $channel
  putserv "NOTICE $nickname :Hello $nickname. You are now the owner of $channel. Your handle is [nick2hand $nickname] and you are added with the hostname [getuser [nick2hand $nickname] hosts]."
  if {[llength $service]} {
    # so because you claimed +ao, let's not be lame and ask for +ao.
    putserv "NOTICE $nickname :For me to function properly, please add me to $service on $channel with +ao. /msg $service chanlev $channel $::botnick +ao."
    channel set $channel $service
  }
}
</tosserbashing>

I hope this was the last time you posted scripts that are ripped from my somewhat older scripts. It's getting quite annoying to see you 'release' scripts that you ripped, tried to rewrite and horribly fail. It's even worse when you come to this forum asking for help on them.

Since you asked for feedback, here was mine. I hope this provides you with a lesson.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

actually, that script was written from scratch, i didn't even look at your script. And its my script, so i can use 20,000 or 30,000 if statements if i like. I might have ripped from you before, but i dont rip from your scripts now, i dont even have you script anymore, it was so crap i decided to write this one. More advanced...
r0t3n @ #r0t3n @ Quakenet
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Tosser^^ wrote:actually, that script was written from scratch, i didn't even look at your script. And its my script, so i can use 20,000 or 30,000 if statements if i like. I might have ripped from you before, but i dont rip from your scripts now, i dont even have you script anymore, it was so crap i decided to write this one. More advanced...
Actually with the exception of your 'shitlist' or whatever you would call it, there was nothing more advanced about it except for the fact that it used alot of procs to do things you could have done with 1 proc very easily.
G
GeeX
Voice
Posts: 29
Joined: Mon Sep 19, 2005 4:29 am

Post by GeeX »

Doesn't work for me :roll:
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Any error messages, everyone using my script has not reported any problems...

Im doing a rewrite of the code, so you have a choice of !request #channel or /msg botnick request #channel and a new botmanagment system. So, a new release soon.
r0t3n @ #r0t3n @ Quakenet
G
GeeX
Voice
Posts: 29
Joined: Mon Sep 19, 2005 4:29 am

Post by GeeX »

No error Messages, but the requested Bot doesn't join the channel, after checking it.
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

.set errorInfo
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Yes. Well im working on a total new bot managment system, so any problems with bots not joining channels wont be a issue in the next version.
r0t3n @ #r0t3n @ Quakenet
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

Hello Tosser^^ have you al fixt the script .
or do you know there are another scripts like this, with request and leaf?
greets
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Currently on the way to making a botnet request script. No eta of when it will be done as i hardly have time for TCL nowadays. I'll try and get it completed within the next 2/3 weeks so keep posted.
r0t3n @ #r0t3n @ Quakenet
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

Currently on the way to making a botnet request script. No eta of when it will be done as i hardly have time for TCL nowadays. I'll try and get it completed within the next 2/3 weeks so keep posted.
are you already with the scripts i will test it :P
Post Reply