So I have this client add-on, I have by no means created it myself, I was trying to get it to work. It was created by Lilboarder using Zack0Wack0's database blockByte.
When I got it I couldn't get it to return anything at all, I have fixed the ID look-up aspect, however the name look-up still has an error. It will return the name, as well as tell me how many results for the name it has found, but it will only list one name instead of multiple.
package updateList
{
function NMH_Type::Send(%this)
{
%Msg = %this.getValue();
if(getWord(%Msg,0) $= "/WhoIs")
{
%args = getWords(%msg,1,getWordCount(%msg));
if(getWord(%args,0) > 0)
{
Blahblah ID lookup
}
else
{
%returnName = findName(%args);
if(%returnName == -1)
{
if(!%foundBLID)
{
clientCmdChatMessage("","","","\c3Database\c6: The search has returned no results for the name "@ %args @".","");
}
%this.setValue("");
Parent::Send(%this);
return;
}
else
{
%currName = getField(%returnName,%i);
%blid = LilDatabaseSO.value[%currName,"clientBLID"];
%lastSeen = LilDatabaseSO.value[%currName,"lastSeen"];
%oldName = LilDatabaseSO.value[%currName,"previousAliases"];
if(%oldName !$= "null")
{
%oldNameString = " - Previous Name: "@ %oldName;
}
else
{
%oldNameString = "";
}
%count = getFieldCount(%returnName);
%s = %count > 1 ? "s" : "";
if(%i == 0)
{
clientCmdChatMessage("","","","\c3Database\c6: "@ %count @" result"@ %s @" for "@ %args @".","");
clientCmdChatMessage("","","","\c3Database\c6: Name: "@ %currName @" - BL_ID: "@ %BLID @" - Last Seen: "@ %lastSeen SPC %oldNameString,"");
}
else
{
clientCmdChatMessage("","","","\c3Database\c6: Name: "@ %currName @" - BL_ID: "@ %BLID @" - Last Seen: "@ %lastSeen SPC %oldNameString,"");
}
}
}
%this.setValue("");
}
Parent::Send(%this);
}
blah blah
I have a feeling I may need for(%i=1;%i<=%count;%i++)
in there somewhere but I'm at a loss.