alias atschrby return $chr(194) $+ $chr(169) alias atschrbydisplay return $chr(169) alias atscolorby { var %atstext = $replace($1-,$atschrby $+ by,$chr(32) $+ $atschrbydisplay $+ $chr(32) $+ by) var %atstoks = $numtok(%atstext,32) if (%atstoks >= 2) && ($gettok(%atstext,$calc(%atstoks - 1),32) == by) { var %atsbytok = $gettok(%atstext,$calc(%atstoks - 2),32) var %atsprefix = $gettok(%atstext,1- $+ $calc(%atstoks - 3),32) if (%atsbytok == $atschrby) || (%atsbytok == $atschrbydisplay) { return %atsprefix $+ $iif(%atsprefix != $null,$chr(32)) $+ $chr(3) $+ %atszitcol2 $+ $atschrbydisplay $+ $chr(32) $+ by $+ $chr(32) $+ $chr(3) $+ %atszitcol3 $+ $gettok(%atstext,%atstoks,32) } %atsprefix = $gettok(%atstext,1- $+ $calc(%atstoks - 2),32) return %atsprefix $+ $iif(%atsprefix != $null,$chr(32)) $+ $chr(3) $+ %atszitcol2 $+ by $+ $chr(32) $+ $chr(3) $+ %atszitcol3 $+ $gettok(%atstext,%atstoks,32) } return %atstext } alias atsquotecontrolcodes return $iif(%atszitcontrolcodes == on,on,off) alias atsquotecontrolfilter { if ($1- == $null) { return } if ($atsquotecontrolcodes == on) { return $1- } return $strip($1-) } alias atsquotesearchnormalize return $strip($1-) alias atsquotesearchquery { var %atspattern = $lower($strip($1-)) if (%atspattern == $null) { return } if (($chr(42) isin %atspattern) || ($chr(63) isin %atspattern)) { return %atspattern } return * $+ %atspattern $+ * } alias atsquotesearchterms { var %atsquery = $lower($strip($remove($1-,*,?))) if (%atsquery == $null) { return } while ($chr(32) $+ $chr(32) isin %atsquery) { %atsquery = $replace(%atsquery,$chr(32) $+ $chr(32),$chr(32)) } return %atsquery } alias atsquotesearchmatch return $atsquotesearchmatches($1-,$2) alias atsquotedisplaybody return $atsquotecontrolfilter($atsquotebody($1)) alias atsquoteplainline return Zitat $+ $chr(160) $+ $1 $+ / $+ $atsquotecount $+ : $+ $chr(32) $+ $atsquotedisplaybody($1) alias atsquotecolorline return Zitat $+ $chr(160) $+ $1 $+ / $+ $atsquotecount $+ : $+ $chr(32) $+ $chr(3) $+ %atszitcol1 $+ $atscolorby($atsquotesearchnormalize($atsquotebody($1))) alias atsquotesearchdisplayline { return Zitat-suche nach $left($replace(%atssuchbegriff,*,$chr(32)), $calc( $len( $replace(%atssuchbegriff,*,$chr(32))) - 1 )) ( $+ %atsdollartemp $+ / $+ %atszitnumm $+ ) $+ $chr(160) $+ [ $+ %atsznummer $+ / $+ $atsquotecount $+ ]: $+ $chr(32) $+ $1- } alias atsquoteinifile return quote.ini alias atsquotelegacyfile return zats2.ats alias atsquotesection return quote_ $+ $1 alias atsquotecacheversion return 17 alias atsquoterecordhash return atsquote_records alias atsquotecategoryhash return atsquote_categories alias atsquotesearchhash return atsquote_searches alias atsquotesourcehash return atsquote_searchlines alias atsquotesearchkey return $replace($lower($1-),*,_,$chr(124),-,`,_,\,_,/,_,?,_,$chr(32),_) alias atsquoteinvalidatecache { atsquotehashclear $atsquoterecordhash 64 atsquotehashclear $atsquotecategoryhash 32 atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 } alias atsquotehashensure { var %atshash = $1 var %atssize = $iif($2 isnum,$2,32) if (!$hget(%atshash)) { hmake %atshash %atssize } } alias atsquotehashclear { var %atshash = $1 var %atssize = $iif($2 isnum,$2,32) atsquotehashensure %atshash %atssize if ($hget(%atshash,0).item > 0) { hdel -w %atshash * } } alias atsquotewarmcache { atsquoteensure atsquotebuildrecordhash atsquotebuildsearchsourcehash atsquotebuildcategoryhash atsquotesearchreset } alias atsquoterecordreset { var %atshash $atsquoterecordhash atsquotehashclear %atshash 64 hadd -m %atshash version $atsquotecacheversion hadd -m %atshash count 0 } alias atsquoterecordset { var %atshash $atsquoterecordhash var %atsindex = $1 var %atsdescription = $2 var %atstext = $3 var %atsnick = $4 var %atscategory = $5 var %atsitem if (!$hget(%atshash)) { atsquoterecordreset } hadd -m %atshash count $max($hget(%atshash,count),%atsindex) %atsitem = description. $+ %atsindex hadd -m %atshash %atsitem %atsdescription %atsitem = text. $+ %atsindex hadd -m %atshash %atsitem %atstext %atsitem = nick. $+ %atsindex hadd -m %atshash %atsitem %atsnick %atsitem = category. $+ %atsindex hadd -m %atshash %atsitem %atscategory } alias atsquoterecordsetencoded { var %atshash $atsquoterecordhash var %atsindex = $1 var %atsdescription = $atsquotedecode($2) var %atstext = $atsquotedecode($3) var %atsnick = $atsquotedecode($4) var %atscategory = $atsquotedecode($5) var %atsitem if (!$hget(%atshash)) { atsquoterecordreset } hadd -m %atshash count $max($hget(%atshash,count),%atsindex) %atsitem = description. $+ %atsindex hadd -m %atshash %atsitem %atsdescription %atsitem = text. $+ %atsindex hadd -m %atshash %atsitem %atstext %atsitem = nick. $+ %atsindex hadd -m %atshash %atsitem %atsnick %atsitem = category. $+ %atsindex hadd -m %atshash %atsitem %atscategory } alias atsquotebuildrecordhash { atsquoteensure atsquoterecordreset var %atsini $atsquoteinifile var %atscount $readini(%atsini,quotes,count) if (%atscount !isnum) { return 0 } hadd -m $atsquoterecordhash count %atscount var %atsindex 1 while (%atsindex <= %atscount) { var %atssection $atsquotesection(%atsindex) var %atsdescriptionitem description. $+ %atsindex var %atstextitem text. $+ %atsindex var %atsnickitem nick. $+ %atsindex var %atscategoryitem category. $+ %atsindex hadd -m $atsquoterecordhash %atsdescriptionitem $atsquotedecode($readini(%atsini,%atssection,description)) hadd -m $atsquoterecordhash %atstextitem $atsquotedecode($readini(%atsini,%atssection,text)) hadd -m $atsquoterecordhash %atsnickitem $atsquotedecode($readini(%atsini,%atssection,nick)) hadd -m $atsquoterecordhash %atscategoryitem $atsquotedecode($readini(%atsini,%atssection,category)) /inc %atsindex 1 } return %atscount } alias atsquoterecordfield { var %atsitem $1 $+ . $+ $2 if (!$hget($atsquoterecordhash)) || ($hget($atsquoterecordhash,version) != $atsquotecacheversion) { atsquotebuildrecordhash } if (!$hget($atsquoterecordhash,%atsitem)) { var %atsvalue $atsquotedecode($readini($atsquoteinifile,$atsquotesection($2),$1)) if (%atsvalue == $null) { return } if ($hget($atsquoterecordhash)) { hadd -m $atsquoterecordhash %atsitem %atsvalue } return %atsvalue } return $hget($atsquoterecordhash,%atsitem) } alias atsquotesourcereset { var %atshash $atsquotesourcehash atsquotehashclear %atshash 64 hadd -m %atshash version $atsquotecacheversion hadd -m %atshash count 0 } alias atsquotebuildsearchsourcehash { atsquoteensure atsquotesourcereset var %atsini $atsquoteinifile var %atscount $readini(%atsini,quotes,count) if (%atscount !isnum) { return 0 } hadd -m $atsquotesourcehash count %atscount var %atsindex 1 while (%atsindex <= %atscount) { var %atssection $atsquotesection(%atsindex) var %atslineitem line. $+ %atsindex var %atsdescription $atsquotedecode($readini(%atsini,%atssection,description)) var %atstext $atsquotedecode($readini(%atsini,%atssection,text)) var %atsnick $atsquotedecode($readini(%atsini,%atssection,nick)) var %atscategory $atsquotedecode($readini(%atsini,%atssection,category)) var %atsline $atsquotesearchnormalize(%atsdescription) $+ $chr(170) $+ $atsquotesearchnormalize(%atstext $+ $atschrby $+ by %atsnick) $+ $iif(%atscategory != $null,$chr(170) $+ $atsquotesearchnormalize(%atscategory)) hadd -m $atsquotesourcehash %atslineitem $atsquoteencode(%atsline) /inc %atsindex 1 } return %atscount } alias atsquotecategoryreset { var %atshash $atsquotecategoryhash atsquotehashclear %atshash 32 hadd -m %atshash version $atsquotecacheversion hadd -m %atshash count 1 hadd -m %atshash cat.1 Alle hadd -m %atshash quotes.1 } alias atsquoteaddcategory { if ($1- == $null) { return 0 } var %atshash $atsquotecategoryhash if (!$hget(%atshash)) { atsquotecategoryreset } var %atsindex 1 var %atscatitem var %atsquotesitem while (%atsindex <= $hget(%atshash,count)) { %atscatitem = cat. $+ %atsindex if ($hget(%atshash,%atscatitem) == $1-) { goto atsquoteaddcategory_found } /inc %atsindex 1 } %atsindex = $calc($hget(%atshash,count) + 1) hadd -m %atshash count %atsindex %atscatitem = cat. $+ %atsindex %atsquotesitem = quotes. $+ %atsindex hadd -m %atshash %atscatitem $1- hadd -m %atshash %atsquotesitem :atsquoteaddcategory_found if ($2 isnum) { %atsquotesitem = quotes. $+ %atsindex var %atsquotes $hget(%atshash,%atsquotesitem) hadd -m %atshash %atsquotesitem $addtok(%atsquotes,$2,170) } return %atsindex } alias atsquotebuildcategoryhash { atsquotecategoryreset var %atsindex 1 while (%atsindex <= $atsquotecount) { var %atscat $atsquotecategory(%atsindex) if (%atscat != $null) { atsquoteaddcategory %atscat %atsindex } /inc %atsindex 1 } } alias atsquotecategorycount { if (!$hget($atsquotecategoryhash)) || ($hget($atsquotecategoryhash,version) != $atsquotecacheversion) { atsquotebuildcategoryhash } return $hget($atsquotecategoryhash,count) } alias atsquotecategoryname { if (!$hget($atsquotecategoryhash)) { atsquotebuildcategoryhash } var %atsitem cat. $+ $1 return $hget($atsquotecategoryhash,%atsitem) } alias atsquotecategoryquotes { if (!$hget($atsquotecategoryhash)) { atsquotebuildcategoryhash } var %atsitem quotes. $+ $1 return $hget($atsquotecategoryhash,%atsitem) } alias atsquoteencode { if ($1- == $null) { return __EMPTY__ } return $encode($1-,m) } alias atsquotedecode { if ($1- == $null) || ($1- == __EMPTY__) { return } return $decode($1-,m) } alias atsquoteensure { var %atsini $atsquoteinifile var %atsnewfile = $iif(!$isfile(%atsini),1,0) if (%atsnewfile) { /echo 7 -at Erzeuge %atsini ... } if (%atsnewfile) { /writeini %atsini quotes format 1 } if ($readini(%atsini,quotes,count) == $null) { /writeini %atsini quotes count 0 } if (%atsnewfile) { /echo 7 -at %atsini erstellt. } } alias atsquotecount { if ($hget($atsquoterecordhash)) { return $hget($atsquoterecordhash,count) } atsquoteensure var %atscount $readini($atsquoteinifile,quotes,count) if (%atscount !isnum) { return 0 } return %atscount } alias atsquotedescription return $atsquoterecordfield(description,$1) alias atsquotetext return $atsquoterecordfield(text,$1) alias atsquotenick return $atsquoterecordfield(nick,$1) alias atsquotecategory return $atsquoterecordfield(category,$1) alias atsquotebody return $atsquotetext($1) $+ $atschrby $+ by $atsquotenick($1) alias atsquotebodyplain return $atsquotetext($1) $+ $chr(32) $+ $atschrbydisplay $+ $chr(32) $+ by $+ $chr(32) $+ $atsquotenick($1) alias atsquoteline return $atsquotedescription($1) $+ $chr(170) $+ $atsquotebody($1) $+ $iif($atsquotecategory($1) != $null,$chr(170) $+ $atsquotecategory($1)) alias atsquotesearchline { if ($1 !isnum 1- $+ $atsquotecount) { return } var %atsdescription $atsquotesearchnormalize($atsquotedescription($1)) var %atsbody $atsquotesearchnormalize($atsquotebody($1)) var %atscategory $atsquotesearchnormalize($atsquotecategory($1)) return %atsdescription $+ $chr(170) $+ %atsbody $+ $iif(%atscategory != $null,$chr(170) $+ %atscategory) } alias atsquotesearchsourceline { if ($1 !isnum 1- $+ $atsquotecount) { return } if (!$hget($atsquotesourcehash)) || ($hget($atsquotesourcehash,version) != $atsquotecacheversion) { atsquotebuildsearchsourcehash } var %atsitem line. $+ $1 if (!$hget($atsquotesourcehash,%atsitem)) { var %atsline $atsquotesearchline($1) if (%atsline == $null) { return } hadd -m $atsquotesourcehash %atsitem $atsquoteencode(%atsline) return %atsline } return $atsquotedecode($hget($atsquotesourcehash,%atsitem)) } alias atsquotesearchmatches { var %atsquery $atsquotesearchterms($1-) if (%atsquery == $null) { return 1 } var %atsline $lower($atsquotesearchsourceline($2)) if (%atsline == $null) { return 0 } var %atstermindex 1 while (%atstermindex <= $numtok(%atsquery,32)) { var %atsterm $gettok(%atsquery,%atstermindex,32) if (%atsterm != $null) { if (%atsterm !isin %atsline) { return 0 } } inc %atstermindex } return 1 } alias atsquoteexists return $iif($atsquotefindindex($1-,1) > 0,$true,$false) alias atsquotefindindex { var %atspattern = $1- var %atsstart = $iif($2 isnum,$2,1) var %atscount = $atsquotecount while (%atsstart <= %atscount) { if ($atsquotesearchmatches(%atspattern,%atsstart)) { return %atsstart } /inc %atsstart 1 } return 0 } alias atsquotefind { var %atsindex = $atsquotefindindex($1-,$2) if (%atsindex > 0) { return $atsquoteline(%atsindex) } return } alias atsquotesearchreset { atsquotehashclear $atsquotesearchhash 32 hadd -m $atsquotesearchhash version $atsquotecacheversion } alias atsquotebuildsearchcache { var %atspattern = $1- var %atskey $atsquotesearchkey(%atspattern) var %atscountitem count. $+ %atskey var %atsresultitem if (!$hget($atsquotesearchhash)) || ($hget($atsquotesearchhash,version) != $atsquotecacheversion) { atsquotesearchreset } if ($hget($atsquotesearchhash,%atscountitem)) { return $hget($atsquotesearchhash,%atscountitem) } var %atsindex 1 var %atscount 0 while (%atsindex <= $atsquotecount) { if ($atsquotesearchmatches(%atspattern,%atsindex)) { /inc %atscount 1 %atsresultitem = result. $+ %atskey $+ . $+ %atscount hadd -m $atsquotesearchhash %atsresultitem %atsindex } /inc %atsindex 1 } hadd -m $atsquotesearchhash %atscountitem %atscount return %atscount } alias atsquotesearchcount { if (!$hget($atsquotesearchhash)) || ($hget($atsquotesearchhash,version) != $atsquotecacheversion) { atsquotesearchreset } var %atskey $atsquotesearchkey($1-) var %atscountitem count. $+ %atskey if (!$hget($atsquotesearchhash,%atscountitem)) { return $atsquotebuildsearchcache($1-) } return $hget($atsquotesearchhash,%atscountitem) } alias atsquotesearchresult { var %atskey $atsquotesearchkey($1-) var %atscountitem count. $+ %atskey var %atsresultitem result. $+ %atskey $+ . $+ $2 if (!$hget($atsquotesearchhash)) || ($hget($atsquotesearchhash,version) != $atsquotecacheversion) { atsquotesearchreset } if (!$hget($atsquotesearchhash,%atscountitem)) { atsquotebuildsearchcache $1- } if ($2 !isnum) { return } if (!$hget($atsquotesearchhash,%atsresultitem)) { return } return $hget($atsquotesearchhash,%atsresultitem) } alias atsquotebuildsearchfile { return $atsquotebuildsearchcache($2-) } alias atsquoteappend { atsquoteensure var %atsnext $calc($atsquotecount + 1) /writeini $atsquoteinifile quotes count %atsnext /writeini $atsquoteinifile $atsquotesection(%atsnext) index %atsnext /writeini $atsquoteinifile $atsquotesection(%atsnext) description $atsquoteencode($1) /writeini $atsquoteinifile $atsquotesection(%atsnext) text $atsquoteencode($2) /writeini $atsquoteinifile $atsquotesection(%atsnext) nick $atsquoteencode($3) /writeini $atsquoteinifile $atsquotesection(%atsnext) category $atsquoteencode($4) atsquoterecordsetencoded %atsnext $atsquoteencode($1) $atsquoteencode($2) $atsquoteencode($3) $atsquoteencode($4) atsquotehashclear $atsquotecategoryhash 32 atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 return %atsnext } alias atsquoteappendencoded { atsquoteensure var %atsnext $calc($atsquotecount + 1) var %atsdescription = $iif($1 != $null,$1,__EMPTY__) var %atstext = $iif($2 != $null,$2,__EMPTY__) var %atsnick = $iif($3 != $null,$3,__EMPTY__) var %atscategory = $iif($4 != $null,$4,__EMPTY__) /writeini $atsquoteinifile quotes count %atsnext /writeini $atsquoteinifile $atsquotesection(%atsnext) index %atsnext /writeini $atsquoteinifile $atsquotesection(%atsnext) description %atsdescription /writeini $atsquoteinifile $atsquotesection(%atsnext) text %atstext /writeini $atsquoteinifile $atsquotesection(%atsnext) nick %atsnick /writeini $atsquoteinifile $atsquotesection(%atsnext) category %atscategory atsquoterecordsetencoded %atsnext %atsdescription %atstext %atsnick %atscategory atsquotehashclear $atsquotecategoryhash 32 atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 return %atsnext } alias atsquoteupdate { if ($1 !isnum 1- $+ $atsquotecount) { return 0 } /writeini $atsquoteinifile $atsquotesection($1) index $1 /writeini $atsquoteinifile $atsquotesection($1) description $atsquoteencode($2) /writeini $atsquoteinifile $atsquotesection($1) text $atsquoteencode($3) /writeini $atsquoteinifile $atsquotesection($1) nick $atsquoteencode($4) /writeini $atsquoteinifile $atsquotesection($1) category $atsquoteencode($5) atsquoterecordsetencoded $1 $atsquoteencode($2) $atsquoteencode($3) $atsquoteencode($4) $atsquoteencode($5) atsquotehashclear $atsquotecategoryhash 32 atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 return $1 } alias atsquoteupdateencoded { if ($1 !isnum 1- $+ $atsquotecount) { return 0 } var %atsdescription = $iif($2 != $null,$2,__EMPTY__) var %atstext = $iif($3 != $null,$3,__EMPTY__) var %atsnick = $iif($4 != $null,$4,__EMPTY__) var %atscategory = $iif($5 != $null,$5,__EMPTY__) /writeini $atsquoteinifile $atsquotesection($1) index $1 /writeini $atsquoteinifile $atsquotesection($1) description %atsdescription /writeini $atsquoteinifile $atsquotesection($1) text %atstext /writeini $atsquoteinifile $atsquotesection($1) nick %atsnick /writeini $atsquoteinifile $atsquotesection($1) category %atscategory atsquoterecordsetencoded $1 %atsdescription %atstext %atsnick %atscategory atsquotehashclear $atsquotecategoryhash 32 atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 return $1 } alias atsquotedelete { var %atsindex = $1 var %atscount = $atsquotecount if (%atsindex !isnum 1- $+ %atscount) { return 0 } while (%atsindex < %atscount) { /atsquoteupdateencoded %atsindex $atsquoteencode($atsquotedescription($calc(%atsindex + 1))) $atsquoteencode($atsquotetext($calc(%atsindex + 1))) $atsquoteencode($atsquotenick($calc(%atsindex + 1))) $atsquoteencode($atsquotecategory($calc(%atsindex + 1))) /inc %atsindex 1 } /remini $atsquoteinifile $atsquotesection(%atscount) /writeini $atsquoteinifile quotes count $calc(%atscount - 1) atsquotebuildrecordhash atsquotehashclear $atsquotecategoryhash 32 atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 return $calc(%atscount - 1) } alias atsquotefilllistall { var %atsindex $iif($3 isnum,$3,1) /did -r $1 $2 while (%atsindex <= $atsquotecount) { /did -a $1 $2 $atsquotedescription(%atsindex) /inc %atsindex 1 } } alias atsquotefillcategories { atsquotebuildcategoryhash /did -r $1 $2 var %atsindex 1 while (%atsindex <= $atsquotecategorycount) { /did -a $1 $2 $atsquotecategoryname(%atsindex) /inc %atsindex 1 } } alias atsquotefilllistcat { /did -r $1 $2 var %atsquotes $atsquotecategoryquotes($3) var %atscounti 1 while (%atscounti <= $numtok(%atsquotes,170)) { var %atsquoteidx $gettok(%atsquotes,%atscounti,170) /did -a $1 $2 $atsquotedescription(%atsquoteidx) /inc %atscounti 1 } } alias atsquotesyncini { var %atslegacy $atsquotelegacyfile var %atsini $atsquoteinifile if (!$isfile(%atslegacy)) { return } if ($isfile(%atsini)) { .remove %atsini } var %atscount $read -tl1 %atslegacy if (%atscount == $null) { %atscount = 0 } /writeini %atsini quotes format 1 /writeini %atsini quotes count %atscount var %atsindex 1 while (%atsindex <= %atscount) { var %atsline $read(%atslegacy, n, %atsindex) var %atsdescription $gettok(%atsline,1,170) var %atsbody $gettok(%atsline,2,170) var %atscategory $gettok(%atsline,3,170) var %atstext $atsquotecontrolfilter($gettok(%atsbody,1,169)) var %atsnick $mid($atsquotecontrolfilter($gettok(%atsbody,2,169)),4) var %atssection quote_ $+ %atsindex /writeini %atsini %atssection index %atsindex /writeini %atsini %atssection description $atsquoteencode(%atsdescription) /writeini %atsini %atssection text $atsquoteencode(%atstext) /writeini %atsini %atssection nick $atsquoteencode(%atsnick) /writeini %atsini %atssection category $atsquoteencode(%atscategory) /inc %atsindex 1 } atsquotebuildrecordhash atsquotehashclear $atsquotecategoryhash 32 atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 } alias atsquoteimportini { var %atsini $atsquoteinifile var %atslegacy $atsquotelegacyfile if (!$isfile(%atsini)) { return 0 } var %atscount $readini(%atsini,quotes,count) if (%atscount == $null) { var %atssectionindex 1 %atscount = 0 while (%atssectionindex <= $ini(%atsini,0)) { if ($left($ini(%atsini,%atssectionindex),6) == quote_) { /inc %atscount 1 } /inc %atssectionindex 1 } } /write -c %atslegacy /write -l1 %atslegacy %atscount var %atsindex 1 while (%atsindex <= %atscount) { var %atssection quote_ $+ %atsindex var %atsdescription $atsquotedecode($readini(%atsini,%atssection,description)) var %atstext $atsquotedecode($readini(%atsini,%atssection,text)) var %atsnick $atsquotedecode($readini(%atsini,%atssection,nick)) var %atscategory $atsquotedecode($readini(%atsini,%atssection,category)) /write -l $+ $calc(%atsindex + 1) %atslegacy %atsdescription $+ $chr(170) $+ %atstext $+ $atschrby $+ by %atsnick $+ $iif(%atscategory != $null,$chr(170) $+ %atscategory) /inc %atsindex 1 } return %atscount } alias atsquotebootstrap { if ($isfile($atsquoteinifile)) { atsquotewarmcache if ($isfile($atsquotelegacyfile)) { .remove $atsquotelegacyfile } return } if ($isfile($atsquotelegacyfile)) { /atsquotesyncini .remove $atsquotelegacyfile atsquotewarmcache return } atsquotewarmcache } alias zs { /inc -u86400 %atszph [ $+ [ $date $+ [ $time(H) ] ] ] if ( $1 != $null ) { if ( $len($remove($1-,*,?)) < 3 ) && ( $len($remove($1-,*,?)) != 0 ) && ( $1- !isnum ) { if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $strip(Zitatsuchbegriff muss mindestens 2 Zeichen lang sein!) } else { /msg %atsATSzitsearch Zitatsuchbegriff muss mindestens 3 Zeichen lang sein! } } else { /echo 7 -t ### $chr(3) $+ 14Zitatsuchbegriff muss mindestens 2 Zeichen lang sein! $chr(3) $+ 7### } /halt } if ( [ $ [ $+ [ $lastarg($$1-) ] ] ] isnum ) { /set %atssuchnummer [ $ [ $+ [ $lastarg($$1-) ] ] ] /set %atssuchbegriff [ $1- [ $+ [ $calc($lastarg($$1-) - 1 ) ] ] ] } elseif ( [ $ [ $+ [ $lastarg($$1-) ] ] ] = random ) { /set %atssuchnummer [ $ [ $+ [ $lastarg($$1-) ] ] ] /set %atssuchbegriff [ $1- [ $+ [ $calc($lastarg($$1-) - 1 ) ] ] ] } else { /set %atssuchnummer $null /set %atssuchbegriff [ $1- [ $+ [ $lastarg($$1-) ] ] ] } } if ( %atssuchbegriff = %atssuchnummer ) { if ( $1 isnum 1- $+ $atsquotecount ) { /set %atsznummer $1 if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $atsquoteplainline(%atsznummer) } else { /msg %atsATSzitsearch $atsquotecolorline(%atsznummer) } } else { if ( c isincs $gettok($chan($chan).mode,1,32) ) { /say $atsquoteplainline(%atsznummer) } else { /say $atsquotecolorline(%atsznummer) } } /halt } } /set %atssuchbegriff * $+ $replace(%atssuchbegriff , $chr(32) , * ) $+ * /set -u10 %atsdollartemp %atssuchnummer :neustart /set %atsznummer $rand(1,$atsquotecount) if ( $1 != $null ) { /unset %atszitnumm if (!$hget($atsquotesearchhash)) || ($hget($atsquotesearchhash,version) != $atsquotecacheversion) { atsquotesearchreset } if ($hget($atsquotesearchhash,query) != %atssuchbegriff) { atsquotesearchreset hadd -m $atsquotesearchhash query %atssuchbegriff var %atsquery $atsquotesearchterms(%atssuchbegriff) var %atsindex 1 var %atscount 0 while (%atsindex <= $atsquotecount) { var %atsline $lower($atsquotesearchsourceline(%atsindex)) var %atsmatched 1 var %atstermindex 1 while (%atstermindex <= $numtok(%atsquery,32)) { var %atsterm $gettok(%atsquery,%atstermindex,32) if (%atsterm != $null) { if (%atsterm !isin %atsline) { %atsmatched = 0 goto atsquotesearchbuild_next } } inc %atstermindex } if (%atsmatched) { inc %atscount hadd -m $atsquotesearchhash result. $+ %atscount %atsindex } :atsquotesearchbuild_next inc %atsindex } hadd -m $atsquotesearchhash count %atscount } /set %atszitnumm $hget($atsquotesearchhash,count) if ( %atszitnumm <= 0 ) { if ( %atsATSzitsearch != $null ) { if ( %atsATSzitrandom = on ) { if ( %atsatsnoresult = 1 ) { /unset %atsATSzitrandom | /unset %atsATSzitsearch | /unset %atsatsnoresult | /halt } /set %atsatsnoresult 1 | /zs2 %atsatshostmask random | /halt } if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch Sorry, habe kein Zitat mit $replace(%atssuchbegriff , * , $chr(32) ) drin gefunden } else { /msg %atsATSzitsearch $chr(3) $+ 14Sorry, habe kein Zitat mit $replace(%atssuchbegriff , * , $chr(32) ) drin gefunden } /unset %atsATSzitsearch /halt } else { /echo 7 -t ### $chr(3) $+ 14Sorry, habe kein Zitat mit $replace(%atssuchbegriff , * , $chr(32) ) drin gefunden $chr(3) $+ 7### | /halt } } if (%atsdollartemp isnum) { if (%atsdollartemp > %atszitnumm) { if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $strip(Die Zitatsuche nach $left($replace(%atssuchbegriff,*,$chr(32)), $calc( $len( $replace(%atssuchbegriff,*,$chr(32))) - 1 )) hat nur %atszitnumm Ergebnisse. Nutze !zitat $+ $me $replace(%atssuchbegriff , * , $chr(32) ) .) } else { /msg %atsATSzitsearch $chr(3) $+ 14Die Zitatsuche nach $left($replace(%atssuchbegriff,*,$chr(32)), $calc( $len( $replace(%atssuchbegriff,*,$chr(32))) - 1 )) hat nur %atszitnumm Ergebnisse. Nutze !zitat $+ $me $replace(%atssuchbegriff , * , $chr(32) ) . } /unset %atsATSzitsearch } else { /echo 7 -t ### $chr(3) $+ 14Die Zitatsuche nach $left($replace(%atssuchbegriff,*,$chr(32)), $calc( $len( $replace(%atssuchbegriff,*,$chr(32))) - 1 )) hat nur %atszitnumm Ergebnisse. Nutze /zs $replace(%atssuchbegriff , * , $chr(32) ) . $chr(3) $+ 7### } /halt } /set %atsznummer $hget($atsquotesearchhash,result. $+ %atsdollartemp) /set -u20 %atszbtemp $atscolorsearch(g) if ( %atszbtemp = $null ) { /set -u20 %atszbtemp $atsquotesearchnormalize($atsquotebody(%atsznummer)) } if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $atsquotesearchdisplayline($atsquotesearchnormalize(%atszbtemp)) } else { /msg %atsATSzitsearch $atsquotesearchdisplayline(%atszbtemp) } /unset %atsATSzitsearch } else { if ( c isincs $gettok($chan($chan).mode,1,32) ) { /say $atsquotesearchdisplayline($atsquotesearchnormalize(%atszbtemp)) } else { /say $atsquotesearchdisplayline(%atszbtemp) } } /halt } if ( %atszitnumm = 1 ) { /set %atsdollartemp 1 /set %atsznummer $hget($atsquotesearchhash,result. $+ %atsdollartemp) /set -u20 %atszbtemp $atscolorsearch(g) if ( %atszbtemp = $null ) { /set -u20 %atszbtemp $atsquotesearchnormalize($atsquotebody(%atsznummer)) } if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $atsquotesearchdisplayline($atsquotesearchnormalize(%atszbtemp)) } else { /msg %atsATSzitsearch $atsquotesearchdisplayline(%atszbtemp) } /unset %atsATSzitsearch } else { if ( c isincs $gettok($chan($chan).mode,1,32) ) { /say $atsquotesearchdisplayline($atsquotesearchnormalize(%atszbtemp)) } else { /say $atsquotesearchdisplayline(%atszbtemp) } } /halt } else { if ( %atsdollartemp = random ) { :retryagain /set %atsdollartemp $rand(1,%atszitnumm) if ( %atslastsearch = %atsdollartemp ) && ( %atszitnumm > 1 ) { goto retryagain } /set %atslastsearch %atsdollartemp /set %atsznummer $hget($atsquotesearchhash,result. $+ %atsdollartemp) /set -u20 %atszbtemp $atscolorsearch(g) if ( %atszbtemp = $null ) { /set -u20 %atszbtemp $atsquotesearchnormalize($atsquotebody(%atsznummer)) } if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $atsquotesearchdisplayline($atsquotesearchnormalize(%atszbtemp)) } else { /msg %atsATSzitsearch $atsquotesearchdisplayline(%atszbtemp) } /unset %atsATSzitsearch } else { if ( c isincs $gettok($chan($chan).mode,1,32) ) { /say $atsquotesearchdisplayline($atsquotesearchnormalize(%atszbtemp)) } else { /say $atsquotesearchdisplayline(%atszbtemp) } } /halt } if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $strip(Die Zitatsuche hat insgesamt %atszitnumm Ergebnisse gebracht, gib !zitat $+ $me $replace(%atssuchbegriff , * , $chr(32) ) ein um dir die einzelnen Ergebnisse anzusehen) } else { /msg %atsATSzitsearch $chr(3) $+ 14Die Zitatsuche hat insgesamt %atszitnumm Ergebnisse gebracht, gib !zitat $+ $me $replace(%atssuchbegriff , * , $chr(32) ) ein um dir die einzelnen Ergebnisse anzusehen } /unset %atsATSzitsearch } else { /echo 7 -t ### $chr(3) $+ 14Die Zitatsuche hat insgesamt %atszitnumm Ergebnisse gebracht, gib /zs $replace(%atssuchbegriff , * , $chr(32) ) ein um dir die einzelnen Ergebnisse anzusehen $chr(3) $+ 7### } /halt } } if ( %atsATSzitsearch != $null ) { if ( c isincs $chan(%atsATSzitsearch).mode ) { /msg %atsATSzitsearch $atsquoteplainline(%atsznummer) } else { /msg %atsATSzitsearch $atsquotecolorline(%atsznummer) } /unset %atsATSzitsearch } else { if ( c isincs $gettok($chan($chan).mode,1,32) ) { say $atsquoteplainline(%atsznummer) } else { say $atsquotecolorline(%atsznummer) } } } on 1:text:!zitat*:%atszitchan:{ triggercheck $1- if ( $me !isop $chan ) && ( S ison $chan ) { /halt } if ( $findtok(%atszitchannot,$chan,1,44) ) && ( %atszitset = 2 ) { /halt } var %atstrigger !zitat $+ $me if ($left($1-,$len(%atstrigger)) == %atstrigger) && (($len($1-) == $len(%atstrigger)) || ($mid($1-,$calc($len(%atstrigger) + 1),1) == $chr(32))) { var %atssuche = $mid($1-,$calc($len(%atstrigger) + 2)) if ( [ %zitchannel [ $+ [ $chan ] ] ] != on ) { /set -u5 [ %zitchannel [ $+ [ $chan ] ] ] on /set %atsATSzitsearch $chan /zs %atssuche /halt } } } alias zitadd { /dialog -m zitaddt zitaddt if ( $$1- != $null ) { /did -o zitaddt 1 1 $$1- | zitaddedit1 } } alias zitadd2 { /set %atszitat $$gettok($$1-,1,179) /set %atsznick $$gettok($$1-,2,179) /set %atszitab $$gettok($$1-,3,179) /set %atszitcat $gettok($$1-,4,179) /set %atsznummer $atsquoteappend(%atszitab,%atszitat,%atsznick,%atszitcat) :weig if ( %atszitaddmod = $null ) { if ( c isincs $gettok($chan($chan).mode,1,32) ) { /msg $active Neues Zitat zur Zitatsammlung hinzugefuegt =) $+ $chr(160) $+ (# $+ %atsznummer $+ ): $strip(%atszitat) $+ $chr(32) $+ $atschrbydisplay $+ $chr(32) $+ by $+ $chr(32) $+ %atsznick } else { /msg $active Neues Zitat zur Zitatsammlung hinzugefuegt =) $+ $chr(160) $+ (# $+ %atsznummer $+ ): $chr(3) $+ %atszitcol1 $+ %atszitat $chr(3) $+ %atszitcol2 $+ $chr(32) $+ $atschrbydisplay $+ $chr(32) $+ by $+ $chr(32) $+ $chr(3) $+ %atszitcol3 $+ %atsznick } } /unset %atszitaddmod } on 1:text:zitadd*:?:{ triggercheck $1- if ( [ %zitadd [ $+ [ $nick ] ] ] != on ) { /set -u30 [ %zitadd [ $+ [ $nick ] ] ] on /set -u20 %zln $read -tl1 fremd.txt /set -u20 %atstemp $calc( %zln + 1 ) /write -l $+ $calc( %atstemp + 1 ) fremd.txt < von $nick >< $gettok($$1-,2,126) >< $gettok($$1-,3-,126) > /write -l1 fremd.txt %atstemp /msg $nick Thx, der Zitat-vorschlag is abgespeichert worden ;) ($gettok($$1-,3-,126) $+ $atschrby $+ by $gettok($$1-,2,126) $chr(3) $+ ) ; /close -m $nick } else { /inc -u30 [ %zitatx $+ [ $nick ] ] 1 if ( [ %zitatx [ $+ [ $nick ] ] ] <= 2 ) { /notice $nick Naaa, bidde net Spammen! } } } alias zitimport { atsquoteimportreset /unset %exfile /set %exfile $file="File auswaehlen" *.bak if ( %exfile = $null ) { /halt } /dialog -m zitimport zitimport /var %atsa1 1 /set -u60 %temp $readini(%exfile,quotes,count) if (%temp == $null) { %temp = 0 } while ( %atsa1 <= %temp ) { var %atssection = quote_ $+ %atsa1 var %atsdescription = $atsquotedecode($readini(%exfile,%atssection,description)) if (%atsdescription != $null) { /did -a zitimport 2 %atsdescription atsquoteimportset $did(zitimport,2).lines %atssection } /inc %atsa1 1 } } on 1:dialog:zitimport:sclick:2:{ var %atssection = $atsquoteimportget($did(zitimport,2).sel) if (%atssection == $null) { halt } var %atstext = $atsquotedecode($readini(%exfile,%atssection,text)) var %atsnick = $atsquotedecode($readini(%exfile,%atssection,nick)) /did -r zitimport 3 /did -o zitimport 3 1 %atstext $+ $atschrby $+ by %atsnick if ( %atstext = $null ) { /did -r zitimport 3 /did -o zitimport 3 1 %atsnick } } on 1:dialog:zitimport:sclick:4:{ var %atssel = $did(zitimport,2).sel var %atssection = $atsquoteimportget($did(zitimport,2).sel) if (%atssection == $null) { halt } atsquoteimportbulkbegin /atsquoteimportappendencoded $readini(%exfile,%atssection,description) $readini(%exfile,%atssection,text) $readini(%exfile,%atssection,nick) $readini(%exfile,%atssection,category) if ( $result = Fehler ) { atsquoteimportbulkend | halt } atsquoteimportbulkend /did -d zitimport 2 %atssel atsquoteexportdelete $atsquoteimporthash %atssel $calc($did(zitimport,2).lines + 1) /did -r zitimport 3 } on 1:dialog:zitimport:sclick:5:{ atsquoteimportbulkbegin /set -u60 %atstempus 1 /set -u60 %atsexplines $did(zitimport,2).lines while ( %atstempus <= %atsexplines ) { var %atssection = $atsquoteimportget(%atstempus) if (%atssection != $null) { /atsquoteimportappendencoded $readini(%exfile,%atssection,description) $readini(%exfile,%atssection,text) $readini(%exfile,%atssection,nick) $readini(%exfile,%atssection,category) } /inc %atstempus 1 } atsquoteimportbulkend /did -r zitimport 3 /did -r zitimport 2 atsquoteimportreset } dialog zitimport { title "Zitate Importieren" size -1 -1 256 153 option dbu button "OK", 1, 222 138 30 10, ok list 2, 3 3 92 150, extsel edit "", 3, 97 3 120 146, read multi button "Import", 4, 222 4 30 10 button "Import All", 5, 222 16 30 10 } on 1:dialog:zitimport:sclick:1:{ atsquoteimportreset } alias zitorga { /dialog -m zitorga zitorga /atsquotefillcategories zitorga 13 /atsquotefilllistall zitorga 2 var %atscatfill 2 while (%atscatfill <= $did(zitorga,13).lines) { /did -a zitorga 9 $did(zitorga,13,%atscatfill).text /inc %atscatfill 1 } /did -b zitorga 5 } dialog zitorga { title "Zitate Organisieren" size -1 -1 346 154 option dbu button "OK", 1, 312 142 30 10, ok list 2, 73 3 92 150 edit "", 3, 167 3 140 114, multi button "Loeschen", 4, 312 4 30 10 button "Aendern", 5, 312 18 30 10 edit "1", 6, 312 32 30 10 edit "", 7, 204 117 102 11 edit "", 8, 204 129 102 11 combo 9, 205 141 101 10, edit drop text "Nick:", 10, 167 120 13 8 text "Beschreibung:", 11, 167 131 37 8 text "Kategorie:", 12, 167 142 25 8 list 13, 0 4 70 138, size button "Kategorie entfernen", 14, 0 144 69 8 } on 1:dialog:zitorga:sclick:14:{ if ( $input(Kategorie wirklich komplett entfernen (Zitate bleiben erhalten) ?,40) = $no ) { /halt } var %atsquotes $atsquotecategoryquotes($did(13).sel) var %atscountii 1 while ( %atscountii <= $numtok(%atsquotes,170) ) { var %atsquoteidx $gettok(%atsquotes,%atscountii,170) /atsquoteupdateencoded %atsquoteidx $atsquoteencode($atsquotedescription(%atsquoteidx)) $atsquoteencode($atsquotetext(%atsquoteidx)) $atsquoteencode($atsquotenick(%atsquoteidx)) __EMPTY__ inc %atscountii } /dialog -c zitorga /zitorga } on 1:dialog:zitorga:sclick:13:{ if ( $did(13).sel = 1 ) { /atsquotefilllistall zitorga 2 } else { /atsquotefilllistcat zitorga 2 $did(13).sel } } alias zss { if ( $$1 isnum ) && ( $$1 isnum 1- $+ $atsquotecount ) return $atsquotebody($$1) } on 1:dialog:zitorga:edit:6:{ if ( $did(zitorga,6).text isnum ) { if ( $did(zitorga,6).text <= $did(zitorga,2).lines ) { /did -c zitorga 2 $did(zitorga,6).text /set -u60 %atstempline $strip($atsquotebody($did(zitorga,6).text)) /did -r zitorga 3 /did -o zitorga 3 1 %atstempline } } } on 1:dialog:zitorga:sclick:5:{ if ( $did(8) = $null ) { %atstemp = $input(Zitat kann ohne Zitat-beschreibung nicht gespeichert werden!,4) | /halt } if ( $did(3) = $null ) { %atstemp = $input(Ohne Zitat kann auch kein Zitat gespeichert werden!,4) | /halt } if ( $did(7) = $null ) { %atstemp = $input(Ohne Nickname kann kein Zitat gespeichert werden!,4) | /halt } if ( $input(Zitat wirklich $+ $chr(228) $+ ndern ?,40) = $no ) { /halt } /set %atstemp $did(3,1) $did(3,2) $did(3,3) $did(3,4) $did(3,5) $did(3,6) $did(3,7) $did(3,8) $did(3,9) /atsquoteupdateencoded $did(zitorga,6) $atsquoteencode($did(8)) $atsquoteencode(%atstemp) $atsquoteencode($did(7)) $atsquoteencode($did(9)) if ( $did(9) != $null ) { atsquoteaddcategory $did(9) if ( $didwm(zitorga,9,$did(9),1) = 0 ) { /did -a zitorga 9 $did(9) } } /did -b zitorga 5 /unset %zitchanged } on 1:dialog:zitorga:sclick:4:{ if ( $input(Zitat wirklich l $+ $chr(246) $+ schen ?,40) = $no ) { /halt } /atsquotedelete $did(6) /did -d zitorga 2 $did(zitorga,2).sel } on 1:dialog:zitorga:sclick:2:{ if ( %zitchanged ) { if ( $input(Zitat wurde ver $+ $chr(228) $+ ndert! Ver $+ $chr(228) $+ nderungen wirklich verwerfen ?,40) = $no ) { /halt } /unset %zitchanged /did -b zitorga 5 } if ( $did(13).sel = 1 ) || ( $did(13).sel = $null ) { /did -o zitorga 6 1 $did(zitorga,2).sel /did -o zitorga 8 1 $did(2,$did(2).sel).text /did -o zitorga 7 1 $atsquotenick($did(zitorga,2).sel) /did -r zitorga 3 /did -o zitorga 3 1 $atsquotetext($did(zitorga,2).sel) /did -c zitorga 9 $didwm(zitorga,9,$atsquotecategory($did(zitorga,2).sel),1) } else { var %atsquoteidx $gettok($atsquotecategoryquotes($did(13).sel),$did(2).sel,170) /did -o zitorga 6 1 %atsquoteidx /did -o zitorga 8 1 $did(2,$did(2).sel).text /did -o zitorga 7 1 $atsquotenick(%atsquoteidx) /did -r zitorga 3 /did -o zitorga 3 1 $atsquotetext(%atsquoteidx) /did -c zitorga 9 $didwm(zitorga,9,$atsquotecategory(%atsquoteidx),1) } } on 1:dialog:zitorga:edit:*:{ if ( $did = 3 ) || ( $did = 7 ) || ( $did = 8 ) || ( $did = 9 ) { /set %zitchanged 1 | /did -e zitorga 5 } } on 1:dialog:zitorga:sclick:1:{ if ( %zitchanged ) { if ( $input(Zitat wurde ver $+ $chr(228) $+ ndert! Ver $+ $chr(228) $+ nderungen wirklich verwerfen ?,40) = $no ) { /halt } /unset %zitchanged /did -b zitorga 5 } } alias impadd { /set -u20 %atszitat $gettok($1-,3,174) /set -u10 %atsfindindex $atsquotefindindex(* $+ %atszitat $+ *,1) /set -u10 %atssfgdsg $atsquotefind(* $+ %atszitat $+ *,1) if ( %atsfindindex > 0 ) { if ( %atssfgdsg = $null ) { goto dochda } /did -r zitimport 3 /did -o zitimport 3 1 Zitat schon vorhanden ! ( Zitat nummer %atsfindindex $+ : $strip($atsquotebody(%atsfindindex)) ) return Fehler } :dochda /set -u20 %atsznick $gettok($1-,2,174) /set -u20 %atszitab $gettok($1-,1,174) /atsquoteappendencoded $atsquoteencode(%atszitab) $atsquoteencode(%atszitat) $atsquoteencode(%atsznick) __EMPTY__ } dialog zitexport { title "Zitate Exportieren" size -1 -1 348 153 option dbu button "Export", 1, 97 26 30 10 list 2, 3 3 92 150, extsel edit "", 3, 224 3 120 146, read multi button "Cancel", 4, 97 37 30 10, ok list 5, 129 3 92 150, extsel button " -> ", 6, 97 4 30 10 button " <- ", 7, 97 15 30 10 } alias atsquoteexporthashleft return atsquote_export_left alias atsquoteexporthashright return atsquote_export_right alias atsquoteimporthash return atsquote_import_sections alias atsquoteexportreset { atsquotehashclear $atsquoteexporthashleft 64 atsquotehashclear $atsquoteexporthashright 64 } alias atsquoteimportreset { atsquotehashclear $atsquoteimporthash 64 } alias atsquoteexportset { var %atshash = $1 var %atsposition = $2 var %atsquoteidx = $3 if (%atsposition !isnum) || (%atsquoteidx !isnum) { return } atsquotehashensure %atshash 64 hadd -m %atshash pos. $+ %atsposition %atsquoteidx } alias atsquoteexportget { var %atshash = $1 var %atsposition = $2 if (%atsposition !isnum) { return 0 } if (!$hget(%atshash)) { return 0 } return $iif($hget(%atshash,pos. $+ %atsposition),$v1,0) } alias atsquoteimportset { var %atsposition = $1 if (%atsposition !isnum) || ($2 == $null) { return } atsquotehashensure $atsquoteimporthash 64 hadd -m $atsquoteimporthash pos. $+ %atsposition $2- } alias atsquoteimportget { if ($1 !isnum) { return } if (!$hget($atsquoteimporthash)) { return } return $hget($atsquoteimporthash,pos. $+ $1) } alias atsquoteimporttextkey { var %atstext = $atsquotedupnormalize($1-) if (%atstext == $null) { return } return text. $+ $len(%atstext) $+ . $+ $crc(%atstext) } alias atsquoteimportbulkbegin { atsquotehashclear $atsquoteimportbodyhash 128 var %atsindex = 1 while (%atsindex <= $atsquotecount) { var %atskey = $atsquoteimporttextkey($atsquotetext(%atsindex)) if (%atskey != $null) { hadd -m $atsquoteimportbodyhash %atskey %atsindex } inc %atsindex } set %atsquoteimportbulk on } alias atsquoteimportbulkend { unset %atsquoteimportbulk atsquotehashclear $atsquoteimportbodyhash 128 } alias atsquoteimportappendencoded { var %atsdescription = $1 var %atstext = $2 var %atsnick = $3 var %atscategory = $4 var %atszitat = $atsquotedecode(%atstext) var %atskey = $iif(%atsquoteimportbulk == on,$atsquoteimporttextkey(%atszitat),$null) if (%atsquoteimportbulk == on) { if (%atskey != $null) && ($hget($atsquoteimportbodyhash,%atskey)) { var %atsexisting = $hget($atsquoteimportbodyhash,%atskey) if ($atsquotedupnormalize(%atszitat) == $atsquotedupnormalize($atsquotetext(%atsexisting))) { /did -r zitimport 3 /did -o zitimport 3 1 Zitat schon vorhanden ! ( Zitat nummer %atsexisting $+ : $strip($atsquotebody(%atsexisting)) ) return Fehler } } } else { /set -u10 %atsfindindex $atsquotefindexact(%atszitat,1) if ( %atsfindindex > 0 ) { /did -r zitimport 3 /did -o zitimport 3 1 Zitat schon vorhanden ! ( Zitat nummer %atsfindindex $+ : $strip($atsquotebody(%atsfindindex)) ) return Fehler } } :atsquoteimportappendencoded_do /atsquoteappendencoded %atsdescription %atstext %atsnick %atscategory if (%atsquoteimportbulk == on) && (%atskey != $null) { hadd -m $atsquoteimportbodyhash %atskey $atsquotecount } } alias atsquoteexportdelete { var %atshash = $1 var %atsposition = $2 var %atslines = $3 if (!$hget(%atshash)) || (%atsposition !isnum) || (%atslines !isnum) { return } while (%atsposition < %atslines) { var %atsnext = $calc(%atsposition + 1) var %atsvalue = $hget(%atshash,pos. $+ %atsnext) if (%atsvalue != $null) { hadd -m %atshash pos. $+ %atsposition %atsvalue } else { hdel %atshash pos. $+ %atsposition } inc %atsposition } if ($hget(%atshash,pos. $+ %atslines)) { hdel %atshash pos. $+ %atslines } } alias atsquoteexportmoveselected { var %atsfromdialog = $1 var %atsfromid = $2 var %atstoid = $3 var %atsfromhash = $4 var %atstohash = $5 var %atsindex = $did(%atsfromdialog,%atsfromid).lines while (%atsindex >= 1) { if ($did(%atsfromdialog,%atsfromid,%atsindex).sel) { var %atsquoteidx = $atsquoteexportget(%atsfromhash,%atsindex) if (%atsquoteidx > 0) { /did -a %atsfromdialog %atstoid $did(%atsfromdialog,%atsfromid,%atsindex).text atsquoteexportset %atstohash $did(%atsfromdialog,%atstoid).lines %atsquoteidx } /did -d %atsfromdialog %atsfromid %atsindex atsquoteexportdelete %atsfromhash %atsindex $calc($did(%atsfromdialog,%atsfromid).lines + 1) } dec %atsindex } } alias atsquoteimportselected { var %atscount = $did(zitimport,2).lines var %atsindex = %atscount while (%atsindex >= 1) { if ($did(zitimport,2,%atsindex).sel) { var %atssection = $atsquoteimportget(%atsindex) if (%atssection != $null) { /atsquoteimportappendencoded $readini(%exfile,%atssection,description) $readini(%exfile,%atssection,text) $readini(%exfile,%atssection,nick) $readini(%exfile,%atssection,category) if ( $result != Fehler ) { /did -d zitimport 2 %atsindex atsquoteexportdelete $atsquoteimporthash %atsindex $calc($did(zitimport,2).lines + 1) } } } dec %atsindex } } alias zitexport { /unset %exfile /set %exfile $?="Filename eintippen ( ohne Endung! )" if ( %exfile = $null ) { /halt } /set %exfile %exfile $+ .bak atsquoteexportreset /dialog -m zitexport zitexport /set -u2 %ttemp $atsquotecount /set %atszeile 1 /set %einstieg %atszeile while ( %atszeile <= %ttemp ) { /set -u60 %atstem2 $atsquotedescription(%atszeile) /did -a zitexport 2 %atstem2 atsquoteexportset $atsquoteexporthashleft %atszeile %atszeile /inc %atszeile 1 } } on 1:dialog:zitexport:sclick:2:{ var %atsquoteidx = $atsquoteexportget($atsquoteexporthashleft,$did(zitexport,2).sel) if (%atsquoteidx <= 0) { halt } /set -u60 %atstempline $strip($atsquotebody(%atsquoteidx)) /did -r zitexport 3 /did -o zitexport 3 1 %atstempline } on 1:dialog:zitexport:sclick:6:{ if ( $did(zitexport,2).sel = $null ) { /halt } atsquoteexportmoveselected zitexport 2 5 $atsquoteexporthashleft $atsquoteexporthashright } on 1:dialog:zitexport:sclick:7:{ if ( $did(zitexport,5).sel = $null ) { /halt } atsquoteexportmoveselected zitexport 5 2 $atsquoteexporthashright $atsquoteexporthashleft } on 1:dialog:zitexport:sclick:5:{ var %atsquoteidx = $atsquoteexportget($atsquoteexporthashright,$did(zitexport,5).sel) if (%atsquoteidx <= 0) { halt } /set -u60 %atstempline $strip($atsquotebody(%atsquoteidx)) /did -r zitexport 3 /did -o zitexport 3 1 %atstempline } on 1:dialog:zitexport:sclick:1:{ var %atsfile = %exfile var %atslines = $did(zitexport,5).lines var %atslineindex = 1 if (%atslines <= 0) { /dialog -x zitexport zitexport | return } /echo 7 -at Exportiere %atslines Zitate nach %atsfile ... .writeini %atsfile quotes format 1 .writeini %atsfile quotes count %atslines while (%atslineindex <= %atslines) { var %atsquoteidx = $atsquoteexportget($atsquoteexporthashright,%atslineindex) if (%atsquoteidx > 0) { var %atssection = quote_ $+ %atslineindex .writeini %atsfile %atssection index %atslineindex .writeini %atsfile %atssection description $atsquoteencode($atsquotedescription(%atsquoteidx)) .writeini %atsfile %atssection text $atsquoteencode($atsquotetext(%atsquoteidx)) .writeini %atsfile %atssection nick $atsquoteencode($atsquotenick(%atsquoteidx)) .writeini %atsfile %atssection category $atsquoteencode($atsquotecategory(%atsquoteidx)) } /inc %atslineindex 1 } atsquoteexportreset /echo 7 -at Exportdatei %atsfile mit %atslines Zitaten erstellt. /dialog -x zitexport zitexport } on 1:dialog:zitexport:sclick:4:{ atsquoteexportreset } alias atsquotesqlescape { var %atsvalue = $1- if (%atsvalue == $null) { return } %atsvalue = $replace(%atsvalue,\,\\) %atsvalue = $replace(%atsvalue,', '') return %atsvalue } alias atsquoteexportmysql { var %atsfile = $mircdir $+ quotes.sql var %atshandle atsquoteexportmysql var %atscount $atsquotecount var %atsindex 1 /echo 7 -at Exportiere %atscount Zitate nach %atsfile ... if ($fopen(%atshandle)) { .fclose %atshandle } .write -c %atsfile .fopen %atshandle %atsfile if (!$fopen(%atshandle)) { /echo 4 -at Fehler beim Schreiben von %atsfile return } .fwrite %atshandle DROP TABLE IF EXISTS ` $+ quote_db $+ `; .fwrite %atshandle CREATE TABLE ` $+ quote_db $+ ` ( .fwrite %atshandle $chr(32) $+ $chr(32) $+ ` $+ id $+ ` int(11) NOT NULL AUTO_INCREMENT, .fwrite %atshandle $chr(32) $+ $chr(32) $+ ` $+ content $+ ` longtext NOT NULL, .fwrite %atshandle $chr(32) $+ $chr(32) $+ ` $+ from $+ ` varchar(255) NOT NULL, .fwrite %atshandle $chr(32) $+ $chr(32) $+ ` $+ description $+ ` varchar(255) NOT NULL, .fwrite %atshandle $chr(32) $+ $chr(32) $+ PRIMARY KEY (` $+ id $+ `) .fwrite %atshandle ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; while (%atsindex <= %atscount) { var %atscontent $atsquotesqlescape($atsquotetext(%atsindex)) var %atsfrom $atsquotesqlescape($atsquotenick(%atsindex)) var %atsdescription $atsquotesqlescape($atsquotedescription(%atsindex)) .fwrite %atshandle INSERT INTO ` $+ quote_db $+ ` (` $+ content $+ `, ` $+ from $+ `, ` $+ description $+ `) VALUES (' $+ %atscontent $+ ', ' $+ %atsfrom $+ ', ' $+ %atsdescription $+ '); /inc %atsindex 1 } .fclose %atshandle /echo 7 -at MySQL-Importdatei %atsfile mit %atscount Zitaten erstellt. } on *:load:{ atsquotebootstrap } on 1:start:{ atsquotebootstrap setatsversion if ( %atsatsnapleft = $null ) { /set %atsatsnapleft < } if ( %atsatsnapright = $null ) { /set %atsatsnapright > } if ( %atstempzittimer = $null ) { /set %atstempzittimer 0 } if ( %atszitchan = $null ) { /set %atszitchan $chr(35) } if ( %atszitcontrolcodes = $null ) { /set %atszitcontrolcodes off } /unset %atszph* %ats.flood.* /unset %atsstopspammzit /unset %zitchannel* if ( %atszitcol1 = $null ) { set %atszitcol1 12 } if ( %atszitcol2 = $null ) { set %atszitcol2 14 } if ( %atszitcol3 = $null ) { set %atszitcol3 4 } if ( %atszitcol4 = $null ) { set %atszitcol4 13 } clearzittemp } alias setatsversion { /set %ATSversion 6.7 } alias triggercheck { if ( $chan == #irpg ) triggercheckstop $1- } alias triggercheckstop { //Echo -s 4 $+ $nick mich mit ' $+ $1- $+ ' in $chan zum reden bringen! halt } menu query,nicklist,channel { - Zitate .- .Zitat auswaehlen:/zitplay .Zitat-sniffer $iif( $lines(zitlist.ats) > 0 , ( $+ $lines(zitlist.ats) Stueck drin) , ):/dialog -m zitsniff zitsniff .Random Zitat ..einfach so:/zs ..$iif($$1 != $null, zu $$1):/zs $$1 random ..zu $iif( (($len($strip($cb(1))) <= 20) && ($len($strip($cb(1))) > 0 )), " $+ $strip($cb(1)) $+ " , Clipboard-inhalt):/zs $cb(1) random .Neues Zitat adden:/zitadd .Bookmarks ..Hinzufuegen:/zaba $$?="Zitat-nummer?" ..Entfernen ...$submenu($zabsubR($1)) ..- ..$submenu($zabsub($1)) .weitere Funktionen ..Optionen:{ if ( $isfile(atspics\5.bmp) = $false ) { createpics } if ($dialog(zitsettings)) { dialog -c zitsettings } /dialog -m zitsettings zitsettings } ..Zitate Organisieren:/zitorga ..Requests anzeigen:/window -a @Requests ..- ..Zitate Exportieren:/zitexport ..MySQL Import -> quotes.sql:/atsquoteexportmysql ..Zitate Importieren:/zitimport } dialog zitplay { title "Zitat Auswaehlen" size -1 -1 339 169 option dbu button "OK", 1, 297 155 30 10, ok edit "Suchbegriff", 5, 81 155 72 10 button "Suchen", 6, 156 155 32 10, default list 2, 81 5 92 150 edit "", 3, 177 5 160 146, read multi text "Zitat-nummer:", 7, 205 155 35 9 edit "1", 4, 240 155 30 10 list 8, 2 5 74 162, size } on 1:dialog:zitplay:sclick:2:{ var %atssel $calc(%atstemp~zz + $did(2).sel) if ( $did(8).sel = 1 ) || ( $did(8).sel = $null ) { /set -u60 %atstempline $strip($atsquotebody(%atssel)) /did -r zitplay 3 /did -o zitplay 3 1 %atstempline /did -o zitplay 4 1 %atssel } else { var %atsquoteidx $gettok($atsquotecategoryquotes($did(8).sel),%atssel,170) /set -u60 %atstempline $strip($atsquotebody(%atsquoteidx)) /did -r zitplay 3 /did -o zitplay 3 1 %atstempline /did -o zitplay 4 1 %atsquoteidx } } on 1:dialog:zitplay:edit:4:{ if ( $did(zitplay,4).text isnum ) { if ( $did(zitplay,4).text <= $did(zitplay,2).lines ) { /did -c zitplay 2 $did(zitplay,4).text /set -u60 %atstempline $strip($atsquotebody($did(zitplay,4).text)) /did -r zitplay 3 /did -o zitplay 3 1 %atstempline } } } on 1:dialog:zitplay:sclick:1:{ var %atssel $calc(%atstemp~zz + $did(2).sel) if ( %atssel != $null ) { /set %atsATSzitsearch $active /.timer 1 0 /dialog -x zitplay zitplay if ( $did(8).sel = 1 ) || ( $did(8).sel = $null ) { /zs %atssel } else { /zs $gettok($atsquotecategoryquotes($did(8).sel),%atssel,170) } } else { halt } } on 1:dialog:zitplay:sclick:8:{ if ( $did(8).sel = 1 ) { /atsquotefilllistall zitplay 2 $calc(%atstemp~zz + 1) } else { /atsquotefilllistcat zitplay 2 $did(8).sel } } on 1:dialog:zitplay:sclick:6:{ :nochmal /set -u1 %atssearchpattern * $+ $replace($did(zitplay,5).text,$chr(32),*) $+ * /set -u1 %atssuchnummer $atsquotefindindex(%atssearchpattern,$calc( %atssuchnummer + 1 )) if ( %atssuchnummer = 0 ) { if ( %atssuchnummer = 0 ) { /did -r zitplay 3 | /did -o zitplay 3 1 Keine Zitate mit " $+ $did(zitplay,5).text $+ " gefunden | halt } /set %atssuchnummer 0 goto nochmal } /did -c zitplay 2 %atssuchnummer /set -u60 %atstempline $strip($atsquotebody(%atssuchnummer)) /did -r zitplay 3 /did -o zitplay 3 1 %atstempline /did -o zitplay 4 1 $did(zitplay,2).sel halt } alias zitplay { /set %atstemp~zz $iif($1 isnum,$calc($1 - 1),0) /set %aatszitchan $chan if ( $chan = $null ) { /set %aatszitchan $active } /set %atssuchnummer 0 /dialog -m zitplay zitplay /atsquotefillcategories zitplay 8 /atsquotefilllistall zitplay 2 $calc(%atstemp~zz + 1) } ctcp 1:ZITAT:*:{ var %atsznummertemp %atsznummer if ( $2 != $null ) && ( $2 isnum ) { var %atsznummertemp $2 } else { halt } if ( %atsznummertemp isnum 1- $+ $atsquotecount ) { /window -h @Requests /aline 4 @Requests $chr(91) $+ $time(HH:nn) $+ $chr(93) $chr(3) $+ 7 $nick Requested Zitat # $+ %atsznummertemp $chr(3) $+ 4### /inc %atszitrequests .ctcpreply $nick ZITRESULT $atsquoteline(%atsznummertemp) } /halt } ctcp 1:ZITATN:*:{ var %atsznummertemp %atsznummer if ($2 != $null) && ($2 isnum) { var %atsznummertemp $2 } else { halt } if ( %atsznummertemp isnum 1- $+ $atsquotecount ) { if (!$window(@Requests)) { window -nhek0 @Requests } aline 4 @Requests $iif(%ats.flood. [ $+ [ $address ] ],$chr(3) $+ 12(Ignored - Flood Protection) $+ $chr(15)) ### $+ $chr(3) $+ 7 $nick ( $+ $address $+ ) requested Zitat $chr(35) $+ %atsznummertemp ### inc %atszitrequests if (!%ats.flood. [ $+ [ $address ] ]) { set -u5 %ats.flood. [ $+ [ $address ] ] $true .ctcpreply $nick ZITRESULT $atsquoteline(%atsznummertemp) } } haltdef } on 1:ctcpreply:ZITRESULT*:{ var %tempzit $replace($2-,$chr(36),$atschrby,$chr(124),$chr(166)) if ( $left($gettok(%tempzit , 2 , 170 ),2) != $chr(3) $+ 12 ) { %tempzit = $gettok(%tempzit , 1 , 170 ) $+ $atschrby $+ $chr(3) $+ 12 $+ $atscolorby($atsquotecontrolfilter($gettok(%tempzit , 2 , 170 ))) } /set -u10 %atssfgdhcvb $atsquotefind(* $+ $gettok($mid($gettok(%tempzit , 2 , 170 ),4),1,169) $+ *,1) if ( $atsquotefindindex(* $+ $gettok($mid($gettok(%tempzit , 2 , 170 ),4),1,169) $+ *,1) > 0 ) { if ( %atssfgdhcvb != $null ) { .timerzit [ $+ [ $nick ] ] $+ * off //Echo 4 -a ### $chr(3) $+ 07Zitat bereits vorhanden !!! $chr(3) $+ 4### /halt } } var %atsraw $replace($atsquotecontrolfilter(%tempzit), $chr(32) $+ $chr(124) $+ $chr(32) , $chr(32) $+ $atschrby $+ $chr(32) ) var %atsdesc $gettok(%atsraw,1,170) var %atsbody $gettok(%atsraw,2,170) var %atscat $gettok(%atsraw,3,170) var %atstext $gettok($atsquotecontrolfilter(%atsbody),1,169) var %atsnick $mid($atsquotecontrolfilter($gettok(%atsbody,2,169)),4) var %atsadded $atsquoteappend(%atsdesc,%atstext,%atsnick,%atscat) //Echo -a --- //Echo 4 -a ### $chr(3) $+ 07Zitat " $+ $chr(3) $+ %atszitcol1 $+ $replace($strip($atsquotebody(%atsadded)),$atschrby $+ $chr(32) $+ by $+ $chr(32),$chr(3) $+ %atszitcol2 $+ $atschrby $+ $chr(32) $+ by $+ $chr(32) $+ $chr(3) $+ %atszitcol3) $+ " $chr(3) $+ 07Erfolgreich von $nick requested und als Zitat # $+ %atsadded $+ hinzugef$+ $chr(252) $+ gt! $chr(3) $+ 4### //Echo -a --- .timerzit [ $+ [ $nick ] ] $+ * off /halt } on 1:text:Zitat*/*:*:{ triggercheck $1- var %znum $gettok($1- , 1 , 58 ) var %znum $gettok( %znum , $gettok( %znum , 0 , 32) , 32 ) if ( $chr(160) isin %znum ) { var %znum $gettok(%znum , 2 , 160 ) if ( $left( %znum , 1 ) = [ ) { var %znum $mid($gettok(%znum , 1 , 47 ) , 2 ) } else { var %znum $gettok(%znum , 1 , 47 ) } } else { var %znum _ } if ( $gettok($1- , 2- , 58 ) = $null ) { halt } if ( $read(zitlist.ats , w , * $+ $gettok($strip($mid($gettok($1- , 2- , 58 ) , 2 ) ),1,169) $+ * ) = $null ) { if ( !$atsquoteexists(* $+ $gettok($strip($mid($gettok($1- , 2- , 58 ) , 2 ) ),1,169) $+ *) ) { if ( $chr(3) !isin $mid($gettok($1- , 2- , 58 ) , 2 ) ) { halt } if ( $findtok(%zitautosniffnicks,$nick,0,44) > 0 ) && ( %zitautosniff ) { /.ctcp $nick Zitatn %znum /.timerzit [ $+ [ $nick ] ] $+ %znum 1 20 /write zitlist.ats $nick $+ $atschrby $+ $chan $+ $atschrby $+ $date $time $+ $atschrby $+ %znum $+ $atschrby $+ $mid($gettok($1- , 2- , 58 ) , 2 ) /halt } /write zitlist.ats $nick $+ $atschrby $+ $chan $+ $atschrby $+ $date $time $+ $atschrby $+ %znum $+ $atschrby $+ $mid($gettok($1- , 2- , 58 ) , 2 ) } } } on 1:text:Neues Zitat zur Zitatsammlung hinzugef*:*:{ var %znum $gettok($1- , 1 , 58 ) if ( $chr(160) isin %znum ) { var %znum $gettok($gettok( %znum , 2 , 35 ) , 1 , 41 ) } else { var %znum _ } if ( $findtok(%zitautosniffnicks,$nick,0,44) > 0 ) && ( %zitautosniff ) { /.ctcp $nick Zitatn %znum ; /.timerzit [ $+ [ $nick ] ] $+ %znum 1 20 /write zitlist.ats $nick $+ $atschrby $+ $chan $+ $atschrby $+ $date $time (Neu hinzugef$+ $chr(252) $+ gt) $+ $atschrby $+ %znum $+ $atschrby $+ $mid($gettok($1- , 2- , 58 ) , 2 ) /.timerzit [ $+ [ $nick ] ] $+ %znum 1 20 /write zitlist.ats $nick $+ $atschrby $+ $chan $+ $atschrby $+ $date $time (Neu hinzugefuegt) $+ $atschrby $+ %znum $+ $atschrby $+ $gettok($1- , 2- , 58 ) /halt } ; /write zitlist.ats $nick $+ $atschrby $+ $chan $+ $atschrby $+ $date $time (Neu hinzugef$+ $chr(252) $+ gt) $+ $atschrby $+ %znum $+ $atschrby $+ $mid($gettok($1- , 2- , 58 ) , 2 ) /write zitlist.ats $nick $+ $atschrby $+ $chan $+ $atschrby $+ $date $time (Neu hinzugefuegt) $+ $atschrby $+ %znum $+ $atschrby $+ $gettok($1- , 2- , 58 ) } alias zs2 /zs $$1- alias atszph { /unset %atszphtemp var %t 0 var %i 0 while ( %i <= $time(H) ) { if ( %atszph [ $+ [ $date $+ [ %i ] ] ] != $null ) { /set %atszphtemp $calc(%atszphtemp + %atszph [ $+ [ $date $+ [ %i ] ] ] ) /inc %t } inc %i } return $Calc(%atszphtemp / %t ) } ctcp 1:VERSION:*:{ if ( $script(ats.ini) != $null ) { .ctcpreply $nick VERSION Abomb's Terror Script V %ATSversion | /halt } else { .ctcpreply $nick VERSION Abomb's Zitat Script V %ATSversion | /halt } } ctcp 1:ATS:*:{ if ( $script(ats.ini) != $null ) { .ctcpreply $nick ATS $iif( $atsquotecount > 0 , ( $+ $atsquotecount Zitate $+ $iif( %atsatsslapcounter != $null, $chr(32) $+ und %atsatsslapcounter mal geslappt worden) $iif($atszph, - ZPH: $atszph)) $iif(%atszitrequests != $null, - %atszitrequests mal wurden von mir Zitate requestet.)) $+ $chr(41) | halt } else { $iif( $atsquotecount > 0 , ( $+ $atsquotecount Zitate $+ $iif(%atsatsslapcounter != $null , $chr(32) $+ und %atsatsslapcounter mal geslappt worden) $iif($atszph, - ZPH: $atszph) $+ $chr(41)) $iif(%atszitrequests != $null, - %atszitrequests mal wurden von mir Zitate requestet.)) $+ $chr(41) | halt } } alias lastarg { /set -u10 %atstemparg 1 while ( $gettok($$1- , %atstemparg , 32 ) != $null ) { inc -u10 %atstemparg } return $calc( %atstemparg - 1 ) } on 1:connect:/set %ats.neuev blub | sockopen ATS.ne2 abomb.info 80 on 1:sockopen:ATS.ne2:{ /sockwrite -n $sockname GET /ats.html HTTP/1.1 /sockwrite -n $sockname User-Agent: Mozilla/bottich /sockwrite -n $sockname Host: abomb.info sockwrite -n $sockname Connection: Keep-Alive sockwrite -n $sockname $crlf } on 1:sockread:ATS.ne2:{ sockread -f %ATS.neuev if ($sockbr == 0) return if (%ATS.neuev == $null) %ATS.neuev = - if (%ATS.neuev = ATS Version Info File: ) { sockread -f %ATS.neuev if ( %ATS.neuev > %ATSversion ) && ( %ats.neuev isnum ) { /atsvc } sockclose ats.ne2 } } dialog zitsniff { title "Zitat-Sniffer" size -1 -1 228 182 option dbu list 1, 0 1 34 178, size edit "", 2, 50 2 177 10, read text "Von:", 3, 36 3 14 8 text "In:", 4, 36 15 12 8 edit "", 5, 50 14 177 10, read text "Zeit:", 6, 36 27 13 8 edit "", 7, 50 26 177 10, read edit "", 8, 36 36 190 106, read multi button "Hinzufuegen", 9, 56 144 37 12 button "Loeschen", 10, 112 144 37 12, default button "Button", 11, 0 84 37 12, hide ok cancel button "Alle Loeschen", 12, 168 144 37 12 check "Auto request Zitate von folgenden Nicks (durch komma getrennt):", 13, 36 159 166 10 edit "", 14, 35 169 190 10, autohs center } alias atsquotesniffdedupe { if (!$isfile(zitlist.ats)) { return 0 } var %atsin = zitlist.ats var %atsout = zitlist.ats.tmp var %atscount = $lines(%atsin) if (%atscount <= 0) { return 0 } var %atshash = ats_quote_sniff_seen atsquotehashclear %atshash 128 .write -c %atsout var %atsindex = 1 var %atswritten = 0 while (%atsindex <= %atscount) { var %atsline = $read(%atsin,%atsindex) if (%atsline != $null) { var %atskey = $len(%atsline) $+ . $+ $crc(%atsline) if (!$hget(%atshash,%atskey)) { hadd -m %atshash %atskey 1 .write %atsout %atsline inc %atswritten } } inc %atsindex } if (%atswritten < %atscount) { .write -c %atsin var %atscopyindex = 1 while (%atscopyindex <= $lines(%atsout)) { .write %atsin $read(%atsout,%atscopyindex) inc %atscopyindex } } .remove %atsout return %atswritten } on 1:dialog:zitsniff:init:0:{ atsquotesniffdedupe var %i = 0 while ( %i < $lines(zitlist.ats) ) { inc %i /did -a zitsniff 1 %i } if ( %zitautosniff != 1 ) /did -b zitsniff 14 if ( %zitautosniff ) /did -c zitsniff 13 /did -a zitsniff 14 %zitautosniffnicks } on 1:dialog:zitsniff:edit:14:/set %zitautosniffnicks $did(14) on 1:dialog:zitsniff:sclick:13:{ if ( $did(13).state = 0 ) { /did -b zitsniff 14 /unset %zitautosniff } else { /did -e zitsniff 14 /set %zitautosniff 1 } } on 1:dialog:zitsniff:sclick:1:{ /did -r zitsniff 8 /did -o zitsniff 2 1 $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 1 , 168 ) /did -o zitsniff 5 1 $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 2 , 168 ) /did -o zitsniff 7 1 $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 3 , 168 ) /did -o zitsniff 8 1 $strip($gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 5 , 168 )) if ( $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 1 , 168 ) ison $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 2 , 168 ) ) { /did -o zitsniff 9 1 Hinzufuegen * } else { /did -o zitsniff 9 1 Hinzufuegen } } on 1:dialog:zitsniff:sclick:12:{ if ( $input(Wirklich alle gesnifften Zitate l $+ $chr(246) $+ schen ?!,136) != $true ) { halt } /write -c zitlist.ats /did -r zitsniff 8 /did -r zitsniff 2 /did -r zitsniff 5 /did -r zitsniff 7 /did -r zitsniff 1 } on 1:dialog:zitsniff:sclick:10:{ if ( $did(zitsniff,1).sel = $null ) { halt } /write -dl $+ $did(zitsniff,1).sel zitlist.ats var %listnum $did(zitsniff,1).sel /did -d zitsniff 1 $did(zitsniff,1).sel /did -c zitsniff 1 %listnum /did -r zitsniff 8 /did -o zitsniff 2 1 $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 1 , 168 ) /did -o zitsniff 5 1 $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 2 , 168 ) /did -o zitsniff 7 1 $gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 3 , 168 ) /did -o zitsniff 8 1 $strip($gettok($read(zitlist.ats , $did(zitsniff,1).sel ) , 5 , 168 )) } dialog zitaddt { title "Zitat hinzufuegen" size -1 -1 200 133 option dbu edit "", 1, 20 4 178 70, multi edit "", 2, 20 76 178 10, autohs text "Zitat-", 3, 4 5 13 8 text "Text", 4, 4 13 13 8 text "(c) by", 5, 4 77 17 8 text "Abk.", 6, 4 89 17 8 edit "", 7, 20 88 178 10 check "Auto-Nick-parse", 8, 4 110 50 10 edit "", 9, 92 110 10 10, hide limit 1 text "Nick Style:", 10, 64 111 29 8, hide text "NickName", 11, 104 111 29 8, hide edit "", 12, 128 110 10 10, hide limit 1 button "Add", 13, 4 122 37 8, ok button "Cancle", 14, 160 122 37 8, cancel check "Strip Time", 15, 160 110 50 10, hide combo 16, 30 99 167 11, edit drop text "Kategorie:", 17, 4 100 25 8 } on 1:dialog:zitaddt:edit:1:{ zitaddedit1 } alias -l zitaddedit1 { if (%atsatszitaddtfresh) { /set %atsatszitaddttemp $atsquotecontrolfilter($did(zitaddt,1,1) $did(zitaddt,1,2) $did(zitaddt,1,3) $did(zitaddt,1,4) $did(zitaddt,1,5) $did(zitaddt,1,6) $did(zitaddt,1,7) $did(zitaddt,1,8) $did(zitaddt,1,9) $did(zitaddt,1,10)) /did -r zitaddt 1 /did -a zitaddt 1 $replace(%atsatszitaddttemp, $chr(32) $+ $chr(124) $+ $chr(32) , $chr(32) $+ $atschrby $+ $chr(32) ) /set %atsatszitaddttemp $did(zitaddt,1,1) $+ $did(zitaddt,1,2) $+ $did(zitaddt,1,3) $+ $did(zitaddt,1,4) $+ $did(zitaddt,1,5) $+ $did(zitaddt,1,6) $+ $did(zitaddt,1,7) $+ $did(zitaddt,1,8) $+ $did(zitaddt,1,9) $+ $did(zitaddt,1,10) } if (%atsatszitaddtfresh) && ($did(zitaddt,15).state) { /did -r zitaddt 1 /set %atsatstimez 1 while ( %atsatstimez <= $gettok(%atsatszitaddttemp, 0, 91) ) { if ( $timestampfmt = [HH:nn] ) { if ( $len($gettok($gettok(%atsatszitaddttemp, %atsatstimez , 91), 1, 93)) = 5 ) && ( $mid($gettok($gettok(%atsatszitaddttemp, %atsatstimez , 91), 1, 93), 3,1) = : ) { /set %atsatstimetok $addtok(%atsatstimetok , $chr(91) $+ $gettok($gettok(%atsatszitaddttemp, %atsatstimez , 91), 1, 93) $+ $chr(93), 44) } } elseif ( $timestampfmt = [HH:nntt] ) { if ( $len($gettok($gettok(%atsatszitaddttemp, %atsatstimez , 91), 1, 93)) = 7 ) && ( $mid($gettok($gettok(%atsatszitaddttemp, %atsatstimez , 91), 1, 93), 3,1) = : ) { /set %atsatstimetok $addtok(%atsatstimetok , $chr(91) $+ $gettok($gettok(%atsatszitaddttemp, %atsatstimez , 91), 1, 93) $+ $chr(93), 44) } } /inc %atsatstimez } while ( $gettok(%atsatstimetok,1,44) != $null ) { /set %atsatszitaddttemp $remove(%atsatszitaddttemp,$gettok(%atsatstimetok,1,44)) /set %atsatstimetok $remtok(%atsatstimetok,$gettok(%atsatstimetok,1,44),44) } /did -a zitaddt 1 %atsatszitaddttemp /set %atsatszitaddttemp $did(zitaddt,1,1) $+ $did(zitaddt,1,2) $+ $did(zitaddt,1,3) $+ $did(zitaddt,1,4) $+ $did(zitaddt,1,5) $+ $did(zitaddt,1,6) $+ $did(zitaddt,1,7) $+ $did(zitaddt,1,8) $+ $did(zitaddt,1,9) $+ $did(zitaddt,1,10) } if (%atsatszitaddtfresh) && ($did(zitaddt,8).state) { if ( $pos(%atsatszitaddttemp,%atsatsnapleft,1) = $null ) { goto nix } /set %atsatszaehltemp 1 while ( %atsatszaehltemp <= $gettok(%atsatszitaddttemp, 0, $asc(%atsatsnapleft)) ) { if ( $chr(32) !isin $replace($gettok($gettok(%atsatszitaddttemp, %atsatszaehltemp, $asc(%atsatsnapleft)), 1, $asc(%atsatsnapright)),@,,+,) ) && ( $len($replace($gettok($gettok(%atsatszitaddttemp, %atsatszaehltemp, $asc(%atsatsnapleft)), 1, $asc(%atsatsnapright)),@,,+,)) < 17 ) { /set -u5 %atsatszitaddttempnicks %atsatsnapleft $+ $gettok($gettok(%atsatszitaddttemp, %atsatszaehltemp, $asc(%atsatsnapleft)), 1, $asc(%atsatsnapright)) $+ %atsatsnapright /set %atsatstempnick $addtok(%atsatstempnick , $replace($gettok($gettok(%atsatszitaddttemp, %atsatszaehltemp, $asc(%atsatsnapleft)), 1, $asc(%atsatsnapright)),@,,+,), 245) } /inc %atsatszaehltemp } if ( $gettok(%atsatstempnick,2,245) = $null ) { /set %atsatszitaddttemp $did(zitaddt,1,1) $+ $did(zitaddt,1,2) $+ $did(zitaddt,1,3) $+ $did(zitaddt,1,4) $+ $did(zitaddt,1,5) $+ $did(zitaddt,1,6) $+ $did(zitaddt,1,7) $+ $did(zitaddt,1,8) $+ $did(zitaddt,1,9) $+ $did(zitaddt,1,10) /did -r zitaddt 1 /set %atsatszitaddttemp $replace(%atsatszitaddttemp , %atsatszitaddttempnicks , $chr(32) $+ - $+ $chr(32) ) if ( $left(%atsatszitaddttemp ,3) = $chr(32) $+ - $+ $chr(32) ) { /set %atsatszitaddttemp $mid(%atsatszitaddttemp ,3) } /did -a zitaddt 1 %atsatszitaddttemp /set %atsatszitaddttemp $did(zitaddt,1,1) $+ $did(zitaddt,1,2) $+ $did(zitaddt,1,3) $+ $did(zitaddt,1,4) $+ $did(zitaddt,1,5) $+ $did(zitaddt,1,6) $+ $did(zitaddt,1,7) $+ $did(zitaddt,1,8) $+ $did(zitaddt,1,9) $+ $did(zitaddt,1,10) } /did -r zitaddt 1 var %blfkf 1 while ( %blfkf <= $gettok(%atsatszitaddttemp,0,32) ) { set -u0 %atstempnachgug $gettok(%atsatszitaddttemp,%blfkf,32) if (($left(%atstempnachgug,1) = %atsatsnapleft) && ($right(%atstempnachgug,1) = %atsatsnapright)) { if ( %atslastnickzit = %atstempnachgug ) { /Set %atsatszitaddttemp $puttok(%atsatszitaddttemp,-,%blfkf,32) } else { /set -u0 %atslastnickzit %atstempnachgug } } inc %blfkf } /did -a zitaddt 1 %atsatszitaddttemp /did -a zitaddt 2 $replace( %atsatstempnick, $chr(245) , $chr(32) $+ + $+ $chr(32)) /did -f zitaddt 7 } :nix /unset %atsatszitaddtfresh /unset %atsatszaehltemp /unset %atsatstempnick /unset %atsatstimez /unset %atsatszitaddttemp2 /unset %atsatstimetok } on 1:dialog:zitaddt:sclick:13:{ if ( $chr(32) $+ $chr(124) $+ $chr(32) isin $did(1,1) $+ $did(1,2) $+ $did(1,3) $+ $did(1,4) $+ $did(1,5) $+ $did(1,6) $+ $did(1,7) $+ $did(1,8) $+ $did(1,9) $+ $did(1,10) ) { /set %atsatszitaddttemp $did(1,1) $+ $did(1,2) $+ $did(1,3) $+ $did(1,4) $+ $did(1,5) $+ $did(1,6) $+ $did(1,7) $+ $did(1,8) $+ $did(1,9) $+ $did(1,10) /did -r zitaddt 1 /did -a zitaddt 1 $replace(%atsatszitaddttemp, $chr(32) $+ $chr(124) $+ $chr(32) , $chr(32) $+ $atschrby $+ $chr(32) ) } if ( $did(7) = $null ) { %result = $input(Keine Zitat-Abk $+ $chr(252) $+ rzung eingegeben !,4) /halt } if ( $did(2) = $null ) { %result = $input(Kein Nick eingegeben !,4) /halt } /zitadd2 $did(1,1) $+ $did(1,2) $+ $did(1,3) $+ $did(1,4) $+ $did(1,5) $+ $did(1,6) $+ $did(1,7) $+ $did(1,8) $+ $did(1,9) $+ $did(1,10) $+ $chr(179) $+ $did(2) $+ $chr(179) $+ $did(7) $+ $chr(179) $+ $iif($did(16) != -- Keine -- , $did(16) ) } on 1:dialog:zitaddt:edit:9:{ /set %atsatsnapleft $did(9) } on 1:dialog:zitaddt:edit:12:{ /set %atsatsnapright $did(12) } on 1:dialog:zitaddt:init:0:{ /set %atsatszitaddtfresh 1 if (%atsatszitanp) { if (%atsatszitaddtst) { /did -c zitaddt 15 } /did -c zitaddt 8 /did -v zitaddt 9,10,11,12 if ( $timestampfmt = [HH:nn] ) || ( $timestampfmt = [HH:nntt] ) { /did -v zitaddt 15 } /did -o zitaddt 9 1 %atsatsnapleft /did -o zitaddt 12 1 %atsatsnapright } /did -a zitaddt 16 -- Keine -- /did -c zitaddt 16 1 if (!$hget($atsquotecategoryhash)) { atsquotebuildcategoryhash } var %atscountti 2 while ( %atscountti <= $atsquotecategorycount ) { /did -a zitaddt 16 $atsquotecategoryname(%atscountti) /inc %atscountti } if ( %atszitaddttmp1 != $null ) { /did -a zitaddt 1 %atszitaddttmp1 /did -a zitaddt 2 %atszitaddttmp2 /unset %atszitaddttmp* /did -b zitaddt 1,2 /set %atszitaddmod 1 return } if ( $did(1) != $null ) zitaddedit1 } on 1:dialog:zitaddt:sclick:15:{ if ( $did(15).state ) { /set %atsatszitaddtst 1 } else { /unset %atsatszitaddtst } } on 1:dialog:zitaddt:sclick:8:{ if ( $did(8).state ) { /did -v zitaddt 9,10,11,12 if ( $timestampfmt = [HH:nn] ) || ( $timestampfmt = [HH:nntt] ) { /did -v zitaddt 15 } if (%atsatszitaddtst) { /did -c zitaddt 15 } /did -o zitaddt 9 1 %atsatsnapleft /did -o zitaddt 12 1 %atsatsnapright /set %atsatszitanp 1 } else { /unset %atsatszitanp /did -h zitaddt 9,10,11,12,15 } } alias readdzit { if ( $read(zitlist.ats , w , * $strip($gettok($1- , 5 , 168 )) $+ * ) = $null ) && ( !$atsquoteexists(* $+ $strip($gettok($1- , 5 , 168 )) $+ *) ) { /write zitlist.ats $$1- } } ; ATS Versions Checker dialog ATSVC { title "ATS Versions Check" size -1 -1 90 80 option dbu box "",1,0 -2 90 80 button "Close",2,60 35 29 10,ok button "E-Mail",3,2 35 29 10 button "Homepage",4,31 35 29 10 edit "",5,2 5 87 30,multi read center edit "checking version...",6,2 45 87 10,read center button "Nach neuer Version suchen",7,2 55 87 10,default button "Neueste Version downloaden",8,2 65 87 10, disable } on 1:dialog:atsvc:init:*:{ did -o atsvc 5 1 Abomb's $iif( $script(ats.ini) != $null , Terror , Zitat ) Script $crlf Version: %atsversion $crlf E-Mail: Abomb@Abomb.de $crlf Homepage: http://www.abomb.de sockopen ATS.ne abomb.info 80 } on 1:dialog:atsvc:sclick:*:{ if $did == 3 { run mailto:abomb@abomb.de?subject=Abomb's Terror Script } if $did == 4 { run http://www.abomb.de } if $did == 7 { did -o atsvc 6 1 checking version... sockopen ATS.ne abomb.info 80 } if $did == 8 { run http://ats.abomb.info } } on 1:sockopen:ATS.ne:{ /sockwrite -n ATS.ne GET /ats.html HTTP/1.1 /sockwrite -n ATS.ne User-Agent: Mozilla/bottich /sockwrite -n ATS.ne Host: abomb.info sockwrite -n $sockname Connection: Keep-Alive sockwrite -n $sockname $crlf } on 1:sockread:ATS.ne:{ sockread -f %ATS.neuev if ($sockbr == 0) return if (%ATS.neuev == $null) %ATS.neuev = - if (%ATS.neuev = ATS Version Info File: ) { sockread -f %ATS.neuev if ( %ATS.neuev > %ATSversion ) && ( %ats.neuev isnum ) { did -o atsvc 6 1 Neue Version verf $+ $chr(252) $+ gbar %ats.neuev did -e atsvc 8 } else { did -o atsvc 6 1 Keine neue Version gefunden did -b atsvc 8 } sockclose ATS.ne } } alias atsvc { if $dialog(atsvc) == $null { dialog -m atsvc atsvc } } alias atscountdown { /dec %atstempzittimer if ( %atstempzittimer = 0 ) { /timeratscountdown off } } dialog zitsettings { title "Zitat-script-settings" size -1 -1 147 215 option dbu radio "!zitat $+ $me in allen channeln erlauben ", 1, 4 4 122 10, group radio "!zitat $+ $me in allen channeln erlauben ausser:", 2, 4 16 126 10, group radio "!zitat $+ $me nur in folgenden channeln:", 3, 4 40 122 10, group button "Schliessen", 4, 54 198 37 8, default ok cancel edit "", 5, 4 28 138 10, center edit "", 6, 4 52 138 10, center radio "An", 7, 6 72 18 8, group radio "Aus", 14, 26 72 20 8 text "Aktiv in folgendem Channel:", 15, 55 72 69 8 box "On-Join Zitate", 16, 4 64 138 30 combo 17, 6 80 132 60, size drop icon 8, 12 168 8 6, atspics\0.bmp, 0 box "Farbgestaltung der Zitate", 9, 4 96 138 98 text "Beispiel Zitat Text (c) by Zitatauthor", 10, 8 106 129 8 combo 11, 18 114 22 56, size drop combo 12, 60 114 22 56, size drop combo 13, 102 114 22 56, size drop text "Farben:", 18, 60 152 25 8 text "00", 19, 13 162 7 6 text "01", 20, 29 162 7 6 icon 21, 28 168 8 6, atspics\1.bmp, 0 text "02", 22, 45 162 7 6 icon 23, 44 168 8 6, atspics\2.bmp, 0 text "03", 24, 61 162 7 6 icon 25, 60 168 8 6, atspics\3.bmp, 0 text "04", 26, 77 162 7 6 icon 27, 76 168 8 6, atspics\4.bmp, 0 text "05", 28, 93 162 7 6 icon 29, 92 168 8 6, atspics\5.bmp, 0 text "06", 30, 109 162 7 6 icon 31, 108 168 8 6, atspics\6.bmp, 0 text "07", 32, 125 162 7 6 icon 33, 124 168 8 6, atspics\7.bmp, 0 text "08", 34, 13 178 7 6 icon 35, 12 184 8 6, atspics\8.bmp, 0 text "09", 36, 29 178 7 6 icon 37, 28 184 8 6, atspics\9.bmp, 0 text "10", 38, 45 178 7 6 icon 39, 44 184 8 6, atspics\10.bmp, 0 text "11", 40, 61 178 7 6 icon 41, 60 184 8 6, atspics\11.bmp, 0 text "12", 42, 77 178 7 6 icon 43, 76 184 8 6, atspics\12.bmp, 0 text "13", 44, 93 178 7 6 icon 45, 92 184 8 6, atspics\13.bmp, 0 text "14", 46, 109 178 7 6 icon 47, 108 184 8 6, atspics\14.bmp, 0 text "15", 48, 125 178 7 6 icon 49, 124 184 8 6, atspics\15.bmp, 0 text "Zitat-Suchbegriff-Highlight-Color", 50, 30 128 81 8 combo 51, 60 136 22 50, size drop check "Controlcodes im Zitat behalten", 52, 8 148 94 10 } on 1:dialog:zitsettings:init:0:{ if ( %atsonjoinan = on ) { /did -c zitsettings 7 } else { /did -c zitsettings 14 } /did -o zitsettings 1 1 !zitat $+ $me in allen channeln erlauben /did -o zitsettings 2 1 !zitat $+ $me in allen channeln erlauben ausser: /did -o zitsettings 3 1 !zitat $+ $me nur in folgenden channeln: if ( %atszitset = $null ) set %atszitset 1 /did -c zitsettings %atszitset /did -o zitsettings 5 1 %atszitsett1 /did -o zitsettings 6 1 %atszitsett2 var %channum 1 while ( %channum <= $chan(0) ) { /did -a zitsettings 17 $chan(%channum) if ( $chan(%channum) = %atsonjoinchan ) { var %blucheck2 %channum } /inc %channum } if ( %blucheck2 != $null ) { /did -c zitsettings 17 %blucheck2 } else { /did -c zitsettings 17 1 } inicolor 11 inicolor 12 inicolor 13 inicolor 51 /did -c zitsettings 11 $calc(%atszitcol1 + 1) /did -c zitsettings 12 $calc(%atszitcol2 + 1) /did -c zitsettings 13 $calc(%atszitcol3 + 1) /did -c zitsettings 51 $calc(%atszitcol4 + 1) if ( $atsquotecontrolcodes == on ) { /did -c zitsettings 52 } } on 1:dialog:zitsettings:sclick:1:{ /did -u zitsettings 2,3 /set %atszitset 1 /set %atszitchan $chr(35) } on 1:dialog:zitsettings:sclick:11:{ /set %atszitcol1 $calc($did(11).sel - 1) } on 1:dialog:zitsettings:sclick:12:{ /set %atszitcol2 $calc($did(12).sel - 1) } on 1:dialog:zitsettings:sclick:13:{ /set %atszitcol3 $calc($did(13).sel - 1) } on 1:dialog:zitsettings:sclick:51:{ /set %atszitcol4 $calc($did(51).sel - 1) } on 1:dialog:zitsettings:sclick:52:{ if ( $did(52).state ) { /set %atszitcontrolcodes on } else { /unset %atszitcontrolcodes } } on 1:dialog:zitsettings:sclick:17:{ /set %atsonjoinchan $did(17) } on 1:dialog:zitsettings:sclick:4:{ /set %atsonjoinchan $did(17) /set %atszitcol1 $calc($did(11).sel - 1) /set %atszitcol2 $calc($did(12).sel - 1) /set %atszitcol3 $calc($did(13).sel - 1) /set %atszitcol4 $calc($did(51).sel - 1) if ( $did(52).state ) { /set %atszitcontrolcodes on } else { /unset %atszitcontrolcodes } } on 1:dialog:zitsettings:sclick:7:{ /set %atsonjoinan on } on 1:dialog:zitsettings:sclick:14:{ /unset %atsonjoinan } on 1:dialog:zitsettings:sclick:2:{ /did -u zitsettings 1,3 /set %atszitset 2 /set %atszitchan $chr(35) /set %atszitchannot $did(5) } on 1:dialog:zitsettings:sclick:3:{ /did -u zitsettings 2,1 /set %atszitset 3 /set %atszitchan $did(6) } on 1:dialog:zitsettings:edit:5:{ /set %atszitsett1 $did(5) if ( $did(2).state ) { /set %atszitchannot $did(5) } } on 1:dialog:zitsettings:edit:6:{ /set %atszitsett2 $did(6) if ( $did(3).state ) { /set %atszitchan $did(6) } } alias clearzittemp { atsquotehashclear $atsquotesearchhash 32 atsquotehashclear $atsquotesourcehash 64 } on ^1:HOTLINK:*soma*:*:if soma:// isin $1 return | else halt on 1:HOTLINK:*soma*:*:/run $1 on 1:join:%atsonjoinchan:{ if ( $uptime(server,3) < 120 ) { halt } if ( $Isignore($nick) ) { halt } if ( $nick != $me ) && ( %atsonjoinan = on ) && ( %atsstopspammzit = $null ) { set -u1 %atsstopspammzit stop if ( $chan = #fick.dich.ins.knie.und.hoer.auf.zu./whois'en ) && ( $rand(1,7) != 5 ) { /halt } if ( $chan = #uo.bab ) && ( $rand(1,7) != 5 ) { /halt } if ( $chan = #augsburg ) && ( $rand(1,7) != 5 ) { /halt } if ( $chan = #tfc.iq ) && ( $rand(1,3) != 2 ) { /halt } /set %atsatshostmask $remove($gettok( $address , 1 , 64 ),~) if ( [ %zas [ $+ [ $nick ] ] ] != $null ) { /set -u10 %atstemp %atsznummer /set %atsATSzitsearch $chan /set %atsATSzitrandom on /set %atsatsnoresult 1 /zs [ %zas [ $+ [ $nick ] ] ] random /set %atsznummer %atstemp /halt } /set %atsATSzitsearch $chan /set %atsATSzitrandom on /zs $nick random /unset %atsATSzitsearch } } alias atszitstats //echo Ich habe $iif($atsquotecount > 0 , insgesamt $atsquotecount , keine ) Zitate, spamme $iif($atszph > 0,$atszph, keine) Zitate pro Stunde, und von mir wurden $iif(%atszitrequests > 0 ,bereits %atszitrequests, noch keine) Zitate requested ;) on 1:text:!zitstats:#:{ triggercheck $1- if ( %atsatszitstats [ $+ [ $nick ] ] ) { halt } /set -u20 %atsatszitstats [ $+ [ $nick ] ] 1 /.notice $nick Ich habe $iif($atsquotecount > 0 , insgesamt $atsquotecount , keine ) Zitate, spamme $iif($atszph > 0,$atszph, keine) Zitate pro Stunde, und von mir wurden $iif(%atszitrequests > 0 ,bereits %atszitrequests, noch keine) Zitate requested ;) } alias zaba $iif(($$1 isnum) && ($$1 <= $atsquotecount),/set %atszab $addtok(%atszab,$$1,1)) alias zabr /set %atszab $remtok(%atszab,$$1,1) alias zabsub $iif(($$1 isnum) && ($$1 <= $numtok(%atszab,1)) ,return $gettok(%atszab,$$1,1) - $atsquotedescription($gettok(%atszab,$$1,1)) $+ :/zs $gettok(%atszab,$$1,1)) alias zabsubR $iif(($$1 isnum) && ($$1 <= $numtok(%atszab,1)) ,return $gettok(%atszab,$$1,1) - $atsquotedescription($gettok(%atszab,$$1,1)) $+ :/zabr $gettok(%atszab,$$1,1)) alias -l createpics { mkdir atspics var %tesd 0 /window -ph +d @atspics 1 1 20 15 while ( %tesd <= 15 ) { /drawrect -f @atspics %tesd 1 0 0 20 15 /drawsave -b16 @atspics atspics\ $+ [ %tesd ] $+ .bmp inc %tesd } window -c @atspics } alias -l inicolor { set %~color-c -1 | :colorloop | if (%~color-c < 15) { inc %~color-c | if (%~color-c < 10) { set %~color-c 0 $+ %~color-c } | did -a zitsettings $1 $chr(91) $+ %~color-c $+ $chr(93) | goto colorloop } else { halt | unset %~color-c } } alias sorttokn { write -c temp.txt $replace($1,$chr($2),$lf) filter -ffcut $+ $iif(r isin $3,e) 1 10 temp.txt temp.txt bread temp.txt 0 940 &a .remove temp.txt return $gettok($replace($bvar(&a,1-).text,$crlf,$chr($2)),1-,$2) } alias atsapplysearchhighlight { var %atsbasecol = $1 var %atstempzeile = $chr(3) $+ %atsbasecol $+ $2- var %atstempsuchbegriff = $replace(%atssuchbegriff,*,$chr(32)) var %x 1 while (%x <= $numtok(%atstempsuchbegriff,32)) { var %atshighlightterm $gettok(%atstempsuchbegriff,%x,32) if (%atshighlightterm == by) || (%atshighlightterm == $atschrby) || (%atshighlightterm == $atschrbydisplay) { inc %x continue } var %y 1 while (%y <= $count(%atstempzeile,%atshighlightterm)) { %atstempzeile = $mid(%atstempzeile, 1, $calc($pos(%atstempzeile,%atshighlightterm,%y)-1)) $+ $chr(3) $+ %atszitcol4 $+ $mid(%atstempzeile, $pos(%atstempzeile,%atshighlightterm,%y), $len(%atshighlightterm)) $+ $chr(3) $+ %atsbasecol $+ $mid(%atstempzeile, $calc($pos(%atstempzeile,%atshighlightterm,%y) + $len(%atshighlightterm))) /inc %y } inc %x } return %atstempzeile } alias atscolorsearch { var %atsindex = $iif($1 == g,%atsznummer,$atsquotefindindex(%atssuchbegriff,%atszbrn)) if (%atsindex !isnum 1- $+ $atsquotecount) { return } var %atstext $atsquotesearchnormalize($atsquotetext(%atsindex)) var %atsnick $atsquotesearchnormalize($atsquotenick(%atsindex)) var %atscoloredtext $atsapplysearchhighlight(%atszitcol1,%atstext) var %atscolorednick $atsapplysearchhighlight(%atszitcol3,%atsnick) return %atscoloredtext $+ $chr(3) $+ %atszitcol2 $+ $chr(32) $+ $atschrbydisplay $+ $chr(32) $+ by $+ $chr(32) $+ %atscolorednick } alias rzs { /zs $calc( $atsquotecount $iif($1 isnum, - $1)) } alias Isignore { var %x 1 while ( %x <= $ignore(0) ) { if ( $address($$1,3) == $ignore(%x) ) { /return $true } /inc %x if ( %x > 200 ) { halt } } /return $false }