• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

[0.x] Insult Command *For Fun*

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
14 posts • Page 1 of 1

Postby Monkieboy » Tue Apr 25, 2006 11:46 pm

Hey everybody! I just want to say that I spent hours trying to find a chat I could easily configure to use with a game I am trying to make, and finally I stumbled upon this one. I have made an insult command: /insult "person" (no quotes). It uses Shakesperian insults to insult people properly. Just save it in the source file as "pfccommand_insult.class.php".

Code: Select all
<?php
// create the customized command
require_once "src/pfccommand.class.php";
class pfcCommand_insult extends pfcCommand
{
  function run(&$xml_reponse, $clientid, $msg)
  {
    $c =& $this->c;

    $nick = $c->nick;   
    $para = trim($msg);
    $para = explode(" ",$para);
    $container =& $c->getContainerInstance();
   
    $phrase1 = array("artless","bawdy","beslubbering","bootless","churlish","clouted",
    "cockered","craven","currish","dankish","dissembling","droning","errant","fawning",
    "fobbing","frothy","froward","gleeking","goatish","gorbellied","impertinent",
    "infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling",
    "paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish",
    "saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed",
    "villainous","warped","wayward","weedy","yeasty");

    $phrase2 = array("base-court","bat-fowling","beef-witted","beetle-headed",
    "boil-brained","clapper-clawed","clay-brained","common-kissing","crook-pated",
    "dismal-dreaming","dizzy-eyed","doghearted","dread-bolted","earth-vexing",
    "elf-skinned","fat-kidneyed","fen-sucked","flap-mouthed","fly-bitten",
    "folly-fallen","fool-born","full-gorged","guts-griping","half-faced","hasty-witted",
    "hedge-born","hell-hated","idle-headed","ill-breeding","ill-nurtured","knotty-pated",
    "milk-livered","motley-minded","onion-eyed","plume-plucked","pottle-deep",
    "pox-marked","reeling-ripe","rough-hewn","rude-growing","rump-fed","shard-borne",
    "sheep-biting","spur-galled","swag-bellied","tardy-gaited","tickle-brained",
    "toad-spotted","urchin-snouted","weather-bitten");

    $phrase3 = array("apple-john","baggage","barnacle","bladder","boar-pig","bugbear",
    "bum-bailey","canker-blossom","clack-dish","clotpole","codpiece","coxcomb","death-token",
    "dewberry","flap-dragon","flax-wench","flirt-gill","foot-licker","fustilarian",
    "giglet","gudgeon","haggard","harpy","hedge-pig","horn-beast","hugger-mugger",
    "joithead","lewdster","lout","maggot-pie","malt-worm","mammet","measle","minnow",
    "miscreant","moldwarp","mumble-news","nut-hook","pigeon-egg","pignut","pumpion",
    "puttock","ratsbane","scut","skainsmate","strumpet","varlet","vassal","wagtail",
    "whey-face");
   
    //rand() returns in range 1-n, subtract 1 for array index
    $rand1 = rand(0,sizeof($phrase1)-1);
    $rand2 = rand(0,sizeof($phrase2)-1);
    $rand3 = rand(0,sizeof($phrase3)-1);
if ($para[0] == '') { 
$insult = "Thou $phrase1[$rand1] $phrase2[$rand2] $phrase3[$rand3]!";
}else {
$insult = "$para[0], thou $phrase1[$rand1] $phrase2[$rand2] $phrase3[$rand3]!";
}   


$result = $insult;
if (!$insult) { $result = 'Not found!'; }

 if (!$insult)
    {
      $cmd =& pfcCommand::Factory("error", $c);
      $cmd->run($xml_reponse, $clientid, "Quote failed: " . $result);
    }
    else
    {
      $container->writeMsg($nick, $result);
    }
    if ($c->debug) pxlog("Cmd_quote[".$c->sessionid."]: msg=".$result, "chat", $c->getId());
 }
}
?>
Last edited by Monkieboy on Wed Oct 11, 2006 4:20 am, edited 1 time in total.
Monkieboy
New member
 
Posts: 3
Joined: Tue Apr 25, 2006 11:39 pm
Top

Postby phpfreechat » Wed Apr 26, 2006 8:42 am

This is a funny command :)
thanks for sharing !
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby mcpg » Thu May 18, 2006 7:29 am

Looks fun but ecactly where do I put the code? Do I create a new file and copy yhr code into that?

Thanks
Mark
mcpg
New member
 
Posts: 3
Joined: Mon May 15, 2006 9:38 pm
Top

Postby phpfreechat » Thu May 18, 2006 8:42 am

Yes as Monkieboy explained :
Just save it in the source file as "pfccommand_insult.class.php".

(put this file in phpfreechat/src/)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby $c@r » Mon Jun 05, 2006 4:11 pm

I love this stuff !
$c@r
Member
 
Posts: 13
Joined: Sat Jun 03, 2006 9:06 pm
Location: France
  • Website
Top

Postby thehermit » Mon Aug 14, 2006 8:37 pm

I cant get this to work under the latest 1.4 version. Any ideas what needs changing?
thehermit
New member
 
Posts: 5
Joined: Mon Aug 14, 2006 8:32 pm
Top

Postby neon » Mon Aug 14, 2006 11:21 pm

thehermit wrote:I cant get this to work under the latest 1.4 version. Any ideas what needs changing?

You getting an XML error? That is what I am getting as well. Would love to see this working...looks funny!
neon
Member
 
Posts: 10
Joined: Thu Jul 13, 2006 6:33 pm
Top

Postby thehermit » Tue Aug 15, 2006 7:09 pm

Yeah, getting "You have whitespace in your responce" as an XML error.

Pity, cos it looks a fab command to have and I know my users would just love it.
thehermit
New member
 
Posts: 5
Joined: Mon Aug 14, 2006 8:32 pm
Top

Postby eretard » Sat Sep 09, 2006 2:07 pm

I uploaded the pfccommand_insult.class.php to the /src directory and it says that it is not a recognized command when I try it in the chatroom. I do it wrong ?

Tom
eretard
Member
 
Posts: 21
Joined: Sat Sep 09, 2006 12:46 pm
Top

Postby phpfreechat » Sat Sep 09, 2006 2:15 pm

eretart, do you have 0.9.3 installed ?
(notice: this contrib doesn't work with 1.x releases)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby eretard » Mon Sep 11, 2006 6:10 am

oh, ok.... yeah i have 1.4 and 1.5
thanks
eretard
Member
 
Posts: 21
Joined: Sat Sep 09, 2006 12:46 pm
Top

Postby Monkieboy » Wed Oct 11, 2006 4:17 am

I will try to update this script in order to get it to work with the new versions.
Monkieboy
New member
 
Posts: 3
Joined: Tue Apr 25, 2006 11:39 pm
Top

Postby eretard » Tue Oct 17, 2006 5:51 pm

Monkieboy wrote:I will try to update this script in order to get it to work with the new versions.

Ok. Sounds good to me. Will watch for it. :)

Thanks
eretard
Member
 
Posts: 21
Joined: Sat Sep 09, 2006 12:46 pm
Top

Postby sabreofsd » Tue Nov 21, 2006 9:30 pm

Any news on the updated script to work with beta 7?
--------------
Sabre
sabreofsd
New member
 
Posts: 5
Joined: Wed Nov 08, 2006 5:14 pm
Location: Washington, DC area
  • Website
Top


Post a reply
14 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 12 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub