IP menu support in UserCommands
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

IP menu support in UserCommands

Started by PPK, 02 March, 2008, 23:49:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PPK

Long time ago on end of year 2002 CZDC++ introduced color chat and part of that are better menus in chat with support for IP addresses.
Many clients used and use that code but problem of this code is that it's supporting only few hardcoded commands, and as far as i know nobody fixed it.
So after many years i'm fixed that problem and released CzDC with IP menu support in UserCommands.

Context for IP menu is 0x10 (or better 16, because that is what is used in $UserCommand). It is not in any way breaking compatibility, clients not supporting that context simply ignore it 8)

Example script for PtokaX:
function OpConnected(curUser)
    Core.GetUserData(curUser, 12) -- get bUserCommands

    if curUser.bUserCommand then
        permissions = ProfMan.GetProfilePermissions(curUser.iProfile)
        local usrcmds = "$UserCommand 255 15|"
        usrcmds = usrcmds.."$UserCommand 0 3|"

        if permissions.bBan then
            usrcmds = usrcmds.."$UserCommand 1 16 Ban Menu\\Ban IP$<%[mynick]> !banip %[userI4] %[line:Enter reason]&#124;|"
            usrcmds = usrcmds.."$UserCommand 1 16 Ban Menu\\Fullban IP$<%[mynick]> !fullbanip %[userI4] %[line:Enter reason]&#124;|"
        end
        if permissions.bUnban then
            usrcmds = usrcmds.."$UserCommand 1 16 Ban Menu\\Unban IP$<%[mynick]> !unban %[userI4]&#124;|"
        end
        if permissions.bTempBan then
            usrcmds = usrcmds.."$UserCommand 1 16 Ban Menu\\Temporary ban IP$<%[mynick]> !tempbanip %[userI4] %[line:Enter time] %[line:Enter reason]&#124;|"
            usrcmds = usrcmds.."$UserCommand 1 16 Ban Menu\\Temporary fullban IP$<%[mynick]> !fulltempbanip %[userI4] %[line:Enter time] %[line:Enter reason]&#124;|"
        end
        if permissions.bTempUnban then
            usrcmds = usrcmds.."$UserCommand 1 16 Ban Menu\\Temp unban IP$<%[mynick]> !tempunban %[userI4]&#124;|"
        end

        Core.SendToUser(curUser, usrcmds)
    end
end
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Jusper


SMF spam blocked by CleanTalk