PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: elpocho on 02 August, 2004, 09:48:04

Title: Non registered redirect
Post by: elpocho on 02 August, 2004, 09:48:04
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
Title:
Post by: Snooze on 02 August, 2004, 10:11:17
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
Title:
Post by: Psycho_Chihuahua on 02 August, 2004, 17:27:14
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
Title:
Post by: elpocho on 02 August, 2004, 18:30:45
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
Title: problem witn script
Post by: elpocho on 02 August, 2004, 22:07:20
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.
Title:
Post by: Snooze on 02 August, 2004, 22:37:23
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
Title:
Post by: NightLitch on 02 August, 2004, 22:44:04
Where is the users redirect now Snooze ??? u only redirecting the HubListPinger...
Title:
Post by: Snooze on 02 August, 2004, 22:57:32
lol - good that someone is awake

Corrected in script above ..
Title:
Post by: elpocho on 03 August, 2004, 02:54:22
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