Hi all ;)
script for right mouse commands ?
( work with PtokaX release 0.5.0.0. )
Thanks for assistance..
Best regards,
Massimiliano
Hi massitux.
I'm still using CustomCmds 2.0 LUA 5.1x [API 2] with PtokaX 0.5.0.1 Lua 5.1.5
Just change the contents (commands) to suit your needs, and it should work.
I hope this help you.
--[[
CustomCmds 2.0 LUA 5.1x [API 2]
by American Idiot 02/22/09
A script to offer custom command context menus [right click]
- Includes full profile table, redundant, yet requested :P
- Sends commands with Zpipe
+Changes from 1.0 02/26/09
- Commands levels
+Added full profile table
+Added check for UserCommand $Support
+Added option for preset menu and or submenu, see notes
+Added notes on command syntax
]]
-- "Command Menu" ["" = hub name]
Menu = ""
-- "Command SubMenu" ["" = script name]
SubMenu = ""
OnStartup = function()
if Menu == "" then Menu = SetMan.GetString(0) end
if SubMenu == "" then SubMenu = "CustomCmds 2.0" end
end
-- added to allow OldUserIP
function UnknownArrival(user,data)
return true
end
--[[
$UserCommand <type> <context> <details>|
<type> What is the command?
0 = separator
1 = raw - Most Commands
2 = mainchat - File Related Commands - to prevent sending command more than once in search results
255 = erase all previous commands
<context> What is the command for?
1 = Hub Command - Hub Settings etc...
2 = User Command - User List - commands with %[nick]
4 = File Command - Search Window
3 = 1 + 2 = Hub and User
5 = 1 + 4 = Hub and File
6 = 2 + 4 = User and File
7 = 1 + 2 + 4 = Hub, User and File
<details> Differs per <type>
<type> 0 = leave blank
<type> 1 = <title>$<command> or <menu>\\<title>$<command> or <menu>\\submenu\\<title>$<command>
<type> 2 = see type 1
<type> 255 = clear all menus
]]
-- Add your own custom commands
-- Typical User Command using preset menu and submenu set above, ending in ||
--{"$UserCommand 1 1 Menu\\SubMenu\\Command Description$<%[mynick]> +command %[line:arg]||"}
-- Typical User Command using any other string for menu and submenu, ending in ||
--{"$UserCommand 1 1 CustomMenu\\CustomSubMenu\\Command Description$<%[mynick]> +command %[line:arg]||"}
-- ***Note: Menus and submenus are optional, yet help to organize commands.
CustomCmds = {
[-1] = {
-- "$UserCommand 2 3 Menu\\SubMenu\\Shows Your Online Time in Hub$<%[mynick]> !myhubtime||",
},
[0] = {
"$UserCommand 2 3 Menu\\SubMenu\\Add Reg User$<%[mynick]> !addreguser %[line:nick] %[line:pass] %[line:profilname]||",
"$UserCommand 2 3 Menu\\SubMenu\\Add selected User to Reg's$<%[mynick]> !addreguser %[nick] %[line:pass] REG||",
"$UserCommand 2 3 Menu\\SubMenu\\Del Reg User$<%[mynick]> !delreguser %[line:nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Full Temp Ban User$<%[mynick]> !fulltempban %[nick] %[line:Time m/h/d/w/M/Y] %[line:Reason]||",
"$UserCommand 2 3 Menu\\SubMenu\\Full Ban User$<%[mynick]> !fullban %[nick] %[line:Reason]||",
"$UserCommand 2 3 Menu\\SubMenu\\Unban$<%[mynick]> !unban %[line:ip or nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Perm Unban$<%[mynick]> !permunban %[line:ip or nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Temp Unban$<%[mynick]> !tempunban %[line:ip or nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Drop User$<%[mynick]> !drop %[nick] %[line:Reason]||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Info$<%[mynick]> !getinfo %[nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Bans$<%[mynick]> !getbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Perm Bans$<%[mynick]> !getpermbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Temp Bans$<%[mynick]> !gettempbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Range Bans$<%[mynick]> !getrangebans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Range Perm Bans$<%[mynick]> !getrangepermbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Range Temp Bans$<%[mynick]> !getrangetempbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Clear Perm Bans$<%[mynick]> !clrpermbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Clear Temp Bans$<%[mynick]> !clrtempbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Clear Range Perm Bans$<%[mynick]> !clrrangepermbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Clear Range Temp Bans$<%[mynick]> !clrrangetempbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Mass Message$<%[mynick]> !massmsg %[line:Message]||",
"$UserCommand 2 3 Menu\\SubMenu\\Gag User$<%[mynick]> !gag %[nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\UnGag User$<%[mynick]> !ungag %[nick]||",
},
[1] = {
"$UserCommand 2 3 Menu\\SubMenu\\Add Reg User$<%[mynick]> !addreguser %[line:nick] %[line:pass] %[line:profilname]||",
"$UserCommand 2 3 Menu\\SubMenu\\Add selected User to Reg's$<%[mynick]> !addreguser %[nick] %[line:pass] REG||",
"$UserCommand 2 3 Menu\\SubMenu\\Del Reg User$<%[mynick]> !delreguser %[line:nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Full Temp Ban User$<%[mynick]> !fulltempban %[nick] %[line:Time m/h/d/w] %[line:Reason]||",
"$UserCommand 2 3 Menu\\SubMenu\\Full Ban User$<%[mynick]> !fullban %[nick] %[line:Reason]||",
"$UserCommand 2 3 Menu\\SubMenu\\Unban$<%[mynick]> !unban %[line:ip or nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Perm Unban$<%[mynick]> !permunban %[line:ip or nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Temp Unban$<%[mynick]> !tempunban %[line:ip or nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Drop User$<%[mynick]> !drop %[nick] %[line:Reason]||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Info$<%[mynick]> !getinfo %[nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Bans$<%[mynick]> !getbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Perm Bans$<%[mynick]> !getpermbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Temp Bans$<%[mynick]> !gettempbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Mass Message$<%[mynick]> !massmsg %[line:Message]||",
"$UserCommand 2 3 Menu\\SubMenu\\Gag User$<%[mynick]> !gag %[nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\UnGag User$<%[mynick]> !ungag %[nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Change Your Password$<%[mynick]> !passwd %[line:New Password]||",
},
[2] = {
"$UserCommand 2 3 Menu\\SubMenu\\Add Reg User$<%[mynick]> !addreguser %[line:nick] %[line:pass] %[line:profilname]||",
"$UserCommand 2 3 Menu\\SubMenu\\Add selected User to Reg's$<%[mynick]> !addreguser %[nick] %[line:pass] REG||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Bans$<%[mynick]> !getbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Perm Bans$<%[mynick]> !getpermbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Temp Bans$<%[mynick]> !gettempbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Drop User$<%[mynick]> !drop %[nick] %[line:Reason]||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Info$<%[mynick]> !getinfo %[nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Change Your Password$<%[mynick]> !passwd %[line:New Password]||",
},
[3] = {
"$UserCommand 2 3 Menu\\SubMenu\\Get Info$<%[mynick]> !getinfo %[nick]||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Bans$<%[mynick]> !getbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Get Temp Bans$<%[mynick]> !gettempbans||",
"$UserCommand 2 3 Menu\\SubMenu\\Change Your Password$<%[mynick]> !passwd %[line:New Password]||",
},
}
UserConnected = function(user)
local cmds = ""
if Core.GetUserValue(user,12) and CustomCmds[user.iProfile] and next(CustomCmds[user.iProfile]) then
for i,v in ipairs(CustomCmds[user.iProfile]) do
cmds = cmds..v:gsub("( Menu\\)"," "..Menu.."\\"):gsub("(\\SubMenu\\)","\\"..SubMenu.."\\")
end
if #cmds > 0 then Core.SendToUser(user,cmds) end
collectgarbage("collect")
end
end
RegConnected,OpConnected = UserConnected,UserConnected
Cheers :)
Thanks :)