PDA

View Full Version : script: editing/adding an aliass ?



00000815
10-19-2010, 05:43 PM
I am looking to add/edit an alias. Where are these aliases stored?

i want to get a better take on regs, so i am searching my db for playernames with #hands>x an have a script creating an alias for those names so that i can run the reports and also look at keyhands without me beeing involved.

Patvs
10-21-2010, 09:22 PM
The alias list is stored deep inside the SQL database.
You can't really edit its values, to create a script to add all regulars to it.

But your idea is genius.
suggest it here - Suggestions Forums - Holdem Manager Forums (http://forums.holdemmanager.com/suggestions-forums/)
and I'll bump it on the developers list

The Minder
10-22-2010, 02:41 AM
lost for words

00000815
10-22-2010, 05:21 AM
The alias list is stored deep inside the SQL database.
shit, was hoping for something else



You can't
mhhhhh, you know what:I can be really really stubborn
:D

redlotus
10-23-2010, 01:05 AM
If you know how to run SQL queries on your HEM database, run the following:


CREATE OR REPLACE FUNCTION fn_alias_regs(alias_name text, min_hands integer)
RETURNS void AS
$BODY$INSERT INTO players (site_id, playername, cashhands, tourneyhands, playertype_id)
VALUES (-1, $1, 0,0,0);
INSERT INTO aliases (aliasplayer_id, player_id)
SELECT (SELECT MAX(player_id) FROM players), player_id FROM players
WHERE cashhands>$2$BODY$
LANGUAGE 'sql' VOLATILE
COST 100;

This will create the function that will do all of the work.

Once the function is created, you can create the alias by running the function:

SELECT fn_alias_regs(name, min # of hands);

Here's an example that creates an alias called "reg_alias" with all regs that you have at least 2000 hands on:

SELECT fn_alias_regs('reg_alias', 2000);

**NOTE** I accept no responsibility if the contents of this post somehow mess up your HEM database. Use at your own risk.**

The biggest problem with doing things this way is that you will have to run the function every so often to add new players that you've collected enough hands on. This will clutter your database a bit since you will need to use a new alias name every time you run it.

-red

00000815
10-23-2010, 01:35 AM
awesome, thanks



The biggest problem with doing things this way is that you will have to run the function every so often to add new players that you've collected enough hands on. This will clutter your database a bit since you will need to use a new alias name every time you run it.
i had in my mind to do this every once in a while - maybe 2 times per month - and delete the alias when the research is done.

redlotus
10-23-2010, 09:56 PM
awesome, thanks
You're welcome




i had in my mind to do this every once in a while - maybe 2 times per month - and delete the alias when the research is done.

Cool. Just don't forget to remove any of your screen names from the alias.

-red

professorpain
12-16-2010, 08:29 AM
Can someone please tell me how to update this code, but instead to make it for players with more than 20 hands and VPIP above 38.

Thanks.

mrhobbeys
01-30-2011, 03:24 AM
I now feel like I should ride the short bus for doing this by hand for so long thanks for the SQL script :):):):):D