PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: bastya_elvtars on 19 May, 2004, 23:29:14

Title: Prefix
Post by: bastya_elvtars on 19 May, 2004, 23:29:14
Sorry 4 posting w/o searching but im off my time...
In my HUB when i set prefix in ptokax so that it must be [HUN] for everyone it still lets non-[HUN] ppl in... If there was a script for this... i would b happy!  :D
Title:
Post by: nErBoS on 20 May, 2004, 01:45:40
Hi,

Hope it helps...

--Requested by bastya_elvtars
--Made by nErBoS

sBot = "Nick Prefix"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
if (strsub(strlower(user.sName),1,5) ~= "[hun]") then
user:SendPM(sBot, "This Hub only accept users with [HUN]nick.")
user:Disconnect()
end
end

Best regards, nErBoS
Title:
Post by: bastya_elvtars on 20 May, 2004, 01:58:52
Thank you, nerbos!

((()))
Title:
Post by: bastya_elvtars on 20 May, 2004, 09:57:51
It reject VIPs... :(
VIPs do not have [HUN] prefix @ us...
Title:
Post by: Madman on 20 May, 2004, 10:35:43
Try this...

--Requested by bastya_elvtars
--Made by nErBoS

sBot = "Nick Prefix"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
if GetProfileName(user.iProfile == -1) then
if (strsub(strlower(user.sName),1,5) ~= "[hun]") then
user:SendPM(sBot, "This Hub only accept users with [HUN]nick.")
user:Disconnect()
end
end
end
Title:
Post by: nErBoS on 20 May, 2004, 12:28:56
Hi,

Simpler and also to check reg....

--Requested by bastya_elvtars
--Made by nErBoS

sBot = "Nick Prefix"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
if (user.iProfile ~= 2 and strsub(strlower(user.sName),1,5) ~= "[hun]") then
user:SendPM(sBot, "This Hub only accept users with [HUN]nick.")
user:Disconnect()
end
end

Best regards, nErBoS
Title:
Post by: bastya_elvtars on 20 May, 2004, 14:23:39
The 2nd one rejected everyone, the 3rd one works...
Thx peepz!
((()))

(I know this was a noob thing but i get banned from hublist if its not 100% sure if [HUN] must be there)
Title:
Post by: oblivion on 07 June, 2004, 23:01:33
Syntax error: bad argument #1 to `strsub' (string expected, got nil)
stack traceback:
   1:  function `strsub' [C]
   2:  function `NewUserConnected' at line 423 [file `Robocop\RoboCopv8.0a.lua']







WHY

 ;(
Title:
Post by: nErBoS on 08 June, 2004, 00:43:48
Hi,

The error comes from RoboCop, are you using this script apart ???

Best regards, nErBoS
Title:
Post by: oblivion on 08 June, 2004, 00:45:51
yes on its own


--Requested by bastya_elvtars
--Made by nErBoS

sBot = "?''??.:']i[':.??''?"

function Main()
   frmHub:RegBot(sBot)
end

function NewUserConnected(user)
   if (user.iProfile ~= 2 and strsub(strlower(user.sName),1,5) ~= "?''??.:']i[':.??''?") then
      user:SendPM(sBot, "THIS IS NOW A PRIVATE HUB ..IF YOU WANT TO BE PART OF IT Hub only accept users with ?''??.:']i[':.??''?nick.")
      user:Disconnect()
   end
end
Title:
Post by: nErBoS on 08 June, 2004, 00:50:48
Hi,

The script has been badly change try this...

--Requested by bastya_elvtars
--Made by nErBoS

sBot = "Nick Prefix"

prefix = "?''??.:']i[':.??''?"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
if (user.iProfile ~= 2 and strsub(strlower(user.sName),1,strlen(prefix)) ~= strlower(prefix)) then
user:SendPM(sBot, "This Hub only accept users with "..prefix.."nick.")
user:Disconnect()
end
end

Best regards, nErBoS
Title:
Post by: oblivion on 08 June, 2004, 00:55:47
nah..i get this shit


Syntax error: bad argument #1 to `strsub' (string expected, got nil)
stack traceback:
   1:  function `strsub' [C]
   2:  function `NewUserConnected' at line 423 [file `Robocop\RoboCopv8.0a.lua']



 X(
Title:
Post by: nErBoS on 08 June, 2004, 01:04:39
Hi,

I have tested the script and is not giving any error, like i said the error comes from RoboCop...

2: function `NewUserConnected' at line 423 [file `Robocop\RoboCopv8.0a.lua']

This says all.

Best regards, nErBoS
Title:
Post by: oblivion on 08 June, 2004, 01:06:33
maybe one for optimus...you watching mate?
Title:
Post by: Herodes on 08 June, 2004, 02:45:05
I don't think the error is from Robocop ...
Nothing against you but I thing Robocop has
frmHub:EnableFullData(1)
So that is why the Robocop.lua is coming up ...
Although, I'm not sure and the above is a guess .. or  a logical conclusion .. ;)

Most probably its the "special" tag  ...
I think it would serve the same purpose if it where not using all these special  chars ....  :S
Title:
Post by: oblivion on 08 June, 2004, 02:52:41
i just tried it without RC8a running, just using built in ptokax settings ..no syntax errors atall

looks like i will have to dump RC 8a..unless opti can rectify my problem ,,who knows!
Title:
Post by: plop on 08 June, 2004, 03:17:34
try this 1.
--Requested by bastya_elvtars
--Made by nErBoS

sBot = "Nick Prefix"

prefix = "?''??.:']i[':.??''?"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
if (user.iProfile ~= 2 and strsub(strlower(user.sName),1,strlen(prefix)) ~= strlower(prefix)) then
user:SendPM(sBot, "This Hub only accept users with "..prefix.."nick.")
user:Disconnect()
      return 1
end
end
plop
Title:
Post by: oblivion on 08 June, 2004, 03:25:04
nope...same shit happens   ;(  ..dam this
Title:
Post by: plop on 08 June, 2004, 03:33:45
QuoteOriginally posted by oblivion
nope...same shit happens   ;(  ..dam this
ok next try.
--Requested by bastya_elvtars
--Made by nErBoS

sBot = "Nick Prefix"

prefix = "?''??.:']i[':.??''?"

function Main()
frmHub:RegBot(sBot)
end

function DataArrival(user, data)
if (user.iProfile ~= 2 and strsub(strlower(user.sName),1,strlen(prefix)) ~= strlower(prefix)) then
user:SendPM(sBot, "This Hub only accept users with "..prefix.."nick.")
user:Disconnect()
      return 1
end
end
plop
Title:
Post by: oblivion on 08 June, 2004, 03:43:03
hmm..no errors now..but.. nobody can connect  ;(
Title:
Post by: bastya_elvtars on 08 June, 2004, 17:04:57
Works here...
Whats the difference? :)
Title:
Post by: oblivion on 08 June, 2004, 21:06:44
NOPE !



Syntax error: bad argument #1 to `strsub' (string expected, got nil)
stack traceback:
   1:  function `strsub' [C]
   2:  function `NewUserConnected' at line 423 [file `Robocop\RoboCopv8.0a.lua']
Title:
Post by: oblivion on 08 June, 2004, 22:19:52
QuoteOriginally posted by oblivion
i just tried it without RC8a running, just using built in ptokax settings ..no syntax errors atall works excellent

looks like i will have to dump RC 8a..unless opti can rectify my problem ,,who knows!


this script conflicts with RC8a..without doubt
Title:
Post by: oblivion on 08 June, 2004, 22:22:02
'User Tags' in RoboCop.
ie... [REG] , [OP], [VIP]?



NONE AT ALL
Title:
Post by: oblivion on 08 June, 2004, 22:46:17
this message keeps repeating itself over and over
do you suggest i replace RC
Title:
Post by: Madman on 08 June, 2004, 23:38:56
Yup.. Re install Rc8... It works just fine for me..

btw nice hub :)
Title:
Post by: oblivion on 09 June, 2004, 19:53:01
Syntax error: bad argument #1 to `strsub' (string expected, got nil)
stack traceback:
   1:  function `strsub' [C]
   2:  function `NewUserConnected' at line 423 [file `Robocop\RoboCopv8.0a.lua']


here i go again ..sorry ..  

this is with everything fresh,, new rc8a,, new ptokax

WTF is causing this
Title:
Post by: oblivion on 09 June, 2004, 20:46:07
hmm this works ok now..with 0.326 Testdrive 4.99
but not with 0.330.b15.25.dbg
Title:
Post by: plop on 10 June, 2004, 05:23:47
@optimus: are you using the info string on line 423 in strsub??

plop
Title:
Post by: Optimus on 10 June, 2004, 12:46:32
423 --// Check Allowed ISP
424 if CheckISP[user.iProfile]==1 then
425 if (strsub(data,1,7) == "$MyINFO") then
for key,isp in TableISP do
if not strfind(strlower(user.sName), strlower(isp),1,1) then
SendToNick(user.sName, "<" ..sBot.."> Your nick should start with one of the following tags: "..ShowTableISP())
SendToNick(user.sName, "<" ..sBot.."> Change it and you are welcome back.")
SendToNick(user.sName, "<" ..sBot.."> Disconnects...")
user:Disconnect()
break
end
end
end
end


Well duno if it's the case but ISP check isn't working like it shows here

if not strfind(strlower(user.sName), strlower(isp),1,1) then

mustbe:

if not strfind(strlower(user.sName), strlower(isp)) then

Further i don't see anything strange
Title:
Post by: plop on 10 June, 2004, 12:56:57
QuoteOriginally posted by Optimus
423 --// Check Allowed ISP
424 if CheckISP[user.iProfile]==1 then
425 if (strsub(data,1,7) == "$MyINFO") then

Further i don't see anything strange
why line 425??
the error has 2 do with strsub and data, the $MyINFO can be emtpy sometimes.
beside that you ain't using the info string for that check so you can drop it.

plop
Title:
Post by: Optimus on 10 June, 2004, 13:05:48
ok allright i'll remove it. Btw it was there so the message was send on the right moment. I can remember there were disconnects without the message
Title:
Post by: plop on 10 June, 2004, 14:10:31
QuoteOriginally posted by Optimus
ok allright i'll remove it. Btw it was there so the message was send on the right moment. I can remember there were disconnects without the message
i used 2 be suffering from a bug like this on a.i..
the infostring can be missing, the prefix bot seems 2 trigger this by oblivion on your RC.
i hope you don't run into the same prob as me, my fix refuses 2 work on testdrive.

plop
Title:
Post by: Optimus on 10 June, 2004, 14:13:02
aiii, that sounds bad ;(