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: Event System (beta)  (Read 10231 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Event System (beta)
« 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
« Last Edit: February 20, 2006, 11:41:42 pm by Wanuarmi »

Offline ZubZero

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Event System (experimental)
« Reply #1 on: January 22, 2006, 02:47:24 pm »
can you write a quick helpfile for it please?

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Event System (experimental)
« Reply #2 on: January 22, 2006, 03:49:34 pm »
switch foreach ($junks as $junk) with foreach ($junks as $cmd) right below the $junks definition. You won't get any command otherwise :)

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: Event System (experimental)
« Reply #3 on: January 22, 2006, 08:44:34 pm »
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

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: Event System (beta)
« Reply #4 on: February 20, 2006, 11:41:59 pm »
bump updated

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Event System (beta)
« Reply #5 on: June 23, 2006, 07:02:10 pm »
Still working on this one Wanu?

-jj-

Offline Sammajos

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Event System (beta)
« Reply #6 on: September 20, 2006, 09:00:16 am »
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:

Quote
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:

Quote
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

Quote
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.
« Last Edit: September 20, 2006, 01:56:03 pm by Sammajos »

Offline Landcast

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Event System (beta)
« Reply #7 on: November 02, 2006, 01:40:45 am »
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

Quote
<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>

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Event System (beta)
« Reply #8 on: May 04, 2007, 08:31:22 am »
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
Standard Raffle (modified) PHP*
Multi-Raffle (modified) PHP*+
Auction (modified) PHP
Requires Glara's module settings plugin
* only use one raffle plugin!
+ multi raffle instructions explained here

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-
« Last Edit: May 17, 2007, 11:57:58 pm by jjones666 »

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Event System (beta)
« Reply #9 on: May 04, 2007, 01:51:49 pm »
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:

Code: [Select]
!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.

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

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Event System (beta)
« Reply #10 on: May 04, 2007, 01:54:33 pm »
Yeah the commands suck for sure.  They're omni style :-)

I'll perhaps change them.

-jj-

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Event System (beta)
« Reply #11 on: May 06, 2007, 01:44:25 am »
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-
« Last Edit: May 06, 2007, 01:47:32 am by jjones666 »

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Event System (beta)
« Reply #12 on: May 06, 2007, 11:16:19 pm »
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-

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Event System (beta)
« Reply #13 on: May 07, 2007, 06:44:35 am »
Jack secretly working on plans to overthrow me? :o :o
That's some nice work you're putting into this

Offline tonyuh

  • BeBot User
  • **
  • Posts: 48
  • Karma: +0/-0
Re: Event System (beta)
« Reply #14 on: May 16, 2007, 07:38:03 pm »
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
Code: [Select]
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.
« Last Edit: May 16, 2007, 07:45:44 pm by tonyuh »

 

* 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: 664
  • 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