Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Wikipedia Addon v2.1

Recommended Posts

  • Administrators
>alias twikicolor  {



 ; hier können die Farben der Wikipedia Ausgabe geändert werden.

 ; die Farben bitte immer nach dem "=" der Variable angeben, also zB:

 ; var %link = xx



 ;in folgender Zeile bitte die Farbe für den Link angeben:

 var %link = 04

 ;in folgender Zeile bitte die Farbe für den Vorschautext angeben:

 var %text = 08

 ;in folgender Zeile bitte die Farbe für den Treffer angeben:

 var %match = 14



 if ($1 == text) return $checkcol($remove(%text,$chr(3))).text

 elseif ($1 == link) return $checkcol($remove(%link,$chr(3))).link

 elseif ($1 == match) return $checkcol($remove(%match,$chr(3))).match

}

alias -l checkcol {

 if ($1 !isnum 0-15) return $replace($prop,text,08,link,04,match,14)

 elseif ($len($1) 
 else return $1

}



;version check alias

alias twiki.version return 2.1



;Wikipedia Addon

on *:TEXT:!wiki*:#:{

 inc -u10 %floodschutz.wiki. [ $+ [ $+($network,$chan) ] ] 1

 if (%floodschutz.wiki. [ $+ [ $+($network,$chan) ] ] == 2) msg $chan 4Der Floodschutz für !wiki wurde in $chan aktiviert! 

 elseif (%floodschutz.wiki. [ $+ [ $+($network,$chan) ] ] 
   if (!$2) msg $chan Usage: !wiki [-a] Suche |||| -a ist optional, damit werden die ersten 3 statt nur dem besten Treffer ausgegeben.

   else {

     sockopen twiki wiki.suche.web.de 80 

     sockmark twiki $chan $strip($2-)

   }

 }

}

on *:sockopen:twiki:{

 tokenize 32 $sock($sockname).mark

 if ($sockerr) msg $1 Wikipedia-Suche felgeschlagen - $sock($sockname).wsmsg 

 else {

   sockwrite -n $sockname GET $+(/wiki/?smode=&su=,$replace($iif($2 == -a,$3-,$2-),$chr(32),$chr(43))) HTTP/1.3

   sockwrite -n $sockname Content-Type: text/html;charset=UTF-8 

   sockwrite -n $sockname Host: wiki.suche.web.de $str($crlf,2)

 }

}

on *:SOCKREAD:twiki:{

 tokenize 32 $strip($sock($sockname).mark)

 sockread %wiki.temp

 if (
     $chr(32)),$chr(31),$chr(32),$chr(2),$chr(3),$chr(57),$chr(151),$chr(3),$chr(49),$chr(52),$chr(116),$chr(3),$chr(57),$chr(45),$chr(3),$chr(49),$chr(53),$chr(248),$chr(3),$chr(57),$chr(45),$chr(3),$chr(48),$chr(110), $&

   $chr(3),$chr(57),$chr(45),$chr(3),$chr(49),$chr(53),$chr(121),$chr(3),$chr(57),$chr(45),$chr(3),$chr(49),$chr(52),$chr(112),$chr(3),$chr(57),$chr(151))  }

 if ($regex(%wiki.temp,/Meinten Sie: (.*)/)) msg $1 $+($chr(3),5,»,$chr(32),$chr(3),15,Meintest du vielleicht,$chr(2),$chr(32),$tonypfree($regml(1)),$chr(2),?)

 if ($regex(%wiki.temp,/(Es wurden keine Seiten. die mit Ihrem Suchebegriff .* gefunden.)/)) { .timer.wiki 1 1 msg $1 $+($chr(3),14,$tonypfree($replace($regml(1),„,„,“,“))) | sockclose wiki | unset %wiki.* }

 if ($regex(%wiki.temp,/\s+$/)) set %wiki.post 1

 if ($regex(%wiki.temp,/\s+[url="(.*)"](.*)[/url].*/)) && (%wiki.post == 1) { 

   ; .timer.wiki.1 $+ %wiki.n 1 %wiki.n msg $1 $+($chr(3),14,$tonypfree($regml(2)),$chr(58),$chr(32),$chr(3),04,$tonypfree($regml(1)))

   .timer.wiki.1 $+ %wiki.n 1 %wiki.n msg $1 $tonypfree($+($chr(3),$twikicolor(match),$regml(2),$chr(58),$chr(32),$chr(3),$twikicolor(link),$regml(1)) )

   inc %wiki.n 

   unset %wiki.post

 }

 if ($regex(%wiki.temp,/\s+(.*).*/)) { 

   if (*Meinten Sie* !iswm $regml(1)) {

     .timer.wiki.2 $+ %wiki.n 1 %wiki.n msg $1 $+($chr(3),$twikicolor(text),$tonypfree($regml(1)))

     inc %wiki.n 

   }

 }

 ;if ($regex(%wiki.temp,/\s+) && (%wiki.post = 1)) { echo -s 4unset | unset %wiki.post }

 if (%wiki.n == $iif($2 == -a,7,3)) { sockclose twiki | unset %wiki.* }

}

alias tonypfree {

 var %tfree = $1-

 /*

 ; ***************UTF-8 experimentel debugging********************

 ;************************************************************

 ; Solltet ihr Probleme bei der Darstellung von UTF-8 haben, löscht das /* über diesen Zeilen und das */ weiter unten.

 ; Zur optimalen Funktionsweise dann noch unter Alt+O -> Other -> Lock sicherstellen, dass bei Decode KEIN Häkchen gesetzt ist.

 ; Dies ist ein experimentelles Feature und es wird mindestens mIRC-Version 6.17 (buggy UTF-8!) benötigt.  (s.o.)

 ;************************************************************.

 if ($lock(decode) == $false) { var %tfree = $replace(%tfree,$chr(44),|komma|) | var %tfree = $utfencode(%tfree) | var %tfree = $utfdecode(%tfree) | var %tfree = $replace(%tfree,|komma|,$chr(44)) }

 else {  var %tfree = $replace(%tfree, Ä, Ä, ä, ä, Ãœ, Ü, ü, ü, Ö, Ö, ö, ö, ß, ß, €, €, €, €,„,",“,",−,-) }

 */



 ;return $replace(%tfree,,,,,[b],,[/b],, ,$chr(32),',',&,&,ü,ü,Ü,Ü,ä,ä,Ä,Ä,ö,ö,Ö,Ö,",",ß,ß,% $+ 20,$chr(32),–,–,
 var %tfree = $replace(%tfree,,,,,[b],,[/b],,$+($chr(40),$chr(32)),$chr(40),$+($chr(32),$chr(41)),$chr(41))

 var %tfree = $tstriphtml(%tfree)

 return %tfree

}



alias tstriphtml {

 /** 

 *** tonyp $tstriphtml v1.0

 *** -----

 *** This is a modified/fixed version of dJabba's $striphtml v0.5

 *** All modifications done by tonyp, contact see above

 *** Changed the /set to /var

 *** Puplished version hadn't worked for me 

 ***  --> i fixed some parts, see below for details

 *** all credits to the author!

 ***

 *** // - tonyp - // 10.01.2009

 ***

 ***

 *** Download original file at: http://mirc.net/projects.php?view_snippet=1109743970

 **

 * Original authors details:

 ; -----------------------––––––––––––-----––––––––––––––––––––––––––––––––––––––

 ;  Author  : dJabba

 ;  Email   : jabbalenium@gmail.com

 ;  URL     : http://www.dJabbaScripts.tk

 ;  Contact : mailto:jabbalenium@gmail.com?subject=dJsthtml%20v0.5

 ; -----------------------––––––––––––-----––––––––––––––––––––––––––––––––––––––

 ;    dJabba's $striphtml (dJsthtml) is copyrighted 2005-2006 by dJabba, all

 ;    rights are reserved by the author.

 ;

 ;    This script is provided "as-is", and i am not responsible for any harm it

 ;    might add to files, software, hardware, brain(s) or what-so-ever.

 ;    By using this script you agree to this and you take full responsibility for

 ;    any action yourself

 ;

 ;    You are allowed to redistribute and modify this file in any way you might

 ;    want or like to, but if you do so you MUST remember to credit me and mention

 ;    that YOU have modified in it.

 *

 *

 */



 if (!$isid) || (!$1) return

 var %H = $1 , %T = $regsub(%H,/(]+>)/g,,%H)

 if ($chr(38) isin %H) var %H = $striphtml_entities(%H)

 return %H

}





alias -l striphtml_entities {

 ;tonyp fix

 ;var %H = $striphtml_num.entities(%H)

 var %H = $striphtml_num.entities($1)

 ;tonyp fix end

 if ($chr(38) !isin %H) return %H

 ;tonyp fix:

 ;set %H $replacecs(%H,",",&,&,
 var %H = $replacecs(%H,",",&,&,
 ;tonyp fix end

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,Å,Å,å,å,Ã,Ã,ã,ã,Ä,Ä,ä,ä,¦,¦,Ç,Ç,ç,ç,¸,¸,¢,¢,ˆ,ˆ,©,©,¤,¤,°,°)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,÷,÷,É,É,é,é,Ê,Ê,ê,ê,È,È,è,è,Ð,Ð,ð,ð,Ë,Ë,ë,ë,&Euro;,€,ƒ,ƒ,½,½,¼,¼)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,¾,¾,Í,Í,í,í,Î,Î,î,î,¡,¡,Ì,Ì,ì,ì,¿,¿,Ï,Ï,ï,ï,«,«,¯,¯,µ,µ,·,·)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,¬,¬,Ñ,Ñ,ñ,ñ,Ó,Ó,ó,ó,Ô,Ô,ô,ô,Œ,Œ,œ,œ,Ò,Ò,ò,ò,ª,ª,º,º,ØØ,ø,ø,)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,Õ,Õ,õ,õ,Ö,Ö,ö,ö,¶,¶,±,±,£,£,»,»,®,®,Š,Š,š,š,§,§,­,­,¹,¹,²,²)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,³,³,ß,ß,Þ,Þ,þ,þ,˜,˜,×,×,Ú,Ú,ú,ú,Û,Û,û,û,Ù,Ù,ù,ù,¨,¨,Ü,Ü,ü,ü)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,Ý,Ý,ý,ý,¥,¥,Ÿ,Ÿ,ÿ,ÿ)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,’,’,‚,‚,“,“,”,”,„,„,‹,‹,›,›,†,†,‡,‡,‰,‰,•,•,…,…,″,?,′,?,‾,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,⁄,?,℘,?,ℑ,I,ℜ,R,™,™,ℵ,?,←,?,↑,?,→,?,↓,?,↔,?,↵,?,⇐,?,⇑,?,⇒,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,⇓,?,⇔,?,∀,?,∂,?,∃,?,∅,?,∇,?,∈,?,∉,?,∋,?,∏,?,∑,?,−,-,∗,?,√,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,∝,?,∞,?,∠,?,∧,?,∨,?,∩,?,∪,?,∫,?,∴,?,∼,?,≅,?,≈,?,≠,?,≡,?,≤,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,≥,?,⊂,?,⊃,?,⊄,?,⊆,?,⊇,?,⊕,?,⊗,?,⊥,?,⇔,?,⋅,?,⌈,?,⌉,?,⌊,?,⌋,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,〈,?,〉,?,◊,?,♠,?,♣,?,♥,?,♦,?,Α,?,α,?,Β,?,β,?,Γ,?,γ,?,Δ,?,δ,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,Ε,?,ε,?,Ζ,?,ζ,?,Η,?,η,?,Θ,?,θ,?,ϑ,?,Ι,?,ι,?,Κ,?,κ,?,Λ,?,λ,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,Μ,?,μ,?,Ν,?,ν,?,Ξ,?,ξ,?,Ο,?,ο,?,Π,?,π,?,ϖ,?,Ρ,?,ρ,?,Σ,?,σ,?)

 if ($chr(38) !isin %H) return %H

 var %H = $replacecs(%H,ς,?,Τ,?,τ,?,Υ,?,υ,?,ϒ,?,Φ,?,φ,?,Χ,?,χ,?,Ψ,?,ψ,?,Ω,?,ω,?)

 return %H

}



alias -l striphtml_num.entities {

 ;Thanks to tidy_trax for help on this code piece here.

 var %a, %b = $regsub($replace($1,$chr(32),$chr(32) $!chr(32) $!+ $!chr(32) $chr(32)),/(\d+);/g,$chr(32) \$+ \$chr(\1) \$+ $chr(32),%a)

 return $(%a,2)

}





on *:SOCKCLOSE:wiki:{

 unset %wiki.*

}

Link to comment
Share on other sites



×
×
  • Create New...