Jump to content

Archived

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

chain

!Uncyclopedia Search Script w/Random

Recommended Posts

  • Administrators

!Uncyclopedia Search Script w/Random

 

logo.jpg

 

10i6ss2.jpg

 

This script searches uncyclopedia.com for your search item. If no search word is given, it will give results from a random word.

This script was created @ the suggestion of ^Neptune.

Syntax for the script is !uncyclopedia search word(s) or just plain !uncyclopedia for random.

There is a ! trigger that will notice the user and a @ trigger that will message the channel if the user has halfops or higher.

***Disclaimer***

Just like the urban dictionary site, this site can render some very RUDE results. From my testing, I found some results to be racially insensitive. I also found some to be very anti-American.

It is up to the bot/channel owner to determine if this script is appropriate for their channel/network.

***************

 

;Uncyclopedia Search Script by Ford_Lawnmower -- irc.mindforge.org #USA-Chat

menu Channel,Status {

  .$iif($group(#uncyclopedia) == On,$style(1)) Uncyclopedia uncyclopedia Trigger

  ..$iif($group(#uncyclopedia) == On,$style(2)) On: .enable #uncyclopedia

  ..$iif($group(#uncyclopedia) == Off,$style(2)) Off: .disable #uncyclopedia

}

#uncyclopedia on

On $*:Text:/^(!|@)uncyclopedia.*/Si:#: {

  if ($timer($+(uncyclopedia,$network,$nick))) { return }

  .timer $+ $+(uncyclopedia,$network,$nick) 1 4 noop

  var %method $iif($regml(1) == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))

  uncyclopediaS %method $2-

}

#uncyclopedia end

alias uncyclopedia { uncyclopediaS echo -a $1- }

alias -l uncyclopediaS {

  $1-2 Searching.......

  var %sockname $+(uncyclopediaS,$network,$2,$ticks)

  sockopen %sockname uncyclopedia.wikia.com 80

  sockmark %sockname $1-2 $iif($3,$+(/wiki/Special:Search/,$replace($3-,$chr(32),+)),/wiki/Special:Random) 0 $iif(!$3,1,0)

}

alias -l uncyclopediaR {

  var %sockname $+(uncyclopediaR,$network,$2,$ticks)

  sockopen %sockname uncyclopedia.wikia.com 80

  sockmark %sockname $1-2 $+(/wiki/,$3) 0 $iif($4,1,0)

}

On *:sockopen:uncyclopedia*: {

  if (!$sockerr) {

    sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0

    sockwrite -n $sockname Host: uncyclopedia.wikia.com

    sockwrite -n $sockname $crlf

  }

  else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }

}

On *:sockread:uncyclopediaS*: {

  if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }

  else {

    var %uncyclopediaS | sockread %uncyclopediaS

    if (Page title matches isincs %uncyclopediaS) { sockmark $sockname $puttok($sock($sockname).mark,1,4,32) }

    if (Page text matches isincs %uncyclopediaS) { sockmark $sockname $puttok($sock($sockname).mark,1,4,32) }    

    if ($gettok($sock($sockname).mark,4,32)) && ($regex(%uncyclopediaS,/\Q

[*]
Link to comment
Share on other sites



×
×
  • Create New...