Im testing your code and it seems to be good. But I am afraid you have not considered the user type can execute this command. That is, I see currently anybody (non admin) can execute /baniptime, /baniptimelist and /unbaniptime. Could you fix this issue, please?

Thank you very much for your effort and time

Greetings from Spain.

Last edited by carlis on Tue Jul 13, 2010 4:05 pm, edited 1 time in total.

The script works perfectly. I was wondering if there was a way to modify the code so if you /baniptime nick then it will automatically ban that nick with it's IP address for a specific time without having to manually enter in the IP or the time. I'm attempting to integrate it into a menu that pops up when you click on a nick in the nick list. So far what I have works fine with the kick and ban commands but because /baniptime requires multiple parameters, I'm having trouble getting the ip passed correctly to the function. The section of code in my pfcclient.js file is as follows.

The output in the chat seems to indicate that the /baniptime executed, but the command doesn't actually execute correctly.If I manually use /baniptime and input the nick and ip address by hand the command executes correctly.

Last edited by Myth024 on Sat Jun 09, 2012 4:53 pm, edited 1 time in total.

Oops lol.. I was messing around with the command to try and get it to work correctly and when I pasted the code I forgot to change it back to what I had. There was a post in the forums on how to add kick and ban options to the menu when you click on a nick in the nick list. I successfully integrated it and the standard kick and ban commands work fine. Now I'm trying to add the /baniptime command to the list. I followed the instructions and if I use the command manually, it works fine. I'm posting the code I'm using right now and it successfully issues the command with an ip address instead of the nick. However because the /baniptime command requires two parameters the standard process for /ban and /kick doesn't work. I haven't yet figured out what command or parameter actually gets the ip of a person otherwise I might be able to figure this out. Thanks for your help and I'll be sure to post whatever eventually works.

This current code will actually add the users IP to a ban list, but they don't get kicked from the room and ultimately the command itself fails. However, if I can figure out how the system gets an IP from a user, or how to call the IP directly I might be able to actually re-write the command itself.

Also, I'm thinking that maybe I should see about moving my set of posts into another thread or something lol. Before this gets out of hand under this contribution unless you think it could be valuable here. Thanks for your help I really do appreciate it.

yes I was referring about this line var nick = pfc.getUserMeta(this.pfc_nickid,'ip'); , if not available it will be undefined that's why I asked you what the window.alert('/baniptime "'+nick+'"') gives you?

I actually got to the point where clicking on my "button" executed the command with the correct parameters where they were supposed to be, but for some reason, all it did was print that a nick at ip as banned for no reason but didn't actually ban the person or kick them from the room. Keep in mind that the /baniptime command works if I manually input the command as /baniptime nick ip (where nick is the nickname and Ip is the ip address). However there was another post on how to integrate commands into a menu that pops up when you click the nick in the list of nick names in a room on the right of the chat page. I was able to put in the default ban and kick commands and they work correctly. I'm thinking what I might have to do is re-write the command so that if I type /baniptime nick then the command will automatically pull the ip address from the nick meta information and pass it to the command function. Ultimately it would probably be even better to have the default ban command also add the ip address of the person banned instead of a nick and do all banning based on IP instead of nick.

I came to the conclusion that the original command requires you to input the IP address manually as part of the command and it wasn't designed to pass user meta information. So I'm going back to the original command functions and looking at a complete re-write. In the meantime, I integrated it into an sql database using your login options and found that it generally works better.