BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Wanuarmi on January 22, 2006, 07:51:38 am
-
This is a raid system similar to IGN's. I still gotta do the auction system and add missions. Current commands are:
startraid/endraid - starts and ends a raid
endraid (win|failure) - ends a raid with a win/lose flag
joinraid/leaveraid - joins/leaves a raid
closeraid/openraid - same as pause/lock, players cant join a raid while closed
raidpts <points> <reason> - gives xx points to all active raiders
addpts <name> <points> <reason> - gives xx points to a player
rempts <name> <points> <reason> - removes xx points from a player
addraider <name> - adds a player to raid
kickraider <name> (<reason>) - kicks a player from raid
raiders/check - shows the list of active raiders
account - shows your account info
account <name> - shows someone's account info
event - shows info on the current event
events - shows a list of events
event <number> - shows event info
-
can you write a quick helpfile for it please?
-
switch foreach ($junks as $junk) with foreach ($junks as $cmd) right below the $junks definition. You won't get any command otherwise :)
-
thanks, put in a cron function too to not crash
zubzero, ill make a helpfile when the module is finished, the commands arent complicated though
startraid <name>
closeraid / openraid
endraid
joinraid
leaveraid
raidpts <points> <reason>
addpoints <player> <points> <reason>
raiders
addraider <player>
kickraider <player>
account
-
bump updated
-
Still working on this one Wanu?
-jj-
-
Hello,
one thing before, Sorry for my bad English.
I try to use this nice Plugin r i have 1 Problem. When 1 Raider is alone in the Raid, i can do raidpts 5 leftzod and the Raider become the Points.
When more than 1 Raider in the Raid and i make raidpts 5 leftzod i become a MySql Error.
Here is the Code:
function event_points($name, $points, $reason)
{
if (empty($this -> event))
{
$this -> bot -> send_tell($name, "No event in progress.");
return;
}
if ($this -> bot -> admin -> in_group($name, "raidleader") || $this -> bot -> admin -> in_group($name, "admin"))
{
$raiders = $this -> raiders;
$eventid = $this -> event['id'];
$query = '';
foreach($raiders AS $raider)
{
$query .= "INSERT INTO event_account (uid, name, points, reason, givedby, time, eventid, type) VALUES ($raider[id], '$raider[name]', $points, '$reason', '$name', ".gmmktime().", $eventid, 1); " ;
}
$this -> bot -> db -> query($query);
$this -> bot -> db -> query("UPDATE event SET totalpoints = totalpoints + $points WHERE id = ".$this -> event['id']);
$this -> output("<font color=#ffff00>$points</font> point(s) have been added to all raiders.");
}
else
$this -> bot -> send_tell($name, "You must be an event leader to do this");
}
can someone help me pls?
Edit: ok, got fixed from Zimble.
Replace:
foreach($raiders AS $raider)
{
$query .= "INSERT INTO event_account (uid, name, points, reason, givedby, time, eventid, type) VALUES ($raider[id], '$raider[name]', $points, '$reason', '$name', ".gmmktime().", $eventid, 1); " ;
}
$this -> bot -> db -> query($query);
with
foreach($raiders AS $raider)
{
$query = "INSERT INTO event_account (uid, name, points, reason, `givedby`, time, eventid, type) VALUES ($raider[id], '$raider[name]', $points, '$reason', '$name', ".gmmktime().", $eventid, 1); " ;
$this -> bot -> db -> query($query);
}
I also fixed some wrong SQL Queries and updatet the Bid Funktion in the Bid.php. Now this Plugin run very fine.
-
Made a helpfile for this. ( i just edited the raid.txt for this )
Dont know if this will help anyone. Just thought i put it up here since i did something
/LC
<font color=CCInfoHeader><pre>RAID COMMANDS</font>
<font color=CCInfoText>Here you will find the basic commands to lead a raid.
<font color=CCInfoHeader><pre>startraid|endraid - name of raid </font>
<font color=CCInfoText>Starts/Stops the raid.
Once the raid is started people can join the raid and gain points.</font>
<font color=CCInfoHeader><pre>endraid (win|failure)</font>
<font color=CCInfoText>ends a raid with a win/lose flag.</font>
<font color=CCInfoHeader><pre>joinraid/leaveraid</font>
<font color=CCInfoText>joins/leaves a raid.</font>
<font color=CCInfoHeader><pre>closeraid|openraid</font>
<font color=CCInfoText>same as pause or lock, players cant join a raid while closed.</font>
<font color=CCInfoHeader><pre>raidpts</font>
<font color=CCInfoText>points reason - gives xx points to all active raiders.</font>
<font color=CCInfoHeader><pre>addpts</font>
<font color=CCInfoText>name points reason - gives xx points to a player.</font>
<font color=CCInfoHeader><pre>rempts</font>
<font color=CCInfoText>name points reason - removes xx points from a player.</font>
<font color=CCInfoHeader><pre>addraider</font>
<font color=CCInfoText>name - adds a player to raid.</font>
<font color=CCInfoHeader><pre>kickraider</font>
<font color=CCInfoText>name (reason) - kicks a player from raid.</font>
<font color=CCInfoHeader><pre>raiders/check</font>
<font color=CCInfoText>shows the list of active raiders.</font>
<font color=CCInfoHeader><pre>account</font>
<font color=CCInfoText>shows the list of active raiders.</font>
<font color=CCInfoHeader><pre>account name</font>
<font color=CCInfoText>shows someone's account info.</font>
<font color=CCInfoHeader><pre>event</font>
<font color=CCInfoText>shows info on the current event.</font>
<font color=CCInfoHeader><pre>events</font>
<font color=CCInfoText>shows a list of events.</font>
<font color=CCInfoHeader><pre>event number</font>
<font color=CCInfoText>shows event info.</font>
-
I was asked to fix this up, however I've only focused on getting the "non point" features working. The points will be fixed at a later date, however would like feedback if anybody uses a raffle type raid system. Will probably add a switch between timed and single point raids in time also.
Eventsystem Changelog:
- fixed numerous typos and bad variable names
- tracks people in raidbot and allows joining of raid only if in bot
- made usage of points functions optional via !settings
- fixed conversion of old raid points table
- revised logging method and added new things to logging
- compatible with php5 where possible
- functions accessable by other modules (for logging of raffles etc)
- added logging (and fixed sql errors) for raid locking and unlocking
- bot will ask for raid description instead of sending help if none given
- reworked points logging
- updated the conversion function for old raid points table
- fixed attendance calculation
- fixed event start crashing bot with ' in name
- added switchable output to settings
* points are now tested and confirmed working ok
Raffle Changelog:
- if raid running, will log winner to database
- if raid running, will only allow people in raid to join raffle
Multi-raffle Changelog:
- modified glara's multiraffle plugin to add logging with the raid system and also added output to GC if needed (switchable in !settings as usual).
Auction/bid Changelog:
- converted the standard bebot !bid system to add logging with the raid system, uses new points table and also added output to GC if needed (switchable in !settings as usual).
Eventsystem PHP (http://www.jjones.co.uk/files/raid/eventsystem.php)
Standard Raffle (modified) PHP (http://www.jjones.co.uk/files/raid/raffle.php)*
Multi-Raffle (modified) PHP (http://www.jjones.co.uk/files/raid/mraffle.php)*+
Auction (modified) PHP (http://www.jjones.co.uk/files/raid/bid.php)
Requires Glara's module settings plugin
* only use one raffle plugin!
+ multi raffle instructions explained here (http://bebot.link/index.php/topic,485.0.html)
general:
!startraid <name>
!endraid (optional : win / failure)
!joinraid
!leaveraid
!closeraid - a.k.a. lock
!openraid - a.k.a. unlock
!addraider
!kickraider (optional: reason)
!checkraid
logging:
!event <eventnumber> - shows raid summary
!events - shows list of all raids
!raiders <eventnumber> - shows raid logs
points management:
!raidpts <points> - awards points to whole raid
!addpts <name> <points> <reason>
!rempts <name> <points> <reason>
!account (optional: name to check)
-jj-
-
I for one think the commands should be different. I might be at odds with everyone else as I haven't really done much raiding but I think that the commands should have been:
!raid start [description] - starts a raid with an optional [description]
!raid end <(win|failure)> - ends a raid with a win/lose flag
!raid join - joins a raid
!raid leave - leave a raid
!raid (pause|lock|close) - pause/lock/close the raid
!raid (unpause|unlock|open) - unpause/unlock/open the raid
!raid points <points> [reason] - Gives <points> points to all players that has participated in the raid
!raid addpts <name> <points> <reason> - gives <points> points to player <name> with a given <reason>
!raid rempts <name> <points> <reason> - removes <points> points from player <name> for the given <reason>
!raid add <name> - adds player <name> to the raid
!raid kick <name> [reason] - kicks player <name> from raid with an optional [reason] for the kick
!raid (list|check) - shows the list of active raiders
!raid account [name] - shows the raid account for player [name]. If no [name] is given it shows the players raid account
!raid event [id] - shows info on the event with a given [id]. If no [id] is given it shows the last event
!raid events - shows a list of events
This because ie. !account might be a command that several modules would want to register, and to avoid conflicts I think it's a good idea to have one command that takes several keywords instead of multiple commands for a module. Not only because it's easier to see which module handles the command but it also keeps the $bot -> commands array to a minimum and that's always good for the speed of the bot.
-
Yeah the commands suck for sure. They're omni style :-)
I'll perhaps change them.
-jj-
-
eventsystem:
- added logging (and fixed sql errors) for raid locking and unlocking
- bot will ask for raid description instead of sending help if none given
raffle (standard):
- fixed a typo
raffle (multi):
- modified glara's multiraffle plugin to add logging with the raid system and also added output to GC if needed (switchable in !settings as usual).
updated links above.
-jj-
-
eventsystem:
- reworked points logging
- updated the conversion function for old raid points table
- fixed attendance calculation
* points are now tested and confirmed working ok
auction:
- converted the standard bebot !bid system to add logging with the raid system and also added output to GC if needed (switchable in !settings as usual).
updated links above.
-jj-
-
Jack secretly working on plans to overthrow me? :o :o
That's some nice work you're putting into this
-
good work! seems like this is aimed for a raidbot and not a guildbot though... the commands are returned by "return" command without checking which channel the command was initiated from. a simple
if ($channel == 'pgmsg')
this -> bot -> send_pgroup(blah);
else
this -> bot -> send_gc(blah);
should work. but of course since you are awesome you will probably create a setting in the setting module to toggle between the channels or something :P
Cheers,
Tony
P.S. since i'm on this subject, command !startraid with a ' in the reason will break the module and restart the bot.
-
Hi,
The output function already will differentiate between GC and PG already where necessary (in theory). Does it not work correctly?
Fixed the event name crashing bot and updated code.
Cheers for the feedback :-)
-jj-
-
Hi,
I just looked at the code again, in theory it should work not sure why it doesn't though, may be 0.2.x doesn't "return" the value to the right channel (since all the RETURN statement were all done in process_command function). I just always get the reply in gc... very weird.
Cheers,
Tony
-
Well if you're running a guild bot, it will currently always return to GC, should I make that optional even for guildbots?
-jj-
-
Probably not, since you don't want raid stuff spamming the gc. Although I thought making them a standard might be good so you can switch it to either gc or pgroup doesn't matter what type of bot it is. Not sure why, but returning queries into a fixed channel regardless of where it was initiated is bad, imo.
Of course if its too much work to change it to optional then if it is a guildbot, I'd rather have it reply to pgroup only, I'm sure others will think the same (I hope!).
Cheers,
Tony
-
Ok, added the output options to !settings, defaults to GC off, PG on. Should work, I didn't have time to test it :-)
PHP updated.
-jj-
-
I guess I wanted to add the timed raids as switchable option also. I was thinking (after seeing the idea somewhere else), it would be nice to have a raid points template, ie, the ability to start a raid for a certain scenario which gives either more or less points per minutes (ie, city raid 0.5 points per 10 minutes, flat 1 point bonus - apf raid 1 point per 10 minutes, flat 2 points bonus etc etc).
Certainly it might be a nice idea, not sure how I'd implement it though :-)
Any thoughts?
Cheers,
-jj-
-
Nice one JJ, I'll test it out when I logon. About the raid template, the only way I can think of is to have another function to add template (ie. !ptstemp "name" "arg1" "arg2") into a table and then have the !startraid function match the name in the template table. Of course there will be a "generic" template which will be used if the name doesn't match any template name. Also !startraid should return which template used to ensure points are allocate using the right template.
Cheers,
Tony
-
Ok, I'll try to find the motivation to put first draft together during the weekend :-)
-jj-
-
Jack is there any way to add other toons to same account?
when i do !account there only one toon in it, and !alts already added on bot.
-
I knew someone would ask for this... and actually, I was too lazy to change the original code which made an account for each toon.
Added to to-do list then, it shouldn't actually take too long to implement points -> main I don't think. I'll keep logging to show raiding character, but points (and account display) stored on one main account.
-jj-
-
oh and wish if it would be possible to chose ticking points too, and top25/all points in bot, with !account + alts on it too, mod would be perfects then (raid commands bit suck but that can be changed :)
edit: great, waiting for updated version then ;D
-
Yeah I know the commands suck, the problem was that it was my friend Drpajeron who asked me to fix up the module for CoN bot and he's Omni so is used to such bizarre structure. However, the original module was coded in such a way that it may be possible to use both sets of commands - !raid style also via !settings.
Thank you for feedback though, it gives me some incentive to plod on with the coding (and hopefully gives Vhab incentive to release Vhabot Guild Edition to usurp me once I've finished!!).
-jj-
-
Eventsystem:
-test version - please let me know how it works and give me feedback- :-)
- added 'points to main' and associated features
- added cleanup function for alt points
- added timed points option (fixed at 0.1/minute for the time being)
- some cosmetic fixes to outputs
To do:
- change commands to standard style
- add raid point templates
Notes:
- points changed to 0.1 point per minute (1/10) as per standard bebot.
- please drop table event_account and all rows marked "raid" in module_settings table (sqlyog ftw).
- use !pointscleanup (temporary/superadmin only) to merge alts with mains in points table.
- edit: points will tick all the time whilst raid is closed for entry (!closeraid)
Settings:-
!settings will give the option for static or timed points. logs will show raiding character, points table (!account) will show main character.
Download:-
PHP (rename to eventsystem.php) (http://www.jjones.co.uk/files/raid/eventsystem2.php)
Thanks for feedback!
-jj-
-
JJ, want SVN access yet? ;)
-
ok, installed on my bot, it looks well:
Account all good, !account on alts works too, points properly converted from old system too.
Starting, joining, closing and ending raid works fine too, except you forgot to add !raid unpause and !raid pause ;D so there is no way to unpause ticking points raid to check if that part works well ( !raid pause should be auto on start when you do !raid start if possible)
So far works well, waiting for those fixed and can be put to use.
btw took me 10 mins of trying to figure out what command is to close and open raid, had to look into code ^^ changing commands to standard would be highly welcome :)
and 1 more thing, donno if it is 2 much work, but would be really good if !account XXX would show all alts there too, if you know what i mean
!account Ornaola
74.9 points in your account :: click to view
when you click new window pops, shows only
::: Ornaola's Account :::.
Total Points: 84.9
Points Spent: 10
Points on Account: 74.9
- so if you could put all other toons that are on same account would be nice ;)
-
heh, little update, found first bug :)
after starting and biding on a "item", points are removed incorrectly from winners account, ie:
Striptizeta has won the auction for xx. 11 points are being deducted from his account.
but when you do !account :
::: Striptizeta's Account :::.
Total Points: 50
Points Spent: 1.1
Points on Account: 48.9
1.1 points removed from account for won auction by system at: 23:31:07 20/05/07 GMT
-
Some warnings when I restart the bot the second time
Warning: socket_read() expects parameter 1 to be resource, null given in E:\BeBo
t_v0.2.10\AOChat.php on line 222
Read error: EOF
Warning: socket_write() expects parameter 1 to be resource, null given in E:\BeB
ot_v0.2.10\AOChat.php on line 310
I assume its something to do with the fact that I didn't drop the table again, or is it not?
Tony
-
Warning: socket_read() expects parameter 1 to be resource, null given in E:\BeBo
t_v0.2.10\AOChat.php on line 222
had that too but only after 2nd restart, after all good.
-
Hi Orna,
Thanks for feedback!
Can you do me a favour and check in the event_account table and see if there are any "Unknown" names in there - I think the error is due to not finding the name of people with old points in the members table but would be good to double check :-)
On your other points:
- points ticking (aka raid !unpause) will start when you do !closeraid for the time being. I'll add an explicit unpause function when I change the commands. As it works at the minute, !startraid test (raid started paused), (all people join), !closeraid (raid unpaused), then add late joiners with !addraider. Nerf being logged on yesterday whilst trying to code, I obviously forgot to mention how that works :-)
- alt's display in account, easy to do, I'll add it after work today.
Cheers,
-jj-
-
heh, little update, found first bug :)
after starting and biding on a "item", points are removed incorrectly from winners account, ie:
Striptizeta has won the auction for xx. 11 points are being deducted from his account.
but when you do !account :
::: Striptizeta's Account :::.
Total Points: 50
Points Spent: 1.1
Points on Account: 48.9
1.1 points removed from account for won auction by system at: 23:31:07 20/05/07 GMT
Oops, of course, I needed to update bid to remove *10 points :-)
Fixed - rename to bid.php (http://www.jjones.co.uk/files/raid/bid2.php)
Should be fine now.
-jj-
-
Some warnings when I restart the bot the second time
Warning: socket_read() expects parameter 1 to be resource, null given in E:\BeBo
t_v0.2.10\AOChat.php on line 222
Read error: EOF
Warning: socket_write() expects parameter 1 to be resource, null given in E:\BeB
ot_v0.2.10\AOChat.php on line 310
I assume its something to do with the fact that I didn't drop the table again, or is it not?
Tony
Again, if you let me know of any "unknown" names in the event_account table, would be great. If you didn't drop the event_account table, it will probably have duplicated some entries but as I mentioned, the error is due to not finding names of people with old points in the members table (I think).
-jj-
-
Hi Orna,
Thanks for feedback!
Can you do me a favour and check in the event_account table and see if there are any "Unknown" names in there - I think the error is due to not finding the name of people with old points in the members table but would be good to double check :-)
Cheers,
-jj-
- yes there are few Unknown in event_account.
- Biding and rem points after bid works well now
- also points are ticking too after !closeraid
- everything else looks like working fine, gj again :)
-
Ok, thanks a lot. I'll try and work round the error spam for people it doesn't know (no need to import junk from the old points table).
I'll try and do some tidying up tonite, add alts and correct the commands also if time.
Any other idea, feel free to throw them over while I'm feeling productive.
Cheers,
-jj-
-
I would like to see !points all or !account all / !account top25
!account top25 viewable by all members, !account all only admins and up.
and thats all i think, mod already has pretty much everything that is needed, if i remember something il post :)
-
Jack, any updates? cant wait for final version hehe ;)