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 

Help with ctcp version (version works, outcome doesn't)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
barcode
Voice


Joined: 17 Jan 2010
Posts: 6

PostPosted: Sun Jan 17, 2010 8:13 pm    Post subject: Help with ctcp version (version works, outcome doesn't) Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Jan 17, 2010 8:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
barcode
Voice


Joined: 17 Jan 2010
Posts: 6

PostPosted: Sun Jan 17, 2010 10:05 pm    Post subject: Reply with quote

Hmm, still doesn't work.

Thanks for the reply, though.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Jan 17, 2010 10:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
barcode
Voice


Joined: 17 Jan 2010
Posts: 6

PostPosted: Mon Jan 18, 2010 10:18 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jan 18, 2010 10:52 am    Post subject: Reply with quote

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
View user's profile Send private message
barcode
Voice


Joined: 17 Jan 2010
Posts: 6

PostPosted: Mon Jan 18, 2010 11:19 am    Post subject: Reply with quote

Sure.

Quote:
<(eggdrop> TYPE FLGS COMMAND HITS BINDING (TCL)
<(eggdrop> ctcr -|- VERSION 0 version:reply
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jan 18, 2010 12:18 pm    Post subject: Reply with quote

'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
View user's profile Send private message
barcode
Voice


Joined: 17 Jan 2010
Posts: 6

PostPosted: Mon Jan 18, 2010 12:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Tue Jan 19, 2010 3:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
barcode
Voice


Joined: 17 Jan 2010
Posts: 6

PostPosted: Tue Jan 19, 2010 7:50 am    Post subject: Reply with quote

Thanks dude. Looks like it was a problem with the way I made the bind. Works fine, now.

Thanks again.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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