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.

Access tcl idea?

Old posts that have not been replied to for several years.
j
jedis

Post by jedis »

TCL error [test:access]: wrong # args: should be "lindex list index"

when someone attempts to dcc chat... script stops working here, and allows access to dcc chat
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Locate line
if {[string tolower [lindex [split $arg]] 0] != "chat"} { retrun 1 }
and replace with
if {[string tolower [lindex [split $arg] 0]] != "chat"} { retrun 1 }
j
jedis

Post by jedis »

Hmm.

DCC Chat connection established
-
[14:55] <Bot3> Enter your password.
[14:55] -Bot3- Access denied - please use Hub.

The messsage pops up, but it still lets them on. Thanks for your hard work ppslim, I appreciate your efforts.
j
jedis

Post by jedis »

Not sure what went wrong, but no one can dcc chat the bots now?

Even owners, with all flags (including +p and +m) cannot dcc chat.. Although /ctcp chat does work. My access flag is set to global master.

Weird...
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

There is some weird problem here.

I will look into it a little more after.
j
jedis

Post by jedis »

Okay, thanks ppslim.

Noticed if I connect via /ctcp chat, once I am in DCC chat, I get the following error:

TCL error [test:access]: no value given for parameter "hand" to "test:access"
j
jedis

Post by jedis »

ppslim, any luck with this script?

Thanks, I appreciate your hard work :smile:
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

because i'm so nice, i'll give you a working implementation of this kinda script.

Code: Select all


bind chon - * dcc_chat_1

proc dcc_chat_1 {hand idx} {
if {![matchattr $hand C]} {
putidx $idx "You do not have the proper flags to chat to this bot."
putlog "$hand doesn't have +C flag - killing connection"
killdcc $idx
return 0
}
}

bind filt m ".chatt* * *" filt_chattr1

proc filt_chattr1 {idx arg} {
 if {(![string match [string tolower [xindex $arg 0]]* ".chattr"]) || ([pownercheck [idx2hand $idx]]) || (![string match *C* [xindex $arg 2]])} {
  return $arg
 } else {
  putlog "Warning: [idx2hand $idx] attempted to modify the +C flag for [xindex $arg 1] (noaccess)"
  putdcc $idx "Only my admin is allowed to set the C flag"
  return
 }
}

proc pownercheck {checkhand} {
 global owner
 regsub -all " " $owner "," ownertemp
 foreach i [split $ownertemp ,] {
  if {[string tolower $i] == [string tolower $checkhand]} {
   return 1
  }
 }
 return 0
}

This will only allow ppl with global +C to chat the bot its loaded on. Don't forget to give yourself +C before you load it. Its also written so that only ppl in $owner can change the global C flag, though you could just unbind the chattr filter to stop this. I seriously suggest putting flag C in your private-globals as well to stop modification from a sharebot
j
jedis

Post by jedis »

Will this work for /ctcp chat?

Thanks for posting that. I appreciate it :smile: I will give it a try.

Though I think the script idea ppslim is working on is a better implementation. I think I'll need to try both out and see which seems more practical. Too many flags gets to be cumbersome.

Thanks again.

-Jedis
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

yah, this will work for all ways of access. yes, it is basic, but its a proven way to work (a lot of botpacks out there use a variation on this method for user authentification)
j
jedis

Post by jedis »

Any luck on this ppslim?

Thanks
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

What I am about to say, is about as true as I invented the internet (roll on Bush)

No I havn't had any luck, but I am a little drunk (notice any typos yet?). I am gonna work on a full solution, or at leate a expandable solution tomorow.

So much for tonight being a night away from the drink, I am worse than ever,
M
Mikee

Post by Mikee »

On 2001-11-09 21:16, ppslim wrote:
What I am about to say, is about as true as I invented the internet (roll on Bush)

No I havn't had any luck, but I am a little drunk (notice any typos yet?). I am gonna work on a full solution, or at leate a expandable solution tomorow.

So much for tonight being a night away from the drink, I am worse than ever,
I noticed that you have confused our great president Bush with Al Gore.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

/me requotes the drunk part - geesh, what the hell are phone company doing, allowing me on the net at that time in the morning.
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

lol
Locked