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: pick random player in raid  (Read 13151 times)

0 Members and 1 Guest are viewing this topic.

Offline goremachine

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
pick random player in raid
« on: February 04, 2010, 09:31:15 pm »
With the relics we got a problem. We use Masterloot to distribute epics. But the relics basically everyone can use.. and !nroll all names is no option.
Rolling for a random number would work and count in the raidlist, but the raidlist looks different to everyone.
Maybe someone can code it.

Description:
A Module that parses the Members currently in the Raid and returns the Name of one.

Command:
!rpick

Return:
Playername
Lorica - Hyrkania RP-PvE (former Blackscar)
Officier of Harlots of Tortage

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: pick random player in raid
« Reply #1 on: February 04, 2010, 10:34:14 pm »
Is this for a guild only raid or randoms users too?
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: pick random player in raid
« Reply #2 on: February 04, 2010, 11:00:30 pm »
Modified the nroll just abit so you can use "!nroll raid" to pick random person that are member of bot inside same instances as the person that runs it.

http://dump.sjef.biz/aoc/bebot/Modules/nroll.phps

Code: [Select]
$me_sql = "SELECT location FROM whois WHERE nickname='".$name."'";
$me_result = $this -> bot -> db -> select($me_sql);
if (!empty($me_result)) {
$instanceID = $me_result[0][0];
$sql = "SELECT u.nickname ";
$sql .= "FROM #___whois AS w ";
$sql .= "LEFT JOIN #___users AS u ON w.nickname=u.nickname ";
$sql .= "WHERE location='$instanceID' AND notify='1' AND user_level='2' ";
$sql .= "ORDER BY RAND() LIMIT 1";
$roll_relic = $this -> bot -> db -> select($sql);
$result = $roll_relic[0][0];
$this->verifyresult[] = $result;
$this->verifytime[] = time();
$this->verifyname[] = $name;
end($this->verifyresult);
                        $output = "I choose <font color=yellow>$result</font>.  To verify, /tell <botname> <pre>nverify ".key($this->verifyresult);
} else { $output = "Could not find your instance ID."; }


Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline goremachine

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: pick random player in raid
« Reply #3 on: February 04, 2010, 11:31:40 pm »
Thats already awesome so far. Thanks a truckload for coming up with a codesnipplet that fast. =)

But it would be great if it would work for the whole raid, also for PUG, tbh. thats when you need it most not to have ppl ninja stuff and have to rely on masterloot.
I don´t know if its possible though to parse all people in one instance, not just those member of the bot.
Lorica - Hyrkania RP-PvE (former Blackscar)
Officier of Harlots of Tortage

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: pick random player in raid
« Reply #4 on: February 04, 2010, 11:41:26 pm »
Its not possible to grab your raidlist. The method im using is checking who ever is in same instance as the one running the command. So random players will not be picked
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline goremachine

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: pick random player in raid
« Reply #5 on: February 05, 2010, 11:14:18 am »
Thanks again for the quick answer.
I was afraid you´r going to say that, i am not into php nor the bot´s functionality but judging by the code (can code C(PP) and assembler so i am no hacking noob =) I mostly got what you do.

Nevertheless, for now its an awesome solution nevertheless.
As we mostly raid with the same guild, the others simply have to alter their nroll as well, then we can just alternate rolling for our guild/botmembers. However on the long term it should be a different solution.

I got another idea too.
Maybe its possible though to make a relic module.. something like that:

relicloot module:

/tell BeBot !rlneed
Adds the Player that send the command to the bot to a XML file, SQL-tuple, textfile or whatsoever, seperate from the Bots playerdatabase
Should be a tell command for non-bot members obviously, so those who want/need a relic can add themselves at the start of the raid. So it takes everyone one keystroke if they have it on macro for themselves.
If only members of the bot can add themselves, again it would take aeons to add e.g. 24 people. Should be possible, as guild-ads also work for non members of the bot. If its not possible, its still better for the raidleader. He can make a script called relichunter or something like that:

/relichunter Foo
--
/invitetoraid %1
/tell BeBot !rlneed %1

So people he invites to raid also get added to the list.

/tell BeBot !rlpick <param1> <param2>
Bot returns <param1> random Picks from the list
<param1> number of items to distribute, e.g. 3 Relics, the bot pics 3 names from the list
<param2> "remove" - when remove is given as second parameter, it deletes the chosen one(s) from the list, to ensure everyone gets only one relic until everyone got at least one. optional though, i guess it depends on the loot policy agreement what people prefere.


/tell BeBot !rlclearlist

raid is over and there are people in the list still. command to clear the list.

/tell BeBot !rlshowlist
returns a linked list for the info window with the names currently held in the list


/tell BeBot !rlremovename <param1>

<param1> is the name of a player currently in the list and the very same gets removed
e.g. someone is full T1 epic already and adds his name for the bot for T1 Relics which is uselesss, or in other words, you have to have the possibility to remove single persons from the list.

/tell BeBot !rlverify <param>
Last but not least, a feedback to proof the roll, like the verify for nroll. <param> holds the roll.

This module might be some more efford than just enhancing nroll, however i think funcom will not come up with an solution soonish, so this could be one of the next default modules.
I guess many raids are not guild only but within a raidalliance or even PUG and honestly masterloot is the only way to be sure no one is ninja-ing or rolling by accident. happened often enough that the game lagged someone clicked and accidentally hit need on a window not yet shown.
« Last Edit: February 05, 2010, 11:20:46 am by goremachine »
Lorica - Hyrkania RP-PvE (former Blackscar)
Officier of Harlots of Tortage

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: pick random player in raid
« Reply #6 on: February 05, 2010, 12:03:29 pm »
Quote
::::: HELP ON LOOT :::::

Module to flat roll on items.

!loot <item> - Adds an item to the roll list.
!loot add <slot> - Adds your name to the slot number. Add 0 removes you from all slots.
!loot rem <slot> - Removes your name from the slot number.
!loot list - Lists all items and who is rolling for them.
!loot clear - Clears all rolls.
!loot result - Rolls for all the items and announces winners.
!loot reroll - Adds any unwon items from the last roll to a new roll.
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline goremachine

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: pick random player in raid
« Reply #7 on: February 05, 2010, 12:27:05 pm »
d'oh. got an awesome idea you can be sure someone had it before you =)

Its already quite helpful, again it has the problem that the module only listens to members of the bot, non members can´t "!loot add <slot>"
And i dont see any possibility to add someone to the loot module by name.
It would need either a "!loot add <slot> <name>" or listen to non-bot-members.

Lorica - Hyrkania RP-PvE (former Blackscar)
Officier of Harlots of Tortage

Offline Sanrye

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: pick random player in raid
« Reply #8 on: February 06, 2010, 01:17:07 am »
You can change access for commands. Just make the loot add, loot rem, loot list commands anonymous and there you go!

Offline goremachine

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: pick random player in raid
« Reply #9 on: February 06, 2010, 01:40:16 am »
Yeh, got our botmaintainer to do that. However it seems not to work properly or our GL messed up the settings.
If we create a loot entry now we can add 4-5 members of our own guild to one slot and then it just stops to accept more participants without saying why.
Lorica - Hyrkania RP-PvE (former Blackscar)
Officier of Harlots of Tortage

 

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