| View previous topic :: View next topic |
| Author |
Message |
barcode Voice
Joined: 17 Jan 2010 Posts: 6
|
Posted: Sun Jan 17, 2010 8:13 pm Post subject: Help with ctcp version (version works, outcome doesn't) |
|
|
Hey, I managed to get my bot to version anyone connecting from a specific isp, which is good because that's what I wanted. However, I also want it to ban depending on what the version reply is.
Yes I know that's a silly way, but this isn't a typical ban on version deal. Basically we only have two people who connect from the same isp and same state, one of them uses mibbit so it is easy to pick them apart.
| Code: |
bind ctcr - VERSION version:reply
bind join - * check:version
proc check:version {nick host hand chan} {
global cversion
set cversion([string tolower $nick]) 1
if {[string match -nocase "*@*.state.isp.net" $host]} {
putserv "privmsg $nick :\001VERSION\001"
}
}
proc version:reply {nick host hand chan dest kw arg} {
global cversion
if {[isbotnick $dest] && [info exists cversion([string tolower $nick])] && [onchan $nick $chan]} {
if {[string match -nocase "*their version reply*" $arg]} {
putserv "KICK $chan $nick :lol"
unset cversion([string tolower $nick])
}
}
}
|
Okay it only says kick there as I was only using kick for testing, but for some reason it doesn't kick o.0 I have tried a few edits to the version:reply proc but i can't get it to do it. I am by no means a pro, in fact I'm still fairly new to tcl, although I am decent at editing and making a few small scripts for my eggdrop. I am sure you can tell all that, I've most probably made a stupid mistake or I have overlooked something.
All I need it to do is kick the user if the version reply matches the version reply of the user I want kicked. I'll add the ban syntax in myself, and like I said I got it to only version someone from a specific isp in a specific state, it's just the outcome if version matches the bad one. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Jan 17, 2010 8:45 pm Post subject: |
|
|
There seems to be one argument too many in your version:reply proc... drop the chan argument. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
barcode Voice
Joined: 17 Jan 2010 Posts: 6
|
Posted: Sun Jan 17, 2010 10:05 pm Post subject: |
|
|
Hmm, still doesn't work.
Thanks for the reply, though. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Jan 17, 2010 10:57 pm Post subject: |
|
|
Next step then would be to add various putlogs for debugging, as to see what is actually going on in your script... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
barcode Voice
Joined: 17 Jan 2010 Posts: 6
|
Posted: Mon Jan 18, 2010 10:18 am Post subject: |
|
|
Man this has me stumped. I've tried to test if there are any errors yet there aren't, nothing coming up in logs at all. Just looking at the code it should work, but for some reason it isn't kicking on bad version from the user.
It will version them if the isp and state match, but it won't carry out the second proc at all for some reason, yet it should. I removed the extra argument, and I tried to catch any errors but there aren't any. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Jan 18, 2010 10:52 am Post subject: |
|
|
Could you issue the command .binds ctcr all on your dcc chat partyline, and post the output here? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
barcode Voice
Joined: 17 Jan 2010 Posts: 6
|
Posted: Mon Jan 18, 2010 11:19 am Post subject: |
|
|
Sure.
| Quote: | <(eggdrop> TYPE FLGS COMMAND HITS BINDING (TCL)
<(eggdrop> ctcr -|- VERSION 0 version:reply |
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Jan 18, 2010 12:18 pm Post subject: |
|
|
'k, that means the binding has yet not been triggered. Which version of eggdrop are you using, if I may ask? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
barcode Voice
Joined: 17 Jan 2010 Posts: 6
|
Posted: Mon Jan 18, 2010 12:40 pm Post subject: |
|
|
The bots version is v1.6.18.
For some reason it isn't the latest, I've a few bots and must have forgot. I'll update it now and see if *.19 fixes anything and I'll edit this post.
edit: Upgraded, but not a problem with version I see. Unless, I'm using outdated code or something which I don't think I am, but I could be wrong. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Tue Jan 19, 2010 3:15 am Post subject: |
|
|
This is the proc i use to catch ctcp reply's | Code: | proc ctcr:something {nick uhost hand dest keyword text} {
if {$keyword == "VERSION"} {
...do something
}
}
bind ctcr -|- "*" proc ctcr:something |
_________________ TCL the misunderstood |
|
| Back to top |
|
 |
barcode Voice
Joined: 17 Jan 2010 Posts: 6
|
Posted: Tue Jan 19, 2010 7:50 am Post subject: |
|
|
Thanks dude. Looks like it was a problem with the way I made the bind. Works fine, now.
Thanks again. |
|
| Back to top |
|
 |
|