I dunno if this is the right place, but I'm looking for a scritp that will redirect non registered user to another hub.
This is for a private hub and there is no need for other functions since there are no rules within the hub.
thanks in adnvance
This will redirect non regged users to the default redirect adress set in the PtokaX HubSoft
function DataArrival(user,data)
if ( strsub(data, 1, 12) == "$MyINFO $ALL" ) then
if (GetProfileName(user.iProfile) == nil) then
user:SendData("*** This is a Private Members ONLY hub.")
user:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
end
end
Best regards,
Snooze
This one works to, and lets in the Hublistpinger from Hublist.org
--???????????????????????????????????????????????????????????????????????????????
--? ???????????? Here some Hubinfo ???????????? ?
--???????????????????????????????????????????????????????????????????????????????
addy="myhub.homeip.net" -- ? <<<<< here redirect address ?
-- ??????????????????????????????????????????????
text= "This Hub is for registered Users only\n"..
" <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n"..
" Interested in becoming a registered User then send an email to the hubadmin [EMAIL]admin@myhub.homeip.net[/EMAIL]\n"..
" <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n"..
" You shall now be redirected to our Partner hub\n" -- ? <<<<< Place Text to send here ?
--???????????????????????????????????????????????????????????????????????????????
--? ???????????? Oberlausitzer Open Hub ???????????? ?
--???????????????????????????????????????????????????????????????????????????????
function NewUserConnected(user)
if (user.iProfile == -1) then
if (user.sName =="{HubListPinger}") then
else
user:SendData(text.."|$ForceMove "..addy.."|")
end
end
end
function DataArrival(user,data)
if (strsub( data, 1, 8 ) == "$MyINFO ") and (user.iProfile == -1) then
if (user.sName =="{HubListPinger}") then
else
user:SendData(text.."|$ForceMove "..addy.."|")
end
end
end
Thank you, thank you, thank you, to the both of you.
you have no idea how much this will help.
regards, and I'm in debt
Psycho_Chihuahua:
your script is giving me the following error message:
Syntax error: expected;
last token read: `?' at line 4 in file `C:\HubDD VIP\scripts\redirect_original.lua'
What I did is I copied your script in an edited lua file which I named redirect _original.lua and put in the scripts folder of PtoKaX. I dunno if what I did is wrong since I'm quite new with PtoKaX and Lua scripts. Please let me now if I made a mistake, and if I did , please let me know how to load this script.
I seem to be getting a similar error from Snooze's script as well. Obviously I'm doing something wrong. Could you please point me in the right direction.
Syntax error: expected;
last token read: `function' at line 3 in file `\\Netserver2\NetServer2\HubDD VIP\scripts\redirect_chico.lua'
Thanks again.
If you wanna let the {HubListPinger} in, this should do it..
function DataArrival(user,data)
if ( strsub(data, 1, 12) == "$MyINFO $ALL" ) then
if (GetProfileName(user.iProfile) == nil) then
if (user.sName =="{HubListPinger}") then
else
user:SendData("*** This is a Private Members ONLY hub.")
user:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
end
end
end
Best regards,
Snooze
Where is the users redirect now Snooze ??? u only redirecting the HubListPinger...
lol - good that someone is awake
Corrected in script above ..
Snooze, thanks for modifying the script, but I'm still getting the same error but now it mentions line 4 instead of 3.
Syntax error: expected;
last token read: `function' at line 4 in file `\\Netserver2\NetServer2\HubDD VIP\scripts\redirect_chico.lua'
What is that expected? Is there something in particular that I have to input there?
Thaks for your patience
Regards