;'God - Check Alternates' skill script

targetID = GetUserID(GetUserMessage(#USERID))

If targetID < 1
	SendMessageToUser(#USERID,"Say the name of a player and then use this skill.",#MSG_SERVER)
	Goto END
EndIf

If IsOnline(targetID) = 0
	SendMessageToUser(#USERID,GetUserName(targetID)+" is not online.",#MSG_SERVER)
	Goto END
EndIf

targetIPAddress=GetUserIP(targetID)

SendMessageToUser(#USERID,"Online alternate accounts of "+GetUserName(targetID)+":",#MSG_TELL)
SendMessageToUser(#USERID,"IP: "+targetIPAddress,#MSG_TELL)

count = 0

ID = GetNextOnlineUser(0)
While ID <> 0
	If targetID <> ID
		If GetUserIP(ID)=targetIPAddress
			SendMessageToUser(#USERID," - "+GetUserName(ID)+" (UserID: "+ID+")",#MSG_TELL)
			count = count + 1
		EndIf
	EndIf
	
	ID = GetNextOnlineUser(ID)
Wend

SendMessageToUser(#USERID,"Number of matches: "+count,#MSG_TELL)

Label END

Continue = 1