BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Wanuarmi on January 25, 2006, 02:44:30 am
-
theres a way to get id using a name, but is there a way to get the name using an id?
$name = $this -> bot -> aoc -> get_uname($id);
doesnt seem to work
-
Works fine when I've used it.
What does it return when you try it?
-
It only works if the bot "knows" the user already (either because the user sent a tell to the bot or cause its on the bot's buddylist).
When the bot asks for a UID that belongs to a name it sends a specific command to the server which replies with the uid. Prob is that there's no command to send a UID and get the name back as a result. :(
I think you can trick it though by simply checking if the bot knows the player already (if so you get a proper name back) and if not adding the person to the bot's buddylist and as soon as you get a server reply that the user is added delete him again and do whatever you wanted to do before...
As a reference you might want to look at the !is command. It even though it doesn't need the name from the UID it has to add the person to the buddylist and once it gets a reply delete the player again and send back the online/offline message.
-
Well, thats the problem, if I had a name to add as buddy I wouldnt have to get the name...
I removed all members from my bot, but I had the raid_points table which I thought I could use to re-add them, but that table only has IDs... So I lost all names of my members.
Can I add a buddy to the bot using the ID?
-
The buddy_* functions work with IDs, so should be possible.
-
Thanks, I was able to add people as buddies using the id with send_package(), then added them as members with a module listening for buddy logons... It was very tricky though, using the send_package() always disconnected me from the server.