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

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

Author Topic: Grats Mod  (Read 33324 times)

0 Members and 1 Guest are viewing this topic.

Offline meatshield

  • BeBot User
  • **
  • Posts: 24
  • Karma: +0/-0
Grats Mod
« on: July 02, 2008, 08:48:06 am »
Description:
I think a Grats mod would be a welcome edition.  In case theres confusing, a grats bot would grats members when they ding.  Would be nice if it had a few random statements to choose from (id like to be able to add more personally).  Ragebot has something like this, and its a clean chatbot... Im just not sure it has the functionality that this one will have.


Commands:
No Called Commands

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Grats Mod
« Reply #1 on: July 02, 2008, 09:53:27 pm »
There has to be a command as the bot doesn't know when a player levels other than when it does a roster update and the xml that FC provides is already old.

It would be possible to monitor the chat channel(s) and detect "ding!" and then reply a grats.

It would also be possible to use that to update the whois on the player before the XML is updated. That would involve some alteration to the roster update as it should not level down a character when it detects that the XML has a lower level. Instead it should possibly flag the level as unconfirmed.

The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: Grats Mod
« Reply #2 on: July 02, 2008, 09:54:55 pm »
This one should probably be moved to the Bebot AoC support. Judging on the Ragebot-reference I think he refers to AoC.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Grats Mod
« Reply #3 on: July 02, 2008, 10:30:17 pm »
This one should probably be moved to the Bebot AoC support. Judging on the Ragebot-reference I think he refers to AoC.
Well it would work in the same fashion on both AoC and AO as far as I can tell so I see no point in moving it.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Grats Mod
« Reply #4 on: July 02, 2008, 11:21:06 pm »
there is a ding module already for the AO version of BeBot

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: Grats Mod
« Reply #5 on: July 02, 2008, 11:26:41 pm »
This one should probably be moved to the Bebot AoC support. Judging on the Ragebot-reference I think he refers to AoC.
Well it would work in the same fashion on both AoC and AO as far as I can tell so I see no point in moving it.


It works a bit different in AoC. Theres no XML available for players, but you are able to see the level and class of players through the chatserver. And the gameclient has a "ding"-announcement channel (though you can't access that from the chat server).

Offline meatshield

  • BeBot User
  • **
  • Posts: 24
  • Karma: +0/-0
Re: Grats Mod
« Reply #6 on: July 03, 2008, 12:05:28 am »
Ya AoC reference :)

I figured AoC Support was for issues.  This was labeled Module Req.

Hopefully that's where this request goes.

You guys are awsome though. Everything I've posted has been replied to several times.

Offline meatshield

  • BeBot User
  • **
  • Posts: 24
  • Karma: +0/-0
Re: Grats Mod
« Reply #7 on: July 03, 2008, 12:21:19 am »
I was thinking -- Can you guys create a AoC Module Req forum Topic?  So that we don't get mixed in with AO and it isn't confusing.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Grats Mod
« Reply #8 on: July 03, 2008, 11:28:05 am »
AoC Subforum created :)

Offline meatshield

  • BeBot User
  • **
  • Posts: 24
  • Karma: +0/-0
Re: Grats Mod
« Reply #9 on: July 04, 2008, 04:44:35 am »
Now that we're moved :)  Any ideas on the grats mod? We had some good stuff going for a bit and then it dropped off.

Offline kardsen

  • BeBot Apprentice
  • ***
  • Posts: 81
  • Karma: +0/-0
Re: Grats Mod
« Reply #10 on: July 07, 2008, 05:16:53 pm »
From another PHP based Bot  (ragebot)

Code: [Select]
<?php
global $guildmates,$guildmains,$guildlookup,$PluginConfig;

/* Already loaded guildmates? If not we currently may logon and receive the status of every buddy */
if ($guildmates[0]&&$guildmates[$args["name"]]) {
/*Do we have a state-change caused by a refresh?*/
if ($guildlookup[$args["name"]]) {
/*do we have a levelup?*/
if ($args["level"]!=$guildlookup[$args["name"]]["level"]) {
say("Guildupdate :: Levelup for guildmate ".$args["name"]." from ".$args["level"]." to ".$guildlookup[$args["name"]]["level"],1);
if ($PluginConfig["guildupdate"]["gratz"]) {
include($currentplugin."/gratz.php");
send_guild_channel_message(colortext(":: ".$msg." ::"));
}
global $db$dbconfig;
$stmt $db->prepare('UPDATE '.$dbconfig['dbprefix'].'toons SET toon_level = :toon_level WHERE toon_name = :toon_name;');
$stmt->bindParam(':toon_name'$args["name"]);
$stmt->bindParam(':toon_level'$args["level"]);
$stmt->execute();
}
/*do we have a playfieldchange?*/
if ($args["playfield"]!=$guildlookup[$args["name"]]["playfield"]) {
say("Guildupdate :: Playfieldchange for guildmate ".$args["name"]." from ".$args["playfield"]." to ".$guildlookup[$args["name"]]["playfield"],1);
}
/*unset lookup*/
unset($guildlookup[$args["name"]]);
if (!$msgsay("Guildupdate :: Statuschange ignored",1);
} else {
say("Guildupdate :: lookup flag not set",1);
}
} else {
say("Guildupdate :: Buddystatus of a none-guildmate suppressed",1);
}
?>


and the grats portion of it

Code: [Select]
<?php
/**** Idea: Creator
***** Strings: Creator
*****/
if ($level==80){
switch (rand(1,2)) {
case 1
$msg="Big gratz ".$args["name"]."! You reached the end of the line, you can finally log off and quit aoc.";
break;
case 2
$msg="Big gratz ".$args["name"]."! Game Over!";
break;
}
} else {     

switch (rand(1,4)) {
case 1:
$msg="Hey ".$args["name"]."! Why don't you come over and apprentice me for a change?";
break;
case 2:
$msg="Come on save some dings for the rest ".$args["name"]."!";
break;
case 3:
$msg="Enough with the dingin ".$args["name"].".. you are making me feel low enough!";
break;
case 4:
$msg="Gratz to level ".$args["level"]." ".$args["name"]."!";
break;
}
}
?>


60% of the time,  it works every time.

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: Grats Mod
« Reply #11 on: July 07, 2008, 05:27:32 pm »
Yup its not too hard to make. Just add it as a cron-function and let the bot lookup the members of the bot every 1-5mins.

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: Grats Mod
« Reply #12 on: July 07, 2008, 07:30:02 pm »
I'd already finished writing this by the time I read this thread.

It's a mod rather than a plugin as I modified the latest versions of Main.php and Bot.php to include 2 new events (buddy_levelup & buddy_location_change), hence I'd recommend this as for advanced users only.

The files are available here.

Offline kardsen

  • BeBot Apprentice
  • ***
  • Posts: 81
  • Karma: +0/-0
Re: Grats Mod
« Reply #13 on: July 11, 2008, 02:19:37 am »
Guildcrier [MOD-CUSTOM] [DIR]   Loading additional modules in directory custom/modules/
Guildcrier [ERROR]      [autogratz]     Event 'buddy_levelup' is invalid. Not registering.
Guildcrier [MOD-CUSTOM] [LOAD]  autogratz.php

Offline Organizer

  • BeBot Apprentice
  • ***
  • Posts: 135
  • Karma: +0/-0
Re: Grats Mod
« Reply #14 on: July 24, 2008, 09:27:42 am »
Vrykolas I presume you edited the autogratz ported module further than then one you provided on request for me a day or two ago...

After using it a bit I see potential for a a few things that would be nice to include and would be all ever needed i would presume:

* Random message option (presume maybe this was added as part of this request? - I'll try this version to check what you done, but I would suggest that it choses randomly amongst all saved messages without a level set, and in case of level match it would chose randomly amongst those as well, so that you technically could have several randoms triggered at lvl 80).
* Keep the level option (as I presume is in there still) for custom messages on certain levels.
* Option to see all the gratz stored (important)
* Option to delete gratz stored (e.g. like in the news module would be totally optimal - very important)
* Option in !settings to either see gratz in guild channel or as /tells

Would it not be better if this simply was with the core bot files and not required separate updated? I'm sure there is a reason I'm not smart enough to understand, but if it could be I rather have it with. Even if it would be default as disables and could be enabled with any options thought the use of !settings

With the above added I think this module would be as flexible and final as it ever would need to be...

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 287
  • 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