the question is simple how to find the localhost of a pc, it changes depending on ur settings, and the firewall etc etc, so whats the best method to do so?
the ip, specifically !!
either run cmd.exe and type ipconfig or look in router for ip's shared amongst network computers
QuoteOriginally posted by kepp
either run cmd.exe and type ipconfig or look in router for ip's shared amongst network computers
I think he meant by Lua scripting ;)
os.execute("ipconfig > filename.txt")
then read it :)
I think that will work
why don't try 127.0.0.1 LooooooooooooooL
QuoteOriginally posted by Dessamator
the question is simple how to find the localhost of a pc, it changes depending on ur settings, and the firewall etc etc, so whats the best method to do so?
the ip, specifically !!
it doesn't change, it's always 127.0.0.1 unless you have changed it yourself.
and then you are still bound to 127.0.0.xxx.
only on special linux/bsd server setups those other local hosts are used (shared server).
plop
QuoteOriginally posted by plop
QuoteOriginally posted by Dessamator
the question is simple how to find the localhost of a pc, it changes depending on ur settings, and the firewall etc etc, so whats the best method to do so?
the ip, specifically !!
it doesn't change, it's always 127.0.0.1 unless you have changed it yourself.
and then you are still bound to 127.0.0.xxx.
only on special linux/bsd server setups those other local hosts are used (shared server).
plop
well the thing is, i created a script which gets the hub ip, and using it finds out which user has it, when i test it with another hub somehow it doesnt find the ip, if the person with the server logs in with localhost,
anyways heres the script for reference:::
--By Dessamator
--SIMPLE Online ip checker
bot=frmHub:GetHubBotName()
function ChatArrival(user, data)
data = string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find(data, "%b<>%s+(%S+)")
local s,e,ip = string.find(data, "%b<>%s+%S+%s+(.+)")
if cmd=="!findip" and user.bOperator then
findip(user,ip,1)
return 1
elseif cmd=="!getserver" and user.bOperator then
local hubip=frmHub:GetHubIp()
findip(user,hubip,0)
return 1
end
end
ToArrival=ChatArrival
function findip(user,ip,i)
local check =""
if i==1 and ip then
temp= "\r\n".."\t".."The ip: "..ip.." Belongs to :".."\r\n"
else
temp= "\r\n".."\t".."The Current server is: ".."\r\n"
end
if ip==nil or ip=="" then
user:SendPM(bot,"Syntax error. Correct Syntax is : !findip ")
else
temp=temp.."\t".."??????????????????????".."\r\n"
for _,nick in frmHub:GetOnlineUsers() do
serverip=string.sub(nick.sIP,1,4)
if nick.sIP==ip then
temp=temp.."\t\t".."•"..nick.sName.."\r\n"
check=check..nick.sName
elseif i==0 and serverip=="127." then
temp=temp.."\t\t".."•"..nick.sName.."\r\n"
check=check..nick.sName
elseif (i==0) and not(nick.sIP==ip ) then
temp="The person with the server isnt online!!"
end
end
if check=="" then
user:SendPM(bot,"The User with that ip isnt online")
else
user:SendPM(bot,temp)
temp=nil
serverip=""
check=""
end
end
end
This could only be retrieved by a script which does a ping -a on the hubs DNS thus retrieves the IP andcompares it with userstable.
QuoteOriginally posted by bastya_elvtars
This could only be retrieved by a script which does a ping -a on the hubs DNS thus retrieves the IP andcompares it with userstable.
well generally that would work, and it already does work in that script, the prob arises when the server connects through localhost !!, when i test it , it works, but not with the other guy who handles the server of our hub !!
why not search with 2 key's??
127.0.0.1 and the ip from frmHub:GetHubIP()
plop
QuoteOriginally posted by plop
why not search with 2 key's??
127.0.0.1 and the ip from frmHub:GetHubIP()
plop
great idea, will do !!