PtokaX forum

Archive => Archived 5.1 boards => Help with scripts => Topic started by: Yahoo on 06 February, 2007, 13:07:55

Title: Help With Userdb
Post by: Yahoo on 06 February, 2007, 13:07:55
i am getting an error with this script can any1 solve this problem..
[17:32] Syntax C:\Ptokax.0.3.5.2.lua5.1.1.dbg\scripts\userdb.lua:91: unfinished string near '", , , , , '
Title: Re: Help With Userdb
Post by: Psycho_Chihuahua on 06 February, 2007, 14:36:19
My guess is because that script is for Lua 5 and your using Lua 5.1.1
Title: Re: Help With Userdb
Post by: Yahoo on 07 February, 2007, 04:29:07
can someone make this script for lua 5.1.1
Title: Re: Help With Userdb
Post by: Naithif on 07 February, 2007, 09:17:27
Quote from: Yahoo on 06 February, 2007, 13:07:55
i am getting an error with this script can any1 solve this problem..
[17:32] Syntax C:\Ptokax.0.3.5.2.lua5.1.1.dbg\scripts\userdb.lua:91: unfinished string near '", , , , , '

There's a line-break in line 91. Remove that break.


            user:SendData(Bot,"Syntax Error, Syntax = "..Prefix..Cmd1..", , , , ,
, , , , , , ,")


To this


            user:SendData(Bot,"Syntax Error, Syntax = "..Prefix..Cmd1..", , , , , , , , , , , ,")
Title: Re: Help With Userdb
Post by: Yahoo on 07 February, 2007, 10:47:24
Thnks Naithif, now i am getting the following error
Syntax ...scripts\userdb.lua:142: attempt to call a table value
Title: Re: Help With Userdb
Post by: Naithif on 07 February, 2007, 11:16:28
Try replacing line 142 with

for key, value in pairs(tTable) do

And 98 with

for i,v in pairs(Users) do

Even better, run a 50to51 converter
Title: Re: Help With Userdb
Post by: Yahoo on 07 February, 2007, 14:06:04
Thnks Mutor , it works
Title: Re: Help With Userdb
Post by: miago on 09 February, 2007, 19:56:50
Hi.

Just found this script and I really like it and I would like to hear if these things are possible to do.

1. Is it possible to get the info in pm instead of main?

2. Is it possible to create a choice in the menu where you can list all users registered? If so, can it be in columns?
(ex: Nicknamn   Password   Real Name   Education   Address   Occupation  E-mail
      [1Mbit]XXX robo         Jon Smith    Highschool  47th        Teacher     
      [10Mbit]Y   cop          Jane Doe                     Bigstreet  Between     yep@hotmail.com

3. Is it possible to let the fields be optional so that you are not forced to fill in them all?

4. Is it possible to make the Find function to search even if the whole nick isn't given?
(Ex: Find sara  - gives the result in a list with [3Mbit]Sara, [100Mbit]KalaSara and [OP]sara)

Thx in advance
//Miago
Title: Re: Help With Userdb
Post by: miago on 09 February, 2007, 23:47:36
Thank you Mutor!!
:D
Title: Re: Help With Userdb
Post by: miago on 10 February, 2007, 10:01:06
Hi there Mutor..
You really are a fast dude  :D
I can agree about the columns, but if there is possibility it would be nice to have later on. I run a release/requestbot  (Release/Request Bot v3a - LUA 5.0.2/5.1 by jiten (3/27/2006)) that gives all info in columns, something like that would be super in the future maybe :)
But I'm already happy for what You have done!!!  :)))

Been testing a little and one thing I can't do is add a user like [1Mbit]Peter. Peter works fine, but not with the prefix and I dont get any error message on that.
Another thing about the search, great to get all users :D, but it still works so that you have to write the whole nick when you search for a user? Better to ask you first before commenting that it doesnt work :D

Again, thank you thank you :D
//Miago

Edit:
Tried the search again, I have 2 johan registerd (1mbitjohan and johan)
   Details for user *johan*

   [ Password ] = eeee
   [ Invitedby ] = Pelle
   [ Other ] = coolt va
   [ Email ] =
   [ Regdate ] = 07-02-10
   [ Regby ] = OP-nick
Did a search for johan and got this:
10:02:24] <-Hub-bot-> Sorry -Admin -, no pattern of johan was found in the database.
//miago

Edit2:
The searchfunction only gives feedback on the first user registered when searching for a nick.
I have 4 users reg, Pelle, johan, Kalle, 1mbitjohan (in that order)
The only one I get info about is when searching for Pelle, for the other I get "no pattern"
//Miago

Edit3:
Another question that popped up, when you do a search for all users, is it possible that the list comes in alphabetic order? Thx again
//Miago
Title: Re: Help With Userdb
Post by: speedX on 10 February, 2007, 15:29:00
Another great script Mutor ;)

Needed one addition if possible,
I want to use only one field of this script (location) , so is it possible to combine it with the addreguser command.
Like !addreguser <nick> <pass> <location>
Also the name of the op who regged the user shud come in the database.


Bug:
My database looks like this
Quote
Details for user *kunalk*
[ Location ] = ghantali

Details for user *champion*
[ Location ] = Mirani Nagar

When i try to delete the entry with name kunalk, it does not get deleted
the command i type is +dbdelete kunalk
Title: Re: Help With Userdb
Post by: miago on 10 February, 2007, 18:24:57
Ty again :D

The search now works wonderfully.
Ok, since LUA is like arabic to me, and I understand that there are things harder to do, the alphabetic order can rest in peace    ;D 

QuoteBeen testing a little and one thing I can't do is add a user like [1Mbit]Peter. Peter works fine, but not with the prefix and I dont get any error message on that.

This doesn't work, but maybe you havent had time to make it or maybe I wrote to much so it was blended in with all my other comments  :)

Thanks again
//Miago
Title: Re: Help With Userdb
Post by: miago on 10 February, 2007, 19:38:45
 :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-* :-*

You're the King!!

//miago
Title: Re: Help With Userdb
Post by: Yahoo on 21 May, 2007, 15:54:52
sir i am using userdb 2.0
i will like to have a small change in the script
sir there are some users in my hub whose nick
are not accepted by the script for eg:
??????????????
CyRuS?
etc
Title: Re: Help With Userdb
Post by: Creative on 24 May, 2007, 09:13:57
Hello Sir,
           Can u tell me which code i should change if i want Operators to see only Add/Edit entry and not (Delete, Query Database, UserDB 2.0b Commands) option in Right Click. But Masters can see and use all options from Right Click.
Title: Re: Help With Userdb
Post by: Psycho_Chihuahua on 24 May, 2007, 14:56:31
i found a small minor bug Mutor

when a User enters an address in form of -->        location, Country (example   Lucerne, Switzerland)
the script crashes which is launched by the comma

is it possible to fix that?
Title: Re: Help With Userdb
Post by: Creative on 29 May, 2007, 14:25:17
Great Work Mutor :)
                 
I would like you to add 1 more thing, when a Operator add any user's info, it should be saved with his nick too.
I mean while reading any user's db by +dbread nick, it should show which operator added the Info.
This will be a good addition if done,
For Example,

<[UserDB]>

Details for user *protocol*
             [ Operator ] = Creative

[ password ] = alien
[ name ] = James
[ address ] = 45 street
[ education ] = Engineering
[ occupation ] = student
[ email ] = xyz@yahoo.com


thanks in advance :)
Title: Re: Help With Userdb
Post by: Creative on 30 May, 2007, 07:07:59
Sorry Mutor, but i didnt understand what u said.
I just thought if you can add the function so that if we do +dbread then it will show the Operator name too who added the info.
Title: Re: Help With Userdb
Post by: Creative on 30 May, 2007, 15:00:18
Sir, can you show me how to add that field??  ???
Title: Re: Help With Userdb
Post by: achiever on 30 May, 2007, 16:38:17
i think if changed then this is how ur columns should look
-- Command(s) will be updated once script is saved/restarted
Columns = {
"password",
"operator",
"name",
"education",
"address",
"occupation",
"email"
},
Title: Re: Help With Userdb
Post by: Creative on 30 May, 2007, 17:45:02
Thankx, but i was thinking, if the operators name get saved automatically. And at the time of +read the name of the operator will be shown.

And 1 more thing,
When Operator puts an User's Info, the script will save the info as well as it will reg tht user(as nick/pass is also added)
So no need to reg the user again by +addreguser command.
Saving the user's info and registering the user will be done by the script itself.
Title: Re: Help With Userdb
Post by: Creative on 18 June, 2007, 15:38:48
Hello Mutor...
                 Actually, i have tried keeping this script open for users, but there are some users who add fake info too... so it creates havoc.......
In my hub, users PM operators from other hub to register them...... so while registering them, operators take info and reg them, and then the Operators add info in UserDB. So i would like if you add 1 more function so that when any Operator adds Info, at the same time, the user will get registered as we put nick and pass in userdb.
My columns are as follows:
Columns = {
   "password",
   "Full_Name",
   "DOB",
   "Address",
   "Phone_No.",
   "Education",
   "Operator_Nick",
   },
Title: Re: Help With Userdb
Post by: achiever on 18 June, 2007, 16:59:01
i think u r in need of this http://forum.ptokax.org/index.php?topic=5445.0#top

but its a lua 5 versions and will need coneversion and gives me error
[20:14] Syntax E:\Downloads\0.3.5.2[Fusion Hub]\scripts\regdb.lua:158: attempt to call a table value