PtokaX forum

Development Section => Your Developing Problems => Topic started by: [DK]DjBent on 19 April, 2004, 21:47:42

Title: a login script
Post by: [DK]DjBent on 19 April, 2004, 21:47:42
Looks like this....

BotName = "[MMZ]Bot" --// Set here your bot name

function NewUserConnected(user)
   Message(user)
end

function OpConnected(user)
   Message(user)
end

--// Profile Counter
function ProfileCounter(profile)
   local table, count = GetUsersByProfile(profile), 0
   for i, User in table do
      if GetItemByName(User) then
         count = count + 1
      end
   end
   return count
end

function Message(user)
   local disp = ""
   doGetProfile =  GetProfileName(user.iProfile) or "Not registerd"
   local s,e,share = strfind(user.sMyInfoString, "$(%d+)%$")
   share = format("%0.2f", ( share / (1024*1024*1024)))
   local hubshare = format("%0.2f",  ( frmHub:GetCurrentShareAmount() / (1024*1024*1024)))
   border1 = "<>=========================H=U=B==I=N=F=O==============================="
   border2 = "<>======================================================================"
   disp = "\r\n\r\n"..border1.."\r\n"
   disp = disp.."   ?Welcome:         "..user.sName.."\r\n"
   disp = disp.."   ?To this fine place Called:   "..frmHub:GetHubName().."\r\n"
   disp = disp.."   ?Your IP:         "..user.sIP.."\r\n"
   disp = disp.."   ?Your Status in this Hub:   "..doGetProfile.."\r\n"
   disp = disp.."   ?Actual Share in the Hub:   "..hubshare.." GB\r\n"
   disp = disp.."   ?There are now:         "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users connected\r\n"
   disp = disp.."   ?Hub description is:      "..frmHub:GetHubDescr().."\r\n"
   disp = disp.."   ?Hub register address is:   "..frmHub:GetRegServer().."\r\n"
   disp = disp.."   ?Hub minshare is:      "..frmHub:GetMinShare()/(1024).." GB\r\n"
   disp = disp.."   ?Redirect address is:      "..frmHub:GetRedirectAddress().."\r\n"
   disp = disp.."   ?Hub is Powered by:      "..frmHub:GetHubBotName().."\r\n"..border2.."\r\n"
   user:SendData(BotName, disp)
end



But it wont get the bot name..... and i would like it to do that..... or say that the hub is powered by Robocop 7.0a

Please help me
Title:
Post by: plop on 19 April, 2004, 22:27:12
your talking about this i guess.
frmHub:GetHubBotName()
it returns the name of the ptokax build-in bot, not a scripted bot.

plop
Title:
Post by: imby on 24 May, 2005, 15:58:15
Anyone have LUA 5 version of this?
Title:
Post by: TTB on 24 May, 2005, 16:04:49
Try this threat and use the search next time!

*CLICK* (http://board.univ-angers.fr/thread.php?threadid=3908&boardid=26)
Title:
Post by: imby on 24 May, 2005, 17:15:57
I did use search, the latter has functions I don't need and parts I don't understand therefore it'll end up as bloat since I wont know what code to remove, the former is perfect for my needs.