Support:Queries

From Arianne
Revision as of 19:58, 27 October 2010 by imported>Hendrik Brummermann
Jump to navigation Jump to search

Characters and accounts

Account belonging to a character

<source lang="SQL"> SELECT account.* FROM account, characters WHERE characters.player_id=account.id AND charname='[character]'; </source>

Characters belonging to an account

<source lang="SQL"> SELECT characters.* FROM account, characters WHERE characters.player_id=account.id AND username='[account]' </source>

Items

Item history of all items touched by suspicious character

<source lang="SQL"> SELECT * FROM itemlog, (SELECT DISTINCT itemid FROM itemlog WHERE source IN ('[charname1]', '[charname2]')) As x WHERE x.itemid=itemlog.itemid ORDER BY itemlog.itemid, itemlog.id </source>

Bots

Finding Bots

TODO: {{{1}}}

Checking if someone is a bot

The following queries lists the number of "use"-actions per player and hour. If there are high number of uses for several hours in a row, it is likely a bot.

<source lang="SQL"> SELECT source, left(timedate, 13) As day, count(*) As cnt FROM gameEvents WHERE (source='[character1]' OR source='[character2]') AND event='use' GROUP BY source, event, day ORDER BY day; </source>