L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 01:19:28 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Working on a new raidbot module
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Working on a new raidbot module  (Read 568 times)
0 Members and 1 Guest are viewing this topic.
ZubZero
Freshman
*
Offline Offline

Posts: 10


Working on a new raidbot module
« on: January 25, 2006, 05:27:13 PM »

I have completed all the !startraid <name>, !addpts <name>, !raidlock etc etc.
I am also working an !account command, so atm I am implementing logging onto the !addpts and !raid kick commands.
I have one little problem with the raid !kick commands if I dont write the reason in 8 words I get alot space like "(Reason: noob      )"

My raidscript is based of the original raidscript and the mercbot someone posted.

I can poste my code and see if someone else has a better way to do it.
How I call the function:
Code:

else if (preg_match("/^" . $this -> bot -> commpre . "raid kick (.+)$/i", $msg, $info))
$this -> kick_raid($name, $info[1]);
The function itself.
Code:
function kick_raid($name, $data)
{
$data = ucfirst(strtolower($data));
if ($this -> bot -> admin -> in_group($name, "leader") || $this -> bot -> admin -> in_group($name, "admin"))
{
$var = explode(" ", $data);
$raiding = $this -> bot -> db -> query("SELECT * FROM " . $this -> bot -> get_tablename("raid_list") . " WHERE name = '" . $var[0] . "'");
  if (!empty($raiding))
  $this -> bot -> send_tell($name, "<font color=#ffff00>$var[0]</font> is not in the raid.");
  else
  {
   
  unset($this -> user[$who]);
  $this -> bot -> send_pgroup("<font color=#ffff00>" . $var[0] . "</font> was kicked from the raid. Reason = $var[1] $var[2] $var[3] $var[4] $var[5] $var[6] $var[7] $var[8] $var[9]");
  $this -> bot -> send_tell($var[0], "<font color=#ffff00>$name</font> kicked you from the raid. Reason = $var[1] $var[2] $var[3] $var[4] $var[5] $var[6] $var[7] $var[8] $var[9]");
  $this -> bot -> db -> query("DELETE FROM " . $this -> bot -> get_tablename("raid_list") . " WHERE name = '" . $var[0] . "'");
$this -> bot -> db -> query("UPDATE raid_points SET raiding = 0 WHERE id =" . $this -> points_to($var[0]));
    //$this -> bot -> db -> query("INSERT INTO " . $this -> bot -> get_tablename("raid_account") . " (name, history) VALUES ('" . $var[0] . "','Kicked from raid. (Reason: " . $var[1] $var[2] $var[3] $var[4] $var[5] $var[6] $var[7] $var[8] $var[9] . ") by " . $name . "')");
    $this -> bot -> db -> query("INSERT INTO " . $this -> bot -> get_tablename("raid_account") . " (name, history) VALUES ('" . $var[0] . "','Kicked from raid. (Reason: " . $var[1] . " " . $var[2] . " " . $var[3] . " " . $var[4] . " " . $var[5] . " " . $var[6] . " " . $var[7] . " " . $var[8] . " " . $var[9] . ") by lamer')");
  }
}
else
$this -> bot -> send_tell($name, "You must be a raid leader to do this");
}
Logged
Wanuarmi
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 121


Re: Working on a new raidbot module
« Reply #1 on: January 25, 2006, 06:48:12 PM »

Quote from: ZubZero on January 25, 2006, 05:27:13 PM
Code:

else if (preg_match("/^" . $this -> bot -> commpre . "raid kick (.+)$/i", $msg, $info))
$this -> kick_raid($name, $info[1]);

else if (preg_match("/^" . $this -> bot -> commpre . "raid kick ([a-zA-Z0-9][a-zA-Z0-9]*) (.+)$/i", $msg, $info))
         return $this -> kick_raid($name, $info[1], $info[2]);

then you get two variables in the kick_raid() function, the name and the reason

this looks alot like the raid module im doing, why are you making another one, if I may ask Tongue
Logged
ZubZero
Freshman
*
Offline Offline

Posts: 10


Re: Working on a new raidbot module
« Reply #2 on: January 26, 2006, 08:24:03 AM »

Well I said it was based of your mercbot Tongue
I just want some similar stuff, I removed the add points out of your raiddone, I added a !addpts command that also logs to the raid_account file. so I can do !addpts APF or whatever. I also want alot of logging towards the raid_account like this raid kick.
I also want to redo the bid system since I need it to show how many points someone has bid. And I also want 2 different way of bidding, I want !bid 100 that makes you bid 100, and I want !bid +1 that makes you bid 1 over what has been bidden before. And I also want this to log to 2 different tables, the raid_account and a raid_auction.

As you might have guessed the raid_account will be used to display a log for someone using the !account command.

I also need to add !command and !announce.
Plus a bunch of aliases Tongue
Logged
Wanuarmi
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 121


Re: Working on a new raidbot module
« Reply #3 on: January 26, 2006, 07:06:16 PM »

alreadythere just released another raid module based off mercbot
http://bebot.shadow-realm.org/index.php/topic,313.0.html

mine isnt based on mercbot, its based on IGN bot, im planning on adding logging of raid kicks/auctions on account and an auction module to go with it, its just not finished yet

of course you can make all raid modules you want, I just wanted to know what was different from mine and why not use mine, to get some feedback
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Working on a new raidbot module
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 9
Total: 10
egrath

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.512 seconds with 28 queries. (Pretty URLs adds 0.039s, 4q)
Loading...