PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: Alexinno on 16 July, 2006, 15:52:27

Title: Login info
Post by: Alexinno on 16 July, 2006, 15:52:27
I'm not a lua coder but kinda maid this script because i needed a script to display custom profile names for Master and User
I inspired much from Mutor's scripts? :P? ::)


--[[
Maybe allready is o bot like this but I maid it because I wanted a script
? ? ?to display custom profile names Master = Admin and User = Guest
And if anyone else need it , here it is :)
? ? ? InfoBot.v1? ?- inspired from Mutor's Auto-Block 1.0? ? ? ? ?
? ? ? ? ? ? ?16/07/2006? by alexinno
? ? ? ? ? ? ? ? ?Sends custom Userinfo prer profile
? ? ? With this output:<PtokaX> Your info:
? ? ? ? ? ? ? ? ? ? ? ?Nick: User
? ? ? ? ? ? ? ? ? ? ? ?Class : User Profile
? ? ? ? ? ? ? ? ? ? ? ?IP: User Ip
? ? ? ? ? ? ? ? ? ? ? ?Country Code: [RO]
? ? ? You can add other info's to display for which profile you want, i put the [b]Country Code: [RO][/b] in the info because is a private hub, only for Romania
]]--? ? ? ? ? ? ? ? ? ?
-- Botname pulled from the hub
Bot = frmHub:GetHubBotName() -- or "BotName-Here"
-- Message to send
function NewUserConnected(user)
? ? ? ?if (user.iProfile == -1) then
user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Guest(0) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
? ? ? ?elseif (user.iProfile == 2) then
? ? ? ? ? ? ? ? user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : VIP(2) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
? ? ? ?elseif (user.iProfile == 3) then
? ? ? ? ? ? ? ? user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Reg(1) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
? ? ? ?end? ? ?
end

function OpConnected(user)
? ? ? ? if (user.iProfile == 1) then
? ? ? ? ? ? ? ? user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Op(3) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
? ? ? ? elseif (user.iProfile == 0) then
? ? ? ? ? ? ? ? user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Admin(4) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
? ? ? ? end
end
Title: Re: Login info
Post by: Markitos on 16 July, 2006, 16:09:22
Hi m8!
Consider this from the Ptokax API
User.
-----
bOperator
bRegistered
Title: Re: Login info
Post by: UwV on 18 July, 2006, 10:34:58
Quote from: Alexinno on 16 July, 2006, 15:52:27
I'm not a lua coder but kinda maid this script because i needed a script to display custom profile names for Master and User

great , way to go :0)
i think we' be seeing more of your work ;0)

btw.. if you are sure there is no other profiles ..
you could do :

-- Message to send
function NewUserConnected(user)
       if (user.iProfile == -1) then
user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Guest(0) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
       elseif (user.iProfile == 2) then
                user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : VIP(2) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
       else
                user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Reg(1) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
       end     
end

function OpConnected(user)
        if (user.iProfile == 1) then
                user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Op(3) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
        else
                user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : Admin(4) \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")
        end
end



ps.
Quote from: Markitos on 16 July, 2006, 16:09:22
Hi m8!
Consider this from the Ptokax API
User.
-----
bOperator
bRegistered



did you ever think about  why there is two arrivals ?
i think this way is nice .. why check bOperator if you  want the profile ID anyway ?
this i think saves a few elseif's in NewUserconnected (no need to look for op's there),
And vice versa for the OpConnected there we need not look for non op profiles.
bRegistered could be used but then he would still need to find the profile ID after that for the other levels..
and " if not user.bRegistered ", or " if  user.iProfile == -1 " saves nothing really.. or does it ?

Markitos ..consider that .
Title: Re: Login info
Post by: Markitos on 18 July, 2006, 11:09:50
Your right...
Title: Re: Login info
Post by: Cêñoßy†ê on 18 July, 2006, 12:07:52
same with little less txt  ::)

NewNames = {
[0] = "Admin(4)",
[1] = "Op(3)",
[2] = "VIP(2)",
[3] = "Reg(1)",
[-1] = "Guest(0)"
}

function NewUserConnected(user)
user:SendData(Bot,"Your info:\r\n Nick: "..user.sName.." \r\n Class : "..NewNames[user.iProfile].." \r\n IP: "..user.sIP.." \r\n Country Code: [RO]")   
end
OpConnected=NewUserConnected
Title: Re: Login info
Post by: jiten on 18 July, 2006, 12:41:03
Just as an addition, if you want to use PX's default profile names:

sBot = frmHub:GetHubBotName()

NewUserConnected = function(user)
user:SendData(sBot, "Your info:\r\nNick: "..user.sName.."\r\nClass : "..(GetProfileName(user.iProfile) or "Guest")..
" ("..user.iProfile..")\r\nIP: "..user.sIP.."\r\nCountry Code: [RO]")
end

OpConnected = NewUserConnected
Title: Re: Login info
Post by: Alexinno on 18 July, 2006, 15:44:49
like i said before ,i'm not a scripter :P but 10q all guys for the support and for helping me with scripts 
maybe one day i'll become a lua scripter too ;)