BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => BeBot Hyborian modules => Topic started by: meatshield on July 02, 2008, 08:48:06 am

Title: Grats Mod
Post by: meatshield 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
Title: Re: Grats Mod
Post by: Blueeagle 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.

Title: Re: Grats Mod
Post by: Noer 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.
Title: Re: Grats Mod
Post by: Blueeagle 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.
Title: Re: Grats Mod
Post by: Temar on July 02, 2008, 11:21:06 pm
there is a ding module already for the AO version of BeBot
Title: Re: Grats Mod
Post by: Noer 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).
Title: Re: Grats Mod
Post by: meatshield 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.
Title: Re: Grats Mod
Post by: meatshield 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.
Title: Re: Grats Mod
Post by: Alreadythere on July 03, 2008, 11:28:05 am
AoC Subforum created :)
Title: Re: Grats Mod
Post by: meatshield 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.
Title: Re: Grats Mod
Post by: kardsen 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.
Title: Re: Grats Mod
Post by: Noer 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.
Title: Re: Grats Mod
Post by: Vrykolas 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 (http://www.oasisavengers.com/autogratz.zip).
Title: Re: Grats Mod
Post by: kardsen 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
Title: Re: Grats Mod
Post by: Organizer 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...
Title: Re: Grats Mod
Post by: Vrykolas on July 24, 2008, 11:49:15 am
Hi Organizer
* Random message option: it already does this - first checking for a random message for the correct level and selecting a general one randomly otherwise (handled via the SQL)


* Keep the level option (as I presume is in there still) for custom messages on certain levels.
Still in there :D

* 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
I'll look into these and see what I can do


Would it not be better if this simply was with the core bot files and not required separate updated?
It's a separate update as it uses a change to Main.php to get the level updates in realtime and neither Noer or myself want to make that a part of the main bot codebase atm.
Title: Re: Grats Mod
Post by: Organizer on July 24, 2008, 02:24:01 pm
Quote
I'll look into these and see what I can do

Thanks for quick response as always :) fair enough on the code base thing, I'm sure you guys have your good reasons for that... and great if you could look into the few extra points as they would make the mod more user friendly for us all..!
Title: Re: Grats Mod
Post by: Vrykolas on August 05, 2008, 12:07:14 am
I've finished adding in the requested commands now - have fun with them! :D
Title: Re: Grats Mod
Post by: Organizer on August 05, 2008, 03:19:10 pm
Oioioi! :D also settings for tell/gc as well, you're the man Vrykolas!
Title: Re: Grats Mod
Post by: pinstripesc on August 17, 2010, 11:07:23 pm
Is this still available? The link doesn't seem to work.
Title: Re: Grats Mod
Post by: Yite on August 18, 2010, 09:06:27 am
Not sure if this is the same module but check out http://bebot.link/aoc-0-6-x-customunofficial-modules/autogratz-modul-for-verison-0-6-5/
SimplePortal 2.3.7 © 2008-2024, SimplePortal