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.

bot crashs while clearing takeovers on qnet - wrong script?!

Old posts that have not been replied to for several years.
Locked
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

bot crashs while clearing takeovers on qnet - wrong script?!

Post by De Kus »

ok, you sure know q.tcl and qneed.tcl from help.quakenet.org. i added some code to qneed to let my bot also be helped by L:

Code: Select all

proc handle:need {channel need} {
    if {![matchattr Q "|o" $channel]} {
    	if {![matchattr L "|o" $channel]} { return 0 }
    	switch $need {
		op {
	    	putserv "PRIVMSG L :op $channel" -next
	    	return 1
		}
		unban {
	    	putserv "PRIVMSG L :UNBANALL $channel" -next
		}
		invite {
	    	putserv "PRIVMSG L :INVITE $channel" -next
		}
		limit {
	    	putserv "PRIVMSG L :CLEARCHAN $channel" -next
		}
		key {
	    	putserv "PRIVMSG L :CLEARCHAN $channel" -next
		}
		default {
	    	putserv "PRIVMSG L :CLEARCHAN $channel"  -next
		}
    	}
    	utimer 1 [subst "putserv \"JOIN $channel\"  -next"]
    	return 1
    }
    switch [...]
}
script works fine, but most times the last thing I see in logs is the done notice from L. so its perhaps caused by queued op commands during beeing deopt or kicked for 0,5-2seconds (usesually even after bot is banned his back with 3in seconds).

so, this is the complet script this time and its complete my own (oh my god :D). plz forgive the puzzling if statments, i was having problems using else and elseif, so i had to find a way without :D. if you think the more code could be the trouble i'll try to optimize the code. a tried to keep cpu usage low, so i saved some commands outputs like [nick2hand $nick]. i started using putserv to deop people, but found back to pushmode.

Code: Select all

#De Kus' Channellamer Script. Especially for Chans with op for all a must have! :)
#Current Feature:
# - removes key and limit from not authorised persons and deops them.
# - ensures to get a handle for this user to keep him deopt.
# - global deop up to channel kickban for botkickers! (to disable just set # in front of the bind line of botripper)
#version 1.1
#1.0  : 11.12.02 channellamer and addnewuser completed and functional in satisfiing way, so i called this 1.0 final :)
#1.0.1: 16.12.02 Added botripper in alpha stat (non tested)

bind mode - * channellamer

#script to deop non-master key setter oder master deopper permanently
#non master l below 5 will be deletet and non op will be deopt permanently

proc channellamer {nick uhost hand chan mode victim} {
  global botnick
  set handle [nick2hand $nick]
  if { [matchattr $hand "m|m" $chan] || !(($mode == "+k") || ($mode == "-o") || ($mode == "+l")) || ($botnick == "$nick")} { return 0 }
  if { $mode == "-o" } {
    set victimhandle [nick2hand $victim]
    if { [matchattr $victimhandle "m|m" $chan] } {
      pushmode $chan -o "$nick"
      pushmode $chan +o "$victim"
      flushmode $chan
      if { [matchattr $handle "d|d" $chan] } { return 1 }
      set newhandle $handle
      if { $hand == "*" } {
        set newhandle [addnewuser $nick $uhost]
      }
      chattr $newhandle |-o+d $chan
      putserv "NOTICE $chan :Deoplamer $newhandle gegen $victimhandle erfolgreich deoppt."
      putcmdlog "Deopper $newhandle gegen $victimhandle auf $chan deoppt am [ctime [unixtime]]."
      setuser $newhandle COMMENT "Deoppte $victimhandle auf $chan am [ctime [unixtime]]."
      return 1
    }
    return 0
  }
  if { $mode == "+l" } {
    if { $victim < 5 } {
      pushmode $chan -l
      pushmode $chan -o $nick
      if { [matchattr $handle "o|o" $chan] || [matchattr $handle "f|f" $chan] || [matchattr $handle "d|d" $chan] } { return 1 }
      set newhandle $handle
      if { $hand == "*" } {
        set newhandle [addnewuser $nick $uhost]
      }
      chattr $newhandle |-o+d $chan
      putserv "NOTICE $chan :Lowlimitlamer $newhandle erfolgreich deoppt."
      putcmdlog "$newhandle wegen Limitsetzen auf $victim auf $chan deoppt am [ctime [unixtime]]."
      setuser $newhandle COMMENT "Setzte Limit $victim auf $chan am [ctime [unixtime]]."
      return 1
    }
    return 0
  }
  pushmode $chan -o "$nick"
  pushmode $chan -k "$victim"
  pushmode $chan -i
  flushmode $chan
  if { [matchattr $handle "d|d" $chan] } { return 1 }
  set newhandle $handle
  if { $hand == "*" } {
    set newhandle [addnewuser $nick $uhost]
  }
  chattr $newhandle |-o+d $chan
  putserv "NOTICE $chan :Keylamer $newhandle erfolgreich deoppt."
  putcmdlog "Keysetzer $newhandle auf $chan deoppt by channellamer am [ctime [unixtime]]."
  setuser $newhandle COMMENT "Setzte auf $chan ein Key am [ctime [unixtime]]."
  return 1
}

#function to ensure to get a new user and returns the new handle name
proc addnewuser {nick uhost} {
  set handle $nick
  if { !([adduser $nick [maskhost $uhost]]) } {
    set handle bad[rand 999999]
    if { !([adduser $handle [maskhost $uhost]) } { return * }
  }
  return $handle
}

bind kick - "* $botnick" botripper

proc botripper { $nick $host $handle $chan $target $reason } {
  if { [matchattr $handle "f|f" $chan] || [matchattr $hand "m|m" $chan] || [matchattr $handle "o|" $chan]} { return 0 }
  if { [matchattr $handle "|o" $chan] } {
    chattr $handle |-o $chan
    putserv "NOTICE $nick :Nein, so geht das nicht. Ich weiß, du hast Op hier, aber mich wird nicht gekickt, lass das einen Channelmaster oder -friend machen und lass das!"
    putserv "NOTICE $nick :Op flag für $chan entfernt. Melde dich beim Admin, beim nächsten Mal gibts globales Deop!"
    return 2
  }
  if { [matchattr $handle "d|d" $chan] } {
    chattr $handle |+k $chan
    putserv "NOTICE $chan :Leute was geht, mich hat grad jemand gekickt, den ich eigentlich deoppe! Falls das deoppen der Grund ist, dann meldet euch verdammt nochmal bei einem Admin! (tried to notifie DeKus about this)"
    putserv "NOTICE $nick :Bevor das hier in ewigem gekicke und deoppe und so ausartet: kickban für $chan, sorry. Kannst ja versuchen ein Meister zu finden, der dir sicher hilft, falls das ein Unfall war :)."
#I tried to send me a privmsg which i would probably fastest read, in other case i simply send a note to me.
#In case you got that script from me, change this in your nicks and your bothandle! :)
    set dekus [hand2nick emp|De_Kus]
    if { $dekus == $botnick } {
      if { [onchan emp|De_Kus] } {
        set dekus emp|De_Kus
      } elseif { [onchan emp|De_Kus^weg] } {
        set dekus emp|De_Kus^weg
      } elseif { [onchan emp|De_Kus^zZz] } {
        set dekus emp|De_Kus^zZz
      } else {
        sendnote emp|De_Kus "$nick alias $handle hat mich mit deopflag von $chan gekickt!"
        return 2
      }
    }
    putserv "PRIVMSG [hand2nick emp|De_Kus]: $nick alias $handle hat mich mit deopflag von $chan gekickt!"
    return 2
  }
  set newhandle $handle
  if { $hand == "*" } {
    set newhandle [addnewuser $nick $uhost]
  }
  chattr newhandle +d
  putserv "NOTICE $nick :Glückwunsch, du hast das Herz der Sicherheit, den Eggdrop des Channels gekickt. Dies handelt dir allerdings ein globales Deopflag ein :). English quicky: Bot kicking sux -> global deop"
}
the text output is german, hope doenst matter. comments are keeped in english :). and yes, i get the log entry from putlog.

examble it worked:

Code: Select all

[18:23:23] * \sonunruhe\ (Millenium5@p50814E50.dip.t-dialin.net) has joined #landau
[18:23:23] * oFF]|[Legolas sets mode: +v \sonunruhe\
[18:23:24] * |EMP| sets mode: +o \sonunruhe\
[18:23:31] * [vibe`] (~blubb@pD9EADABB.dip.t-dialin.net) has joined #landau
[18:23:31] * oFF]|[Legolas sets mode: +v [vibe`]
[18:23:33] * |EMP| sets mode: +o [vibe`]
[18:23:38] * \sonunruhe\ sets mode: +pik (VirusScript
[18:23:38] * \sonunruhe\ sets mode: +l 1
[18:23:38] * \sonunruhe\ changes topic to 14(12VirusScript7 ME14)(15BeTa14) 10Get it at6 http://www.vScripT.cjb.net/ 10and6 http://www.yasarozg.net/
[18:23:38] * |EMP| sets mode: -pilko (VirusScript \sonunruhe\
[18:23:38] * \sonunruhe\ sets mode: -oooooo Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF emp|De_Kus^weg
[18:23:38] * hub.barrysworld.uk.quakenet.org sets mode: -o+ooooo \sonunruhe\ Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF
[18:23:38] * hub.barrysworld.uk.quakenet.org sets mode: +o emp|De_Kus^weg
[18:23:38] * tiscali.dk.quakenet.org sets mode: -o+ooooo \sonunruhe\ Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF
[18:23:38] * tiscali.dk.quakenet.org sets mode: +o emp|De_Kus^weg
[18:23:38] * \sonunruhe\ was kicked by |EMP| (Missbrauch eines Desync)
[18:23:39] -|EMP|@#landau- Keylamer \sonunruhe\ erfolgreich deoppt.
[18:23:44] -|EMP|@#landau- Deoplamer \sonunruhe\ gegen emp|De_Kus erfolgreich deoppt.
[18:23:46] * |EMP| sets mode: -ooooo Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF
in this case he was even a bit to fast so the whole szene desynched :D.
and cause of the double msg i added a smal if, that checks if he is already beeing deopt :).

and here a false:

Code: Select all

[21:46:32] * Kronix` (~kampflord@p508E697B.dip.t-dialin.net) has joined #landau
[21:46:32] * BloodRider sets mode: +v Kronix`
[21:46:33] * |EMP| sets mode: +o Kronix`
[21:46:42] * Maisysarah (sarah@pD9E38D0E.dip.t-dialin.net) Quit (Quit: <a1d0n> [19:26] <Maiskoernchen> ein grund den blonden von mir fehrn zu halten <<<<und ich war mit dem ne woche lang im selben zimmer!!!)
[21:50:35] * boo\\1] (~ZHGOZ@p508E697B.dip.t-dialin.net) has joined #landau (1 clone: @+Kronix`)
[21:50:36] * boo\\2] (~LZYZU@p508E697B.dip.t-dialin.net) has joined #landau (2 clones: @+Kronix` boo\\1])
[21:50:36] * boo\\3] (~LIHSB@p508E697B.dip.t-dialin.net) has joined #landau (3 clones: @+Kronix` boo\\2] boo\\1])
[21:50:36] * BloodRider sets mode: +v boo\\1]
[21:50:36] * BloodRider sets mode: +v boo\\2]
[21:50:36] * BloodRider sets mode: +v boo\\3]
[21:50:36] * Kronix` sets mode: +oo boo\\1] boo\\2]
[21:50:36] * |EMP| sets mode: +b *!*@p508E697B.dip.t-dialin.net
[21:50:36] * |EMP| sets mode: +o boo\\3]
[21:50:36] * boo\\1] sets mode: -bo *!*@p508E697B.dip.t-dialin.net |EMP|
[21:50:37] * L sets mode: +o |EMP|
[21:50:38] * |EMP| sets mode: -o+b Kronix` *!*@p508E697B.dip.t-dialin.net
[21:50:38] * Bg`ChiCka`bNc was kicked by boo\\1] (Bg`ChiCka`bNc)
[21:50:38] * BloodRider was kicked by boo\\2] (BloodRider)
[21:50:38] * c64|Solid was kicked by boo\\3] (c64|Solid)
[21:50:38] * Cha\ was kicked by boo\\1] (Cha\)
[21:50:38] * cryp^lernen was kicked by boo\\2] (cryp^lernen)
[21:50:38] * DiDi|afk was kicked by boo\\3] (DiDi|afk)
[21:50:38] * cryp^lernen (cryptic@pD9E4ACA2.dip.t-dialin.net) has joined #landau
[21:50:38] * Dschungeltier|a was kicked by boo\\1] (Dschungeltier|a)
[21:50:38] * E-waY was kicked by boo\\2] (E-waY)
[21:50:38] * emp|CoS21 was kicked by boo\\3] (emp|CoS21)
[21:50:38] * Dschungeltier|a (~Patrick.R@p508BEA8C.dip.t-dialin.net) has joined #landau
[21:50:39] * c64|Solid (Daniel@p508BD8D9.dip.t-dialin.net) has joined #landau
[21:50:39] * oFF]|[Lego`afk sets mode: +v cryp^lernen
[21:50:40] * Cha\ (cha@pD9E4AA3E.dip.t-dialin.net) has joined #landau
[21:50:41] * emp|De_Kus^weg was kicked by boo\\1] (emp|De_Kus^weg)
[21:50:43] *
[21:50:43] * Now talking in: (#landau)
[21:50:43] *
[21:50:43] * Topic: (9,1 Welcome ² #Landau - www.LD-WasGehtAb.de)
[21:50:43] * Set by: (TheWinner^afk) on (Monday December 16 2002 21:02:15)
[21:50:43] * Users: (20), Ops: (11/55%), Voiced: (6/30%), Regs: (3/15%)
[21:50:43] * Join synched in: (101) ms
[21:50:43] *
[21:50:43] 
[21:50:43] * oFF]|[Lego`afk sets mode: +v FlyingFin[work]
[21:50:43] * murda|Trooper was kicked by boo\\2] (murda|Trooper)
[21:50:43] * oFF]|[Lego`afk was kicked by boo\\3] (oFF]|[Lego`afk)
[21:50:43] * L sets mode: +o emp|De_Kus^weg
[21:50:43] * murda|Trooper (baer@LINUX.Server.sind.gameserver-profis.de) has joined #landau
[21:50:44] * DiDi|afk (~bnc2@p50842170.dip0.t-ipconnect.de) has joined #landau
[21:50:44] * L sets mode: +o DiDi|afk
[21:50:45] * TheWinner was kicked by boo\\1] (TheWinner)
[21:50:45] * vaLLe`-n\a was kicked by boo\\2] (vaLLe`-n\a)
[21:50:45] * XmasN3o^afk was kicked by boo\\3] (XmasN3o^afk)
[21:50:45] * TheWinner (~TheWinner@p50843689.dip.t-dialin.net) has joined #landau
[21:50:46] * oFF]|[Lego`afk (_Legolas@p5084173A.dip.t-dialin.net) has joined #landau
[21:50:47] * [TEE]-on^two was kicked by boo\\1] ([TEE]-on^two)
[21:50:47] * [zivi|bnc] was kicked by boo\\2] ([zivi|bnc])
[21:50:47] * INSIGNIA was kicked by boo\\3] (INSIGNIA)
[21:50:47] * XmasN3o^afk (~Freak@pD9E4AF62.dip.t-dialin.net) has joined #landau
[21:50:47] * vaLLe`-n\a (junger_got@p5084374F.dip.t-dialin.net) has joined #landau
[21:50:47] * INSIGNIA (angel@ist.der.raucher-am-werk.de) has joined #landau
[21:50:47] * [TEE]-on^two (~lulu@p5084341C.dip.t-dialin.net) has joined #landau
[21:50:49] * boo\\2] sets mode: +o Kronix`
[21:50:51] * boo\\2] sets mode: -b *!*@p508E697B.dip.t-dialin.net
[21:50:54] * boo\\3] was kicked by DiDi|afk (2(Gamers.IRC 3.2 Advanced Kick Protection2))
[21:50:59] * DiDi|afk was kicked by boo\\1] (DiDi|afk)
[21:50:59] * emp|De_Kus^weg was kicked by boo\\2] (emp|De_Kus^weg)
[21:51:01] *
[21:51:01] * Now talking in: (#landau)
[21:51:01] *
[21:51:01] * Topic: (9,1 Welcome ² #Landau - www.LD-WasGehtAb.de)
[21:51:01] * Set by: (TheWinner^afk) on (Monday December 16 2002 21:02:15)
[21:51:01] * Users: (13), Ops: (4/31%), Voiced: (1/8%), Regs: (8/62%)
[21:51:01] * Join synched in: (20) ms
[21:51:01] *
[21:51:01] 
[21:51:01] * INSIGNIA (angel@ist.der.raucher-am-werk.de) has joined #landau
[21:51:01] * Cha\ (cha@pD9E4AA3E.dip.t-dialin.net) has joined #landau
[21:51:01] * c64|Solid (Daniel@p508BD8D9.dip.t-dialin.net) has joined #landau
[21:51:02] * L sets mode: +o emp|De_Kus^weg
[21:51:02] * Dschungeltier|a (~Patrick.R@p508BEA8C.dip.t-dialin.net) has joined #landau
[21:51:02] * vaLLe`-n\a (junger_got@p5084374F.dip.t-dialin.net) has joined #landau
[21:51:02] * TheWinner was kicked by boo\\1] (TheWinner)
[21:51:03] * cryp^lernen was kicked by boo\\2] (cryp^lernen)
[21:51:03] * cryp^lernen (cryptic@pD9E4ACA2.dip.t-dialin.net) has joined #landau
[21:51:04] * [TEE]-on^two was kicked by boo\\1] ([TEE]-on^two)
[21:51:04] * FlyingFin[work] was kicked by boo\\2] (FlyingFin[work])
[21:51:04] * [TEE]-on^two (~lulu@p5084341C.dip.t-dialin.net) has joined #landau
[21:51:05] * FlyingFin[work] (~frank@ip3e83b5ca.speed.planet.nl) has joined #landau
[21:51:05] * DiDi|afk (~bnc2@p50842170.dip0.t-ipconnect.de) has joined #landau
[21:51:05] * L sets mode: +o DiDi|afk
[21:51:06] * Kronix` sets mode: +i
[21:51:07] * murda|Trooper was kicked by boo\\2] (murda|Trooper)
[21:51:08] * emp|De_Kus^weg was kicked by boo\\1] (emp|De_Kus^weg)
first sentinel sets ip ban cause of clone join flood (good)
gets deoppt cause of ban
gets reoppt and this is the he did... he never put a second deop or a kick...
seems he stucked in some loop and died (probably EOF from client). last log entry was L response "done".

any idea, or to much code and history? :D
and im sad to tell you im using windrop... im having no shell :(.
currently i have the latest 1.6.14 complied cvs (4.12.), but had the same problem already with 1.6.13 final (hoped .14 would have already some fixes ^-^).

PS: ich hab für das letzte beispiel nochma in den channel logs nachgeschaut: das waren die letzten zeile, das ab "|EMP| joined #landau." muss schon nach dem neustart sein. also ist er nach den zeilen irgendwann abgeschmiert, hab aktiviert, dass er erst nachträglich die logs schreibt, er könnte also noch ein paar sekunden gelebt haben (muss er ja, sonst hätte ich gleich EOF noch gesehen).
Bg`ChiCka`bNc kicked from #landau by boo\\1]: Bg`ChiCka`bNc
BloodRider kicked from #landau |EMP| joined #landau.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

There are a few thing you can do to find out what is causing the problems.

First off, downdrade to 1.6.12. This was a pretty stable release, and will rule out many issues.

Second, post the message generated by the crash. Most of the time, this message can be obtained from the file called DEBUG (note the caps) in the bots directory. It will also be posted to the console, so you can copy it from there (for the console method, do not start via a shortcut, open a dos window, and start the bot manualy with the command).

This error message will give us the last point eggdrop triggered a "context" marker. These are placed, as waypoints, so that we can tell that the bot crashed between the last displayed marker, and the next one found in processing order (this can usualy be obtained by looking at a few of these markers).

When it comes to Tcl script, eggdrop will usualy display the proc it was next triggering. If you call other functions in that script, eggdrop wont know about it, as it will only capture it's own running cycle.

With this information, we should be able to help more.

One thing I did notice, was you timer command. This needs revising a little.

You might try

Code: Select all

utimer 1 [list putserv "join $channel" -next]
This will generate the command correctly.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

k, thx

Post by De Kus »

k, ill look into it. i get headache only thinking on downgrading :D. ill test it later with 1.6.12.

and thx for the tip with the utimer. i just copied from the original qneed.tcl so i thought this way it would be ok.

and im having a strange - no its not a probleme, more a - phaenoman. but look yourself:
Image
my parallel running eggdrop for euirc shows normal readable stuff on console (dos-box) at startup. only scripts it has not, are the q scripts. i haven't had it earlier. and the only real diffrent in the config file is:

Code: Select all

set init-server {
  putserv "MODE $botnick +i-ws"
  putquick "PRIVMSG Q@CServe.quakenet.org :AUTH EMPIRE_eggi <yesthisnoterallymypassword>"
}
i added this line, so the bot gets already oppt during joining, but cant imaging that it could be the cause, and because it really doenst matter anyway... :D

btw. is it normal that the DEBUG doesnt change without error and the console gibts empty?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This debug is only generated on a eggdrop crash.

It is simalr to saving files in a text editor, it only changes it when needed. IE, in a word doc, when you ask it to save, in eggdrop, when it crashes.
Locked