EEggy wrote:In "return [p_identban $target $uhost $hand $chan $arg]" you change $target to $hand.
oh u mean in return procedure , i change $target to $hand, i did that, but same thing.
thanks
regards
So did you:
1. locate the line [p_identban $target $uhost $hand $chan $arg]?
2. in that line, change $target to $hand?
3. restart the bot?
The script you present has some other odd things in it. In the procedure proc dcc_identban, you extract an uhost like: "set uhost [getchanhost $target $chan]". This uhost you then send to the procedure p_identban. Why do that?
The p_identban requires 5 arguments:
1. The nick typing ".identban"
2. The user@host of the nick typing the ".identban" (not of the one being banned).
3. The handle of the nick typing ".identban". There must be handle since the binding flags are "o|o"
4. The channel where nick typed ".identban". There must be a channel, since the binding is a PUB binding.
5. The text the nick typed after ".identban".
So, all arguments of the p_identban procedure pertain to the nick typing the command, and not to the target that is going to be banned.
Subsequently, when calling the p_identban procedure from the partyline, all the arguments you give with that call must pertain to the person typing .identban on the partyline. So, you'll have to come up with 5 arguments:
1. nick??? There is no nick, since the user typed it from the partyline. Either you see if that user is on one of the channels the bot is monitoring using [hand2nick], or you just use the handle.
2. host??? In principle it is possible to retrieve the host of the user typing it from the partyline, but it is not used. Either you retrieve it from the DCC information or you set it to something like $hand!$hand@*. Why did you set it to the uhost of the target?
3. handle. This one you have, since the DCC connection gives a handle.
4. channel. The channel you indeed can retrieve from the console information.
5. text?!? As the 5th argument you can indeed use the text the user typed in the partyline. The p_identban will retrieve the target and the banreason from it.
Code: Select all
proc dcc_identban {hand idx arg} {
set chan [lindex [console $idx] 0]
set uhost $hand!$hand@*
return [p_identban $hand $uhost $hand $chan $arg]
}
Now the weird part comes here. You call the procedure p_identban from the partyline. Anything you want to return to that user, MUST be returned to the $idx!
But instead, if something goes wrong you do: "puthelp "NOTICE $nick :$target is not on $chan." This assumes that the person using the partyline is also on irc, on the channel and using the same nick as his/her handle. In fact your return values are 0 and 1. So a user types an identban from the partyline and gets as a result a "0". ????
Another weird thing is, is that in the p_identban procedure, you first construct a reason using [date], [clock] etc.... and after that you are going to check if the victim is on the channel. Why first constructing the reason and then find out the $target is not on the channel?
Since your procedure is an identban, I can see a reason for setting a ban like "*!*$ident@". This is appearantly what you are after. But suppose your nuhost is like eeggy!
eeggy@host.com. The only thing I have to do is come online as egghead!~
y@eggheadshost.com, bug you a while and get a .identban egghead. The bot will set a ban like *!*y@*.
And, your script also doesnt test for who gets banned. The bot will happily set bans on itself, its owner, its master anyone when requested.