Development > Coding and development discussion

noob question ;) is it possible to get the online stat chars?

(1/2) > >>

Zorrna:
Hi

Is it possible to get the online state of any char on the server via bot?

I need it to make my Friendslist better to use that i can see on my list if the player is on or not

I´am working on this http://bebot.link/module-requests/alternative-friendslist-for-aoc/

by the way is it also possible to get the class of any char on my server?

LG


Drizzurdeen:
try .... !is charname ... this would give u feedback if the char is online
!yg charname ... this would give u feddback of the yg profile of the char

hop i could help

drizz

Zorrna:
i know th !is funktion but i want to use it in a script



--- Code: --- function freund_liste($name)
{
//finde den mainchar von $name
$findmain = $this -> bot -> db -> select("SELECT main FROM alts WHERE alts.alt='$name'");
if (empty($findmain)) {$main=$name;}
else {$main = current($findmain[0]);}

//finde alle freunde und liste in scriptbox
$output ="<Center>##ao_infoheadline##:::: Freundesliste von $main und Twinks ::::##end##</Center>".$this->brfix(2);
$freunde = $this -> bot -> db -> select("SELECT * FROM  `#___friends` WHERE mainchar =  '$main'");
if (!empty($freunde)) {
foreach ($freunde as $aa) {
$fname = $aa[1];
$fdatum = $aa[2];
$fnotiz = $aa[3];
$output .= "##Lime##$fname##end##    $fdatum    $fnotiz".$this->brfix();
}
}
$output = $this -> bot -> core("tools") -> make_blob("Freundesliste f?r $main", $output);
return $output;
}

--- End code ---

u see i make a list with my buddy´s and make a blob to show it but i want to check if the char wit the name $fname is online if not i don´t add him to the list can i use !is for this?

Drizzurdeen:
i think so .... just try and error ;) .... on our bot the !is funktion works with no botmembers either

Runemy:
If you get your friends added to the bot somehow, perhaps as guests, then I suppose you could use this sniplet to some extent? (It's from the guildinfo.php mod)


--- Code: ---$online = $this -> bot -> core("online") -> get_online_state('Wood');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Wood Im interested in joining Exalted'>Wood</a> - Guild leader##end##\n";
--- End code ---

I don't know how you could implement it fully to your use, but it might be a clue.

Navigation

[0] Message Index

[#] Next page

Go to full version