collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Social Mods  (Read 5410 times)

0 Members and 1 Guest are viewing this topic.

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Social Mods
« on: September 28, 2005, 10:32:36 pm »
EDIT: Since the problem was solved here are all the Social Mods I've made for Bebot.
These reply with reponses from the Original IGN Plugins... well all Except !credz. That's a "Xenixa Original"™. :p
   
* Special thanks goes out to Zacix for his Helpful insight in making these possible.

Beer.php
Cheetos.php
Credz.php
Cyber.php
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Derroylo

  • Contributor
  • *******
  • Posts: 43
  • Karma: +0/-0
Social Mods
« Reply #1 on: September 28, 2005, 11:08:10 pm »
heya

the problem is easy :)
you want to return the class variable cheese but there isn´t anything in. You didn´t fill it somewhere. What you have done is, that you have defined(filled with data) it in the function get_cheesy so you need to change the line:
Code: [Select]

Return $this -> bot -> $cheese[rand(0,sizeof($cheese)-1)];


with this one

Code: [Select]

Return $cheese[rand(0,sizeof($cheese)-1)];


hope it helped :)
Derroylo 220/23 NT RK2

Offline Zacix

  • Contributor
  • *******
  • Posts: 73
  • Karma: +0/-0
Social Mods
« Reply #2 on: September 29, 2005, 09:53:22 am »
first of all you should return
Code: [Select]
Return $this -> $cheese[rand(0,sizeof($this->cheese)-1)];This means that you actually use the classvarible you have declared.

second, you don't pass the $name variable to the get_cheesy() function. Whenever you call get_cheesy(), use
Code: [Select]
$this->get_cheesy($name)

The whole file should look like:
Code: [Select]
<?
  /*
   * Cheetos.php - A Social Module
   * For BeBot - An Anarchy Online Chat Automaton Developed by Blondengy (RK1)
   * Copyright (C) 2004 Jonas Jax
   *
   * Module Developed by Xenixa (RK1)
   *
   * As usual place this file in ./modules
   */
   
  /*
    Add a "_" at the beginning of the file (_Cheetos.php) if you do not want it to be loaded.
  */
 
  $cheetos = new Cheetos($bot);

  $commands["tell"]["cheetos"] = &$cheetos;
  $commands["pgmsg"]["cheetos"] = &$cheetos;
  $commands["gc"]["cheetos"] = &$cheetos;


  /*
    The Class itself...
  */
  class Cheetos
  {
    var $bot;
    var $cheese;
       

    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function Cheetos (&$bot)
    {
      $this -> bot = &$bot;
      $this->cheese = array(
      "casts Materialize Greater Cheetos in *name*'s mouth.",
      "stuffs some cheetos in your mouth.",
      "Your mom asked me to give you an apple instead.",
      "cleans his orange hands, then puts more cheetos in *name*'s mouth.",
      "carefully uses chopsticks to place a cheeto in *name*'s mouth.",
      "tosses a few cheetos into *name*'s mouth from 11 meters away.",
      "whips out his QL257 Pump Cheeto Master and hits *name* for *dmg* points of Orange damage.",
      "starts to put a cheeto in *name*'s mouth, but pulls away teasingly.",
      "sneaks a few cheerios into *name*'s mouth instead of cheetos.",
      "rushes forward to jamb a cheeto in *name*'s mouth but gets in their nose instead.");
      // You can add more possible responses to the array above.
   
    }


    /*
      This gets called on a tell with the command
    */
    function tell($name, $msg)
    {
      $this -> bot -> send_tell($name, $this -> get_cheesy($name));
    }


    /*
      This gets called on a msg in the privgroup with the command
    */
    function pgmsg($name, $msg)
    {
      $this -> bot -> send_pgroup($this -> get_cheesy($name));
   }


    /*
      This gets called on a msg in the guildchat with the command
    */
    function gc($name, $msg)
    {
      $this -> bot -> send_gc($this -> get_cheesy($name));
    }

   
    /*
      Build response
    */
    function get_cheesy($name)
      {
       $dmg = rand(100,999);
       $returnstr = $this -> cheese[rand(0,sizeof($this->cheese)-1)];
       $returnstr = str_replace("*name*",$name,$returnstr);
       $returnstr = str_replace("*dmg*",$dmg,$returnstr);
       return $returnstr;    
     }
  }
?>
Zacix
Current projects:
RINGBot, BeBot branch
Neutnet, RK2 Neutral massmessage network

Offline Zacix

  • Contributor
  • *******
  • Posts: 73
  • Karma: +0/-0
Social Mods
« Reply #3 on: September 29, 2005, 10:03:38 am »
Took the liberty to change the file a bit, hate me or not...think it should work at least...haven't tested though :D
Zacix
Current projects:
RINGBot, BeBot branch
Neutnet, RK2 Neutral massmessage network

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Social Mods
« Reply #4 on: October 02, 2005, 11:17:59 am »
Hmmm heheh, forgot I had posted this.
I had actually already changed the Return line to like what you posted Zacix.

I.E. from this
Code: [Select]
Return $this -> bot -> $cheese[rand(0,sizeof($this->cheese)-1)];
to this
Code: [Select]
Return $this -> $cheese[rand(0,sizeof($this->cheese)-1)];
I had put it aside afterword and forgot about it.

All I needed to do was add $name in the function call send_*($this -> get_cheesy(); like you mentioned and walla! It works.

That's an interesting solution you came up with. I tested yours and it does work btw, I'll probably just use yours. Although that string replacing has to make me wonder if it slows down the replies. I'll run a few tests and see which seems to reply faster probably for grins. :)
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Zacix

  • Contributor
  • *******
  • Posts: 73
  • Karma: +0/-0
Social Mods
« Reply #5 on: October 02, 2005, 05:14:28 pm »
The problem with your earlier version is that the strings were instanciated each time. If you changed the $cheese variable to $this->cheese would also mean that all the strings would be static and not change at all...if I'm not totally wrong. Think acutally my version is the best ^^
Zacix
Current projects:
RINGBot, BeBot branch
Neutnet, RK2 Neutral massmessage network

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Social Mods
« Reply #6 on: October 03, 2005, 08:55:05 am »
Ya I was just looking at the structure again. The way I had it set up it would rebuild the string array every time it was called. Looks like a trade off, do string replacements or rebuild array. :)

Just sticking with your structure now. Thanks for the help.

Oh and I also made a Social mod for Beer and Cyber that can be found on some IGN bots. They're just conversions of the possible replies really from IGN plugin to BeBot mod.

If anyone wants the Beer and Cyber mods for Bebot I suppose I could slap them up here. Now were was I? Oh ya, looking at retooling the guest autoinv function.
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Social Mods
« Reply #7 on: October 19, 2005, 03:25:38 pm »
See EDIT in first post ^^
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Social Mods
« Reply #8 on: November 12, 2006, 08:09:07 pm »
is it possible to get a new link to these? or have someone email me the files for beer and cyber?

thanks in advance

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Social Mods
« Reply #9 on: December 07, 2006, 07:30:22 pm »
Here's the social mods in a new unified module called "jokes". Basically it handles all the different types and allows variables and ingame adding of more entries.

Usage:

!jokeadd type text

Types supported:

!beer
!cheetos
!cyber
!creds
!chuck
!joke


Variables supported:

@@@ = characters name
### = random ql from 1-300
$$$ = random creds from 1-99, resolves as "xxx million"
*** = random damage from 1-1000000


For instance, if you typed the following ingame:

!jokeadd beer Hey there @@@, here's your ql### trox ale, i'll put the $$$ creds on your account.

It would add the text under the type "beer". If I typed !beer in orgchat or a tell and it randomly chose that entry, it would appear so:

Hey there Malosar, here's your ql176 trox ale, I'll put the 56 million creds on your account.

I've included most of the entries from the old IGN bot plugins, feel free to add many yourself and use the variables wherever possible I guess. Add any variables and types you want.

Module, helpfile and sql included in rar package.
« Last Edit: December 18, 2006, 05:26:55 pm by Malosar »
Eternalist
General of The Syndicate

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Social Mods
« Reply #10 on: December 08, 2006, 09:38:27 pm »
Updated module with a !chuck type and updated the sql with a whole bunch of chuck comments.
Eternalist
General of The Syndicate

Offline Bart

  • BeBot User
  • **
  • Posts: 39
  • Karma: +0/-0
Re: Social Mods
« Reply #11 on: December 16, 2006, 07:18:25 pm »
Xenixa's FTP seems to be down, does anyone else have these?

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Social Mods
« Reply #12 on: December 16, 2006, 08:05:03 pm »
Xenixa's FTP seems to be down, does anyone else have these?

Did you see my post?
Eternalist
General of The Syndicate

Offline Bart

  • BeBot User
  • **
  • Posts: 39
  • Karma: +0/-0
Re: Social Mods
« Reply #13 on: December 18, 2006, 04:14:31 am »
yeah found your post, now can you explain this?


ERROR 1231 (42000) at line 24: Variable 'sql_mode' can't be set to the value of
'NULL'



Offline madrid

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Social Mods
« Reply #14 on: December 18, 2006, 08:09:22 am »
Does anyone still have copies of these modules?  The links at the top of the page don't work anymore.  LMK

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 399
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal