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: is there a way to get name using id?  (Read 2404 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
is there a way to get name using id?
« 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

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: is there a way to get name using id?
« Reply #1 on: January 25, 2006, 02:03:40 pm »
Works fine when I've used it.
What does it return when you try it?
Too many toons.

Offline Blondengy

  • BeBot Creator and Founder
  • BeBot Hero
  • ******
  • Posts: 51
  • Karma: +0/-0
Re: is there a way to get name using id?
« Reply #2 on: January 25, 2006, 06:16:53 pm »
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.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: is there a way to get name using id?
« Reply #3 on: January 26, 2006, 12:52:57 am »
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?

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: is there a way to get name using id?
« Reply #4 on: January 26, 2006, 06:43:22 am »
The buddy_* functions work with IDs, so should be possible.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: is there a way to get name using id?
« Reply #5 on: January 27, 2006, 10:01:57 pm »
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.

 

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