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.

pushmode problem

Old posts that have not been replied to for several years.
Locked
t
tiberius

pushmode problem

Post by tiberius »

my problem: pushmode does not perform a command while executed through a proc... it works fine with other modes and if i try > .tcl pushmode #t.d.p. -b blu!pp@pop.de < through the partyline it just works fine as well

but this does not work:
bind mode - "% \+b" mode:ban

proc mode:ban { nick host hand chan change victim } {
if {[botisop $chan] == 1} {
mylog "putkick $chan $nick \"> /mode $chan +b $victim < > [ctime [unixtime]] <\"" 3
putkick $chan $nick "> /mode $chan +b $victim < > [ctime [unixtime]] <"
mylog "pushmode $chan -b $victim" 3
# for some reasons the following line does not want to work at all
pushmode $chan -b $victim
}
}

thats are the logs on the partyline
[19:09:46] <tibtestbot> [19:09] #t.d.p.: mode change '+b blu!pp@pop.de' by tiberius_!tiberius@netzlab.info
[19:09:47] <tibtestbot> [19:09] putkick #t.d.p. tiberius_ "> /mode #t.d.p. +b blu!pp@pop.de < > Sat Dec 13 19:09:37 2003 <"
[19:09:47] <tibtestbot> [19:09] pushmode #t.d.p. -b blu!pp@pop.de
[19:09:47] <tibtestbot> [19:09] tiberius_ kicked from #t.d.p. by tibtestbot: > /mode #t.d.p. +b blu!pp@pop.de < > Sat Dec 13 19:09:37 2003 <

####################################
chaninfo for that channel:
[19:12:37] <tibtestbot> Settings for dynamic channel #t.d.p.:
[19:12:37] <tibtestbot> Protect modes (chanmode): +tn-kipsr
[19:12:37] <tibtestbot> Idle Kick after (idle-kick): DON'T!
[19:12:37] <tibtestbot> stopnethack: DON'T!
[19:12:37] <tibtestbot> aop-delay: 0:0
[19:12:37] <tibtestbot> revenge-mode: 0
[19:12:37] <tibtestbot> ban-time: 120
[19:12:37] <tibtestbot> exempt-time: 60
[19:12:37] <tibtestbot> invite-time: 60
[19:12:37] <tibtestbot> Other modes:
[19:12:37] <tibtestbot> -inactive -statuslog -secret +shared
[19:12:37] <tibtestbot> -greet -seen -cycle -dontkickops
[19:12:37] <tibtestbot> -protectops -protectfriends -revenge -revengebot
[19:12:37] <tibtestbot> -bitch -autoop -autovoice -nodesynch
[19:12:37] <tibtestbot> -enforcebans +dynamicbans +userbans -autohalfop
[19:12:37] <tibtestbot> -protecthalfops
[19:12:37] <tibtestbot> -dynamicexempts -userexempts -dynamicinvites -userinvites
[19:12:37] <tibtestbot> User defined channel flags:
[19:12:37] <tibtestbot> -joinafterauth +highrules
[19:12:37] <tibtestbot> User defined channel settings:
[19:12:37] <tibtestbot> ircop: 1
[19:12:37] <tibtestbot> flood settings: chan ctcp join kick deop nick
[19:12:37] <tibtestbot> number: 0 3 0 0 0 0
[19:12:37] <tibtestbot> time : 0 10 0 0 0 0

####################################
my logs on the channel:
[19:09:46] * tiberius_ sets mode: +b blu!pp@pop.de
[19:09:47] * tiberius_ was kicked by tibtestbot (> /mode #t.d.p. +b blu!pp@pop.de < > Sat Dec 13 19:09:37 2003 <)

as you can see the kick just works well, but the unban just don't work -.- even if it appears on the partyline as through the mylog command (mylog is a small proc which just checks for a var, if it should perform the putcmdlog to log the commands)

i know that the chansetting -userbans would remove the ban but this is not what i want ...

----
<edit>
i just recognized that the whole thing does not work in the inversion of the script, too -.-
</edit>
----
cya
-ti
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

if ur problem is that it doesn't execute ..

maybe
mylog "pushmode $chan -b $victim" 3

Code: Select all

mylog [pushmode $chan -b $victim] 3
not sur ur code doesn't make sence to me .. ??? ? could u put it in code so its readable ...?

also what is mylog i can't seem to find that command anywhere so i suppose its a proc ur refering to could u paste that proc as well plz
XplaiN but think of me as stupid
t
tiberius

Post by tiberius »

no mylog doesn't do anything else then checking for a var and if the var is >0 then putcmdlog the text ... the command itself is not executed at this point, it's executed in the next line as you can see ... you can just imagine the mylog as something like putcmdlog "the command" ... it only makes the things going on in the script available for the logfiles ... so if a command fails and i use this putcmdlog before in the logfiles it would look like
[timestamp] someproc $blo $bla $blup
and then
[timestamp] Tcl error: <some errors>
it's only to make it easier tracing errors cause you see the line which caused the error then ... but in this case it does not give any tcl errors ... it just 'ignores' the command -.-

cu
-ti
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

tiberius wrote:[snip]
# for some reasons the following line does not want to work at all
pushmode $chan -b $victim
[snip]
$victim is the nick of the user being banned, then $victim doesn't exist in the channel's banlist so the bot will not unban a none existing ban.
t
tiberius

Re: pushmode problem

Post by tiberius »

tiberius wrote:thats are the logs on the partyline
[19:09:46] <tibtestbot> [19:09] #t.d.p.: mode change '+b blu!pp@pop.de' by tiberius_!tiberius@netzlab.info
[19:09:47] <tibtestbot> [19:09] putkick #t.d.p. tiberius_ "> /mode #t.d.p. +b blu!pp@pop.de < > Sat Dec 13 19:09:37 2003 <"
[19:09:47] <tibtestbot> [19:09] pushmode #t.d.p. -b blu!pp@pop.de

[19:09:47] <tibtestbot> [19:09] tiberius_ kicked from #t.d.p. by tibtestbot: > /mode #t.d.p. +b blu!pp@pop.de < > Sat Dec 13 19:09:37 2003 <
the underlined lines are exactly what mylog gives out ... and if you take a second look then you'll see that $victim is NOT the nick of the user who gets banned ...

cu
-ti
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

you cant really ban a person, just the hotmask of the user

a ban like lame!lamer@124.324324.some-dialup-host.com would most probably match just one user, but you dont ban the user but the host

if you want to check what nicks match the ban you have to scan every user in the channel and check if the banmask matches the users mask
t
tiberius

Post by tiberius »

if everybody would keep reading the whole thing please

$victim is NOT a users nick
$victim is the mask of the ban, which was set ...
so if someone sets /mode #chan +b bla!bla@bla.bla
then $victim would be bla!bla@bla.bla
just don't care about the name of the var ... IT IS THE MASK!!!

and my problem is, that the bot does NOT remove the ban while executing

Code: Select all

pushmode $chan -b $victim
(remember: $victim IS THE BANMASK)

cu
-ti
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Have you ever tried using putserv "MODE $chan -b $victim" ?

because there's nothing wrong in your code. the pushmode should work.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

tiberius wrote: $victim is NOT a users nick
$victim is the mask of the ban, which was set ...
so if someone sets /mode #chan +b bla!bla@bla.bla
then $victim would be bla!bla@bla.bla
just don't care about the name of the var ... IT IS THE MASK!!!
isn't that what i just said ? :P
t
tiberius

Post by tiberius »

Sir_Fz wrote:Have you ever tried using putserv "MODE $chan -b $victim" ?

because there's nothing wrong in your code. the pushmode should work.
i already tried it some days before i got here and it worked fine ... but i intended to use the bots internal queue for processing modes ... because this would cause less lines to send to the server ... the bot is going to be a security bot, and so it has to work effective and not dump 'every' mode change in one line (which is done by putserv afaik) ... (and which can cause the bot to flood off the server) ... i also tried to easily use 'resetbans' but this floods the bot off the server (...too), when there are more than one user who sets bans ... so i'm in need to use pushmode -.-
GodOfSuicide wrote:isn't that what i just said ? :P
ehm, yeah, but ... it's uninteresting in this case ... the problem is, as i said, that the pushmode does not work for any reasons, and i just wanted to know why ...
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Just a thought...

Post by user »

Try issuing the pushmode with a slight delay. I didn't care to check it, but it might be that eggdrop doesn't yet have the ban in its list of active bans when the proc is called and is filtering the mode because it looks redundant.
Have you ever read "The Manual"?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

good point there :P
t
tiberius

Post by tiberius »

aye good point ... and right, it works when i use a utimer with 1 sec delay ... but do you see chance to adjust pushmode that it works without a delay?

[edit]
i've searched through the eggdrop internal binds ... would it help to run
*raw:irc:mode
or
*raw:MODE
before ... i guess somewhere to bot refreshes his internal banlist, maybe it could help to do this before the pushmode is used?
[/edit]


cu
-ti
Locked