Jump to content

Auto-update Friends List


Guest patros
 Share

Recommended Posts

Posting this cause I didn't see it anywhere, sorry if it's been done before. One of my mates came up with the idea of automatically updating the friends list so that any character made by anyone would be added to everyone's friends list. After a bit of tinkering I came up with this script for Linux...

***Begin Script***

#!/bin/bash

update_friend_list() {

mysql --user=mangos --password=typeyourpasswordhere characters --execute="DELETE character_social.* FROM character_social;"

mysql --user=mangos --password=typeyourpasswordhere characters --execute="INSERT INTO character_social SELECT main.guid, friend.guid, 1 AS flags, '' AS note FROM characters AS main JOIN characters AS friend WHERE main.account <> friend.account;"

}

while [ "1" = "1" ]

do

update_friend_list

sleep 1m

done

***End Script***

I should revise it so it only updates the character_social table instead of clearing it and recreating it, but it should do the trick as is. You just have to check and change your sql username and password and run the script on your server. I'm sure there is someone who could change this to a batch file for windows, or I could if someone is interested. It updates every minute but you could change the delay to suit.

Hope someone gets use out of it.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use