PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: WickeD on 16 March, 2004, 14:05:08

Title: Need help whit script!
Post by: WickeD on 16 March, 2004, 14:05:08
Is there a line that can bee added in a script that shows a ISP-Tagg for a user in mainchat?

Like this: "..curUser.sName.."  but shows the ISP-Tagg like: Your ISP tagg is: [Telia]

Can eny one help mee whit this problem?

//WickeD
Title:
Post by: Skrollster on 16 March, 2004, 14:14:31
How do you usually do then you find out what isp a user has??
Title: Whit this script I check users ISP-Tagg!
Post by: WickeD on 16 March, 2004, 17:02:11
I want the users to get a massage i mainchat when they enter the hub that say: Your ISP-Tagg is: [Bostaden] and are allow here!


BotName = "[Bot]??Gate-Check??"
ISP = {
"[Bostaden]",
"[Scream]",
"[Telecom3]",
}


-- Main Sub
function Main()
frmHub:RegBot(BotName)
end


function NewUserConnected(curUser)

for key, value in ISP do --Loop ISP Array
if (strfind(strlower(curUser.sName), strlower(value),1,1)) then
x=1
break
else
x=0
end
end

if (x == 0) then
-- Kick user
curUser:SendData("Your [ISP]-Tagg is wrong!")
curUser:SendData("Your nickname must have your [ISP]-Tagg Before your nickname!")
curUser:SendData("Change your [ISP]-Tagg to: [Bostaden]Yournickname or what [ISP] that you now have!")
curUser:Disconnect()
end

end



//WickeD
Title:
Post by: Skrollster on 16 March, 2004, 17:41:45
I meant how do you usualy do to determ if a user is allowed??
Title: How do you meen??
Post by: WickeD on 16 March, 2004, 19:53:11
If they have this IPS-Tagg they can enter the hub:

"[Bostaden]",
"[Scream]",
"[Telecom3]",


Is that what you meen??

//WickeD
Title:
Post by: Skrollster on 16 March, 2004, 21:18:40
so any one with those isp-tags can enter the hub?
Title:
Post by: ??????Hawk?????? on 16 March, 2004, 21:28:26
hmmmm  i think maby hes wanting something like



user connect:-

Get ip info from Whois Database

Check for coresponding isp tag

if no tag then pm user and disconnect them


??????? maby
Title:
Post by: Skrollster on 16 March, 2004, 21:35:53
yes, maybe, but i wanted him to get to that conclution on his own..
Title: Hmmm! Like this!
Post by: WickeD on 16 March, 2004, 23:17:12
I use this script to check and block users whit wrong IPS-Tagg to enter my hub! And it works fine!  BUT! I want the script to show a loggin massage to a user when enter the hub! That say: Welcome WickeD! Your IPS-Tagg is: [Bostaden] and are allowed in here!

That is all the help I want to whit this script!  =)


BotName = "[Bot]??Gate-Check??"
ISP = {
"[Bostaden]",
"[Scream]",
"[Telecom3]",
}


-- Main Sub
function Main()
frmHub:RegBot(BotName)
end


function NewUserConnected(curUser)

for key, value in ISP do --Loop ISP Array
if (strfind(strlower(curUser.sName), strlower(value),1,1)) then
x=1
break
else
x=0
end
end

if (x == 0) then
-- Kick user
curUser:SendData("Your [ISP]-Tagg is wrong!")
curUser:SendData("Your nickname must have your [ISP]-Tagg Before your nickname!")
curUser:SendData("Change your [ISP]-Tagg to: [Bostaden]Yournickname or what [ISP] that you now have!")
curUser:Disconnect()
end

end




//WickeD
Title:
Post by: NightLitch on 16 March, 2004, 23:51:32
for you problem, you must most likley bind the ISP to a IP that is how I have done.

ex:


Table = {
["192.168.0.*"] = "[ROUTER]",
["127.0.0.*"] = "[LOCAL]",
}

but there is many way's.
Title: Okej!
Post by: WickeD on 17 March, 2004, 00:24:19
Thx for your help my m8?s!!!  =)


//WickeD
Title:
Post by: ??????Hawk?????? on 17 March, 2004, 02:58:09
try this  ( Untested )





BotName = "[Bot]??Gate-Check??"
ISP = {
"[Bostaden]",
"[Scream]",
"[Telecom3]",
}


-- Main Sub
function Main()
frmHub:RegBot(BotName)
end


function NewUserConnected(curUser)
for key, value in ISP do --Loop ISP Array
if (strfind(strlower(curUser.sName), strlower(value),1,1)) then
x=1
break
else
x=0
end
end
if (x == 0) then
-- Kick user
curUser:SendData("Your [ISP]-Tagg is wrong!")
curUser:SendData("Your nickname must have your [ISP]-Tagg Before your nickname!")
curUser:SendData("Change your [ISP]-Tagg to: [Bostaden]Yournickname or what [ISP] that you now have!")
curUser:Disconnect()
elseif (x == 1) then
curUser:SendData("Welcome "..curUser.sName.." Your IPS-Tagg is: "..value.." and are allowed in here!")
end

end


Title: Thx my m8!!
Post by: WickeD on 17 March, 2004, 09:09:35
This: "..value.." is what I wanted!!!  Thx a lot my m8!!!

I added that to my script and now I have all I need to my ISP script!


//WickeD
Title:
Post by: ??????Hawk?????? on 17 March, 2004, 18:43:58
your welcome m8 ..  

sorry  i misunderstood you @ first   but we got there in the end  :P