Hungarista
Member-
Content count
9 -
Joined
-
Last visited
About Hungarista
-
Rank
Newbie
- Birthday 05/04/86
Contact Methods
-
MSN
wss1986@axelero.hu
-
Website URL
http://www.ro.4242.hu
-
ICQ
0
Profile Information
-
Location
Mezőkövesd, Hungary
-
Interests
Programming
-
Next version sBot = frmHub:GetHubBotName() iClass = 3 function Main() local file = io.open(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."scripts\\rukus\\list.dat","r") if file then file:close() LoadDatabase() else tPendingUsers = {} end end function ChatArrival(curUser,data) if curUser.bOperator then local _,_,cmd,param = string.find(data,"%b<>%s*%p*(%S+)%s*(.*)|") if cmd then if cmd == "showpending" then LoadDatabase() if #tPendingUsers > 0 then local msg = "\n\t---------------- Pending: "..#tPendingUsers.." \t----------------\r\n\r\n".. "\tNumber:\tNickname:\t\tPassword:\tEmail:\r\n" for i,v in ipairs(tPendingUsers) do msg = msg.."\t["..i.."] \t"..v["sNick"].."\t\t"..v["sPass"].."\t\t"..v["sEmail"].."\r\n" end curUser:SendPM(sBot,msg) else curUser:SendPM(sBot,"The list is empty.") end return 1 elseif cmd == "regpending" then if type(tonumber(param)) == "number" then param = tonumber(param) if param <= #tPendingUsers then if not frmHub:isNickRegged(tPendingUsers[param]["sNick"]) then AddRegUser(tPendingUsers[param]["sNick"],tPendingUsers[param]["sPass"],iClass) curUser:SendData(sBot,tPendingUsers[param]["sNick"].." has been succesfully registered as "..GetProfileName(iClass)) table.insert(tRegisteredUsers,tPendingUsers[param]) table.remove(tPendingUsers,param) SaveDatabase() else curUser:SendData(sBot,tPendingUsers[param]["sNick"].." is already registered user.") end elseif param == 411 then local tReggedUsers = {} for i,v in ipairs(tPendingUsers) do table.insert(tRegisteredUsers,tPendingUsers[i]) if not frmHub:isNickRegged(v["sNick"]) then AddRegUser(v["sNick"],v["sPass"],iClass) else table.insert(tReggedUsers,v["sNick"]) end end if (#tPendingUsers - #tReggedUsers) == 0 then curUser:SendData(sBot,"No users have been registered. (Maybe they are all still registered?)") elseif (#tPendingUsers - #tReggedUsers) ~= #tPendingUsers then curUser:SendData(sBot,(#tPendingUsers - #tReggedUsers).." users have been registered as "..GetProfileName(iClass)) else curUser:SendData(sBot,"All users have been registered as "..GetProfileName(iClass)) end tPendingUsers = {} SaveDatabase() LoadDatabase() else curUser:SendData(sBot,"There is no index "..param..". Check your syntax.") end else curUser:SendData(sBot,"Use just numbers! Use 411 to register all pending users.") end return 1 elseif cmd == "delpending" then if type(tonumber(param)) == "number" then param = tonumber(param) if param <= #tPendingUsers then table.remove(tPendingUsers,param) SaveDatabase() LoadDatabase() curUser:SendData(sBot,"User with index "..param.." has been successfully deleted.") else curUser:SendData(sBot,"There is no index "..param..". Check your syntax.") end else curUser:SendData(sBot,"Use just numbers! Use 411 to register all pending users.") end return 1 end end end end function ToArrival(curUser,sData) if curUser.bOperator then local _,_, nickto = string.find(sData, "^%$To:%s(%S+)%s") if nickto == sBot then ChatArrival(curUser,sData) end end end function LoadDatabase() tPendingUsers = {} tRegisteredUsers = {} for line in io.lines(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."\\scripts\\rukus\\list.dat") do local _,_,sNick,sPass,sEmail,bIsReg = string.find(line, "^:!:(.*):!:(.*):!:(.*):!:(.*):!:$") local sName = {["sNick"] = sNick, ["sPass"] = sPass, ["sEmail"] = sEmail,} if tonumber(bIsReg) == 0 then table.insert(tPendingUsers,sName) else table.insert(tRegisteredUsers,sName) end end end function SaveDatabase() local file = io.open(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."\\scripts\\rukus\\list.dat","w+") for i,v in ipairs(tPendingUsers) do file:write(":!:"..v["sNick"]..":!:"..v["sPass"]..":!:"..v["sEmail"]..":!:0:!:\r\n") end for i,v in ipairs(tRegisteredUsers) do file:write(":!:"..v["sNick"]..":!:"..v["sPass"]..":!:"..v["sEmail"]..":!:1:!:\r\n") end file:close() end
-
So, in that file there are the all registered and unregistered users? Then I have to pout just an another array into it, when an operator register a user, put one user to another array, and save & load the two array. I hope now I understand well :)
-
Firstly, sorry for my great lag I had two exams on Monday, and today I had to do the PtokaX translation. Now I am ready with it, but you didn't anser to my questions posted above... So I did it as I thought, you have to try and debug it. It do all things you explained, maybe bugless sBot = frmHub:GetHubBotName() iClass = 3 -- In which class you want to register users? In base settings 3 is the registered users. function Main() local file = io.open(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."scripts\\rukus\\list.dat","r") if file then file:close() LoadDatabase() else tPendingUsers = {} end end function ChatArrival(curUser,data) if curUser.bOperator then local _,_,cmd,param = string.find(data,"%b<>%s*%p*(%S+)%s*(.*)|") if cmd then if cmd == "showpending" then LoadDatabase() if #tPendingUsers > 0 then local msg = "\n\t---------------- Pending: "..#tPendingUsers.." \t----------------\r\n\r\n".. "\tNumber:\tNickname:\t\tPassword:\tEmail:\r\n" for i,v in ipairs(tPendingUsers) do msg = msg.."\t["..i.."] \t"..v["sNick"].."\t\t"..v["sPass"].."\t\t"..v["sEmail"].."\r\n" end curUser:SendPM(sBot,msg) else curUser:SendPM(sBot,"The list is empty.") end return 1 elseif cmd == "regpending" then if type(tonumber(param)) == "number" then param = tonumber(param) if param <= #tPendingUsers then if not frmHub:isNickRegged(tPendingUsers[param]["sNick"]) then AddRegUser(tPendingUsers[param]["sNick"],tPendingUsers[param]["sPass"],iClass) curUser:SendData(sBot,tPendingUsers[param]["sNick"].." has been succesfully registered as "..GetProfileName(iClass)) tPendingUsers[param] = nil SaveDatabase() else curUser:SendData(sBot,tPendingUsers[param]["sNick"].." is already registered user.") end elseif param == 411 then local tReggedUsers = {} for i,v in ipairs(tPendingUsers) do if not frmHub:isNickRegged(v["sNick"]) then AddRegUser(v["sNick"],v["sPass"],iClass) else table.insert(tReggedUsers,v["sNick"]) end end if (#tPendingUsers - #tReggedUsers) == 0 then curUser:SendData(sBot,"No users have been registered. (Maybe they are all still registered?)") elseif (#tPendingUsers - #tReggedUsers) ~= #tPendingUsers then curUser:SendData(sBot,(#tPendingUsers - #tReggedUsers).." users have been registered as "..GetProfileName(iClass)) else curUser:SendData(sBot,"All users have been registered as "..GetProfileName(iClass)) end tPendingUsers = {} io.open(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."scripts\\rukus\\list.dat","w+") else curUser:SendData(sBot,"There is no index "..param..". Check your syntax.") end else curUser:SendData(sBot,"Use just numbers! Use 411 to register all pending users.") end return 1 elseif cmd == "delpending" then if type(tonumber(param)) == "number" then param = tonumber(param) if param <= #tPendingUsers then table.remove(tPendingUsers,param) SaveDatabase() LoadDatabase() curUser:SendData(sBot,"User with index "..param.." has been successfully deleted.") else curUser:SendData(sBot,"There is no index "..param..". Check your syntax.") end else curUser:SendData(sBot,"Use just numbers! Use 411 to register all pending users.") end return 1 end end end end function ToArrival(curUser,sData) if curUser.bOperator then local _,_, nickto = string.find(sData, "^%$To:%s(%S+)%s") if nickto == sBot then ChatArrival(curUser,sData) end end end function LoadDatabase() tPendingUsers = {} for line in io.lines(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."\\scripts\\rukus\\list.dat") do local _,_,sNick,sPass,sEmail,bIsReg = string.find(line, "^:!:(.*):!:(.*):!:(.*):!:(.*):!:$") local sName = {["sNick"] = sNick, ["sPass"] = sPass, ["sEmail"] = sEmail, ["bIsReg"] = bIsReg,} table.insert(tPendingUsers,sName) end end function SaveDatabase() local file = io.open(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."\\scripts\\rukus\\list.dat","w+") for i,v in ipairs(tPendingUsers) do file:write(":!:"..v["sNick"]..":!:"..v["sPass"]..":!:"..v["sEmail"]..":!:0:!:\r\n") end file:close() end If something isn't in it, or works another way as you except, please tell it me. Commands works in main and private too, commands are what you requested.
-
The script is almost ready, just a question. Registered and unregistered users are in the file, why? It's a webserver-made file, somebody want to register himself/herself on the hub. So it's sure, he isn't registered on the hub. Maybe his/her nickname is already registered by an another user, but the webpage have to inform the user about it. I think many unregistered users in the file, and if an operator use !regpending # or 411 then that line will be removed from the file, thats all. This is what the script is doing now Ps. Could you send me the web-page which generate this file? I wanna upgrade it.
-
Please explain me more the regpending stuff. What is it doing exactly? There is no impossible, if I know what should I do The web-based register system... Maybe. PtokaX has inbuild webserver, somebody just have to wrote the php or html page - I will try it, maybe, but I never did any kind of webpage :D
-
Ohh, men This script is the strangest one what I've ever seen... Half of the script is out of use. Try to use 2-3 different scripts instead of this. Check this page
-
1; Your nickname has 'sticked' into the hub because the lag. Wait a minute, then reconnect. 2; Somebody is online on the hub with the same nickname. Change nick and reconnect.
-
I will do it as soon as possible, but as I see I have to completly rewrite it, it wasn't made by a LUA scripter If I will finish it, I will inform you here.
-
Ave peoples! I found this great client nowadays, and I deleted all those clients which I ever used before this. That is that what peoples calls good work Since when I use it, I've found some missing functions, which I will list here. I didn't want to open a new topic for it - this is an enough good collective for it I hope. So. Editable NMDC debug messages - Now "was kicked" messages showed in the mainchat instead of status bar, and it would be useful to filter needless messages - like winamp spams Rename /find command - Well, as far as we know, /find command is for search users, since this command exist. I think this command in this context is totally un-necessary few users excepted. Logging and /log command solve this. /find <user/IP> would be more nice, and useful, but as I've read, it would use more resources :ermm: Ratio in description instead of slots - To show the slot numbers in the description is a... :shifty: strange thing. It always MyINFO-floods the hubs, and shows the user, what he/she can know from the tag too. Ratio would be more nice: the user can know, if he/she deserve to start downloading from the user. This client has this feature, and I think it's good enough to add it to ApexDC too Highlight - The above mentioned client has highlight function, it would be very welcomed too, and maybe with additional sounds, if possible. Select user when rightclick on him/her - When I rightclick on an online username in the mainchat, a menu showed, but the user isn't selected in the userlist. I use it many times to see more information about the user. More column into userinfos - Some other column would be useful, like hostnames, to know which user is from which country (most case the hostname ends with country-code). If client-information retrieved from checking, it also can be added into a new column. Selectable statusbar informations - On the appereance page you should add some checkbox, to select which information we want to see: personally I want debug messages, and slots not. Openable system.log - I would be very thankful if you can add an extra menu into View menu: Open system.log. I saw that was requested before, but who knows Here we can check debug messages, and if I talk about that: ignored users message isn't shown, but nowhere shown! It would be nice to add to system.log: ignored message from <USER>: <MSG> Renameable RAW commands - There is now five RAW: RAW1 -> RAW5 When I set up the forbidden things, it would be more easier, if they have names like: Ban3h, Nickban, and so on. Multiline usercommands - This also would be important to me. My hub is half-private: users can connect to it, but just registered users can download, search, chat, see the chat, and PM. So when a user connents, I used to send them a message to give me a password, because this hub is private, and you can't ... until I register. This all in one line is very ugly $UserIP support on favorite hubs - I think I needn't explain this, maybe if its added, than it might be UserIP2 support. LUA support - As Zai4ik mentioned in first post, LUA support would be fine too, I am a LUA scripter, many problem could be resolved by this. This would be the most important to me Thanks for this great client, I finnaly found a fine client, which is under developing, and I really hope my advances would help to make ApexDC++ the best client Ps. Sorry for my 'Hunglish'